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

package library_elements

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

// DeleteLibraryElementByUIDReader is a Reader for the DeleteLibraryElementByUID structure.
type DeleteLibraryElementByUIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteLibraryElementByUIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteLibraryElementByUIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteLibraryElementByUIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteLibraryElementByUIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteLibraryElementByUIDForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteLibraryElementByUIDNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteLibraryElementByUIDInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /library-elements/{library_element_uid}] deleteLibraryElementByUID", response, response.Code())
	}
}

// NewDeleteLibraryElementByUIDOK creates a DeleteLibraryElementByUIDOK with default headers values
func NewDeleteLibraryElementByUIDOK() *DeleteLibraryElementByUIDOK {
	return &DeleteLibraryElementByUIDOK{}
}

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

An OKResponse is returned if the request was successful.
*/
type DeleteLibraryElementByUIDOK struct {
	Payload *models.SuccessResponseBody
}

// IsSuccess returns true when this delete library element by Uid Ok response has a 2xx status code
func (o *DeleteLibraryElementByUIDOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete library element by Uid Ok response has a 3xx status code
func (o *DeleteLibraryElementByUIDOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid Ok response has a 4xx status code
func (o *DeleteLibraryElementByUIDOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete library element by Uid Ok response has a 5xx status code
func (o *DeleteLibraryElementByUIDOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete library element by Uid Ok response a status code equal to that given
func (o *DeleteLibraryElementByUIDOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete library element by Uid Ok response
func (o *DeleteLibraryElementByUIDOK) Code() int {
	return 200
}

func (o *DeleteLibraryElementByUIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidOk %s", 200, payload)
}

func (o *DeleteLibraryElementByUIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidOk %s", 200, payload)
}

func (o *DeleteLibraryElementByUIDOK) GetPayload() *models.SuccessResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.SuccessResponseBody)

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

	return nil
}

// NewDeleteLibraryElementByUIDBadRequest creates a DeleteLibraryElementByUIDBadRequest with default headers values
func NewDeleteLibraryElementByUIDBadRequest() *DeleteLibraryElementByUIDBadRequest {
	return &DeleteLibraryElementByUIDBadRequest{}
}

/*
DeleteLibraryElementByUIDBadRequest 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 DeleteLibraryElementByUIDBadRequest struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete library element by Uid bad request response has a 2xx status code
func (o *DeleteLibraryElementByUIDBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete library element by Uid bad request response has a 3xx status code
func (o *DeleteLibraryElementByUIDBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid bad request response has a 4xx status code
func (o *DeleteLibraryElementByUIDBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete library element by Uid bad request response has a 5xx status code
func (o *DeleteLibraryElementByUIDBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this delete library element by Uid bad request response a status code equal to that given
func (o *DeleteLibraryElementByUIDBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the delete library element by Uid bad request response
func (o *DeleteLibraryElementByUIDBadRequest) Code() int {
	return 400
}

func (o *DeleteLibraryElementByUIDBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidBadRequest %s", 400, payload)
}

func (o *DeleteLibraryElementByUIDBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidBadRequest %s", 400, payload)
}

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

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

// NewDeleteLibraryElementByUIDUnauthorized creates a DeleteLibraryElementByUIDUnauthorized with default headers values
func NewDeleteLibraryElementByUIDUnauthorized() *DeleteLibraryElementByUIDUnauthorized {
	return &DeleteLibraryElementByUIDUnauthorized{}
}

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

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

// IsSuccess returns true when this delete library element by Uid unauthorized response has a 2xx status code
func (o *DeleteLibraryElementByUIDUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete library element by Uid unauthorized response has a 3xx status code
func (o *DeleteLibraryElementByUIDUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid unauthorized response has a 4xx status code
func (o *DeleteLibraryElementByUIDUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete library element by Uid unauthorized response has a 5xx status code
func (o *DeleteLibraryElementByUIDUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete library element by Uid unauthorized response a status code equal to that given
func (o *DeleteLibraryElementByUIDUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete library element by Uid unauthorized response
func (o *DeleteLibraryElementByUIDUnauthorized) Code() int {
	return 401
}

func (o *DeleteLibraryElementByUIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidUnauthorized %s", 401, payload)
}

func (o *DeleteLibraryElementByUIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidUnauthorized %s", 401, payload)
}

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

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

// NewDeleteLibraryElementByUIDForbidden creates a DeleteLibraryElementByUIDForbidden with default headers values
func NewDeleteLibraryElementByUIDForbidden() *DeleteLibraryElementByUIDForbidden {
	return &DeleteLibraryElementByUIDForbidden{}
}

/*
DeleteLibraryElementByUIDForbidden 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 DeleteLibraryElementByUIDForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete library element by Uid forbidden response has a 2xx status code
func (o *DeleteLibraryElementByUIDForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete library element by Uid forbidden response has a 3xx status code
func (o *DeleteLibraryElementByUIDForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid forbidden response has a 4xx status code
func (o *DeleteLibraryElementByUIDForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete library element by Uid forbidden response has a 5xx status code
func (o *DeleteLibraryElementByUIDForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this delete library element by Uid forbidden response a status code equal to that given
func (o *DeleteLibraryElementByUIDForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the delete library element by Uid forbidden response
func (o *DeleteLibraryElementByUIDForbidden) Code() int {
	return 403
}

func (o *DeleteLibraryElementByUIDForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidForbidden %s", 403, payload)
}

func (o *DeleteLibraryElementByUIDForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidForbidden %s", 403, payload)
}

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

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

// NewDeleteLibraryElementByUIDNotFound creates a DeleteLibraryElementByUIDNotFound with default headers values
func NewDeleteLibraryElementByUIDNotFound() *DeleteLibraryElementByUIDNotFound {
	return &DeleteLibraryElementByUIDNotFound{}
}

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

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

// IsSuccess returns true when this delete library element by Uid not found response has a 2xx status code
func (o *DeleteLibraryElementByUIDNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete library element by Uid not found response has a 3xx status code
func (o *DeleteLibraryElementByUIDNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid not found response has a 4xx status code
func (o *DeleteLibraryElementByUIDNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete library element by Uid not found response has a 5xx status code
func (o *DeleteLibraryElementByUIDNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this delete library element by Uid not found response a status code equal to that given
func (o *DeleteLibraryElementByUIDNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the delete library element by Uid not found response
func (o *DeleteLibraryElementByUIDNotFound) Code() int {
	return 404
}

func (o *DeleteLibraryElementByUIDNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidNotFound %s", 404, payload)
}

func (o *DeleteLibraryElementByUIDNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidNotFound %s", 404, payload)
}

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

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

// NewDeleteLibraryElementByUIDInternalServerError creates a DeleteLibraryElementByUIDInternalServerError with default headers values
func NewDeleteLibraryElementByUIDInternalServerError() *DeleteLibraryElementByUIDInternalServerError {
	return &DeleteLibraryElementByUIDInternalServerError{}
}

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

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

// IsSuccess returns true when this delete library element by Uid internal server error response has a 2xx status code
func (o *DeleteLibraryElementByUIDInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete library element by Uid internal server error response has a 3xx status code
func (o *DeleteLibraryElementByUIDInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete library element by Uid internal server error response has a 4xx status code
func (o *DeleteLibraryElementByUIDInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete library element by Uid internal server error response has a 5xx status code
func (o *DeleteLibraryElementByUIDInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this delete library element by Uid internal server error response a status code equal to that given
func (o *DeleteLibraryElementByUIDInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the delete library element by Uid internal server error response
func (o *DeleteLibraryElementByUIDInternalServerError) Code() int {
	return 500
}

func (o *DeleteLibraryElementByUIDInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidInternalServerError %s", 500, payload)
}

func (o *DeleteLibraryElementByUIDInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /library-elements/{library_element_uid}][%d] deleteLibraryElementByUidInternalServerError %s", 500, payload)
}

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

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