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

// GetVehiclecommandImmobilizeReader is a Reader for the GetVehiclecommandImmobilize structure.
type GetVehiclecommandImmobilizeReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetVehiclecommandImmobilizeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetVehiclecommandImmobilizeOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetVehiclecommandImmobilizeBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetVehiclecommandImmobilizeUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetVehiclecommandImmobilizeServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /vehiclecommand/immobilize] GetVehiclecommandImmobilize", response, response.Code())
	}
}

// NewGetVehiclecommandImmobilizeOK creates a GetVehiclecommandImmobilizeOK with default headers values
func NewGetVehiclecommandImmobilizeOK() *GetVehiclecommandImmobilizeOK {
	return &GetVehiclecommandImmobilizeOK{}
}

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

OK
*/
type GetVehiclecommandImmobilizeOK struct {
	Payload map[string]models.BackgroundCarTrack
}

// IsSuccess returns true when this get vehiclecommand immobilize o k response has a 2xx status code
func (o *GetVehiclecommandImmobilizeOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get vehiclecommand immobilize o k response has a 3xx status code
func (o *GetVehiclecommandImmobilizeOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehiclecommand immobilize o k response has a 4xx status code
func (o *GetVehiclecommandImmobilizeOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get vehiclecommand immobilize o k response has a 5xx status code
func (o *GetVehiclecommandImmobilizeOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get vehiclecommand immobilize o k response
func (o *GetVehiclecommandImmobilizeOK) Code() int {
	return 200
}

func (o *GetVehiclecommandImmobilizeOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeOK %s", 200, payload)
}

func (o *GetVehiclecommandImmobilizeOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeOK %s", 200, payload)
}

func (o *GetVehiclecommandImmobilizeOK) GetPayload() map[string]models.BackgroundCarTrack {
	return o.Payload
}

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

// NewGetVehiclecommandImmobilizeBadRequest creates a GetVehiclecommandImmobilizeBadRequest with default headers values
func NewGetVehiclecommandImmobilizeBadRequest() *GetVehiclecommandImmobilizeBadRequest {
	return &GetVehiclecommandImmobilizeBadRequest{}
}

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

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

// IsSuccess returns true when this get vehiclecommand immobilize bad request response has a 2xx status code
func (o *GetVehiclecommandImmobilizeBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehiclecommand immobilize bad request response has a 3xx status code
func (o *GetVehiclecommandImmobilizeBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehiclecommand immobilize bad request response has a 4xx status code
func (o *GetVehiclecommandImmobilizeBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehiclecommand immobilize bad request response has a 5xx status code
func (o *GetVehiclecommandImmobilizeBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get vehiclecommand immobilize bad request response
func (o *GetVehiclecommandImmobilizeBadRequest) Code() int {
	return 400
}

func (o *GetVehiclecommandImmobilizeBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeBadRequest %s", 400, payload)
}

func (o *GetVehiclecommandImmobilizeBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeBadRequest %s", 400, payload)
}

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

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

// NewGetVehiclecommandImmobilizeUnauthorized creates a GetVehiclecommandImmobilizeUnauthorized with default headers values
func NewGetVehiclecommandImmobilizeUnauthorized() *GetVehiclecommandImmobilizeUnauthorized {
	return &GetVehiclecommandImmobilizeUnauthorized{}
}

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

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

// IsSuccess returns true when this get vehiclecommand immobilize unauthorized response has a 2xx status code
func (o *GetVehiclecommandImmobilizeUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehiclecommand immobilize unauthorized response has a 3xx status code
func (o *GetVehiclecommandImmobilizeUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehiclecommand immobilize unauthorized response has a 4xx status code
func (o *GetVehiclecommandImmobilizeUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehiclecommand immobilize unauthorized response has a 5xx status code
func (o *GetVehiclecommandImmobilizeUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get vehiclecommand immobilize unauthorized response
func (o *GetVehiclecommandImmobilizeUnauthorized) Code() int {
	return 401
}

func (o *GetVehiclecommandImmobilizeUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeUnauthorized %s", 401, payload)
}

func (o *GetVehiclecommandImmobilizeUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeUnauthorized %s", 401, payload)
}

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

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

// NewGetVehiclecommandImmobilizeServiceUnavailable creates a GetVehiclecommandImmobilizeServiceUnavailable with default headers values
func NewGetVehiclecommandImmobilizeServiceUnavailable() *GetVehiclecommandImmobilizeServiceUnavailable {
	return &GetVehiclecommandImmobilizeServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get vehiclecommand immobilize service unavailable response has a 2xx status code
func (o *GetVehiclecommandImmobilizeServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehiclecommand immobilize service unavailable response has a 3xx status code
func (o *GetVehiclecommandImmobilizeServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehiclecommand immobilize service unavailable response has a 4xx status code
func (o *GetVehiclecommandImmobilizeServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get vehiclecommand immobilize service unavailable response has a 5xx status code
func (o *GetVehiclecommandImmobilizeServiceUnavailable) IsServerError() bool {
	return true
}

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

// Code gets the status code for the get vehiclecommand immobilize service unavailable response
func (o *GetVehiclecommandImmobilizeServiceUnavailable) Code() int {
	return 503
}

func (o *GetVehiclecommandImmobilizeServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeServiceUnavailable %s", 503, payload)
}

func (o *GetVehiclecommandImmobilizeServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehiclecommand/immobilize][%d] getVehiclecommandImmobilizeServiceUnavailable %s", 503, payload)
}

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

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