// Code generated by go-swagger; DO NOT EDIT. package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "encoding/json" "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/fiskerinc/cloud-services/pkg/ota_api/models" ) // PostManifestmigrateReader is a Reader for the PostManifestmigrate structure. type PostManifestmigrateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *PostManifestmigrateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewPostManifestmigrateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewPostManifestmigrateBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 401: result := NewPostManifestmigrateUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 503: result := NewPostManifestmigrateServiceUnavailable() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[POST /manifestmigrate] PostManifestmigrate", response, response.Code()) } } // NewPostManifestmigrateOK creates a PostManifestmigrateOK with default headers values func NewPostManifestmigrateOK() *PostManifestmigrateOK { return &PostManifestmigrateOK{} } /* PostManifestmigrateOK describes a response with status code 200, with default header values. OK */ type PostManifestmigrateOK struct { Payload *models.CommonJSONMessage } // IsSuccess returns true when this post manifestmigrate o k response has a 2xx status code func (o *PostManifestmigrateOK) IsSuccess() bool { return true } // IsRedirect returns true when this post manifestmigrate o k response has a 3xx status code func (o *PostManifestmigrateOK) IsRedirect() bool { return false } // IsClientError returns true when this post manifestmigrate o k response has a 4xx status code func (o *PostManifestmigrateOK) IsClientError() bool { return false } // IsServerError returns true when this post manifestmigrate o k response has a 5xx status code func (o *PostManifestmigrateOK) IsServerError() bool { return false } // IsCode returns true when this post manifestmigrate o k response a status code equal to that given func (o *PostManifestmigrateOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the post manifestmigrate o k response func (o *PostManifestmigrateOK) Code() int { return 200 } func (o *PostManifestmigrateOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateOK %s", 200, payload) } func (o *PostManifestmigrateOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateOK %s", 200, payload) } func (o *PostManifestmigrateOK) GetPayload() *models.CommonJSONMessage { return o.Payload } func (o *PostManifestmigrateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.CommonJSONMessage) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewPostManifestmigrateBadRequest creates a PostManifestmigrateBadRequest with default headers values func NewPostManifestmigrateBadRequest() *PostManifestmigrateBadRequest { return &PostManifestmigrateBadRequest{} } /* PostManifestmigrateBadRequest describes a response with status code 400, with default header values. Bad request */ type PostManifestmigrateBadRequest struct { Payload *models.CommonJSONError } // IsSuccess returns true when this post manifestmigrate bad request response has a 2xx status code func (o *PostManifestmigrateBadRequest) IsSuccess() bool { return false } // IsRedirect returns true when this post manifestmigrate bad request response has a 3xx status code func (o *PostManifestmigrateBadRequest) IsRedirect() bool { return false } // IsClientError returns true when this post manifestmigrate bad request response has a 4xx status code func (o *PostManifestmigrateBadRequest) IsClientError() bool { return true } // IsServerError returns true when this post manifestmigrate bad request response has a 5xx status code func (o *PostManifestmigrateBadRequest) IsServerError() bool { return false } // IsCode returns true when this post manifestmigrate bad request response a status code equal to that given func (o *PostManifestmigrateBadRequest) IsCode(code int) bool { return code == 400 } // Code gets the status code for the post manifestmigrate bad request response func (o *PostManifestmigrateBadRequest) Code() int { return 400 } func (o *PostManifestmigrateBadRequest) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateBadRequest %s", 400, payload) } func (o *PostManifestmigrateBadRequest) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateBadRequest %s", 400, payload) } func (o *PostManifestmigrateBadRequest) GetPayload() *models.CommonJSONError { return o.Payload } func (o *PostManifestmigrateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.CommonJSONError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewPostManifestmigrateUnauthorized creates a PostManifestmigrateUnauthorized with default headers values func NewPostManifestmigrateUnauthorized() *PostManifestmigrateUnauthorized { return &PostManifestmigrateUnauthorized{} } /* PostManifestmigrateUnauthorized describes a response with status code 401, with default header values. Unauthorized */ type PostManifestmigrateUnauthorized struct { Payload *models.CommonJSONError } // IsSuccess returns true when this post manifestmigrate unauthorized response has a 2xx status code func (o *PostManifestmigrateUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this post manifestmigrate unauthorized response has a 3xx status code func (o *PostManifestmigrateUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this post manifestmigrate unauthorized response has a 4xx status code func (o *PostManifestmigrateUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this post manifestmigrate unauthorized response has a 5xx status code func (o *PostManifestmigrateUnauthorized) IsServerError() bool { return false } // IsCode returns true when this post manifestmigrate unauthorized response a status code equal to that given func (o *PostManifestmigrateUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the post manifestmigrate unauthorized response func (o *PostManifestmigrateUnauthorized) Code() int { return 401 } func (o *PostManifestmigrateUnauthorized) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateUnauthorized %s", 401, payload) } func (o *PostManifestmigrateUnauthorized) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateUnauthorized %s", 401, payload) } func (o *PostManifestmigrateUnauthorized) GetPayload() *models.CommonJSONError { return o.Payload } func (o *PostManifestmigrateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.CommonJSONError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewPostManifestmigrateServiceUnavailable creates a PostManifestmigrateServiceUnavailable with default headers values func NewPostManifestmigrateServiceUnavailable() *PostManifestmigrateServiceUnavailable { return &PostManifestmigrateServiceUnavailable{} } /* PostManifestmigrateServiceUnavailable describes a response with status code 503, with default header values. Service unavailable */ type PostManifestmigrateServiceUnavailable struct { Payload *models.CommonJSONError } // IsSuccess returns true when this post manifestmigrate service unavailable response has a 2xx status code func (o *PostManifestmigrateServiceUnavailable) IsSuccess() bool { return false } // IsRedirect returns true when this post manifestmigrate service unavailable response has a 3xx status code func (o *PostManifestmigrateServiceUnavailable) IsRedirect() bool { return false } // IsClientError returns true when this post manifestmigrate service unavailable response has a 4xx status code func (o *PostManifestmigrateServiceUnavailable) IsClientError() bool { return false } // IsServerError returns true when this post manifestmigrate service unavailable response has a 5xx status code func (o *PostManifestmigrateServiceUnavailable) IsServerError() bool { return true } // IsCode returns true when this post manifestmigrate service unavailable response a status code equal to that given func (o *PostManifestmigrateServiceUnavailable) IsCode(code int) bool { return code == 503 } // Code gets the status code for the post manifestmigrate service unavailable response func (o *PostManifestmigrateServiceUnavailable) Code() int { return 503 } func (o *PostManifestmigrateServiceUnavailable) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateServiceUnavailable %s", 503, payload) } func (o *PostManifestmigrateServiceUnavailable) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[POST /manifestmigrate][%d] postManifestmigrateServiceUnavailable %s", 503, payload) } func (o *PostManifestmigrateServiceUnavailable) GetPayload() *models.CommonJSONError { return o.Payload } func (o *PostManifestmigrateServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.CommonJSONError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }