diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index 678d48093..b0251b527 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -297,7 +297,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - serviceAccountMailValue := "serviceAccountMail" + serviceAccountMailValue := "serviceAccountMail-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -1566,7 +1566,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { _apiUrlPath := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := "keypairName" + keypairNameValue := "keypairName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -2551,7 +2551,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { _apiUrlPath := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := "keypairName" + keypairNameValue := "keypairName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -2605,7 +2605,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1alpha1/projects/{projectId}/machine-types/{machineType}" projectIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - machineTypeValue := "machineType" + machineTypeValue := "machineType-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -2944,7 +2944,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1alpha1/organizations/{organizationId}/requests/{requestId}" organizationIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - requestIdValue := "requestId" + requestIdValue := "requestId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -3106,7 +3106,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1alpha1/projects/{projectId}/requests/{requestId}" projectIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - requestIdValue := "requestId" + requestIdValue := "requestId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -3662,7 +3662,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" projectIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumePerformanceClassValue := "volumePerformanceClass" + volumePerformanceClassValue := "volumePerformanceClass-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -5508,7 +5508,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := uuid.NewString() _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - serviceAccountMailValue := "serviceAccountMail" + serviceAccountMailValue := "serviceAccountMail-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -6352,7 +6352,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { _apiUrlPath := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := "keypairName" + keypairNameValue := "keypairName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) testDefaultApiServeMux := http.NewServeMux() diff --git a/services/iaasalpha/client.go b/services/iaasalpha/client.go index de3841509..acb3cedda 100644 --- a/services/iaasalpha/client.go +++ b/services/iaasalpha/client.go @@ -308,7 +308,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)