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

// ReRunBillRunReader is a Reader for the ReRunBillRun structure.
type ReRunBillRunReader struct {
	formats strfmt.Registry
}

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

// NewReRunBillRunAccepted creates a ReRunBillRunAccepted with default headers values
func NewReRunBillRunAccepted() *ReRunBillRunAccepted {
	return &ReRunBillRunAccepted{}
}

/*ReRunBillRunAccepted handles this case with default header values.

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

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

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

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

// NewReRunBillRunNotFound creates a ReRunBillRunNotFound with default headers values
func NewReRunBillRunNotFound() *ReRunBillRunNotFound {
	return &ReRunBillRunNotFound{}
}

/*ReRunBillRunNotFound handles this case with default header values.

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

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

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

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

// NewReRunBillRunInternalServerError creates a ReRunBillRunInternalServerError with default headers values
func NewReRunBillRunInternalServerError() *ReRunBillRunInternalServerError {
	return &ReRunBillRunInternalServerError{}
}

/*ReRunBillRunInternalServerError handles this case with default header values.

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

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

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

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