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

// PutBrandPlansReader is a Reader for the PutBrandPlans structure.
type PutBrandPlansReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutBrandPlansReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutBrandPlansOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutBrandPlansBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutBrandPlansUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutBrandPlansForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutBrandPlansInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /brandplans] putBrandPlans", response, response.Code())
	}
}

// NewPutBrandPlansOK creates a PutBrandPlansOK with default headers values
func NewPutBrandPlansOK() *PutBrandPlansOK {
	return &PutBrandPlansOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutBrandPlansBadRequest creates a PutBrandPlansBadRequest with default headers values
func NewPutBrandPlansBadRequest() *PutBrandPlansBadRequest {
	return &PutBrandPlansBadRequest{}
}

// PutBrandPlansBadRequest describes a response with status code 400, with default header values.
//
// Invalid plan placement
type PutBrandPlansBadRequest struct {
}

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

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

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

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

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

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

func (o *PutBrandPlansBadRequest) Error() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansBadRequest", 400)
}

func (o *PutBrandPlansBadRequest) String() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansBadRequest", 400)
}

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

	return nil
}

// NewPutBrandPlansUnauthorized creates a PutBrandPlansUnauthorized with default headers values
func NewPutBrandPlansUnauthorized() *PutBrandPlansUnauthorized {
	return &PutBrandPlansUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutBrandPlansUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansUnauthorized", 401)
}

func (o *PutBrandPlansUnauthorized) String() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansUnauthorized", 401)
}

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

	return nil
}

// NewPutBrandPlansForbidden creates a PutBrandPlansForbidden with default headers values
func NewPutBrandPlansForbidden() *PutBrandPlansForbidden {
	return &PutBrandPlansForbidden{}
}

// PutBrandPlansForbidden describes a response with status code 403, with default header values.
//
// Actor lacks plan-management authority
type PutBrandPlansForbidden struct {
}

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

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

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

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

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

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

func (o *PutBrandPlansForbidden) Error() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansForbidden", 403)
}

func (o *PutBrandPlansForbidden) String() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansForbidden", 403)
}

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

	return nil
}

// NewPutBrandPlansInternalServerError creates a PutBrandPlansInternalServerError with default headers values
func NewPutBrandPlansInternalServerError() *PutBrandPlansInternalServerError {
	return &PutBrandPlansInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutBrandPlansInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansInternalServerError", 500)
}

func (o *PutBrandPlansInternalServerError) String() string {
	return fmt.Sprintf("[PUT /brandplans][%d] putBrandPlansInternalServerError", 500)
}

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

	return nil
}
