// Code generated by go-swagger; DO NOT EDIT.

package invoice_management

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/billing/models"
)

// GenerateInvoiceForResellerReader is a Reader for the GenerateInvoiceForReseller structure.
type GenerateInvoiceForResellerReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GenerateInvoiceForResellerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewGenerateInvoiceForResellerAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGenerateInvoiceForResellerBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGenerateInvoiceForResellerInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewGenerateInvoiceForResellerAccepted creates a GenerateInvoiceForResellerAccepted with default headers values
func NewGenerateInvoiceForResellerAccepted() *GenerateInvoiceForResellerAccepted {
	return &GenerateInvoiceForResellerAccepted{}
}

/*GenerateInvoiceForResellerAccepted handles this case with default header values.

The request for processing had been added to the queue
*/
type GenerateInvoiceForResellerAccepted struct {
	Payload *models.ItemCreatedResponse
}

func (o *GenerateInvoiceForResellerAccepted) Error() string {
	return fmt.Sprintf("[POST /invoice/reseller/{id}][%d] generateInvoiceForResellerAccepted  %+v", 202, o.Payload)
}

func (o *GenerateInvoiceForResellerAccepted) GetPayload() *models.ItemCreatedResponse {
	return o.Payload
}

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

	o.Payload = new(models.ItemCreatedResponse)

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

	return nil
}

// NewGenerateInvoiceForResellerBadRequest creates a GenerateInvoiceForResellerBadRequest with default headers values
func NewGenerateInvoiceForResellerBadRequest() *GenerateInvoiceForResellerBadRequest {
	return &GenerateInvoiceForResellerBadRequest{}
}

/*GenerateInvoiceForResellerBadRequest handles this case with default header values.

Invalid input, object invalid
*/
type GenerateInvoiceForResellerBadRequest struct {
	Payload *models.ErrorResponse
}

func (o *GenerateInvoiceForResellerBadRequest) Error() string {
	return fmt.Sprintf("[POST /invoice/reseller/{id}][%d] generateInvoiceForResellerBadRequest  %+v", 400, o.Payload)
}

func (o *GenerateInvoiceForResellerBadRequest) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}

// NewGenerateInvoiceForResellerInternalServerError creates a GenerateInvoiceForResellerInternalServerError with default headers values
func NewGenerateInvoiceForResellerInternalServerError() *GenerateInvoiceForResellerInternalServerError {
	return &GenerateInvoiceForResellerInternalServerError{}
}

/*GenerateInvoiceForResellerInternalServerError handles this case with default header values.

Something unexpected happend, error raised
*/
type GenerateInvoiceForResellerInternalServerError struct {
	Payload *models.ErrorResponse
}

func (o *GenerateInvoiceForResellerInternalServerError) Error() string {
	return fmt.Sprintf("[POST /invoice/reseller/{id}][%d] generateInvoiceForResellerInternalServerError  %+v", 500, o.Payload)
}

func (o *GenerateInvoiceForResellerInternalServerError) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}
