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

// GetBrandServicesReader is a Reader for the GetBrandServices structure.
type GetBrandServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetBrandServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetBrandServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetBrandServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetBrandServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetBrandServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetBrandServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /brandservices] getBrandServices", response, response.Code())
	}
}

// NewGetBrandServicesOK creates a GetBrandServicesOK with default headers values
func NewGetBrandServicesOK() *GetBrandServicesOK {
	return &GetBrandServicesOK{}
}

// GetBrandServicesOK describes a response with status code 200, with default header values.
//
// Brand-service records
type GetBrandServicesOK struct {
	Payload *members_models.BrandServiceResponse
}

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

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

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

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

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

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

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

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

func (o *GetBrandServicesOK) GetPayload() *members_models.BrandServiceResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.BrandServiceResponse)

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

	return nil
}

// NewGetBrandServicesBadRequest creates a GetBrandServicesBadRequest with default headers values
func NewGetBrandServicesBadRequest() *GetBrandServicesBadRequest {
	return &GetBrandServicesBadRequest{}
}

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

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

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

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

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

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

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

func (o *GetBrandServicesBadRequest) Error() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesBadRequest", 400)
}

func (o *GetBrandServicesBadRequest) String() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesBadRequest", 400)
}

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

	return nil
}

// NewGetBrandServicesUnauthorized creates a GetBrandServicesUnauthorized with default headers values
func NewGetBrandServicesUnauthorized() *GetBrandServicesUnauthorized {
	return &GetBrandServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetBrandServicesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesUnauthorized", 401)
}

func (o *GetBrandServicesUnauthorized) String() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesUnauthorized", 401)
}

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

	return nil
}

// NewGetBrandServicesForbidden creates a GetBrandServicesForbidden with default headers values
func NewGetBrandServicesForbidden() *GetBrandServicesForbidden {
	return &GetBrandServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *GetBrandServicesForbidden) Error() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesForbidden", 403)
}

func (o *GetBrandServicesForbidden) String() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesForbidden", 403)
}

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

	return nil
}

// NewGetBrandServicesInternalServerError creates a GetBrandServicesInternalServerError with default headers values
func NewGetBrandServicesInternalServerError() *GetBrandServicesInternalServerError {
	return &GetBrandServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetBrandServicesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesInternalServerError", 500)
}

func (o *GetBrandServicesInternalServerError) String() string {
	return fmt.Sprintf("[GET /brandservices][%d] getBrandServicesInternalServerError", 500)
}

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

	return nil
}
