// 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 (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/pingcap/test-infra/services/sdkserver/diag/models"
)

// CancelCheckReader is a Reader for the CancelCheck structure.
type CancelCheckReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CancelCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewCancelCheckAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewCancelCheckNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewCancelCheckNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewCancelCheckInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewCancelCheckAccepted creates a CancelCheckAccepted with default headers values
func NewCancelCheckAccepted() *CancelCheckAccepted {
	return &CancelCheckAccepted{}
}

/* CancelCheckAccepted describes a response with status code 202, with default header values.

check has finished, no need to cancal
*/
type CancelCheckAccepted struct {
	Payload string
}

func (o *CancelCheckAccepted) Error() string {
	return fmt.Sprintf("[DELETE /data/{id}/check][%d] cancelCheckAccepted  %+v", 202, o.Payload)
}
func (o *CancelCheckAccepted) GetPayload() string {
	return o.Payload
}

func (o *CancelCheckAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewCancelCheckNoContent creates a CancelCheckNoContent with default headers values
func NewCancelCheckNoContent() *CancelCheckNoContent {
	return &CancelCheckNoContent{}
}

/* CancelCheckNoContent describes a response with status code 204, with default header values.

check cancelled
*/
type CancelCheckNoContent struct {
}

func (o *CancelCheckNoContent) Error() string {
	return fmt.Sprintf("[DELETE /data/{id}/check][%d] cancelCheckNoContent ", 204)
}

func (o *CancelCheckNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewCancelCheckNotFound creates a CancelCheckNotFound with default headers values
func NewCancelCheckNotFound() *CancelCheckNotFound {
	return &CancelCheckNotFound{}
}

/* CancelCheckNotFound describes a response with status code 404, with default header values.

data set not found or check result unavailable
*/
type CancelCheckNotFound struct {
	Payload *models.ResponseMsg
}

func (o *CancelCheckNotFound) Error() string {
	return fmt.Sprintf("[DELETE /data/{id}/check][%d] cancelCheckNotFound  %+v", 404, o.Payload)
}
func (o *CancelCheckNotFound) GetPayload() *models.ResponseMsg {
	return o.Payload
}

func (o *CancelCheckNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.ResponseMsg)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewCancelCheckInternalServerError creates a CancelCheckInternalServerError with default headers values
func NewCancelCheckInternalServerError() *CancelCheckInternalServerError {
	return &CancelCheckInternalServerError{}
}

/* CancelCheckInternalServerError describes a response with status code 500, with default header values.

server side error
*/
type CancelCheckInternalServerError struct {
	Payload *models.ResponseMsg
}

func (o *CancelCheckInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /data/{id}/check][%d] cancelCheckInternalServerError  %+v", 500, o.Payload)
}
func (o *CancelCheckInternalServerError) GetPayload() *models.ResponseMsg {
	return o.Payload
}

func (o *CancelCheckInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.ResponseMsg)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
