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

// PostFleetNameVehiclesDeleteReader is a Reader for the PostFleetNameVehiclesDelete structure.
type PostFleetNameVehiclesDeleteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostFleetNameVehiclesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostFleetNameVehiclesDeleteOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostFleetNameVehiclesDeleteBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostFleetNameVehiclesDeleteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostFleetNameVehiclesDeleteServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /fleet/{name}/vehicles/delete] PostFleetNameVehiclesDelete", response, response.Code())
	}
}

// NewPostFleetNameVehiclesDeleteOK creates a PostFleetNameVehiclesDeleteOK with default headers values
func NewPostFleetNameVehiclesDeleteOK() *PostFleetNameVehiclesDeleteOK {
	return &PostFleetNameVehiclesDeleteOK{}
}

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

OK
*/
type PostFleetNameVehiclesDeleteOK struct {
	Payload *models.CommonJSONMessage
}

// IsSuccess returns true when this post fleet name vehicles delete o k response has a 2xx status code
func (o *PostFleetNameVehiclesDeleteOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this post fleet name vehicles delete o k response has a 3xx status code
func (o *PostFleetNameVehiclesDeleteOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post fleet name vehicles delete o k response has a 4xx status code
func (o *PostFleetNameVehiclesDeleteOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this post fleet name vehicles delete o k response has a 5xx status code
func (o *PostFleetNameVehiclesDeleteOK) IsServerError() bool {
	return false
}

// IsCode returns true when this post fleet name vehicles delete o k response a status code equal to that given
func (o *PostFleetNameVehiclesDeleteOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the post fleet name vehicles delete o k response
func (o *PostFleetNameVehiclesDeleteOK) Code() int {
	return 200
}

func (o *PostFleetNameVehiclesDeleteOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteOK %s", 200, payload)
}

func (o *PostFleetNameVehiclesDeleteOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteOK %s", 200, payload)
}

func (o *PostFleetNameVehiclesDeleteOK) GetPayload() *models.CommonJSONMessage {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONMessage)

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

	return nil
}

// NewPostFleetNameVehiclesDeleteBadRequest creates a PostFleetNameVehiclesDeleteBadRequest with default headers values
func NewPostFleetNameVehiclesDeleteBadRequest() *PostFleetNameVehiclesDeleteBadRequest {
	return &PostFleetNameVehiclesDeleteBadRequest{}
}

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

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

// IsSuccess returns true when this post fleet name vehicles delete bad request response has a 2xx status code
func (o *PostFleetNameVehiclesDeleteBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post fleet name vehicles delete bad request response has a 3xx status code
func (o *PostFleetNameVehiclesDeleteBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post fleet name vehicles delete bad request response has a 4xx status code
func (o *PostFleetNameVehiclesDeleteBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this post fleet name vehicles delete bad request response has a 5xx status code
func (o *PostFleetNameVehiclesDeleteBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this post fleet name vehicles delete bad request response a status code equal to that given
func (o *PostFleetNameVehiclesDeleteBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the post fleet name vehicles delete bad request response
func (o *PostFleetNameVehiclesDeleteBadRequest) Code() int {
	return 400
}

func (o *PostFleetNameVehiclesDeleteBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteBadRequest %s", 400, payload)
}

func (o *PostFleetNameVehiclesDeleteBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteBadRequest %s", 400, payload)
}

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

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

// NewPostFleetNameVehiclesDeleteUnauthorized creates a PostFleetNameVehiclesDeleteUnauthorized with default headers values
func NewPostFleetNameVehiclesDeleteUnauthorized() *PostFleetNameVehiclesDeleteUnauthorized {
	return &PostFleetNameVehiclesDeleteUnauthorized{}
}

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

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

// IsSuccess returns true when this post fleet name vehicles delete unauthorized response has a 2xx status code
func (o *PostFleetNameVehiclesDeleteUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post fleet name vehicles delete unauthorized response has a 3xx status code
func (o *PostFleetNameVehiclesDeleteUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post fleet name vehicles delete unauthorized response has a 4xx status code
func (o *PostFleetNameVehiclesDeleteUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this post fleet name vehicles delete unauthorized response has a 5xx status code
func (o *PostFleetNameVehiclesDeleteUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this post fleet name vehicles delete unauthorized response a status code equal to that given
func (o *PostFleetNameVehiclesDeleteUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the post fleet name vehicles delete unauthorized response
func (o *PostFleetNameVehiclesDeleteUnauthorized) Code() int {
	return 401
}

func (o *PostFleetNameVehiclesDeleteUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteUnauthorized %s", 401, payload)
}

func (o *PostFleetNameVehiclesDeleteUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteUnauthorized %s", 401, payload)
}

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

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

// NewPostFleetNameVehiclesDeleteServiceUnavailable creates a PostFleetNameVehiclesDeleteServiceUnavailable with default headers values
func NewPostFleetNameVehiclesDeleteServiceUnavailable() *PostFleetNameVehiclesDeleteServiceUnavailable {
	return &PostFleetNameVehiclesDeleteServiceUnavailable{}
}

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

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

// IsSuccess returns true when this post fleet name vehicles delete service unavailable response has a 2xx status code
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post fleet name vehicles delete service unavailable response has a 3xx status code
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post fleet name vehicles delete service unavailable response has a 4xx status code
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this post fleet name vehicles delete service unavailable response has a 5xx status code
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this post fleet name vehicles delete service unavailable response a status code equal to that given
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the post fleet name vehicles delete service unavailable response
func (o *PostFleetNameVehiclesDeleteServiceUnavailable) Code() int {
	return 503
}

func (o *PostFleetNameVehiclesDeleteServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteServiceUnavailable %s", 503, payload)
}

func (o *PostFleetNameVehiclesDeleteServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /fleet/{name}/vehicles/delete][%d] postFleetNameVehiclesDeleteServiceUnavailable %s", 503, payload)
}

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

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