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

// PostServiceScopesReader is a Reader for the PostServiceScopes structure.
type PostServiceScopesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostServiceScopesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostServiceScopesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostServiceScopesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostServiceScopesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostServiceScopesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostServiceScopesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /servicescopes] postServiceScopes", response, response.Code())
	}
}

// NewPostServiceScopesOK creates a PostServiceScopesOK with default headers values
func NewPostServiceScopesOK() *PostServiceScopesOK {
	return &PostServiceScopesOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostServiceScopesBadRequest creates a PostServiceScopesBadRequest with default headers values
func NewPostServiceScopesBadRequest() *PostServiceScopesBadRequest {
	return &PostServiceScopesBadRequest{}
}

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

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

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

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

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

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

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

func (o *PostServiceScopesBadRequest) Error() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesBadRequest", 400)
}

func (o *PostServiceScopesBadRequest) String() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesBadRequest", 400)
}

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

	return nil
}

// NewPostServiceScopesUnauthorized creates a PostServiceScopesUnauthorized with default headers values
func NewPostServiceScopesUnauthorized() *PostServiceScopesUnauthorized {
	return &PostServiceScopesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostServiceScopesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesUnauthorized", 401)
}

func (o *PostServiceScopesUnauthorized) String() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesUnauthorized", 401)
}

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

	return nil
}

// NewPostServiceScopesForbidden creates a PostServiceScopesForbidden with default headers values
func NewPostServiceScopesForbidden() *PostServiceScopesForbidden {
	return &PostServiceScopesForbidden{}
}

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

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

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

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

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

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

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

func (o *PostServiceScopesForbidden) Error() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesForbidden", 403)
}

func (o *PostServiceScopesForbidden) String() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesForbidden", 403)
}

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

	return nil
}

// NewPostServiceScopesInternalServerError creates a PostServiceScopesInternalServerError with default headers values
func NewPostServiceScopesInternalServerError() *PostServiceScopesInternalServerError {
	return &PostServiceScopesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostServiceScopesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesInternalServerError", 500)
}

func (o *PostServiceScopesInternalServerError) String() string {
	return fmt.Sprintf("[POST /servicescopes][%d] postServiceScopesInternalServerError", 500)
}

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

	return nil
}
