From f08716b69cb78db7dde8bebae739ac0fc208a01d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 28 Nov 2024 10:30:48 +0000 Subject: [PATCH] Generate serverupdate --- services/serverupdate/api_default.go | 156 +++------------------------ 1 file changed, 12 insertions(+), 144 deletions(-) diff --git a/services/serverupdate/api_default.go b/services/serverupdate/api_default.go index 5facd4b3c..b65d3113b 100644 --- a/services/serverupdate/api_default.go +++ b/services/serverupdate/api_default.go @@ -69,7 +69,7 @@ func (r ApiCreateUpdateRequest) Execute() (*Update, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -110,17 +110,6 @@ func (r ApiCreateUpdateRequest) Execute() (*Update, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -208,7 +197,7 @@ func (r ApiCreateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -249,17 +238,6 @@ func (r ApiCreateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -342,7 +320,7 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -381,17 +359,6 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } return newErr } @@ -465,7 +432,7 @@ func (r ApiDisableServiceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -504,17 +471,6 @@ func (r ApiDisableServiceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } return newErr } @@ -588,7 +544,7 @@ func (r ApiDisableServiceResourceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -627,17 +583,6 @@ func (r ApiDisableServiceResourceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } return newErr } @@ -714,7 +659,7 @@ func (r ApiEnableServiceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -755,17 +700,6 @@ func (r ApiEnableServiceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } return newErr } @@ -845,7 +779,7 @@ func (r ApiEnableServiceResourceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -886,17 +820,6 @@ func (r ApiEnableServiceResourceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } return newErr } @@ -970,7 +893,7 @@ func (r ApiGetUpdateRequest) Execute() (*Update, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1009,17 +932,6 @@ func (r ApiGetUpdateRequest) Execute() (*Update, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -1106,7 +1018,7 @@ func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1145,17 +1057,6 @@ func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -1355,7 +1256,7 @@ func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, e } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1394,17 +1295,6 @@ func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, e Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -1486,7 +1376,7 @@ func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1525,17 +1415,6 @@ func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr } @@ -1625,7 +1504,7 @@ func (r ApiUpdateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1666,17 +1545,6 @@ func (r ApiUpdateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } return localVarReturnValue, newErr }