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

// GetServiceScopesReader is a Reader for the GetServiceScopes structure.
type GetServiceScopesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetServiceScopesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetServiceScopesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetServiceScopesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetServiceScopesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetServiceScopesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetServiceScopesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /servicescopes] getServiceScopes", response, response.Code())
	}
}

// NewGetServiceScopesOK creates a GetServiceScopesOK with default headers values
func NewGetServiceScopesOK() *GetServiceScopesOK {
	return &GetServiceScopesOK{}
}

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

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

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

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

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

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

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

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

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

func (o *GetServiceScopesOK) GetPayload() *members_models.ServiceScopeResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ServiceScopeResponse)

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

	return nil
}

// NewGetServiceScopesBadRequest creates a GetServiceScopesBadRequest with default headers values
func NewGetServiceScopesBadRequest() *GetServiceScopesBadRequest {
	return &GetServiceScopesBadRequest{}
}

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

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

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

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

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

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

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

func (o *GetServiceScopesBadRequest) Error() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesBadRequest", 400)
}

func (o *GetServiceScopesBadRequest) String() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesBadRequest", 400)
}

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

	return nil
}

// NewGetServiceScopesUnauthorized creates a GetServiceScopesUnauthorized with default headers values
func NewGetServiceScopesUnauthorized() *GetServiceScopesUnauthorized {
	return &GetServiceScopesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetServiceScopesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesUnauthorized", 401)
}

func (o *GetServiceScopesUnauthorized) String() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesUnauthorized", 401)
}

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

	return nil
}

// NewGetServiceScopesForbidden creates a GetServiceScopesForbidden with default headers values
func NewGetServiceScopesForbidden() *GetServiceScopesForbidden {
	return &GetServiceScopesForbidden{}
}

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

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

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

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

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

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

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

func (o *GetServiceScopesForbidden) Error() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesForbidden", 403)
}

func (o *GetServiceScopesForbidden) String() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesForbidden", 403)
}

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

	return nil
}

// NewGetServiceScopesInternalServerError creates a GetServiceScopesInternalServerError with default headers values
func NewGetServiceScopesInternalServerError() *GetServiceScopesInternalServerError {
	return &GetServiceScopesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetServiceScopesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesInternalServerError", 500)
}

func (o *GetServiceScopesInternalServerError) String() string {
	return fmt.Sprintf("[GET /servicescopes][%d] getServiceScopesInternalServerError", 500)
}

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

	return nil
}
