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

// GetFleetNameFiltersReader is a Reader for the GetFleetNameFilters structure.
type GetFleetNameFiltersReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetFleetNameFiltersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetFleetNameFiltersOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetFleetNameFiltersBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetFleetNameFiltersUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetFleetNameFiltersServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /fleet/{name}/filters] GetFleetNameFilters", response, response.Code())
	}
}

// NewGetFleetNameFiltersOK creates a GetFleetNameFiltersOK with default headers values
func NewGetFleetNameFiltersOK() *GetFleetNameFiltersOK {
	return &GetFleetNameFiltersOK{}
}

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

OK
*/
type GetFleetNameFiltersOK struct {
	Payload *models.CommonJSONDBQueryResult
}

// IsSuccess returns true when this get fleet name filters o k response has a 2xx status code
func (o *GetFleetNameFiltersOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get fleet name filters o k response has a 3xx status code
func (o *GetFleetNameFiltersOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get fleet name filters o k response has a 4xx status code
func (o *GetFleetNameFiltersOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get fleet name filters o k response has a 5xx status code
func (o *GetFleetNameFiltersOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get fleet name filters o k response
func (o *GetFleetNameFiltersOK) Code() int {
	return 200
}

func (o *GetFleetNameFiltersOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersOK %s", 200, payload)
}

func (o *GetFleetNameFiltersOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersOK %s", 200, payload)
}

func (o *GetFleetNameFiltersOK) GetPayload() *models.CommonJSONDBQueryResult {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONDBQueryResult)

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

	return nil
}

// NewGetFleetNameFiltersBadRequest creates a GetFleetNameFiltersBadRequest with default headers values
func NewGetFleetNameFiltersBadRequest() *GetFleetNameFiltersBadRequest {
	return &GetFleetNameFiltersBadRequest{}
}

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

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

// IsSuccess returns true when this get fleet name filters bad request response has a 2xx status code
func (o *GetFleetNameFiltersBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get fleet name filters bad request response has a 3xx status code
func (o *GetFleetNameFiltersBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get fleet name filters bad request response has a 4xx status code
func (o *GetFleetNameFiltersBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get fleet name filters bad request response has a 5xx status code
func (o *GetFleetNameFiltersBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get fleet name filters bad request response
func (o *GetFleetNameFiltersBadRequest) Code() int {
	return 400
}

func (o *GetFleetNameFiltersBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersBadRequest %s", 400, payload)
}

func (o *GetFleetNameFiltersBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersBadRequest %s", 400, payload)
}

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

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

// NewGetFleetNameFiltersUnauthorized creates a GetFleetNameFiltersUnauthorized with default headers values
func NewGetFleetNameFiltersUnauthorized() *GetFleetNameFiltersUnauthorized {
	return &GetFleetNameFiltersUnauthorized{}
}

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

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

// IsSuccess returns true when this get fleet name filters unauthorized response has a 2xx status code
func (o *GetFleetNameFiltersUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get fleet name filters unauthorized response has a 3xx status code
func (o *GetFleetNameFiltersUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get fleet name filters unauthorized response has a 4xx status code
func (o *GetFleetNameFiltersUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get fleet name filters unauthorized response has a 5xx status code
func (o *GetFleetNameFiltersUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get fleet name filters unauthorized response
func (o *GetFleetNameFiltersUnauthorized) Code() int {
	return 401
}

func (o *GetFleetNameFiltersUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersUnauthorized %s", 401, payload)
}

func (o *GetFleetNameFiltersUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersUnauthorized %s", 401, payload)
}

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

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

// NewGetFleetNameFiltersServiceUnavailable creates a GetFleetNameFiltersServiceUnavailable with default headers values
func NewGetFleetNameFiltersServiceUnavailable() *GetFleetNameFiltersServiceUnavailable {
	return &GetFleetNameFiltersServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get fleet name filters service unavailable response has a 2xx status code
func (o *GetFleetNameFiltersServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get fleet name filters service unavailable response has a 3xx status code
func (o *GetFleetNameFiltersServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get fleet name filters service unavailable response has a 4xx status code
func (o *GetFleetNameFiltersServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get fleet name filters service unavailable response has a 5xx status code
func (o *GetFleetNameFiltersServiceUnavailable) IsServerError() bool {
	return true
}

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

// Code gets the status code for the get fleet name filters service unavailable response
func (o *GetFleetNameFiltersServiceUnavailable) Code() int {
	return 503
}

func (o *GetFleetNameFiltersServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersServiceUnavailable %s", 503, payload)
}

func (o *GetFleetNameFiltersServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /fleet/{name}/filters][%d] getFleetNameFiltersServiceUnavailable %s", 503, payload)
}

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

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