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

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

// GetTransactionByIDReader is a Reader for the GetTransactionByID structure.
type GetTransactionByIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTransactionByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTransactionByIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTransactionByIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTransactionByIDForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTransactionByIDNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTransactionByIDInternalServerError()
		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())
	}
}

// NewGetTransactionByIDOK creates a GetTransactionByIDOK with default headers values
func NewGetTransactionByIDOK() *GetTransactionByIDOK {
	return &GetTransactionByIDOK{}
}

/*GetTransactionByIDOK handles this case with default header values.

A Transaction was successfully retrieved
*/
type GetTransactionByIDOK struct {
	Payload *blaze_models.TransactionByIDResponse
}

func (o *GetTransactionByIDOK) Error() string {
	return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdOK  %+v", 200, o.Payload)
}

func (o *GetTransactionByIDOK) GetPayload() *blaze_models.TransactionByIDResponse {
	return o.Payload
}

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

	o.Payload = new(blaze_models.TransactionByIDResponse)

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

	return nil
}

// NewGetTransactionByIDUnauthorized creates a GetTransactionByIDUnauthorized with default headers values
func NewGetTransactionByIDUnauthorized() *GetTransactionByIDUnauthorized {
	return &GetTransactionByIDUnauthorized{}
}

/*GetTransactionByIDUnauthorized handles this case with default header values.

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

func (o *GetTransactionByIDUnauthorized) Error() string {
	return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdUnauthorized  %+v", 401, o.Payload)
}

func (o *GetTransactionByIDUnauthorized) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetTransactionByIDForbidden creates a GetTransactionByIDForbidden with default headers values
func NewGetTransactionByIDForbidden() *GetTransactionByIDForbidden {
	return &GetTransactionByIDForbidden{}
}

/*GetTransactionByIDForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetTransactionByIDForbidden struct {
	Payload *blaze_models.Error
}

func (o *GetTransactionByIDForbidden) Error() string {
	return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdForbidden  %+v", 403, o.Payload)
}

func (o *GetTransactionByIDForbidden) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetTransactionByIDNotFound creates a GetTransactionByIDNotFound with default headers values
func NewGetTransactionByIDNotFound() *GetTransactionByIDNotFound {
	return &GetTransactionByIDNotFound{}
}

/*GetTransactionByIDNotFound handles this case with default header values.

Resource was not found
*/
type GetTransactionByIDNotFound struct {
	Payload *blaze_models.Error
}

func (o *GetTransactionByIDNotFound) Error() string {
	return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdNotFound  %+v", 404, o.Payload)
}

func (o *GetTransactionByIDNotFound) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetTransactionByIDInternalServerError creates a GetTransactionByIDInternalServerError with default headers values
func NewGetTransactionByIDInternalServerError() *GetTransactionByIDInternalServerError {
	return &GetTransactionByIDInternalServerError{}
}

/*GetTransactionByIDInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetTransactionByIDInternalServerError struct {
	Payload *blaze_models.Error
}

func (o *GetTransactionByIDInternalServerError) Error() string {
	return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdInternalServerError  %+v", 500, o.Payload)
}

func (o *GetTransactionByIDInternalServerError) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}
