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

// GetVehicleVinVersionReader is a Reader for the GetVehicleVinVersion structure.
type GetVehicleVinVersionReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetVehicleVinVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetVehicleVinVersionOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetVehicleVinVersionBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetVehicleVinVersionUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetVehicleVinVersionNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetVehicleVinVersionServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /vehicle/{vin}/version] GetVehicleVinVersion", response, response.Code())
	}
}

// NewGetVehicleVinVersionOK creates a GetVehicleVinVersionOK with default headers values
func NewGetVehicleVinVersionOK() *GetVehicleVinVersionOK {
	return &GetVehicleVinVersionOK{}
}

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

OK
*/
type GetVehicleVinVersionOK struct {
	Payload map[string]string
}

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

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

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

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

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

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

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

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

func (o *GetVehicleVinVersionOK) GetPayload() map[string]string {
	return o.Payload
}

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

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

	return nil
}

// NewGetVehicleVinVersionBadRequest creates a GetVehicleVinVersionBadRequest with default headers values
func NewGetVehicleVinVersionBadRequest() *GetVehicleVinVersionBadRequest {
	return &GetVehicleVinVersionBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetVehicleVinVersionUnauthorized creates a GetVehicleVinVersionUnauthorized with default headers values
func NewGetVehicleVinVersionUnauthorized() *GetVehicleVinVersionUnauthorized {
	return &GetVehicleVinVersionUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetVehicleVinVersionNotFound creates a GetVehicleVinVersionNotFound with default headers values
func NewGetVehicleVinVersionNotFound() *GetVehicleVinVersionNotFound {
	return &GetVehicleVinVersionNotFound{}
}

/*
GetVehicleVinVersionNotFound describes a response with status code 404, with default header values.

Not Found
*/
type GetVehicleVinVersionNotFound struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get vehicle vin version not found response has a 2xx status code
func (o *GetVehicleVinVersionNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehicle vin version not found response has a 3xx status code
func (o *GetVehicleVinVersionNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin version not found response has a 4xx status code
func (o *GetVehicleVinVersionNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehicle vin version not found response has a 5xx status code
func (o *GetVehicleVinVersionNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get vehicle vin version not found response a status code equal to that given
func (o *GetVehicleVinVersionNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get vehicle vin version not found response
func (o *GetVehicleVinVersionNotFound) Code() int {
	return 404
}

func (o *GetVehicleVinVersionNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/version][%d] getVehicleVinVersionNotFound %s", 404, payload)
}

func (o *GetVehicleVinVersionNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/version][%d] getVehicleVinVersionNotFound %s", 404, payload)
}

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

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

// NewGetVehicleVinVersionServiceUnavailable creates a GetVehicleVinVersionServiceUnavailable with default headers values
func NewGetVehicleVinVersionServiceUnavailable() *GetVehicleVinVersionServiceUnavailable {
	return &GetVehicleVinVersionServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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