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

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

// PutPlanServicesReader is a Reader for the PutPlanServices structure.
type PutPlanServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutPlanServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutPlanServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutPlanServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutPlanServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutPlanServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutPlanServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /planservices] putPlanServices", response, response.Code())
	}
}

// NewPutPlanServicesOK creates a PutPlanServicesOK with default headers values
func NewPutPlanServicesOK() *PutPlanServicesOK {
	return &PutPlanServicesOK{}
}

// PutPlanServicesOK describes a response with status code 200, with default header values.
//
// Updated plan-service records
type PutPlanServicesOK struct {
	Payload *members_models.PlanServiceResponse
}

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

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

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

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

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

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

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

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

func (o *PutPlanServicesOK) GetPayload() *members_models.PlanServiceResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.PlanServiceResponse)

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

	return nil
}

// NewPutPlanServicesBadRequest creates a PutPlanServicesBadRequest with default headers values
func NewPutPlanServicesBadRequest() *PutPlanServicesBadRequest {
	return &PutPlanServicesBadRequest{}
}

// PutPlanServicesBadRequest describes a response with status code 400, with default header values.
//
// Invalid typed limit or immutable plan grant
type PutPlanServicesBadRequest struct {
}

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

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

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

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

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

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

func (o *PutPlanServicesBadRequest) Error() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesBadRequest", 400)
}

func (o *PutPlanServicesBadRequest) String() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesBadRequest", 400)
}

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

	return nil
}

// NewPutPlanServicesUnauthorized creates a PutPlanServicesUnauthorized with default headers values
func NewPutPlanServicesUnauthorized() *PutPlanServicesUnauthorized {
	return &PutPlanServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutPlanServicesUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesUnauthorized", 401)
}

func (o *PutPlanServicesUnauthorized) String() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesUnauthorized", 401)
}

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

	return nil
}

// NewPutPlanServicesForbidden creates a PutPlanServicesForbidden with default headers values
func NewPutPlanServicesForbidden() *PutPlanServicesForbidden {
	return &PutPlanServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *PutPlanServicesForbidden) Error() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesForbidden", 403)
}

func (o *PutPlanServicesForbidden) String() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesForbidden", 403)
}

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

	return nil
}

// NewPutPlanServicesInternalServerError creates a PutPlanServicesInternalServerError with default headers values
func NewPutPlanServicesInternalServerError() *PutPlanServicesInternalServerError {
	return &PutPlanServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutPlanServicesInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesInternalServerError", 500)
}

func (o *PutPlanServicesInternalServerError) String() string {
	return fmt.Sprintf("[PUT /planservices][%d] putPlanServicesInternalServerError", 500)
}

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

	return nil
}
