diff --git a/compute/apiv1/autoscalers_client.go b/compute/apiv1/autoscalers_client.go index 4c1dcb8bba4..a95f43254b2 100644 --- a/compute/apiv1/autoscalers_client.go +++ b/compute/apiv1/autoscalers_client.go @@ -505,21 +505,15 @@ func (c *autoscalersRESTClient) Update(ctx context.Context, req *computepb.Updat } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers", req.GetProject(), req.GetZone()) params := url.Values{} if req != nil && req.Autoscaler != nil { params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } - if req.GetZone() != "" { - params.Add("zone", fmt.Sprintf("%v", req.GetZone())) - } baseUrl.RawQuery = params.Encode() diff --git a/compute/apiv1/backend_buckets_client.go b/compute/apiv1/backend_buckets_client.go index b7b1ff8bf8d..1a355810595 100644 --- a/compute/apiv1/backend_buckets_client.go +++ b/compute/apiv1/backend_buckets_client.go @@ -548,15 +548,9 @@ func (c *backendBucketsRESTClient) Update(ctx context.Context, req *computepb.Up } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v", req.GetProject(), req.GetBackendBucket()) params := url.Values{} - if req.GetBackendBucket() != "" { - params.Add("backendBucket", fmt.Sprintf("%v", req.GetBackendBucket())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/backend_services_client.go b/compute/apiv1/backend_services_client.go index 903600d167b..cce773cd11f 100644 --- a/compute/apiv1/backend_services_client.go +++ b/compute/apiv1/backend_services_client.go @@ -731,15 +731,9 @@ func (c *backendServicesRESTClient) Update(ctx context.Context, req *computepb.U } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v", req.GetProject(), req.GetBackendService()) params := url.Values{} - if req.GetBackendService() != "" { - params.Add("backendService", fmt.Sprintf("%v", req.GetBackendService())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/firewalls_client.go b/compute/apiv1/firewalls_client.go index 45f85cd2d41..f5d6219fd96 100644 --- a/compute/apiv1/firewalls_client.go +++ b/compute/apiv1/firewalls_client.go @@ -436,15 +436,9 @@ func (c *firewallsRESTClient) Update(ctx context.Context, req *computepb.UpdateF } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls/%v", req.GetProject(), req.GetFirewall()) params := url.Values{} - if req.GetFirewall() != "" { - params.Add("firewall", fmt.Sprintf("%v", req.GetFirewall())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/health_checks_client.go b/compute/apiv1/health_checks_client.go index fe9a602be28..ddb78d3e94c 100644 --- a/compute/apiv1/health_checks_client.go +++ b/compute/apiv1/health_checks_client.go @@ -502,15 +502,9 @@ func (c *healthChecksRESTClient) Update(ctx context.Context, req *computepb.Upda } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks/%v", req.GetProject(), req.GetHealthCheck()) params := url.Values{} - if req.GetHealthCheck() != "" { - params.Add("healthCheck", fmt.Sprintf("%v", req.GetHealthCheck())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/instances_client.go b/compute/apiv1/instances_client.go index 77e2f8dd33f..fb05615361d 100644 --- a/compute/apiv1/instances_client.go +++ b/compute/apiv1/instances_client.go @@ -2233,27 +2233,18 @@ func (c *instancesRESTClient) Update(ctx context.Context, req *computepb.UpdateI } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v", req.GetProject(), req.GetZone(), req.GetInstance()) params := url.Values{} - if req.GetInstance() != "" { - params.Add("instance", fmt.Sprintf("%v", req.GetInstance())) - } if req != nil && req.MinimalAction != nil { params.Add("minimalAction", fmt.Sprintf("%v", req.GetMinimalAction())) } if req != nil && req.MostDisruptiveAllowedAction != nil { params.Add("mostDisruptiveAllowedAction", fmt.Sprintf("%v", req.GetMostDisruptiveAllowedAction())) } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } - if req.GetZone() != "" { - params.Add("zone", fmt.Sprintf("%v", req.GetZone())) - } baseUrl.RawQuery = params.Encode() diff --git a/compute/apiv1/region_autoscalers_client.go b/compute/apiv1/region_autoscalers_client.go index 2ed332931d8..a79e0a2ece3 100644 --- a/compute/apiv1/region_autoscalers_client.go +++ b/compute/apiv1/region_autoscalers_client.go @@ -439,18 +439,12 @@ func (c *regionAutoscalersRESTClient) Update(ctx context.Context, req *computepb } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers", req.GetProject(), req.GetRegion()) params := url.Values{} if req != nil && req.Autoscaler != nil { params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } - if req.GetRegion() != "" { - params.Add("region", fmt.Sprintf("%v", req.GetRegion())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/region_backend_services_client.go b/compute/apiv1/region_backend_services_client.go index a7f9f7ab67b..adebf4252b4 100644 --- a/compute/apiv1/region_backend_services_client.go +++ b/compute/apiv1/region_backend_services_client.go @@ -487,18 +487,9 @@ func (c *regionBackendServicesRESTClient) Update(ctx context.Context, req *compu } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v", req.GetProject(), req.GetRegion(), req.GetBackendService()) params := url.Values{} - if req.GetBackendService() != "" { - params.Add("backendService", fmt.Sprintf("%v", req.GetBackendService())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } - if req.GetRegion() != "" { - params.Add("region", fmt.Sprintf("%v", req.GetRegion())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/region_health_checks_client.go b/compute/apiv1/region_health_checks_client.go index ce481d7357c..ca66eb0a050 100644 --- a/compute/apiv1/region_health_checks_client.go +++ b/compute/apiv1/region_health_checks_client.go @@ -436,18 +436,9 @@ func (c *regionHealthChecksRESTClient) Update(ctx context.Context, req *computep } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheck()) params := url.Values{} - if req.GetHealthCheck() != "" { - params.Add("healthCheck", fmt.Sprintf("%v", req.GetHealthCheck())) - } - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } - if req.GetRegion() != "" { - params.Add("region", fmt.Sprintf("%v", req.GetRegion())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } diff --git a/compute/apiv1/region_url_maps_client.go b/compute/apiv1/region_url_maps_client.go index 26d6b3fa32b..4c6388556fd 100644 --- a/compute/apiv1/region_url_maps_client.go +++ b/compute/apiv1/region_url_maps_client.go @@ -443,21 +443,12 @@ func (c *regionUrlMapsRESTClient) Update(ctx context.Context, req *computepb.Upd } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps/%v", req.GetProject(), req.GetRegion(), req.GetUrlMap()) params := url.Values{} - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } - if req.GetRegion() != "" { - params.Add("region", fmt.Sprintf("%v", req.GetRegion())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } - if req.GetUrlMap() != "" { - params.Add("urlMap", fmt.Sprintf("%v", req.GetUrlMap())) - } baseUrl.RawQuery = params.Encode() diff --git a/compute/apiv1/routers_client.go b/compute/apiv1/routers_client.go index 8df00e9886e..d5d0f947e82 100644 --- a/compute/apiv1/routers_client.go +++ b/compute/apiv1/routers_client.go @@ -660,21 +660,12 @@ func (c *routersRESTClient) Update(ctx context.Context, req *computepb.UpdateRou } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v", req.GetProject(), req.GetRegion(), req.GetRouter()) params := url.Values{} - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } - if req.GetRegion() != "" { - params.Add("region", fmt.Sprintf("%v", req.GetRegion())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } - if req.GetRouter() != "" { - params.Add("router", fmt.Sprintf("%v", req.GetRouter())) - } baseUrl.RawQuery = params.Encode() diff --git a/compute/apiv1/url_maps_client.go b/compute/apiv1/url_maps_client.go index a1a7c5a418e..ae3740f7acf 100644 --- a/compute/apiv1/url_maps_client.go +++ b/compute/apiv1/url_maps_client.go @@ -571,18 +571,12 @@ func (c *urlMapsRESTClient) Update(ctx context.Context, req *computepb.UpdateUrl } baseUrl, _ := url.Parse(c.endpoint) - baseUrl.Path += fmt.Sprintf("") + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v", req.GetProject(), req.GetUrlMap()) params := url.Values{} - if req.GetProject() != "" { - params.Add("project", fmt.Sprintf("%v", req.GetProject())) - } if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } - if req.GetUrlMap() != "" { - params.Add("urlMap", fmt.Sprintf("%v", req.GetUrlMap())) - } baseUrl.RawQuery = params.Encode()