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

// PostFleetNameFilterReader is a Reader for the PostFleetNameFilter structure.
type PostFleetNameFilterReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostFleetNameFilterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostFleetNameFilterOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostFleetNameFilterBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostFleetNameFilterUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostFleetNameFilterServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /fleet/{name}/filter] PostFleetNameFilter", response, response.Code())
	}
}

// NewPostFleetNameFilterOK creates a PostFleetNameFilterOK with default headers values
func NewPostFleetNameFilterOK() *PostFleetNameFilterOK {
	return &PostFleetNameFilterOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostFleetNameFilterBadRequest creates a PostFleetNameFilterBadRequest with default headers values
func NewPostFleetNameFilterBadRequest() *PostFleetNameFilterBadRequest {
	return &PostFleetNameFilterBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostFleetNameFilterUnauthorized creates a PostFleetNameFilterUnauthorized with default headers values
func NewPostFleetNameFilterUnauthorized() *PostFleetNameFilterUnauthorized {
	return &PostFleetNameFilterUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostFleetNameFilterServiceUnavailable creates a PostFleetNameFilterServiceUnavailable with default headers values
func NewPostFleetNameFilterServiceUnavailable() *PostFleetNameFilterServiceUnavailable {
	return &PostFleetNameFilterServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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