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

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

// GetVendorReader is a Reader for the GetVendor structure.
type GetVendorReader struct {
	formats strfmt.Registry
}

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

// NewGetVendorOK creates a GetVendorOK with default headers values
func NewGetVendorOK() *GetVendorOK {
	return &GetVendorOK{}
}

/*GetVendorOK handles this case with default header values.

Product was successfully retrieved
*/
type GetVendorOK struct {
	Payload *blaze_models.VendorResponse
}

func (o *GetVendorOK) Error() string {
	return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorOK  %+v", 200, o.Payload)
}

func (o *GetVendorOK) GetPayload() *blaze_models.VendorResponse {
	return o.Payload
}

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

	o.Payload = new(blaze_models.VendorResponse)

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

	return nil
}

// NewGetVendorUnauthorized creates a GetVendorUnauthorized with default headers values
func NewGetVendorUnauthorized() *GetVendorUnauthorized {
	return &GetVendorUnauthorized{}
}

/*GetVendorUnauthorized handles this case with default header values.

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

func (o *GetVendorUnauthorized) Error() string {
	return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetVendorForbidden creates a GetVendorForbidden with default headers values
func NewGetVendorForbidden() *GetVendorForbidden {
	return &GetVendorForbidden{}
}

/*GetVendorForbidden handles this case with default header values.

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

func (o *GetVendorForbidden) Error() string {
	return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetVendorNotFound creates a GetVendorNotFound with default headers values
func NewGetVendorNotFound() *GetVendorNotFound {
	return &GetVendorNotFound{}
}

/*GetVendorNotFound handles this case with default header values.

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

func (o *GetVendorNotFound) Error() string {
	return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetVendorInternalServerError creates a GetVendorInternalServerError with default headers values
func NewGetVendorInternalServerError() *GetVendorInternalServerError {
	return &GetVendorInternalServerError{}
}

/*GetVendorInternalServerError handles this case with default header values.

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

func (o *GetVendorInternalServerError) Error() string {
	return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorInternalServerError  %+v", 500, o.Payload)
}

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

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