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

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

// GetProductReader is a Reader for the GetProduct structure.
type GetProductReader struct {
	formats strfmt.Registry
}

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

// NewGetProductOK creates a GetProductOK with default headers values
func NewGetProductOK() *GetProductOK {
	return &GetProductOK{}
}

/*GetProductOK handles this case with default header values.

Product was successfully retrieved
*/
type GetProductOK struct {
	Payload *blaze_models.ProductResponse
}

func (o *GetProductOK) Error() string {
	return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductOK  %+v", 200, o.Payload)
}

func (o *GetProductOK) GetPayload() *blaze_models.ProductResponse {
	return o.Payload
}

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

	o.Payload = new(blaze_models.ProductResponse)

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

	return nil
}

// NewGetProductUnauthorized creates a GetProductUnauthorized with default headers values
func NewGetProductUnauthorized() *GetProductUnauthorized {
	return &GetProductUnauthorized{}
}

/*GetProductUnauthorized handles this case with default header values.

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

func (o *GetProductUnauthorized) Error() string {
	return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetProductForbidden creates a GetProductForbidden with default headers values
func NewGetProductForbidden() *GetProductForbidden {
	return &GetProductForbidden{}
}

/*GetProductForbidden handles this case with default header values.

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

func (o *GetProductForbidden) Error() string {
	return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetProductNotFound creates a GetProductNotFound with default headers values
func NewGetProductNotFound() *GetProductNotFound {
	return &GetProductNotFound{}
}

/*GetProductNotFound handles this case with default header values.

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

func (o *GetProductNotFound) Error() string {
	return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetProductInternalServerError creates a GetProductInternalServerError with default headers values
func NewGetProductInternalServerError() *GetProductInternalServerError {
	return &GetProductInternalServerError{}
}

/*GetProductInternalServerError handles this case with default header values.

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

func (o *GetProductInternalServerError) Error() string {
	return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductInternalServerError  %+v", 500, o.Payload)
}

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

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