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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package portal_catalog

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// GetBrandsReader is a Reader for the GetBrands structure.
type GetBrandsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetBrandsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetBrandsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetBrandsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetBrandsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetBrandsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetBrandsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /brands] getBrands", response, response.Code())
	}
}

// NewGetBrandsOK creates a GetBrandsOK with default headers values
func NewGetBrandsOK() *GetBrandsOK {
	return &GetBrandsOK{}
}

// GetBrandsOK describes a response with status code 200, with default header values.
//
// Brand records
type GetBrandsOK struct {
	Payload *members_models.BrandResponse
}

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

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

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

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

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

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

func (o *GetBrandsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /brands][%d] getBrandsOK %s", 200, payload)
}

func (o *GetBrandsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /brands][%d] getBrandsOK %s", 200, payload)
}

func (o *GetBrandsOK) GetPayload() *members_models.BrandResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.BrandResponse)

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

	return nil
}

// NewGetBrandsBadRequest creates a GetBrandsBadRequest with default headers values
func NewGetBrandsBadRequest() *GetBrandsBadRequest {
	return &GetBrandsBadRequest{}
}

// GetBrandsBadRequest describes a response with status code 400, with default header values.
//
// Invalid brand filter
type GetBrandsBadRequest struct {
}

// IsSuccess returns true when this get brands bad request response has a 2xx status code
func (o *GetBrandsBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get brands bad request response has a 3xx status code
func (o *GetBrandsBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get brands bad request response has a 4xx status code
func (o *GetBrandsBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get brands bad request response has a 5xx status code
func (o *GetBrandsBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this get brands bad request response a status code equal to that given
func (o *GetBrandsBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the get brands bad request response
func (o *GetBrandsBadRequest) Code() int {
	return 400
}

func (o *GetBrandsBadRequest) Error() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsBadRequest", 400)
}

func (o *GetBrandsBadRequest) String() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsBadRequest", 400)
}

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

	return nil
}

// NewGetBrandsUnauthorized creates a GetBrandsUnauthorized with default headers values
func NewGetBrandsUnauthorized() *GetBrandsUnauthorized {
	return &GetBrandsUnauthorized{}
}

// GetBrandsUnauthorized describes a response with status code 401, with default header values.
//
// Missing or invalid server or session credential
type GetBrandsUnauthorized struct {
}

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

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

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

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

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

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

func (o *GetBrandsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsUnauthorized", 401)
}

func (o *GetBrandsUnauthorized) String() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsUnauthorized", 401)
}

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

	return nil
}

// NewGetBrandsForbidden creates a GetBrandsForbidden with default headers values
func NewGetBrandsForbidden() *GetBrandsForbidden {
	return &GetBrandsForbidden{}
}

// GetBrandsForbidden describes a response with status code 403, with default header values.
//
// Actor is not authorized for the requested scope
type GetBrandsForbidden struct {
}

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

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

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

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

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

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

func (o *GetBrandsForbidden) Error() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsForbidden", 403)
}

func (o *GetBrandsForbidden) String() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsForbidden", 403)
}

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

	return nil
}

// NewGetBrandsInternalServerError creates a GetBrandsInternalServerError with default headers values
func NewGetBrandsInternalServerError() *GetBrandsInternalServerError {
	return &GetBrandsInternalServerError{}
}

// GetBrandsInternalServerError describes a response with status code 500, with default header values.
//
// Server error
type GetBrandsInternalServerError struct {
}

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

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

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

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

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

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

func (o *GetBrandsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsInternalServerError", 500)
}

func (o *GetBrandsInternalServerError) String() string {
	return fmt.Sprintf("[GET /brands][%d] getBrandsInternalServerError", 500)
}

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

	return nil
}
