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

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

// GetServicesReader is a Reader for the GetServices structure.
type GetServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /services] getServices", response, response.Code())
	}
}

// NewGetServicesOK creates a GetServicesOK with default headers values
func NewGetServicesOK() *GetServicesOK {
	return &GetServicesOK{}
}

// GetServicesOK describes a response with status code 200, with default header values.
//
// Service records
type GetServicesOK struct {
	Payload *members_models.ServiceResponse
}

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

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

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

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

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

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

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

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

func (o *GetServicesOK) GetPayload() *members_models.ServiceResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ServiceResponse)

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

	return nil
}

// NewGetServicesBadRequest creates a GetServicesBadRequest with default headers values
func NewGetServicesBadRequest() *GetServicesBadRequest {
	return &GetServicesBadRequest{}
}

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

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

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

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

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

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

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

func (o *GetServicesBadRequest) Error() string {
	return fmt.Sprintf("[GET /services][%d] getServicesBadRequest", 400)
}

func (o *GetServicesBadRequest) String() string {
	return fmt.Sprintf("[GET /services][%d] getServicesBadRequest", 400)
}

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

	return nil
}

// NewGetServicesUnauthorized creates a GetServicesUnauthorized with default headers values
func NewGetServicesUnauthorized() *GetServicesUnauthorized {
	return &GetServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetServicesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /services][%d] getServicesUnauthorized", 401)
}

func (o *GetServicesUnauthorized) String() string {
	return fmt.Sprintf("[GET /services][%d] getServicesUnauthorized", 401)
}

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

	return nil
}

// NewGetServicesForbidden creates a GetServicesForbidden with default headers values
func NewGetServicesForbidden() *GetServicesForbidden {
	return &GetServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *GetServicesForbidden) Error() string {
	return fmt.Sprintf("[GET /services][%d] getServicesForbidden", 403)
}

func (o *GetServicesForbidden) String() string {
	return fmt.Sprintf("[GET /services][%d] getServicesForbidden", 403)
}

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

	return nil
}

// NewGetServicesInternalServerError creates a GetServicesInternalServerError with default headers values
func NewGetServicesInternalServerError() *GetServicesInternalServerError {
	return &GetServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetServicesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /services][%d] getServicesInternalServerError", 500)
}

func (o *GetServicesInternalServerError) String() string {
	return fmt.Sprintf("[GET /services][%d] getServicesInternalServerError", 500)
}

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

	return nil
}
