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

// GetAuthorizedClientsReader is a Reader for the GetAuthorizedClients structure.
type GetAuthorizedClientsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAuthorizedClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetAuthorizedClientsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetAuthorizedClientsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetAuthorizedClientsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetAuthorizedClientsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetAuthorizedClientsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /authorizedclients] getAuthorizedClients", response, response.Code())
	}
}

// NewGetAuthorizedClientsOK creates a GetAuthorizedClientsOK with default headers values
func NewGetAuthorizedClientsOK() *GetAuthorizedClientsOK {
	return &GetAuthorizedClientsOK{}
}

// GetAuthorizedClientsOK describes a response with status code 200, with default header values.
//
// Authorized-client metadata without tokens or secrets
type GetAuthorizedClientsOK struct {
	Payload *members_models.AuthorizedClientResponse
}

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

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

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

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

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

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

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

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

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

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

// NewGetAuthorizedClientsBadRequest creates a GetAuthorizedClientsBadRequest with default headers values
func NewGetAuthorizedClientsBadRequest() *GetAuthorizedClientsBadRequest {
	return &GetAuthorizedClientsBadRequest{}
}

// GetAuthorizedClientsBadRequest describes a response with status code 400, with default header values.
//
// Invalid authorized-client filter
type GetAuthorizedClientsBadRequest struct {
}

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

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

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

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

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

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

func (o *GetAuthorizedClientsBadRequest) Error() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsBadRequest", 400)
}

func (o *GetAuthorizedClientsBadRequest) String() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsBadRequest", 400)
}

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

	return nil
}

// NewGetAuthorizedClientsUnauthorized creates a GetAuthorizedClientsUnauthorized with default headers values
func NewGetAuthorizedClientsUnauthorized() *GetAuthorizedClientsUnauthorized {
	return &GetAuthorizedClientsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetAuthorizedClientsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsUnauthorized", 401)
}

func (o *GetAuthorizedClientsUnauthorized) String() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsUnauthorized", 401)
}

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

	return nil
}

// NewGetAuthorizedClientsForbidden creates a GetAuthorizedClientsForbidden with default headers values
func NewGetAuthorizedClientsForbidden() *GetAuthorizedClientsForbidden {
	return &GetAuthorizedClientsForbidden{}
}

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

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

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

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

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

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

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

func (o *GetAuthorizedClientsForbidden) Error() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsForbidden", 403)
}

func (o *GetAuthorizedClientsForbidden) String() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsForbidden", 403)
}

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

	return nil
}

// NewGetAuthorizedClientsInternalServerError creates a GetAuthorizedClientsInternalServerError with default headers values
func NewGetAuthorizedClientsInternalServerError() *GetAuthorizedClientsInternalServerError {
	return &GetAuthorizedClientsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetAuthorizedClientsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsInternalServerError", 500)
}

func (o *GetAuthorizedClientsInternalServerError) String() string {
	return fmt.Sprintf("[GET /authorizedclients][%d] getAuthorizedClientsInternalServerError", 500)
}

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

	return nil
}
