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

// PostBrandPlansReader is a Reader for the PostBrandPlans structure.
type PostBrandPlansReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostBrandPlansReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostBrandPlansOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostBrandPlansBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostBrandPlansUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostBrandPlansForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostBrandPlansInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /brandplans] postBrandPlans", response, response.Code())
	}
}

// NewPostBrandPlansOK creates a PostBrandPlansOK with default headers values
func NewPostBrandPlansOK() *PostBrandPlansOK {
	return &PostBrandPlansOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostBrandPlansBadRequest creates a PostBrandPlansBadRequest with default headers values
func NewPostBrandPlansBadRequest() *PostBrandPlansBadRequest {
	return &PostBrandPlansBadRequest{}
}

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

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

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

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

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

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

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

func (o *PostBrandPlansBadRequest) Error() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansBadRequest", 400)
}

func (o *PostBrandPlansBadRequest) String() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansBadRequest", 400)
}

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

	return nil
}

// NewPostBrandPlansUnauthorized creates a PostBrandPlansUnauthorized with default headers values
func NewPostBrandPlansUnauthorized() *PostBrandPlansUnauthorized {
	return &PostBrandPlansUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostBrandPlansUnauthorized) Error() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansUnauthorized", 401)
}

func (o *PostBrandPlansUnauthorized) String() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansUnauthorized", 401)
}

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

	return nil
}

// NewPostBrandPlansForbidden creates a PostBrandPlansForbidden with default headers values
func NewPostBrandPlansForbidden() *PostBrandPlansForbidden {
	return &PostBrandPlansForbidden{}
}

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

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

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

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

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

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

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

func (o *PostBrandPlansForbidden) Error() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansForbidden", 403)
}

func (o *PostBrandPlansForbidden) String() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansForbidden", 403)
}

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

	return nil
}

// NewPostBrandPlansInternalServerError creates a PostBrandPlansInternalServerError with default headers values
func NewPostBrandPlansInternalServerError() *PostBrandPlansInternalServerError {
	return &PostBrandPlansInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostBrandPlansInternalServerError) Error() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansInternalServerError", 500)
}

func (o *PostBrandPlansInternalServerError) String() string {
	return fmt.Sprintf("[POST /brandplans][%d] postBrandPlansInternalServerError", 500)
}

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

	return nil
}
