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

// 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/sf-gate/sf_gate_models"
)

// GetGlAccountsReader is a Reader for the GetGlAccounts structure.
type GetGlAccountsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetGlAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetGlAccountsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetGlAccountsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetGlAccountsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetGlAccountsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetGlAccountsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetGlAccountsInternalServerError()
		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())
	}
}

// NewGetGlAccountsOK creates a GetGlAccountsOK with default headers values
func NewGetGlAccountsOK() *GetGlAccountsOK {
	return &GetGlAccountsOK{}
}

/*GetGlAccountsOK handles this case with default header values.

An array of GL Account Objects
*/
type GetGlAccountsOK struct {
	Payload *sf_gate_models.GlAccountResponse
}

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

func (o *GetGlAccountsOK) GetPayload() *sf_gate_models.GlAccountResponse {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.GlAccountResponse)

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

	return nil
}

// NewGetGlAccountsUnauthorized creates a GetGlAccountsUnauthorized with default headers values
func NewGetGlAccountsUnauthorized() *GetGlAccountsUnauthorized {
	return &GetGlAccountsUnauthorized{}
}

/*GetGlAccountsUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetGlAccountsUnauthorized struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetGlAccountsUnauthorized) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetGlAccountsForbidden creates a GetGlAccountsForbidden with default headers values
func NewGetGlAccountsForbidden() *GetGlAccountsForbidden {
	return &GetGlAccountsForbidden{}
}

/*GetGlAccountsForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetGlAccountsForbidden struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetGlAccountsForbidden) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetGlAccountsNotFound creates a GetGlAccountsNotFound with default headers values
func NewGetGlAccountsNotFound() *GetGlAccountsNotFound {
	return &GetGlAccountsNotFound{}
}

/*GetGlAccountsNotFound handles this case with default header values.

Resource was not found
*/
type GetGlAccountsNotFound struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetGlAccountsNotFound) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetGlAccountsUnprocessableEntity creates a GetGlAccountsUnprocessableEntity with default headers values
func NewGetGlAccountsUnprocessableEntity() *GetGlAccountsUnprocessableEntity {
	return &GetGlAccountsUnprocessableEntity{}
}

/*GetGlAccountsUnprocessableEntity handles this case with default header values.

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

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

func (o *GetGlAccountsUnprocessableEntity) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetGlAccountsInternalServerError creates a GetGlAccountsInternalServerError with default headers values
func NewGetGlAccountsInternalServerError() *GetGlAccountsInternalServerError {
	return &GetGlAccountsInternalServerError{}
}

/*GetGlAccountsInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetGlAccountsInternalServerError struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetGlAccountsInternalServerError) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}
