// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package company_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"

	"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)

// GetCompanyProductsReader is a Reader for the GetCompanyProducts structure.
type GetCompanyProductsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCompanyProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCompanyProductsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCompanyProductsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCompanyProductsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCompanyProductsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCompanyProductsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCompanyProductsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewGetCompanyProductsOK creates a GetCompanyProductsOK with default headers values
func NewGetCompanyProductsOK() *GetCompanyProductsOK {
	return &GetCompanyProductsOK{}
}

/*
GetCompanyProductsOK describes a response with status code 200, with default header values.

Response with an array of CompanyProduct objects
*/
type GetCompanyProductsOK struct {
	Payload *sfgate_models.CompanyProductResponse
}

// IsSuccess returns true when this get company products o k response has a 2xx status code
func (o *GetCompanyProductsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get company products o k response has a 3xx status code
func (o *GetCompanyProductsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products o k response has a 4xx status code
func (o *GetCompanyProductsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get company products o k response has a 5xx status code
func (o *GetCompanyProductsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get company products o k response a status code equal to that given
func (o *GetCompanyProductsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get company products o k response
func (o *GetCompanyProductsOK) Code() int {
	return 200
}

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

func (o *GetCompanyProductsOK) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsOK  %+v", 200, o.Payload)
}

func (o *GetCompanyProductsOK) GetPayload() *sfgate_models.CompanyProductResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.CompanyProductResponse)

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

	return nil
}

// NewGetCompanyProductsUnauthorized creates a GetCompanyProductsUnauthorized with default headers values
func NewGetCompanyProductsUnauthorized() *GetCompanyProductsUnauthorized {
	return &GetCompanyProductsUnauthorized{}
}

/*
GetCompanyProductsUnauthorized describes a response with status code 401, with default header values.

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

// IsSuccess returns true when this get company products unauthorized response has a 2xx status code
func (o *GetCompanyProductsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company products unauthorized response has a 3xx status code
func (o *GetCompanyProductsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products unauthorized response has a 4xx status code
func (o *GetCompanyProductsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company products unauthorized response has a 5xx status code
func (o *GetCompanyProductsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get company products unauthorized response a status code equal to that given
func (o *GetCompanyProductsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get company products unauthorized response
func (o *GetCompanyProductsUnauthorized) Code() int {
	return 401
}

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

func (o *GetCompanyProductsUnauthorized) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCompanyProductsUnauthorized) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewGetCompanyProductsForbidden creates a GetCompanyProductsForbidden with default headers values
func NewGetCompanyProductsForbidden() *GetCompanyProductsForbidden {
	return &GetCompanyProductsForbidden{}
}

/*
GetCompanyProductsForbidden describes a response with status code 403, with default header values.

Access forbidden, account lacks access
*/
type GetCompanyProductsForbidden struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company products forbidden response has a 2xx status code
func (o *GetCompanyProductsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company products forbidden response has a 3xx status code
func (o *GetCompanyProductsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products forbidden response has a 4xx status code
func (o *GetCompanyProductsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company products forbidden response has a 5xx status code
func (o *GetCompanyProductsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get company products forbidden response a status code equal to that given
func (o *GetCompanyProductsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get company products forbidden response
func (o *GetCompanyProductsForbidden) Code() int {
	return 403
}

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

func (o *GetCompanyProductsForbidden) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsForbidden  %+v", 403, o.Payload)
}

func (o *GetCompanyProductsForbidden) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewGetCompanyProductsNotFound creates a GetCompanyProductsNotFound with default headers values
func NewGetCompanyProductsNotFound() *GetCompanyProductsNotFound {
	return &GetCompanyProductsNotFound{}
}

/*
GetCompanyProductsNotFound describes a response with status code 404, with default header values.

Resource was not found
*/
type GetCompanyProductsNotFound struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company products not found response has a 2xx status code
func (o *GetCompanyProductsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company products not found response has a 3xx status code
func (o *GetCompanyProductsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products not found response has a 4xx status code
func (o *GetCompanyProductsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company products not found response has a 5xx status code
func (o *GetCompanyProductsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get company products not found response a status code equal to that given
func (o *GetCompanyProductsNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get company products not found response
func (o *GetCompanyProductsNotFound) Code() int {
	return 404
}

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

func (o *GetCompanyProductsNotFound) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsNotFound  %+v", 404, o.Payload)
}

func (o *GetCompanyProductsNotFound) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewGetCompanyProductsUnprocessableEntity creates a GetCompanyProductsUnprocessableEntity with default headers values
func NewGetCompanyProductsUnprocessableEntity() *GetCompanyProductsUnprocessableEntity {
	return &GetCompanyProductsUnprocessableEntity{}
}

/*
GetCompanyProductsUnprocessableEntity describes a response with status code 422, with default header values.

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

// IsSuccess returns true when this get company products unprocessable entity response has a 2xx status code
func (o *GetCompanyProductsUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company products unprocessable entity response has a 3xx status code
func (o *GetCompanyProductsUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products unprocessable entity response has a 4xx status code
func (o *GetCompanyProductsUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company products unprocessable entity response has a 5xx status code
func (o *GetCompanyProductsUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this get company products unprocessable entity response a status code equal to that given
func (o *GetCompanyProductsUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the get company products unprocessable entity response
func (o *GetCompanyProductsUnprocessableEntity) Code() int {
	return 422
}

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

func (o *GetCompanyProductsUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCompanyProductsUnprocessableEntity) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewGetCompanyProductsInternalServerError creates a GetCompanyProductsInternalServerError with default headers values
func NewGetCompanyProductsInternalServerError() *GetCompanyProductsInternalServerError {
	return &GetCompanyProductsInternalServerError{}
}

/*
GetCompanyProductsInternalServerError describes a response with status code 500, with default header values.

Server Internal Error
*/
type GetCompanyProductsInternalServerError struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company products internal server error response has a 2xx status code
func (o *GetCompanyProductsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company products internal server error response has a 3xx status code
func (o *GetCompanyProductsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company products internal server error response has a 4xx status code
func (o *GetCompanyProductsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get company products internal server error response has a 5xx status code
func (o *GetCompanyProductsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get company products internal server error response a status code equal to that given
func (o *GetCompanyProductsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get company products internal server error response
func (o *GetCompanyProductsInternalServerError) Code() int {
	return 500
}

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

func (o *GetCompanyProductsInternalServerError) String() string {
	return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCompanyProductsInternalServerError) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}
