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

package bulk_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"
)

// ReRunAllBillRunsReader is a Reader for the ReRunAllBillRuns structure.
type ReRunAllBillRunsReader struct {
	formats strfmt.Registry
}

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

// NewReRunAllBillRunsAccepted creates a ReRunAllBillRunsAccepted with default headers values
func NewReRunAllBillRunsAccepted() *ReRunAllBillRunsAccepted {
	return &ReRunAllBillRunsAccepted{}
}

/*ReRunAllBillRunsAccepted handles this case with default header values.

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

func (o *ReRunAllBillRunsAccepted) Error() string {
	return fmt.Sprintf("[PUT /billrun][%d] reRunAllBillRunsAccepted  %+v", 202, o.Payload)
}

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

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

// NewReRunAllBillRunsNotFound creates a ReRunAllBillRunsNotFound with default headers values
func NewReRunAllBillRunsNotFound() *ReRunAllBillRunsNotFound {
	return &ReRunAllBillRunsNotFound{}
}

/*ReRunAllBillRunsNotFound handles this case with default header values.

The invoice id provided doesn't exist
*/
type ReRunAllBillRunsNotFound struct {
	Payload *models.ErrorResponse
}

func (o *ReRunAllBillRunsNotFound) Error() string {
	return fmt.Sprintf("[PUT /billrun][%d] reRunAllBillRunsNotFound  %+v", 404, o.Payload)
}

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

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

// NewReRunAllBillRunsInternalServerError creates a ReRunAllBillRunsInternalServerError with default headers values
func NewReRunAllBillRunsInternalServerError() *ReRunAllBillRunsInternalServerError {
	return &ReRunAllBillRunsInternalServerError{}
}

/*ReRunAllBillRunsInternalServerError handles this case with default header values.

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

func (o *ReRunAllBillRunsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /billrun][%d] reRunAllBillRunsInternalServerError  %+v", 500, o.Payload)
}

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

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