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

// PostBrandServicesReader is a Reader for the PostBrandServices structure.
type PostBrandServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostBrandServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostBrandServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostBrandServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostBrandServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostBrandServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostBrandServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /brandservices] postBrandServices", response, response.Code())
	}
}

// NewPostBrandServicesOK creates a PostBrandServicesOK with default headers values
func NewPostBrandServicesOK() *PostBrandServicesOK {
	return &PostBrandServicesOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostBrandServicesBadRequest creates a PostBrandServicesBadRequest with default headers values
func NewPostBrandServicesBadRequest() *PostBrandServicesBadRequest {
	return &PostBrandServicesBadRequest{}
}

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

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

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

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

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

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

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

func (o *PostBrandServicesBadRequest) Error() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesBadRequest", 400)
}

func (o *PostBrandServicesBadRequest) String() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesBadRequest", 400)
}

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

	return nil
}

// NewPostBrandServicesUnauthorized creates a PostBrandServicesUnauthorized with default headers values
func NewPostBrandServicesUnauthorized() *PostBrandServicesUnauthorized {
	return &PostBrandServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostBrandServicesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesUnauthorized", 401)
}

func (o *PostBrandServicesUnauthorized) String() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesUnauthorized", 401)
}

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

	return nil
}

// NewPostBrandServicesForbidden creates a PostBrandServicesForbidden with default headers values
func NewPostBrandServicesForbidden() *PostBrandServicesForbidden {
	return &PostBrandServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *PostBrandServicesForbidden) Error() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesForbidden", 403)
}

func (o *PostBrandServicesForbidden) String() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesForbidden", 403)
}

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

	return nil
}

// NewPostBrandServicesInternalServerError creates a PostBrandServicesInternalServerError with default headers values
func NewPostBrandServicesInternalServerError() *PostBrandServicesInternalServerError {
	return &PostBrandServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostBrandServicesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesInternalServerError", 500)
}

func (o *PostBrandServicesInternalServerError) String() string {
	return fmt.Sprintf("[POST /brandservices][%d] postBrandServicesInternalServerError", 500)
}

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

	return nil
}
