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

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

// PutEntitlementsReader is a Reader for the PutEntitlements structure.
type PutEntitlementsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutEntitlementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutEntitlementsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutEntitlementsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutEntitlementsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutEntitlementsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutEntitlementsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /entitlements] putEntitlements", response, response.Code())
	}
}

// NewPutEntitlementsOK creates a PutEntitlementsOK with default headers values
func NewPutEntitlementsOK() *PutEntitlementsOK {
	return &PutEntitlementsOK{}
}

// PutEntitlementsOK describes a response with status code 200, with default header values.
//
// Updated entitlements
type PutEntitlementsOK struct {
	Payload *members_models.EntitlementResponse
}

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

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

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

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

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

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

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

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

func (o *PutEntitlementsOK) GetPayload() *members_models.EntitlementResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.EntitlementResponse)

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

	return nil
}

// NewPutEntitlementsBadRequest creates a PutEntitlementsBadRequest with default headers values
func NewPutEntitlementsBadRequest() *PutEntitlementsBadRequest {
	return &PutEntitlementsBadRequest{}
}

// PutEntitlementsBadRequest describes a response with status code 400, with default header values.
//
// Invalid or overlapping explicit grant
type PutEntitlementsBadRequest struct {
}

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

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

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

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

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

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

func (o *PutEntitlementsBadRequest) Error() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsBadRequest", 400)
}

func (o *PutEntitlementsBadRequest) String() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsBadRequest", 400)
}

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

	return nil
}

// NewPutEntitlementsUnauthorized creates a PutEntitlementsUnauthorized with default headers values
func NewPutEntitlementsUnauthorized() *PutEntitlementsUnauthorized {
	return &PutEntitlementsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutEntitlementsUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsUnauthorized", 401)
}

func (o *PutEntitlementsUnauthorized) String() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsUnauthorized", 401)
}

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

	return nil
}

// NewPutEntitlementsForbidden creates a PutEntitlementsForbidden with default headers values
func NewPutEntitlementsForbidden() *PutEntitlementsForbidden {
	return &PutEntitlementsForbidden{}
}

// PutEntitlementsForbidden describes a response with status code 403, with default header values.
//
// Actor cannot manage grants for the tenant
type PutEntitlementsForbidden struct {
}

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

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

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

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

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

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

func (o *PutEntitlementsForbidden) Error() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsForbidden", 403)
}

func (o *PutEntitlementsForbidden) String() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsForbidden", 403)
}

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

	return nil
}

// NewPutEntitlementsInternalServerError creates a PutEntitlementsInternalServerError with default headers values
func NewPutEntitlementsInternalServerError() *PutEntitlementsInternalServerError {
	return &PutEntitlementsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutEntitlementsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsInternalServerError", 500)
}

func (o *PutEntitlementsInternalServerError) String() string {
	return fmt.Sprintf("[PUT /entitlements][%d] putEntitlementsInternalServerError", 500)
}

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

	return nil
}
