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

// PostSupplierActivateEmailReader is a Reader for the PostSupplierActivateEmail structure.
type PostSupplierActivateEmailReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostSupplierActivateEmailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostSupplierActivateEmailOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostSupplierActivateEmailBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostSupplierActivateEmailUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostSupplierActivateEmailServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /supplier/activate/{email}] PostSupplierActivateEmail", response, response.Code())
	}
}

// NewPostSupplierActivateEmailOK creates a PostSupplierActivateEmailOK with default headers values
func NewPostSupplierActivateEmailOK() *PostSupplierActivateEmailOK {
	return &PostSupplierActivateEmailOK{}
}

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

OK
*/
type PostSupplierActivateEmailOK struct {
	Payload *models.HandlersApproveResponse
}

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

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

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

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

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

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

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

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

func (o *PostSupplierActivateEmailOK) GetPayload() *models.HandlersApproveResponse {
	return o.Payload
}

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

	o.Payload = new(models.HandlersApproveResponse)

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

	return nil
}

// NewPostSupplierActivateEmailBadRequest creates a PostSupplierActivateEmailBadRequest with default headers values
func NewPostSupplierActivateEmailBadRequest() *PostSupplierActivateEmailBadRequest {
	return &PostSupplierActivateEmailBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostSupplierActivateEmailUnauthorized creates a PostSupplierActivateEmailUnauthorized with default headers values
func NewPostSupplierActivateEmailUnauthorized() *PostSupplierActivateEmailUnauthorized {
	return &PostSupplierActivateEmailUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostSupplierActivateEmailServiceUnavailable creates a PostSupplierActivateEmailServiceUnavailable with default headers values
func NewPostSupplierActivateEmailServiceUnavailable() *PostSupplierActivateEmailServiceUnavailable {
	return &PostSupplierActivateEmailServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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