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

// PutBrandServicesReader is a Reader for the PutBrandServices structure.
type PutBrandServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutBrandServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutBrandServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutBrandServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutBrandServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutBrandServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutBrandServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /brandservices] putBrandServices", response, response.Code())
	}
}

// NewPutBrandServicesOK creates a PutBrandServicesOK with default headers values
func NewPutBrandServicesOK() *PutBrandServicesOK {
	return &PutBrandServicesOK{}
}

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

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

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

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

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

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

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

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

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

func (o *PutBrandServicesOK) GetPayload() *members_models.BrandServiceResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.BrandServiceResponse)

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

	return nil
}

// NewPutBrandServicesBadRequest creates a PutBrandServicesBadRequest with default headers values
func NewPutBrandServicesBadRequest() *PutBrandServicesBadRequest {
	return &PutBrandServicesBadRequest{}
}

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

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

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

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

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

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

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

func (o *PutBrandServicesBadRequest) Error() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesBadRequest", 400)
}

func (o *PutBrandServicesBadRequest) String() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesBadRequest", 400)
}

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

	return nil
}

// NewPutBrandServicesUnauthorized creates a PutBrandServicesUnauthorized with default headers values
func NewPutBrandServicesUnauthorized() *PutBrandServicesUnauthorized {
	return &PutBrandServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutBrandServicesUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesUnauthorized", 401)
}

func (o *PutBrandServicesUnauthorized) String() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesUnauthorized", 401)
}

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

	return nil
}

// NewPutBrandServicesForbidden creates a PutBrandServicesForbidden with default headers values
func NewPutBrandServicesForbidden() *PutBrandServicesForbidden {
	return &PutBrandServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *PutBrandServicesForbidden) Error() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesForbidden", 403)
}

func (o *PutBrandServicesForbidden) String() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesForbidden", 403)
}

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

	return nil
}

// NewPutBrandServicesInternalServerError creates a PutBrandServicesInternalServerError with default headers values
func NewPutBrandServicesInternalServerError() *PutBrandServicesInternalServerError {
	return &PutBrandServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutBrandServicesInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesInternalServerError", 500)
}

func (o *PutBrandServicesInternalServerError) String() string {
	return fmt.Sprintf("[PUT /brandservices][%d] putBrandServicesInternalServerError", 500)
}

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

	return nil
}
