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

// PostSubscriptionsReader is a Reader for the PostSubscriptions structure.
type PostSubscriptionsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostSubscriptionsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostSubscriptionsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostSubscriptionsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostSubscriptionsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostSubscriptionsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /subscriptions] postSubscriptions", response, response.Code())
	}
}

// NewPostSubscriptionsOK creates a PostSubscriptionsOK with default headers values
func NewPostSubscriptionsOK() *PostSubscriptionsOK {
	return &PostSubscriptionsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostSubscriptionsBadRequest creates a PostSubscriptionsBadRequest with default headers values
func NewPostSubscriptionsBadRequest() *PostSubscriptionsBadRequest {
	return &PostSubscriptionsBadRequest{}
}

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

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

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

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

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

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

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

func (o *PostSubscriptionsBadRequest) Error() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsBadRequest", 400)
}

func (o *PostSubscriptionsBadRequest) String() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsBadRequest", 400)
}

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

	return nil
}

// NewPostSubscriptionsUnauthorized creates a PostSubscriptionsUnauthorized with default headers values
func NewPostSubscriptionsUnauthorized() *PostSubscriptionsUnauthorized {
	return &PostSubscriptionsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostSubscriptionsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsUnauthorized", 401)
}

func (o *PostSubscriptionsUnauthorized) String() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsUnauthorized", 401)
}

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

	return nil
}

// NewPostSubscriptionsForbidden creates a PostSubscriptionsForbidden with default headers values
func NewPostSubscriptionsForbidden() *PostSubscriptionsForbidden {
	return &PostSubscriptionsForbidden{}
}

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

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

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

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

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

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

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

func (o *PostSubscriptionsForbidden) Error() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsForbidden", 403)
}

func (o *PostSubscriptionsForbidden) String() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsForbidden", 403)
}

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

	return nil
}

// NewPostSubscriptionsInternalServerError creates a PostSubscriptionsInternalServerError with default headers values
func NewPostSubscriptionsInternalServerError() *PostSubscriptionsInternalServerError {
	return &PostSubscriptionsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostSubscriptionsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsInternalServerError", 500)
}

func (o *PostSubscriptionsInternalServerError) String() string {
	return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsInternalServerError", 500)
}

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

	return nil
}
