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

// PutSubscriptionsReader is a Reader for the PutSubscriptions structure.
type PutSubscriptionsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutSubscriptionsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutSubscriptionsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutSubscriptionsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutSubscriptionsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutSubscriptionsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /subscriptions] putSubscriptions", response, response.Code())
	}
}

// NewPutSubscriptionsOK creates a PutSubscriptionsOK with default headers values
func NewPutSubscriptionsOK() *PutSubscriptionsOK {
	return &PutSubscriptionsOK{}
}

// PutSubscriptionsOK describes a response with status code 200, with default header values.
//
// Updated subscriptions
type PutSubscriptionsOK struct {
	Payload *members_models.SubscriptionResponse
}

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

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

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

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

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

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

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

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

func (o *PutSubscriptionsOK) GetPayload() *members_models.SubscriptionResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.SubscriptionResponse)

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

	return nil
}

// NewPutSubscriptionsBadRequest creates a PutSubscriptionsBadRequest with default headers values
func NewPutSubscriptionsBadRequest() *PutSubscriptionsBadRequest {
	return &PutSubscriptionsBadRequest{}
}

// PutSubscriptionsBadRequest describes a response with status code 400, with default header values.
//
// Invalid subscription lifecycle transition
type PutSubscriptionsBadRequest struct {
}

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

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

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

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

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

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

func (o *PutSubscriptionsBadRequest) Error() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsBadRequest", 400)
}

func (o *PutSubscriptionsBadRequest) String() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsBadRequest", 400)
}

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

	return nil
}

// NewPutSubscriptionsUnauthorized creates a PutSubscriptionsUnauthorized with default headers values
func NewPutSubscriptionsUnauthorized() *PutSubscriptionsUnauthorized {
	return &PutSubscriptionsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutSubscriptionsUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsUnauthorized", 401)
}

func (o *PutSubscriptionsUnauthorized) String() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsUnauthorized", 401)
}

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

	return nil
}

// NewPutSubscriptionsForbidden creates a PutSubscriptionsForbidden with default headers values
func NewPutSubscriptionsForbidden() *PutSubscriptionsForbidden {
	return &PutSubscriptionsForbidden{}
}

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

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

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

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

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

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

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

func (o *PutSubscriptionsForbidden) Error() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsForbidden", 403)
}

func (o *PutSubscriptionsForbidden) String() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsForbidden", 403)
}

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

	return nil
}

// NewPutSubscriptionsInternalServerError creates a PutSubscriptionsInternalServerError with default headers values
func NewPutSubscriptionsInternalServerError() *PutSubscriptionsInternalServerError {
	return &PutSubscriptionsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutSubscriptionsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsInternalServerError", 500)
}

func (o *PutSubscriptionsInternalServerError) String() string {
	return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsInternalServerError", 500)
}

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

	return nil
}
