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

// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package journal_entry

// 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/taxnexus/go/lib/api/ledger/ledger_models"
)

// GetJournalEntriesReader is a Reader for the GetJournalEntries structure.
type GetJournalEntriesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetJournalEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetJournalEntriesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetJournalEntriesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetJournalEntriesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetJournalEntriesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetJournalEntriesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetJournalEntriesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewGetJournalEntriesOK creates a GetJournalEntriesOK with default headers values
func NewGetJournalEntriesOK() *GetJournalEntriesOK {
	return &GetJournalEntriesOK{}
}

/*GetJournalEntriesOK handles this case with default header values.

Taxnexus Response with Journal Entry objects with Journal Items
*/
type GetJournalEntriesOK struct {
	Payload *ledger_models.JournalEntryResponse
}

func (o *GetJournalEntriesOK) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesOK  %+v", 200, o.Payload)
}

func (o *GetJournalEntriesOK) GetPayload() *ledger_models.JournalEntryResponse {
	return o.Payload
}

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

	o.Payload = new(ledger_models.JournalEntryResponse)

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

	return nil
}

// NewGetJournalEntriesUnauthorized creates a GetJournalEntriesUnauthorized with default headers values
func NewGetJournalEntriesUnauthorized() *GetJournalEntriesUnauthorized {
	return &GetJournalEntriesUnauthorized{}
}

/*GetJournalEntriesUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type GetJournalEntriesUnauthorized struct {
	Payload *ledger_models.Error
}

func (o *GetJournalEntriesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetJournalEntriesUnauthorized) GetPayload() *ledger_models.Error {
	return o.Payload
}

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

	o.Payload = new(ledger_models.Error)

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

	return nil
}

// NewGetJournalEntriesForbidden creates a GetJournalEntriesForbidden with default headers values
func NewGetJournalEntriesForbidden() *GetJournalEntriesForbidden {
	return &GetJournalEntriesForbidden{}
}

/*GetJournalEntriesForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetJournalEntriesForbidden struct {
	Payload *ledger_models.Error
}

func (o *GetJournalEntriesForbidden) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesForbidden  %+v", 403, o.Payload)
}

func (o *GetJournalEntriesForbidden) GetPayload() *ledger_models.Error {
	return o.Payload
}

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

	o.Payload = new(ledger_models.Error)

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

	return nil
}

// NewGetJournalEntriesNotFound creates a GetJournalEntriesNotFound with default headers values
func NewGetJournalEntriesNotFound() *GetJournalEntriesNotFound {
	return &GetJournalEntriesNotFound{}
}

/*GetJournalEntriesNotFound handles this case with default header values.

Resource was not found
*/
type GetJournalEntriesNotFound struct {
	Payload *ledger_models.Error
}

func (o *GetJournalEntriesNotFound) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesNotFound  %+v", 404, o.Payload)
}

func (o *GetJournalEntriesNotFound) GetPayload() *ledger_models.Error {
	return o.Payload
}

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

	o.Payload = new(ledger_models.Error)

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

	return nil
}

// NewGetJournalEntriesUnprocessableEntity creates a GetJournalEntriesUnprocessableEntity with default headers values
func NewGetJournalEntriesUnprocessableEntity() *GetJournalEntriesUnprocessableEntity {
	return &GetJournalEntriesUnprocessableEntity{}
}

/*GetJournalEntriesUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetJournalEntriesUnprocessableEntity struct {
	Payload *ledger_models.Error
}

func (o *GetJournalEntriesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetJournalEntriesUnprocessableEntity) GetPayload() *ledger_models.Error {
	return o.Payload
}

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

	o.Payload = new(ledger_models.Error)

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

	return nil
}

// NewGetJournalEntriesInternalServerError creates a GetJournalEntriesInternalServerError with default headers values
func NewGetJournalEntriesInternalServerError() *GetJournalEntriesInternalServerError {
	return &GetJournalEntriesInternalServerError{}
}

/*GetJournalEntriesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetJournalEntriesInternalServerError struct {
	Payload *ledger_models.Error
}

func (o *GetJournalEntriesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetJournalEntriesInternalServerError) GetPayload() *ledger_models.Error {
	return o.Payload
}

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

	o.Payload = new(ledger_models.Error)

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

	return nil
}
