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

// DeleteFleetNameFilterIDReader is a Reader for the DeleteFleetNameFilterID structure.
type DeleteFleetNameFilterIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteFleetNameFilterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteFleetNameFilterIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteFleetNameFilterIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteFleetNameFilterIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteFleetNameFilterIDServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /fleet/{name}/filter/{id}] DeleteFleetNameFilterID", response, response.Code())
	}
}

// NewDeleteFleetNameFilterIDOK creates a DeleteFleetNameFilterIDOK with default headers values
func NewDeleteFleetNameFilterIDOK() *DeleteFleetNameFilterIDOK {
	return &DeleteFleetNameFilterIDOK{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete fleet name filter Id o k response
func (o *DeleteFleetNameFilterIDOK) Code() int {
	return 200
}

func (o *DeleteFleetNameFilterIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdOK %s", 200, payload)
}

func (o *DeleteFleetNameFilterIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdOK %s", 200, payload)
}

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

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

// NewDeleteFleetNameFilterIDBadRequest creates a DeleteFleetNameFilterIDBadRequest with default headers values
func NewDeleteFleetNameFilterIDBadRequest() *DeleteFleetNameFilterIDBadRequest {
	return &DeleteFleetNameFilterIDBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete fleet name filter Id bad request response
func (o *DeleteFleetNameFilterIDBadRequest) Code() int {
	return 400
}

func (o *DeleteFleetNameFilterIDBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdBadRequest %s", 400, payload)
}

func (o *DeleteFleetNameFilterIDBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdBadRequest %s", 400, payload)
}

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

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

// NewDeleteFleetNameFilterIDUnauthorized creates a DeleteFleetNameFilterIDUnauthorized with default headers values
func NewDeleteFleetNameFilterIDUnauthorized() *DeleteFleetNameFilterIDUnauthorized {
	return &DeleteFleetNameFilterIDUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete fleet name filter Id unauthorized response
func (o *DeleteFleetNameFilterIDUnauthorized) Code() int {
	return 401
}

func (o *DeleteFleetNameFilterIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdUnauthorized %s", 401, payload)
}

func (o *DeleteFleetNameFilterIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdUnauthorized %s", 401, payload)
}

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

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

// NewDeleteFleetNameFilterIDServiceUnavailable creates a DeleteFleetNameFilterIDServiceUnavailable with default headers values
func NewDeleteFleetNameFilterIDServiceUnavailable() *DeleteFleetNameFilterIDServiceUnavailable {
	return &DeleteFleetNameFilterIDServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete fleet name filter Id service unavailable response
func (o *DeleteFleetNameFilterIDServiceUnavailable) Code() int {
	return 503
}

func (o *DeleteFleetNameFilterIDServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdServiceUnavailable %s", 503, payload)
}

func (o *DeleteFleetNameFilterIDServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}/filter/{id}][%d] deleteFleetNameFilterIdServiceUnavailable %s", 503, payload)
}

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

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