From 2e3d6950baff5a0fb6f71bf3ca060aa376cd4e35 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 13 Apr 2018 15:48:41 -0700 Subject: [PATCH] regen from artman --- ...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/deprecated/it/ITComputeTest.java | 1 + .../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-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/deprecated/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java index 943d915ced9c..03627e8ce452 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ b/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/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/", ""); - } -}