diff --git a/services/serviceenablement/api_default_test.go b/services/serviceenablement/api_default_test.go index 9a148d337..a17486cf0 100644 --- a/services/serviceenablement/api_default_test.go +++ b/services/serviceenablement/api_default_test.go @@ -25,11 +25,11 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService DisableServiceRegional", func(t *testing.T) { _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" - regionValue := "region" + regionValue := "region-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) - projectIdValue := "projectId" + projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serviceIdValue := "serviceId" + serviceIdValue := "serviceId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -77,11 +77,11 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService EnableServiceRegional", func(t *testing.T) { _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" - regionValue := "region" + regionValue := "region-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) - projectIdValue := "projectId" + projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serviceIdValue := "serviceId" + serviceIdValue := "serviceId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -129,11 +129,11 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService GetServiceStatusRegional", func(t *testing.T) { _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" - regionValue := "region" + regionValue := "region-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) - projectIdValue := "projectId" + projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serviceIdValue := "serviceId" + serviceIdValue := "serviceId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -187,9 +187,9 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService ListServiceStatusRegional", func(t *testing.T) { _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services" - regionValue := "region" + regionValue := "region-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) - projectIdValue := "projectId" + projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() diff --git a/services/serviceenablement/client.go b/services/serviceenablement/client.go index f6795f163..70a4693aa 100644 --- a/services/serviceenablement/client.go +++ b/services/serviceenablement/client.go @@ -305,7 +305,7 @@ func (c *APIClient) prepareRequest( var body *bytes.Buffer // Detect postBody type and post. - if postBody != nil { + if !IsNil(postBody) { contentType := headerParams["Content-Type"] if contentType == "" { contentType = detectContentType(postBody)