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

// DeleteSupplierEmailReader is a Reader for the DeleteSupplierEmail structure.
type DeleteSupplierEmailReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteSupplierEmailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteSupplierEmailOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteSupplierEmailBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteSupplierEmailUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteSupplierEmailServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /supplier/{email}] DeleteSupplierEmail", response, response.Code())
	}
}

// NewDeleteSupplierEmailOK creates a DeleteSupplierEmailOK with default headers values
func NewDeleteSupplierEmailOK() *DeleteSupplierEmailOK {
	return &DeleteSupplierEmailOK{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete supplier email o k response
func (o *DeleteSupplierEmailOK) Code() int {
	return 200
}

func (o *DeleteSupplierEmailOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailOK %s", 200, payload)
}

func (o *DeleteSupplierEmailOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailOK %s", 200, payload)
}

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

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

// NewDeleteSupplierEmailBadRequest creates a DeleteSupplierEmailBadRequest with default headers values
func NewDeleteSupplierEmailBadRequest() *DeleteSupplierEmailBadRequest {
	return &DeleteSupplierEmailBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete supplier email bad request response
func (o *DeleteSupplierEmailBadRequest) Code() int {
	return 400
}

func (o *DeleteSupplierEmailBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailBadRequest %s", 400, payload)
}

func (o *DeleteSupplierEmailBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailBadRequest %s", 400, payload)
}

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

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

// NewDeleteSupplierEmailUnauthorized creates a DeleteSupplierEmailUnauthorized with default headers values
func NewDeleteSupplierEmailUnauthorized() *DeleteSupplierEmailUnauthorized {
	return &DeleteSupplierEmailUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete supplier email unauthorized response
func (o *DeleteSupplierEmailUnauthorized) Code() int {
	return 401
}

func (o *DeleteSupplierEmailUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailUnauthorized %s", 401, payload)
}

func (o *DeleteSupplierEmailUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailUnauthorized %s", 401, payload)
}

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

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

// NewDeleteSupplierEmailServiceUnavailable creates a DeleteSupplierEmailServiceUnavailable with default headers values
func NewDeleteSupplierEmailServiceUnavailable() *DeleteSupplierEmailServiceUnavailable {
	return &DeleteSupplierEmailServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete supplier email service unavailable response
func (o *DeleteSupplierEmailServiceUnavailable) Code() int {
	return 503
}

func (o *DeleteSupplierEmailServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailServiceUnavailable %s", 503, payload)
}

func (o *DeleteSupplierEmailServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /supplier/{email}][%d] deleteSupplierEmailServiceUnavailable %s", 503, payload)
}

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

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