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

// PutFleetNameFilterIDReader is a Reader for the PutFleetNameFilterID structure.
type PutFleetNameFilterIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutFleetNameFilterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutFleetNameFilterIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutFleetNameFilterIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutFleetNameFilterIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPutFleetNameFilterIDServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /fleet/{name}/filter/{id}] PutFleetNameFilterID", response, response.Code())
	}
}

// NewPutFleetNameFilterIDOK creates a PutFleetNameFilterIDOK with default headers values
func NewPutFleetNameFilterIDOK() *PutFleetNameFilterIDOK {
	return &PutFleetNameFilterIDOK{}
}

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

OK
*/
type PutFleetNameFilterIDOK struct {
	Payload *models.CommonSubscriptionConfiguration
}

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

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

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

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

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

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

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

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

func (o *PutFleetNameFilterIDOK) GetPayload() *models.CommonSubscriptionConfiguration {
	return o.Payload
}

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

	o.Payload = new(models.CommonSubscriptionConfiguration)

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

	return nil
}

// NewPutFleetNameFilterIDBadRequest creates a PutFleetNameFilterIDBadRequest with default headers values
func NewPutFleetNameFilterIDBadRequest() *PutFleetNameFilterIDBadRequest {
	return &PutFleetNameFilterIDBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutFleetNameFilterIDUnauthorized creates a PutFleetNameFilterIDUnauthorized with default headers values
func NewPutFleetNameFilterIDUnauthorized() *PutFleetNameFilterIDUnauthorized {
	return &PutFleetNameFilterIDUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutFleetNameFilterIDServiceUnavailable creates a PutFleetNameFilterIDServiceUnavailable with default headers values
func NewPutFleetNameFilterIDServiceUnavailable() *PutFleetNameFilterIDServiceUnavailable {
	return &PutFleetNameFilterIDServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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