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

// DeleteIssuesIDReader is a Reader for the DeleteIssuesID structure.
type DeleteIssuesIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteIssuesIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteIssuesIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteIssuesIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteIssuesIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteIssuesIDServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /issues/{id}] DeleteIssuesID", response, response.Code())
	}
}

// NewDeleteIssuesIDOK creates a DeleteIssuesIDOK with default headers values
func NewDeleteIssuesIDOK() *DeleteIssuesIDOK {
	return &DeleteIssuesIDOK{}
}

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

OK
*/
type DeleteIssuesIDOK struct {
	Payload *models.CommonJSONMessage
}

// IsSuccess returns true when this delete issues Id o k response has a 2xx status code
func (o *DeleteIssuesIDOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete issues Id o k response has a 3xx status code
func (o *DeleteIssuesIDOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete issues Id o k response has a 4xx status code
func (o *DeleteIssuesIDOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete issues Id o k response has a 5xx status code
func (o *DeleteIssuesIDOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete issues Id o k response a status code equal to that given
func (o *DeleteIssuesIDOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete issues Id o k response
func (o *DeleteIssuesIDOK) Code() int {
	return 200
}

func (o *DeleteIssuesIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdOK %s", 200, payload)
}

func (o *DeleteIssuesIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdOK %s", 200, payload)
}

func (o *DeleteIssuesIDOK) GetPayload() *models.CommonJSONMessage {
	return o.Payload
}

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

// NewDeleteIssuesIDBadRequest creates a DeleteIssuesIDBadRequest with default headers values
func NewDeleteIssuesIDBadRequest() *DeleteIssuesIDBadRequest {
	return &DeleteIssuesIDBadRequest{}
}

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

Bad request
*/
type DeleteIssuesIDBadRequest struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this delete issues Id bad request response has a 2xx status code
func (o *DeleteIssuesIDBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete issues Id bad request response has a 3xx status code
func (o *DeleteIssuesIDBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete issues Id bad request response has a 4xx status code
func (o *DeleteIssuesIDBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete issues Id bad request response has a 5xx status code
func (o *DeleteIssuesIDBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this delete issues Id bad request response a status code equal to that given
func (o *DeleteIssuesIDBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the delete issues Id bad request response
func (o *DeleteIssuesIDBadRequest) Code() int {
	return 400
}

func (o *DeleteIssuesIDBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdBadRequest %s", 400, payload)
}

func (o *DeleteIssuesIDBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdBadRequest %s", 400, payload)
}

func (o *DeleteIssuesIDBadRequest) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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

// NewDeleteIssuesIDUnauthorized creates a DeleteIssuesIDUnauthorized with default headers values
func NewDeleteIssuesIDUnauthorized() *DeleteIssuesIDUnauthorized {
	return &DeleteIssuesIDUnauthorized{}
}

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

Unauthorized
*/
type DeleteIssuesIDUnauthorized struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this delete issues Id unauthorized response has a 2xx status code
func (o *DeleteIssuesIDUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete issues Id unauthorized response has a 3xx status code
func (o *DeleteIssuesIDUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete issues Id unauthorized response has a 4xx status code
func (o *DeleteIssuesIDUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete issues Id unauthorized response has a 5xx status code
func (o *DeleteIssuesIDUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete issues Id unauthorized response a status code equal to that given
func (o *DeleteIssuesIDUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete issues Id unauthorized response
func (o *DeleteIssuesIDUnauthorized) Code() int {
	return 401
}

func (o *DeleteIssuesIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdUnauthorized %s", 401, payload)
}

func (o *DeleteIssuesIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdUnauthorized %s", 401, payload)
}

func (o *DeleteIssuesIDUnauthorized) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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

// NewDeleteIssuesIDServiceUnavailable creates a DeleteIssuesIDServiceUnavailable with default headers values
func NewDeleteIssuesIDServiceUnavailable() *DeleteIssuesIDServiceUnavailable {
	return &DeleteIssuesIDServiceUnavailable{}
}

/*
DeleteIssuesIDServiceUnavailable describes a response with status code 503, with default header values.

Service unavailable
*/
type DeleteIssuesIDServiceUnavailable struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this delete issues Id service unavailable response has a 2xx status code
func (o *DeleteIssuesIDServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete issues Id service unavailable response has a 3xx status code
func (o *DeleteIssuesIDServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete issues Id service unavailable response has a 4xx status code
func (o *DeleteIssuesIDServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete issues Id service unavailable response has a 5xx status code
func (o *DeleteIssuesIDServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this delete issues Id service unavailable response a status code equal to that given
func (o *DeleteIssuesIDServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the delete issues Id service unavailable response
func (o *DeleteIssuesIDServiceUnavailable) Code() int {
	return 503
}

func (o *DeleteIssuesIDServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdServiceUnavailable %s", 503, payload)
}

func (o *DeleteIssuesIDServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /issues/{id}][%d] deleteIssuesIdServiceUnavailable %s", 503, payload)
}

func (o *DeleteIssuesIDServiceUnavailable) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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