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

// GenerateInvoiceForCustomerReader is a Reader for the GenerateInvoiceForCustomer structure.
type GenerateInvoiceForCustomerReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GenerateInvoiceForCustomerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewGenerateInvoiceForCustomerAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGenerateInvoiceForCustomerBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGenerateInvoiceForCustomerInternalServerError()
		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())
	}
}

// NewGenerateInvoiceForCustomerAccepted creates a GenerateInvoiceForCustomerAccepted with default headers values
func NewGenerateInvoiceForCustomerAccepted() *GenerateInvoiceForCustomerAccepted {
	return &GenerateInvoiceForCustomerAccepted{}
}

/*GenerateInvoiceForCustomerAccepted handles this case with default header values.

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

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

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

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

// NewGenerateInvoiceForCustomerBadRequest creates a GenerateInvoiceForCustomerBadRequest with default headers values
func NewGenerateInvoiceForCustomerBadRequest() *GenerateInvoiceForCustomerBadRequest {
	return &GenerateInvoiceForCustomerBadRequest{}
}

/*GenerateInvoiceForCustomerBadRequest handles this case with default header values.

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

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

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

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

// NewGenerateInvoiceForCustomerInternalServerError creates a GenerateInvoiceForCustomerInternalServerError with default headers values
func NewGenerateInvoiceForCustomerInternalServerError() *GenerateInvoiceForCustomerInternalServerError {
	return &GenerateInvoiceForCustomerInternalServerError{}
}

/*GenerateInvoiceForCustomerInternalServerError handles this case with default header values.

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

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

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

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