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

// PutAuthorizedClientsReader is a Reader for the PutAuthorizedClients structure.
type PutAuthorizedClientsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutAuthorizedClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutAuthorizedClientsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutAuthorizedClientsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutAuthorizedClientsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutAuthorizedClientsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutAuthorizedClientsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /authorizedclients] putAuthorizedClients", response, response.Code())
	}
}

// NewPutAuthorizedClientsOK creates a PutAuthorizedClientsOK with default headers values
func NewPutAuthorizedClientsOK() *PutAuthorizedClientsOK {
	return &PutAuthorizedClientsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutAuthorizedClientsBadRequest creates a PutAuthorizedClientsBadRequest with default headers values
func NewPutAuthorizedClientsBadRequest() *PutAuthorizedClientsBadRequest {
	return &PutAuthorizedClientsBadRequest{}
}

// PutAuthorizedClientsBadRequest describes a response with status code 400, with default header values.
//
// Invalid client lifecycle transition
type PutAuthorizedClientsBadRequest struct {
}

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

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

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

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

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

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

func (o *PutAuthorizedClientsBadRequest) Error() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsBadRequest", 400)
}

func (o *PutAuthorizedClientsBadRequest) String() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsBadRequest", 400)
}

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

	return nil
}

// NewPutAuthorizedClientsUnauthorized creates a PutAuthorizedClientsUnauthorized with default headers values
func NewPutAuthorizedClientsUnauthorized() *PutAuthorizedClientsUnauthorized {
	return &PutAuthorizedClientsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutAuthorizedClientsUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsUnauthorized", 401)
}

func (o *PutAuthorizedClientsUnauthorized) String() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsUnauthorized", 401)
}

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

	return nil
}

// NewPutAuthorizedClientsForbidden creates a PutAuthorizedClientsForbidden with default headers values
func NewPutAuthorizedClientsForbidden() *PutAuthorizedClientsForbidden {
	return &PutAuthorizedClientsForbidden{}
}

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

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

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

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

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

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

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

func (o *PutAuthorizedClientsForbidden) Error() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsForbidden", 403)
}

func (o *PutAuthorizedClientsForbidden) String() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsForbidden", 403)
}

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

	return nil
}

// NewPutAuthorizedClientsInternalServerError creates a PutAuthorizedClientsInternalServerError with default headers values
func NewPutAuthorizedClientsInternalServerError() *PutAuthorizedClientsInternalServerError {
	return &PutAuthorizedClientsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutAuthorizedClientsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsInternalServerError", 500)
}

func (o *PutAuthorizedClientsInternalServerError) String() string {
	return fmt.Sprintf("[PUT /authorizedclients][%d] putAuthorizedClientsInternalServerError", 500)
}

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

	return nil
}
