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

// GetVehicleVinFiltersReader is a Reader for the GetVehicleVinFilters structure.
type GetVehicleVinFiltersReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetVehicleVinFiltersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetVehicleVinFiltersOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetVehicleVinFiltersBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetVehicleVinFiltersUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetVehicleVinFiltersServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /vehicle/{vin}/filters] GetVehicleVinFilters", response, response.Code())
	}
}

// NewGetVehicleVinFiltersOK creates a GetVehicleVinFiltersOK with default headers values
func NewGetVehicleVinFiltersOK() *GetVehicleVinFiltersOK {
	return &GetVehicleVinFiltersOK{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get vehicle vin filters o k response
func (o *GetVehicleVinFiltersOK) Code() int {
	return 200
}

func (o *GetVehicleVinFiltersOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersOK %s", 200, payload)
}

func (o *GetVehicleVinFiltersOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersOK %s", 200, payload)
}

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

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

// NewGetVehicleVinFiltersBadRequest creates a GetVehicleVinFiltersBadRequest with default headers values
func NewGetVehicleVinFiltersBadRequest() *GetVehicleVinFiltersBadRequest {
	return &GetVehicleVinFiltersBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get vehicle vin filters bad request response
func (o *GetVehicleVinFiltersBadRequest) Code() int {
	return 400
}

func (o *GetVehicleVinFiltersBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersBadRequest %s", 400, payload)
}

func (o *GetVehicleVinFiltersBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersBadRequest %s", 400, payload)
}

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

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

// NewGetVehicleVinFiltersUnauthorized creates a GetVehicleVinFiltersUnauthorized with default headers values
func NewGetVehicleVinFiltersUnauthorized() *GetVehicleVinFiltersUnauthorized {
	return &GetVehicleVinFiltersUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get vehicle vin filters unauthorized response
func (o *GetVehicleVinFiltersUnauthorized) Code() int {
	return 401
}

func (o *GetVehicleVinFiltersUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersUnauthorized %s", 401, payload)
}

func (o *GetVehicleVinFiltersUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersUnauthorized %s", 401, payload)
}

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

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

// NewGetVehicleVinFiltersServiceUnavailable creates a GetVehicleVinFiltersServiceUnavailable with default headers values
func NewGetVehicleVinFiltersServiceUnavailable() *GetVehicleVinFiltersServiceUnavailable {
	return &GetVehicleVinFiltersServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get vehicle vin filters service unavailable response
func (o *GetVehicleVinFiltersServiceUnavailable) Code() int {
	return 503
}

func (o *GetVehicleVinFiltersServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersServiceUnavailable %s", 503, payload)
}

func (o *GetVehicleVinFiltersServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/filters][%d] getVehicleVinFiltersServiceUnavailable %s", 503, payload)
}

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

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