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

// GetPlanServicesReader is a Reader for the GetPlanServices structure.
type GetPlanServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetPlanServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetPlanServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetPlanServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetPlanServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetPlanServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetPlanServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /planservices] getPlanServices", response, response.Code())
	}
}

// NewGetPlanServicesOK creates a GetPlanServicesOK with default headers values
func NewGetPlanServicesOK() *GetPlanServicesOK {
	return &GetPlanServicesOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetPlanServicesBadRequest creates a GetPlanServicesBadRequest with default headers values
func NewGetPlanServicesBadRequest() *GetPlanServicesBadRequest {
	return &GetPlanServicesBadRequest{}
}

// GetPlanServicesBadRequest describes a response with status code 400, with default header values.
//
// Invalid plan-service filter
type GetPlanServicesBadRequest struct {
}

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

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

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

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

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

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

func (o *GetPlanServicesBadRequest) Error() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesBadRequest", 400)
}

func (o *GetPlanServicesBadRequest) String() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesBadRequest", 400)
}

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

	return nil
}

// NewGetPlanServicesUnauthorized creates a GetPlanServicesUnauthorized with default headers values
func NewGetPlanServicesUnauthorized() *GetPlanServicesUnauthorized {
	return &GetPlanServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetPlanServicesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesUnauthorized", 401)
}

func (o *GetPlanServicesUnauthorized) String() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesUnauthorized", 401)
}

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

	return nil
}

// NewGetPlanServicesForbidden creates a GetPlanServicesForbidden with default headers values
func NewGetPlanServicesForbidden() *GetPlanServicesForbidden {
	return &GetPlanServicesForbidden{}
}

// GetPlanServicesForbidden describes a response with status code 403, with default header values.
//
// Actor is not authorized for the requested scope
type GetPlanServicesForbidden struct {
}

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

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

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

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

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

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

func (o *GetPlanServicesForbidden) Error() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesForbidden", 403)
}

func (o *GetPlanServicesForbidden) String() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesForbidden", 403)
}

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

	return nil
}

// NewGetPlanServicesInternalServerError creates a GetPlanServicesInternalServerError with default headers values
func NewGetPlanServicesInternalServerError() *GetPlanServicesInternalServerError {
	return &GetPlanServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetPlanServicesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesInternalServerError", 500)
}

func (o *GetPlanServicesInternalServerError) String() string {
	return fmt.Sprintf("[GET /planservices][%d] getPlanServicesInternalServerError", 500)
}

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

	return nil
}
