// 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 accounting_ruleset

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

// GetAccountingRulesetsReader is a Reader for the GetAccountingRulesets structure.
type GetAccountingRulesetsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAccountingRulesetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetAccountingRulesetsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetAccountingRulesetsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetAccountingRulesetsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetAccountingRulesetsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetAccountingRulesetsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetAccountingRulesetsInternalServerError()
		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())
	}
}

// NewGetAccountingRulesetsOK creates a GetAccountingRulesetsOK with default headers values
func NewGetAccountingRulesetsOK() *GetAccountingRulesetsOK {
	return &GetAccountingRulesetsOK{}
}

/*GetAccountingRulesetsOK handles this case with default header values.

Taxnexus Response with Accounting Ruleset objects
*/
type GetAccountingRulesetsOK struct {
	Payload *ledger_models.AccountingRulesetResponse
}

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

func (o *GetAccountingRulesetsOK) GetPayload() *ledger_models.AccountingRulesetResponse {
	return o.Payload
}

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

	o.Payload = new(ledger_models.AccountingRulesetResponse)

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

	return nil
}

// NewGetAccountingRulesetsUnauthorized creates a GetAccountingRulesetsUnauthorized with default headers values
func NewGetAccountingRulesetsUnauthorized() *GetAccountingRulesetsUnauthorized {
	return &GetAccountingRulesetsUnauthorized{}
}

/*GetAccountingRulesetsUnauthorized handles this case with default header values.

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

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

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

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

// NewGetAccountingRulesetsForbidden creates a GetAccountingRulesetsForbidden with default headers values
func NewGetAccountingRulesetsForbidden() *GetAccountingRulesetsForbidden {
	return &GetAccountingRulesetsForbidden{}
}

/*GetAccountingRulesetsForbidden handles this case with default header values.

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

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

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

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

// NewGetAccountingRulesetsNotFound creates a GetAccountingRulesetsNotFound with default headers values
func NewGetAccountingRulesetsNotFound() *GetAccountingRulesetsNotFound {
	return &GetAccountingRulesetsNotFound{}
}

/*GetAccountingRulesetsNotFound handles this case with default header values.

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

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

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

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

// NewGetAccountingRulesetsUnprocessableEntity creates a GetAccountingRulesetsUnprocessableEntity with default headers values
func NewGetAccountingRulesetsUnprocessableEntity() *GetAccountingRulesetsUnprocessableEntity {
	return &GetAccountingRulesetsUnprocessableEntity{}
}

/*GetAccountingRulesetsUnprocessableEntity handles this case with default header values.

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

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

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

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

// NewGetAccountingRulesetsInternalServerError creates a GetAccountingRulesetsInternalServerError with default headers values
func NewGetAccountingRulesetsInternalServerError() *GetAccountingRulesetsInternalServerError {
	return &GetAccountingRulesetsInternalServerError{}
}

/*GetAccountingRulesetsInternalServerError handles this case with default header values.

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

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

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

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