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

// PostAuthorizedClientsReader is a Reader for the PostAuthorizedClients structure.
type PostAuthorizedClientsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostAuthorizedClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostAuthorizedClientsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostAuthorizedClientsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostAuthorizedClientsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostAuthorizedClientsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostAuthorizedClientsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /authorizedclients] postAuthorizedClients", response, response.Code())
	}
}

// NewPostAuthorizedClientsOK creates a PostAuthorizedClientsOK with default headers values
func NewPostAuthorizedClientsOK() *PostAuthorizedClientsOK {
	return &PostAuthorizedClientsOK{}
}

// PostAuthorizedClientsOK describes a response with status code 200, with default header values.
//
// Created client metadata
type PostAuthorizedClientsOK struct {
	Payload *members_models.AuthorizedClientResponse
}

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

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

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

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

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

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

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

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

func (o *PostAuthorizedClientsOK) GetPayload() *members_models.AuthorizedClientResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.AuthorizedClientResponse)

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

	return nil
}

// NewPostAuthorizedClientsBadRequest creates a PostAuthorizedClientsBadRequest with default headers values
func NewPostAuthorizedClientsBadRequest() *PostAuthorizedClientsBadRequest {
	return &PostAuthorizedClientsBadRequest{}
}

// PostAuthorizedClientsBadRequest describes a response with status code 400, with default header values.
//
// Invalid client metadata or tenant/user scope
type PostAuthorizedClientsBadRequest struct {
}

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

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

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

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

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

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

func (o *PostAuthorizedClientsBadRequest) Error() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsBadRequest", 400)
}

func (o *PostAuthorizedClientsBadRequest) String() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsBadRequest", 400)
}

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

	return nil
}

// NewPostAuthorizedClientsUnauthorized creates a PostAuthorizedClientsUnauthorized with default headers values
func NewPostAuthorizedClientsUnauthorized() *PostAuthorizedClientsUnauthorized {
	return &PostAuthorizedClientsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PostAuthorizedClientsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsUnauthorized", 401)
}

func (o *PostAuthorizedClientsUnauthorized) String() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsUnauthorized", 401)
}

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

	return nil
}

// NewPostAuthorizedClientsForbidden creates a PostAuthorizedClientsForbidden with default headers values
func NewPostAuthorizedClientsForbidden() *PostAuthorizedClientsForbidden {
	return &PostAuthorizedClientsForbidden{}
}

// PostAuthorizedClientsForbidden describes a response with status code 403, with default header values.
//
// Actor cannot manage clients for the tenant
type PostAuthorizedClientsForbidden struct {
}

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

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

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

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

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

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

func (o *PostAuthorizedClientsForbidden) Error() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsForbidden", 403)
}

func (o *PostAuthorizedClientsForbidden) String() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsForbidden", 403)
}

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

	return nil
}

// NewPostAuthorizedClientsInternalServerError creates a PostAuthorizedClientsInternalServerError with default headers values
func NewPostAuthorizedClientsInternalServerError() *PostAuthorizedClientsInternalServerError {
	return &PostAuthorizedClientsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PostAuthorizedClientsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsInternalServerError", 500)
}

func (o *PostAuthorizedClientsInternalServerError) String() string {
	return fmt.Sprintf("[POST /authorizedclients][%d] postAuthorizedClientsInternalServerError", 500)
}

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

	return nil
}
