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

// GetVehicleVinVersionLogsReader is a Reader for the GetVehicleVinVersionLogs structure.
type GetVehicleVinVersionLogsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetVehicleVinVersionLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetVehicleVinVersionLogsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetVehicleVinVersionLogsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetVehicleVinVersionLogsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetVehicleVinVersionLogsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetVehicleVinVersionLogsServiceUnavailable()
		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/logs] GetVehicleVinVersionLogs", response, response.Code())
	}
}

// NewGetVehicleVinVersionLogsOK creates a GetVehicleVinVersionLogsOK with default headers values
func NewGetVehicleVinVersionLogsOK() *GetVehicleVinVersionLogsOK {
	return &GetVehicleVinVersionLogsOK{}
}

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

OK
*/
type GetVehicleVinVersionLogsOK struct {
	Payload *models.CommonCarVersionLogs
}

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

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

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

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

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

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

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

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

func (o *GetVehicleVinVersionLogsOK) GetPayload() *models.CommonCarVersionLogs {
	return o.Payload
}

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

	o.Payload = new(models.CommonCarVersionLogs)

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

	return nil
}

// NewGetVehicleVinVersionLogsBadRequest creates a GetVehicleVinVersionLogsBadRequest with default headers values
func NewGetVehicleVinVersionLogsBadRequest() *GetVehicleVinVersionLogsBadRequest {
	return &GetVehicleVinVersionLogsBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetVehicleVinVersionLogsUnauthorized creates a GetVehicleVinVersionLogsUnauthorized with default headers values
func NewGetVehicleVinVersionLogsUnauthorized() *GetVehicleVinVersionLogsUnauthorized {
	return &GetVehicleVinVersionLogsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetVehicleVinVersionLogsNotFound creates a GetVehicleVinVersionLogsNotFound with default headers values
func NewGetVehicleVinVersionLogsNotFound() *GetVehicleVinVersionLogsNotFound {
	return &GetVehicleVinVersionLogsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetVehicleVinVersionLogsServiceUnavailable creates a GetVehicleVinVersionLogsServiceUnavailable with default headers values
func NewGetVehicleVinVersionLogsServiceUnavailable() *GetVehicleVinVersionLogsServiceUnavailable {
	return &GetVehicleVinVersionLogsServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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