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

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

// GetBrandPlansReader is a Reader for the GetBrandPlans structure.
type GetBrandPlansReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetBrandPlansReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetBrandPlansOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetBrandPlansBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetBrandPlansUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetBrandPlansForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetBrandPlansInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /brandplans] getBrandPlans", response, response.Code())
	}
}

// NewGetBrandPlansOK creates a GetBrandPlansOK with default headers values
func NewGetBrandPlansOK() *GetBrandPlansOK {
	return &GetBrandPlansOK{}
}

// GetBrandPlansOK describes a response with status code 200, with default header values.
//
// Brand-plan records
type GetBrandPlansOK struct {
	Payload *members_models.BrandPlanResponse
}

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

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

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

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

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

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

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

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

func (o *GetBrandPlansOK) GetPayload() *members_models.BrandPlanResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.BrandPlanResponse)

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

	return nil
}

// NewGetBrandPlansBadRequest creates a GetBrandPlansBadRequest with default headers values
func NewGetBrandPlansBadRequest() *GetBrandPlansBadRequest {
	return &GetBrandPlansBadRequest{}
}

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

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

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

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

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

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

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

func (o *GetBrandPlansBadRequest) Error() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansBadRequest", 400)
}

func (o *GetBrandPlansBadRequest) String() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansBadRequest", 400)
}

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

	return nil
}

// NewGetBrandPlansUnauthorized creates a GetBrandPlansUnauthorized with default headers values
func NewGetBrandPlansUnauthorized() *GetBrandPlansUnauthorized {
	return &GetBrandPlansUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetBrandPlansUnauthorized) Error() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansUnauthorized", 401)
}

func (o *GetBrandPlansUnauthorized) String() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansUnauthorized", 401)
}

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

	return nil
}

// NewGetBrandPlansForbidden creates a GetBrandPlansForbidden with default headers values
func NewGetBrandPlansForbidden() *GetBrandPlansForbidden {
	return &GetBrandPlansForbidden{}
}

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

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

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

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

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

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

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

func (o *GetBrandPlansForbidden) Error() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansForbidden", 403)
}

func (o *GetBrandPlansForbidden) String() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansForbidden", 403)
}

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

	return nil
}

// NewGetBrandPlansInternalServerError creates a GetBrandPlansInternalServerError with default headers values
func NewGetBrandPlansInternalServerError() *GetBrandPlansInternalServerError {
	return &GetBrandPlansInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetBrandPlansInternalServerError) Error() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansInternalServerError", 500)
}

func (o *GetBrandPlansInternalServerError) String() string {
	return fmt.Sprintf("[GET /brandplans][%d] getBrandPlansInternalServerError", 500)
}

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

	return nil
}
