// Code generated by go-swagger; DO NOT EDIT.

package datasources

// 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/grafana/grafana-openapi-client-go/models"
)

// DatasourceProxyDELETEcallsReader is a Reader for the DatasourceProxyDELETEcalls structure.
type DatasourceProxyDELETEcallsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DatasourceProxyDELETEcallsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewDatasourceProxyDELETEcallsAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDatasourceProxyDELETEcallsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDatasourceProxyDELETEcallsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDatasourceProxyDELETEcallsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDatasourceProxyDELETEcallsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDatasourceProxyDELETEcallsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}] datasourceProxyDELETEcalls", response, response.Code())
	}
}

// NewDatasourceProxyDELETEcallsAccepted creates a DatasourceProxyDELETEcallsAccepted with default headers values
func NewDatasourceProxyDELETEcallsAccepted() *DatasourceProxyDELETEcallsAccepted {
	return &DatasourceProxyDELETEcallsAccepted{}
}

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

(empty)
*/
type DatasourceProxyDELETEcallsAccepted struct {
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls accepted response has a 2xx status code
func (o *DatasourceProxyDELETEcallsAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls accepted response has a 3xx status code
func (o *DatasourceProxyDELETEcallsAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls accepted response has a 4xx status code
func (o *DatasourceProxyDELETEcallsAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this datasource proxy d e l e t ecalls accepted response has a 5xx status code
func (o *DatasourceProxyDELETEcallsAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this datasource proxy d e l e t ecalls accepted response a status code equal to that given
func (o *DatasourceProxyDELETEcallsAccepted) IsCode(code int) bool {
	return code == 202
}

// Code gets the status code for the datasource proxy d e l e t ecalls accepted response
func (o *DatasourceProxyDELETEcallsAccepted) Code() int {
	return 202
}

func (o *DatasourceProxyDELETEcallsAccepted) Error() string {
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsAccepted", 202)
}

func (o *DatasourceProxyDELETEcallsAccepted) String() string {
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsAccepted", 202)
}

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

	return nil
}

// NewDatasourceProxyDELETEcallsBadRequest creates a DatasourceProxyDELETEcallsBadRequest with default headers values
func NewDatasourceProxyDELETEcallsBadRequest() *DatasourceProxyDELETEcallsBadRequest {
	return &DatasourceProxyDELETEcallsBadRequest{}
}

/*
DatasourceProxyDELETEcallsBadRequest describes a response with status code 400, with default header values.

BadRequestError is returned when the request is invalid and it cannot be processed.
*/
type DatasourceProxyDELETEcallsBadRequest struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls bad request response has a 2xx status code
func (o *DatasourceProxyDELETEcallsBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls bad request response has a 3xx status code
func (o *DatasourceProxyDELETEcallsBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls bad request response has a 4xx status code
func (o *DatasourceProxyDELETEcallsBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this datasource proxy d e l e t ecalls bad request response has a 5xx status code
func (o *DatasourceProxyDELETEcallsBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this datasource proxy d e l e t ecalls bad request response a status code equal to that given
func (o *DatasourceProxyDELETEcallsBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the datasource proxy d e l e t ecalls bad request response
func (o *DatasourceProxyDELETEcallsBadRequest) Code() int {
	return 400
}

func (o *DatasourceProxyDELETEcallsBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsBadRequest %s", 400, payload)
}

func (o *DatasourceProxyDELETEcallsBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsBadRequest %s", 400, payload)
}

func (o *DatasourceProxyDELETEcallsBadRequest) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDatasourceProxyDELETEcallsUnauthorized creates a DatasourceProxyDELETEcallsUnauthorized with default headers values
func NewDatasourceProxyDELETEcallsUnauthorized() *DatasourceProxyDELETEcallsUnauthorized {
	return &DatasourceProxyDELETEcallsUnauthorized{}
}

/*
DatasourceProxyDELETEcallsUnauthorized describes a response with status code 401, with default header values.

UnauthorizedError is returned when the request is not authenticated.
*/
type DatasourceProxyDELETEcallsUnauthorized struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls unauthorized response has a 2xx status code
func (o *DatasourceProxyDELETEcallsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls unauthorized response has a 3xx status code
func (o *DatasourceProxyDELETEcallsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls unauthorized response has a 4xx status code
func (o *DatasourceProxyDELETEcallsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this datasource proxy d e l e t ecalls unauthorized response has a 5xx status code
func (o *DatasourceProxyDELETEcallsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this datasource proxy d e l e t ecalls unauthorized response a status code equal to that given
func (o *DatasourceProxyDELETEcallsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the datasource proxy d e l e t ecalls unauthorized response
func (o *DatasourceProxyDELETEcallsUnauthorized) Code() int {
	return 401
}

func (o *DatasourceProxyDELETEcallsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsUnauthorized %s", 401, payload)
}

func (o *DatasourceProxyDELETEcallsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsUnauthorized %s", 401, payload)
}

func (o *DatasourceProxyDELETEcallsUnauthorized) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDatasourceProxyDELETEcallsForbidden creates a DatasourceProxyDELETEcallsForbidden with default headers values
func NewDatasourceProxyDELETEcallsForbidden() *DatasourceProxyDELETEcallsForbidden {
	return &DatasourceProxyDELETEcallsForbidden{}
}

/*
DatasourceProxyDELETEcallsForbidden describes a response with status code 403, with default header values.

ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
*/
type DatasourceProxyDELETEcallsForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls forbidden response has a 2xx status code
func (o *DatasourceProxyDELETEcallsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls forbidden response has a 3xx status code
func (o *DatasourceProxyDELETEcallsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls forbidden response has a 4xx status code
func (o *DatasourceProxyDELETEcallsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this datasource proxy d e l e t ecalls forbidden response has a 5xx status code
func (o *DatasourceProxyDELETEcallsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this datasource proxy d e l e t ecalls forbidden response a status code equal to that given
func (o *DatasourceProxyDELETEcallsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the datasource proxy d e l e t ecalls forbidden response
func (o *DatasourceProxyDELETEcallsForbidden) Code() int {
	return 403
}

func (o *DatasourceProxyDELETEcallsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsForbidden %s", 403, payload)
}

func (o *DatasourceProxyDELETEcallsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsForbidden %s", 403, payload)
}

func (o *DatasourceProxyDELETEcallsForbidden) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDatasourceProxyDELETEcallsNotFound creates a DatasourceProxyDELETEcallsNotFound with default headers values
func NewDatasourceProxyDELETEcallsNotFound() *DatasourceProxyDELETEcallsNotFound {
	return &DatasourceProxyDELETEcallsNotFound{}
}

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

NotFoundError is returned when the requested resource was not found.
*/
type DatasourceProxyDELETEcallsNotFound struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls not found response has a 2xx status code
func (o *DatasourceProxyDELETEcallsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls not found response has a 3xx status code
func (o *DatasourceProxyDELETEcallsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls not found response has a 4xx status code
func (o *DatasourceProxyDELETEcallsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this datasource proxy d e l e t ecalls not found response has a 5xx status code
func (o *DatasourceProxyDELETEcallsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this datasource proxy d e l e t ecalls not found response a status code equal to that given
func (o *DatasourceProxyDELETEcallsNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the datasource proxy d e l e t ecalls not found response
func (o *DatasourceProxyDELETEcallsNotFound) Code() int {
	return 404
}

func (o *DatasourceProxyDELETEcallsNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsNotFound %s", 404, payload)
}

func (o *DatasourceProxyDELETEcallsNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsNotFound %s", 404, payload)
}

func (o *DatasourceProxyDELETEcallsNotFound) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDatasourceProxyDELETEcallsInternalServerError creates a DatasourceProxyDELETEcallsInternalServerError with default headers values
func NewDatasourceProxyDELETEcallsInternalServerError() *DatasourceProxyDELETEcallsInternalServerError {
	return &DatasourceProxyDELETEcallsInternalServerError{}
}

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

InternalServerError is a general error indicating something went wrong internally.
*/
type DatasourceProxyDELETEcallsInternalServerError struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this datasource proxy d e l e t ecalls internal server error response has a 2xx status code
func (o *DatasourceProxyDELETEcallsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this datasource proxy d e l e t ecalls internal server error response has a 3xx status code
func (o *DatasourceProxyDELETEcallsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this datasource proxy d e l e t ecalls internal server error response has a 4xx status code
func (o *DatasourceProxyDELETEcallsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this datasource proxy d e l e t ecalls internal server error response has a 5xx status code
func (o *DatasourceProxyDELETEcallsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this datasource proxy d e l e t ecalls internal server error response a status code equal to that given
func (o *DatasourceProxyDELETEcallsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the datasource proxy d e l e t ecalls internal server error response
func (o *DatasourceProxyDELETEcallsInternalServerError) Code() int {
	return 500
}

func (o *DatasourceProxyDELETEcallsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsInternalServerError %s", 500, payload)
}

func (o *DatasourceProxyDELETEcallsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /datasources/proxy/{id}/{datasource_proxy_route}][%d] datasourceProxyDELETEcallsInternalServerError %s", 500, payload)
}

func (o *DatasourceProxyDELETEcallsInternalServerError) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}
