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

// PutBrandsReader is a Reader for the PutBrands structure.
type PutBrandsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutBrandsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutBrandsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutBrandsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutBrandsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutBrandsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutBrandsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /brands] putBrands", response, response.Code())
	}
}

// NewPutBrandsOK creates a PutBrandsOK with default headers values
func NewPutBrandsOK() *PutBrandsOK {
	return &PutBrandsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutBrandsBadRequest creates a PutBrandsBadRequest with default headers values
func NewPutBrandsBadRequest() *PutBrandsBadRequest {
	return &PutBrandsBadRequest{}
}

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

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

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

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

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

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

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

func (o *PutBrandsBadRequest) Error() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsBadRequest", 400)
}

func (o *PutBrandsBadRequest) String() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsBadRequest", 400)
}

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

	return nil
}

// NewPutBrandsUnauthorized creates a PutBrandsUnauthorized with default headers values
func NewPutBrandsUnauthorized() *PutBrandsUnauthorized {
	return &PutBrandsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutBrandsUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsUnauthorized", 401)
}

func (o *PutBrandsUnauthorized) String() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsUnauthorized", 401)
}

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

	return nil
}

// NewPutBrandsForbidden creates a PutBrandsForbidden with default headers values
func NewPutBrandsForbidden() *PutBrandsForbidden {
	return &PutBrandsForbidden{}
}

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

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

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

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

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

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

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

func (o *PutBrandsForbidden) Error() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsForbidden", 403)
}

func (o *PutBrandsForbidden) String() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsForbidden", 403)
}

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

	return nil
}

// NewPutBrandsInternalServerError creates a PutBrandsInternalServerError with default headers values
func NewPutBrandsInternalServerError() *PutBrandsInternalServerError {
	return &PutBrandsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutBrandsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsInternalServerError", 500)
}

func (o *PutBrandsInternalServerError) String() string {
	return fmt.Sprintf("[PUT /brands][%d] putBrandsInternalServerError", 500)
}

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

	return nil
}
