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

// DeleteFleetNameReader is a Reader for the DeleteFleetName structure.
type DeleteFleetNameReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteFleetNameReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteFleetNameOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteFleetNameBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteFleetNameUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteFleetNameServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /fleet/{name}] DeleteFleetName", response, response.Code())
	}
}

// NewDeleteFleetNameOK creates a DeleteFleetNameOK with default headers values
func NewDeleteFleetNameOK() *DeleteFleetNameOK {
	return &DeleteFleetNameOK{}
}

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

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

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

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

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

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

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

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

func (o *DeleteFleetNameOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameOK %s", 200, payload)
}

func (o *DeleteFleetNameOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameOK %s", 200, payload)
}

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

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

// NewDeleteFleetNameBadRequest creates a DeleteFleetNameBadRequest with default headers values
func NewDeleteFleetNameBadRequest() *DeleteFleetNameBadRequest {
	return &DeleteFleetNameBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *DeleteFleetNameBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameBadRequest %s", 400, payload)
}

func (o *DeleteFleetNameBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameBadRequest %s", 400, payload)
}

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

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

// NewDeleteFleetNameUnauthorized creates a DeleteFleetNameUnauthorized with default headers values
func NewDeleteFleetNameUnauthorized() *DeleteFleetNameUnauthorized {
	return &DeleteFleetNameUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *DeleteFleetNameUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameUnauthorized %s", 401, payload)
}

func (o *DeleteFleetNameUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameUnauthorized %s", 401, payload)
}

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

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

// NewDeleteFleetNameServiceUnavailable creates a DeleteFleetNameServiceUnavailable with default headers values
func NewDeleteFleetNameServiceUnavailable() *DeleteFleetNameServiceUnavailable {
	return &DeleteFleetNameServiceUnavailable{}
}

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

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

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

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

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

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

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

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

func (o *DeleteFleetNameServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameServiceUnavailable %s", 503, payload)
}

func (o *DeleteFleetNameServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /fleet/{name}][%d] deleteFleetNameServiceUnavailable %s", 503, payload)
}

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

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