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

// PostBrandsReader is a Reader for the PostBrands structure.
type PostBrandsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostBrandsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostBrandsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostBrandsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostBrandsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostBrandsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostBrandsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /brands] postBrands", response, response.Code())
	}
}

// NewPostBrandsOK creates a PostBrandsOK with default headers values
func NewPostBrandsOK() *PostBrandsOK {
	return &PostBrandsOK{}
}

// PostBrandsOK describes a response with status code 200, with default header values.
//
// Created brands
type PostBrandsOK struct {
	Payload *members_models.BrandResponse
}

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

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

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

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

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

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

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

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

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

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

// NewPostBrandsBadRequest creates a PostBrandsBadRequest with default headers values
func NewPostBrandsBadRequest() *PostBrandsBadRequest {
	return &PostBrandsBadRequest{}
}

// PostBrandsBadRequest describes a response with status code 400, with default header values.
//
// Invalid lifecycle or catalog data
type PostBrandsBadRequest struct {
}

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

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

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

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

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

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

func (o *PostBrandsBadRequest) Error() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsBadRequest", 400)
}

func (o *PostBrandsBadRequest) String() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsBadRequest", 400)
}

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

	return nil
}

// NewPostBrandsUnauthorized creates a PostBrandsUnauthorized with default headers values
func NewPostBrandsUnauthorized() *PostBrandsUnauthorized {
	return &PostBrandsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostBrandsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsUnauthorized", 401)
}

func (o *PostBrandsUnauthorized) String() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsUnauthorized", 401)
}

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

	return nil
}

// NewPostBrandsForbidden creates a PostBrandsForbidden with default headers values
func NewPostBrandsForbidden() *PostBrandsForbidden {
	return &PostBrandsForbidden{}
}

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

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

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

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

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

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

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

func (o *PostBrandsForbidden) Error() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsForbidden", 403)
}

func (o *PostBrandsForbidden) String() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsForbidden", 403)
}

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

	return nil
}

// NewPostBrandsInternalServerError creates a PostBrandsInternalServerError with default headers values
func NewPostBrandsInternalServerError() *PostBrandsInternalServerError {
	return &PostBrandsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostBrandsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsInternalServerError", 500)
}

func (o *PostBrandsInternalServerError) String() string {
	return fmt.Sprintf("[POST /brands][%d] postBrandsInternalServerError", 500)
}

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

	return nil
}
