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

// PostVehicleVinFilterReader is a Reader for the PostVehicleVinFilter structure.
type PostVehicleVinFilterReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostVehicleVinFilterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostVehicleVinFilterOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostVehicleVinFilterBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostVehicleVinFilterUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostVehicleVinFilterServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /vehicle/{vin}/filter] PostVehicleVinFilter", response, response.Code())
	}
}

// NewPostVehicleVinFilterOK creates a PostVehicleVinFilterOK with default headers values
func NewPostVehicleVinFilterOK() *PostVehicleVinFilterOK {
	return &PostVehicleVinFilterOK{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post vehicle vin filter o k response
func (o *PostVehicleVinFilterOK) Code() int {
	return 200
}

func (o *PostVehicleVinFilterOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterOK %s", 200, payload)
}

func (o *PostVehicleVinFilterOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterOK %s", 200, payload)
}

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

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

// NewPostVehicleVinFilterBadRequest creates a PostVehicleVinFilterBadRequest with default headers values
func NewPostVehicleVinFilterBadRequest() *PostVehicleVinFilterBadRequest {
	return &PostVehicleVinFilterBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post vehicle vin filter bad request response
func (o *PostVehicleVinFilterBadRequest) Code() int {
	return 400
}

func (o *PostVehicleVinFilterBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterBadRequest %s", 400, payload)
}

func (o *PostVehicleVinFilterBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterBadRequest %s", 400, payload)
}

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

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

// NewPostVehicleVinFilterUnauthorized creates a PostVehicleVinFilterUnauthorized with default headers values
func NewPostVehicleVinFilterUnauthorized() *PostVehicleVinFilterUnauthorized {
	return &PostVehicleVinFilterUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post vehicle vin filter unauthorized response
func (o *PostVehicleVinFilterUnauthorized) Code() int {
	return 401
}

func (o *PostVehicleVinFilterUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterUnauthorized %s", 401, payload)
}

func (o *PostVehicleVinFilterUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterUnauthorized %s", 401, payload)
}

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

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

// NewPostVehicleVinFilterServiceUnavailable creates a PostVehicleVinFilterServiceUnavailable with default headers values
func NewPostVehicleVinFilterServiceUnavailable() *PostVehicleVinFilterServiceUnavailable {
	return &PostVehicleVinFilterServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post vehicle vin filter service unavailable response
func (o *PostVehicleVinFilterServiceUnavailable) Code() int {
	return 503
}

func (o *PostVehicleVinFilterServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterServiceUnavailable %s", 503, payload)
}

func (o *PostVehicleVinFilterServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /vehicle/{vin}/filter][%d] postVehicleVinFilterServiceUnavailable %s", 503, payload)
}

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

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