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

// PutServiceScopesReader is a Reader for the PutServiceScopes structure.
type PutServiceScopesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutServiceScopesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutServiceScopesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutServiceScopesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutServiceScopesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutServiceScopesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutServiceScopesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /servicescopes] putServiceScopes", response, response.Code())
	}
}

// NewPutServiceScopesOK creates a PutServiceScopesOK with default headers values
func NewPutServiceScopesOK() *PutServiceScopesOK {
	return &PutServiceScopesOK{}
}

// PutServiceScopesOK describes a response with status code 200, with default header values.
//
// Updated service scopes
type PutServiceScopesOK struct {
	Payload *members_models.ServiceScopeResponse
}

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

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

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

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

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

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

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

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

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

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

// NewPutServiceScopesBadRequest creates a PutServiceScopesBadRequest with default headers values
func NewPutServiceScopesBadRequest() *PutServiceScopesBadRequest {
	return &PutServiceScopesBadRequest{}
}

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

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

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

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

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

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

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

func (o *PutServiceScopesBadRequest) Error() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesBadRequest", 400)
}

func (o *PutServiceScopesBadRequest) String() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesBadRequest", 400)
}

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

	return nil
}

// NewPutServiceScopesUnauthorized creates a PutServiceScopesUnauthorized with default headers values
func NewPutServiceScopesUnauthorized() *PutServiceScopesUnauthorized {
	return &PutServiceScopesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutServiceScopesUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesUnauthorized", 401)
}

func (o *PutServiceScopesUnauthorized) String() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesUnauthorized", 401)
}

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

	return nil
}

// NewPutServiceScopesForbidden creates a PutServiceScopesForbidden with default headers values
func NewPutServiceScopesForbidden() *PutServiceScopesForbidden {
	return &PutServiceScopesForbidden{}
}

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

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

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

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

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

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

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

func (o *PutServiceScopesForbidden) Error() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesForbidden", 403)
}

func (o *PutServiceScopesForbidden) String() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesForbidden", 403)
}

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

	return nil
}

// NewPutServiceScopesInternalServerError creates a PutServiceScopesInternalServerError with default headers values
func NewPutServiceScopesInternalServerError() *PutServiceScopesInternalServerError {
	return &PutServiceScopesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutServiceScopesInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesInternalServerError", 500)
}

func (o *PutServiceScopesInternalServerError) String() string {
	return fmt.Sprintf("[PUT /servicescopes][%d] putServiceScopesInternalServerError", 500)
}

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

	return nil
}
