// 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"
)

// GetCheckResultReader is a Reader for the GetCheckResult structure.
type GetCheckResultReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCheckResultReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCheckResultOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewGetCheckResultNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewGetCheckResultNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCheckResultInternalServerError()
		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())
	}
}

// NewGetCheckResultOK creates a GetCheckResultOK with default headers values
func NewGetCheckResultOK() *GetCheckResultOK {
	return &GetCheckResultOK{}
}

/* GetCheckResultOK describes a response with status code 200, with default header values.

show last check result of the data set
*/
type GetCheckResultOK struct {
	Payload string
}

func (o *GetCheckResultOK) Error() string {
	return fmt.Sprintf("[GET /data/{id}/check][%d] getCheckResultOK  %+v", 200, o.Payload)
}
func (o *GetCheckResultOK) GetPayload() string {
	return o.Payload
}

func (o *GetCheckResultOK) 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
}

// NewGetCheckResultNoContent creates a GetCheckResultNoContent with default headers values
func NewGetCheckResultNoContent() *GetCheckResultNoContent {
	return &GetCheckResultNoContent{}
}

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

no check result available
*/
type GetCheckResultNoContent struct {
}

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

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

	return nil
}

// NewGetCheckResultNotFound creates a GetCheckResultNotFound with default headers values
func NewGetCheckResultNotFound() *GetCheckResultNotFound {
	return &GetCheckResultNotFound{}
}

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

data set not found
*/
type GetCheckResultNotFound struct {
	Payload *models.ResponseMsg
}

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

func (o *GetCheckResultNotFound) 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
}

// NewGetCheckResultInternalServerError creates a GetCheckResultInternalServerError with default headers values
func NewGetCheckResultInternalServerError() *GetCheckResultInternalServerError {
	return &GetCheckResultInternalServerError{}
}

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

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

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

func (o *GetCheckResultInternalServerError) 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
}
