// 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 events

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

// PutEventCategoriesReader is a Reader for the PutEventCategories structure.
type PutEventCategoriesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutEventCategoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutEventCategoriesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutEventCategoriesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutEventCategoriesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutEventCategoriesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPutEventCategoriesConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutEventCategoriesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutEventCategoriesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /eventcategories] putEventCategories", response, response.Code())
	}
}

// NewPutEventCategoriesOK creates a PutEventCategoriesOK with default headers values
func NewPutEventCategoriesOK() *PutEventCategoriesOK {
	return &PutEventCategoriesOK{}
}

// PutEventCategoriesOK describes a response with status code 200, with default header values.
//
// Event Response Object
type PutEventCategoriesOK struct {
	Payload *members_models.EventCategoryResponse
}

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

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

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

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

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

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

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

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

func (o *PutEventCategoriesOK) GetPayload() *members_models.EventCategoryResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.EventCategoryResponse)

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

	return nil
}

// NewPutEventCategoriesUnauthorized creates a PutEventCategoriesUnauthorized with default headers values
func NewPutEventCategoriesUnauthorized() *PutEventCategoriesUnauthorized {
	return &PutEventCategoriesUnauthorized{}
}

// PutEventCategoriesUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type PutEventCategoriesUnauthorized struct {
	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *PutEventCategoriesUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesUnauthorized %s", 401, payload)
}

func (o *PutEventCategoriesUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesUnauthorized %s", 401, payload)
}

func (o *PutEventCategoriesUnauthorized) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutEventCategoriesForbidden creates a PutEventCategoriesForbidden with default headers values
func NewPutEventCategoriesForbidden() *PutEventCategoriesForbidden {
	return &PutEventCategoriesForbidden{}
}

// PutEventCategoriesForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PutEventCategoriesForbidden struct {
	AccessControlAllowOrigin string

	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *PutEventCategoriesForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesForbidden %s", 403, payload)
}

func (o *PutEventCategoriesForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesForbidden %s", 403, payload)
}

func (o *PutEventCategoriesForbidden) GetPayload() *members_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutEventCategoriesNotFound creates a PutEventCategoriesNotFound with default headers values
func NewPutEventCategoriesNotFound() *PutEventCategoriesNotFound {
	return &PutEventCategoriesNotFound{}
}

// PutEventCategoriesNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type PutEventCategoriesNotFound struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put event categories not found response has a 2xx status code
func (o *PutEventCategoriesNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put event categories not found response has a 3xx status code
func (o *PutEventCategoriesNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put event categories not found response has a 4xx status code
func (o *PutEventCategoriesNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this put event categories not found response has a 5xx status code
func (o *PutEventCategoriesNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this put event categories not found response a status code equal to that given
func (o *PutEventCategoriesNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the put event categories not found response
func (o *PutEventCategoriesNotFound) Code() int {
	return 404
}

func (o *PutEventCategoriesNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesNotFound %s", 404, payload)
}

func (o *PutEventCategoriesNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesNotFound %s", 404, payload)
}

func (o *PutEventCategoriesNotFound) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutEventCategoriesConflict creates a PutEventCategoriesConflict with default headers values
func NewPutEventCategoriesConflict() *PutEventCategoriesConflict {
	return &PutEventCategoriesConflict{}
}

// PutEventCategoriesConflict describes a response with status code 409, with default header values.
//
// The supplied LastModifiedDate is stale; reload the record before retrying.
type PutEventCategoriesConflict struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put event categories conflict response has a 2xx status code
func (o *PutEventCategoriesConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put event categories conflict response has a 3xx status code
func (o *PutEventCategoriesConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put event categories conflict response has a 4xx status code
func (o *PutEventCategoriesConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this put event categories conflict response has a 5xx status code
func (o *PutEventCategoriesConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this put event categories conflict response a status code equal to that given
func (o *PutEventCategoriesConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the put event categories conflict response
func (o *PutEventCategoriesConflict) Code() int {
	return 409
}

func (o *PutEventCategoriesConflict) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesConflict %s", 409, payload)
}

func (o *PutEventCategoriesConflict) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesConflict %s", 409, payload)
}

func (o *PutEventCategoriesConflict) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutEventCategoriesUnprocessableEntity creates a PutEventCategoriesUnprocessableEntity with default headers values
func NewPutEventCategoriesUnprocessableEntity() *PutEventCategoriesUnprocessableEntity {
	return &PutEventCategoriesUnprocessableEntity{}
}

// PutEventCategoriesUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type PutEventCategoriesUnprocessableEntity struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put event categories unprocessable entity response has a 2xx status code
func (o *PutEventCategoriesUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put event categories unprocessable entity response has a 3xx status code
func (o *PutEventCategoriesUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put event categories unprocessable entity response has a 4xx status code
func (o *PutEventCategoriesUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this put event categories unprocessable entity response has a 5xx status code
func (o *PutEventCategoriesUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this put event categories unprocessable entity response a status code equal to that given
func (o *PutEventCategoriesUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the put event categories unprocessable entity response
func (o *PutEventCategoriesUnprocessableEntity) Code() int {
	return 422
}

func (o *PutEventCategoriesUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesUnprocessableEntity %s", 422, payload)
}

func (o *PutEventCategoriesUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesUnprocessableEntity %s", 422, payload)
}

func (o *PutEventCategoriesUnprocessableEntity) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutEventCategoriesInternalServerError creates a PutEventCategoriesInternalServerError with default headers values
func NewPutEventCategoriesInternalServerError() *PutEventCategoriesInternalServerError {
	return &PutEventCategoriesInternalServerError{}
}

// PutEventCategoriesInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type PutEventCategoriesInternalServerError struct {
	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *PutEventCategoriesInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesInternalServerError %s", 500, payload)
}

func (o *PutEventCategoriesInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /eventcategories][%d] putEventCategoriesInternalServerError %s", 500, payload)
}

func (o *PutEventCategoriesInternalServerError) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}
