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

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

// PostAuthorizedClientScopesReader is a Reader for the PostAuthorizedClientScopes structure.
type PostAuthorizedClientScopesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostAuthorizedClientScopesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostAuthorizedClientScopesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostAuthorizedClientScopesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostAuthorizedClientScopesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostAuthorizedClientScopesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostAuthorizedClientScopesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /authorizedclientscopes] postAuthorizedClientScopes", response, response.Code())
	}
}

// NewPostAuthorizedClientScopesOK creates a PostAuthorizedClientScopesOK with default headers values
func NewPostAuthorizedClientScopesOK() *PostAuthorizedClientScopesOK {
	return &PostAuthorizedClientScopesOK{}
}

// PostAuthorizedClientScopesOK describes a response with status code 200, with default header values.
//
// Created authorized-client scopes
type PostAuthorizedClientScopesOK struct {
	Payload *members_models.AuthorizedClientScopeResponse
}

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

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

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

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

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

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

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

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

func (o *PostAuthorizedClientScopesOK) GetPayload() *members_models.AuthorizedClientScopeResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.AuthorizedClientScopeResponse)

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

	return nil
}

// NewPostAuthorizedClientScopesBadRequest creates a PostAuthorizedClientScopesBadRequest with default headers values
func NewPostAuthorizedClientScopesBadRequest() *PostAuthorizedClientScopesBadRequest {
	return &PostAuthorizedClientScopesBadRequest{}
}

// PostAuthorizedClientScopesBadRequest describes a response with status code 400, with default header values.
//
// Scope is not backed by an effective service entitlement
type PostAuthorizedClientScopesBadRequest struct {
}

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

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

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

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

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

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

func (o *PostAuthorizedClientScopesBadRequest) Error() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesBadRequest", 400)
}

func (o *PostAuthorizedClientScopesBadRequest) String() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesBadRequest", 400)
}

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

	return nil
}

// NewPostAuthorizedClientScopesUnauthorized creates a PostAuthorizedClientScopesUnauthorized with default headers values
func NewPostAuthorizedClientScopesUnauthorized() *PostAuthorizedClientScopesUnauthorized {
	return &PostAuthorizedClientScopesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostAuthorizedClientScopesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesUnauthorized", 401)
}

func (o *PostAuthorizedClientScopesUnauthorized) String() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesUnauthorized", 401)
}

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

	return nil
}

// NewPostAuthorizedClientScopesForbidden creates a PostAuthorizedClientScopesForbidden with default headers values
func NewPostAuthorizedClientScopesForbidden() *PostAuthorizedClientScopesForbidden {
	return &PostAuthorizedClientScopesForbidden{}
}

// PostAuthorizedClientScopesForbidden describes a response with status code 403, with default header values.
//
// Actor cannot manage scopes for the client
type PostAuthorizedClientScopesForbidden struct {
}

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

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

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

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

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

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

func (o *PostAuthorizedClientScopesForbidden) Error() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesForbidden", 403)
}

func (o *PostAuthorizedClientScopesForbidden) String() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesForbidden", 403)
}

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

	return nil
}

// NewPostAuthorizedClientScopesInternalServerError creates a PostAuthorizedClientScopesInternalServerError with default headers values
func NewPostAuthorizedClientScopesInternalServerError() *PostAuthorizedClientScopesInternalServerError {
	return &PostAuthorizedClientScopesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostAuthorizedClientScopesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesInternalServerError", 500)
}

func (o *PostAuthorizedClientScopesInternalServerError) String() string {
	return fmt.Sprintf("[POST /authorizedclientscopes][%d] postAuthorizedClientScopesInternalServerError", 500)
}

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

	return nil
}
