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

// PutVehicleVinFilterIDReader is a Reader for the PutVehicleVinFilterID structure.
type PutVehicleVinFilterIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutVehicleVinFilterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutVehicleVinFilterIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutVehicleVinFilterIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutVehicleVinFilterIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPutVehicleVinFilterIDServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /vehicle/{vin}/filter/{id}] PutVehicleVinFilterID", response, response.Code())
	}
}

// NewPutVehicleVinFilterIDOK creates a PutVehicleVinFilterIDOK with default headers values
func NewPutVehicleVinFilterIDOK() *PutVehicleVinFilterIDOK {
	return &PutVehicleVinFilterIDOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutVehicleVinFilterIDBadRequest creates a PutVehicleVinFilterIDBadRequest with default headers values
func NewPutVehicleVinFilterIDBadRequest() *PutVehicleVinFilterIDBadRequest {
	return &PutVehicleVinFilterIDBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutVehicleVinFilterIDUnauthorized creates a PutVehicleVinFilterIDUnauthorized with default headers values
func NewPutVehicleVinFilterIDUnauthorized() *PutVehicleVinFilterIDUnauthorized {
	return &PutVehicleVinFilterIDUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutVehicleVinFilterIDServiceUnavailable creates a PutVehicleVinFilterIDServiceUnavailable with default headers values
func NewPutVehicleVinFilterIDServiceUnavailable() *PutVehicleVinFilterIDServiceUnavailable {
	return &PutVehicleVinFilterIDServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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