// Code generated by go-swagger; DO NOT EDIT.

package org

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/grafana/grafana-openapi-client-go/models"
)

// GetOrgUsersForCurrentOrgLookupReader is a Reader for the GetOrgUsersForCurrentOrgLookup structure.
type GetOrgUsersForCurrentOrgLookupReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetOrgUsersForCurrentOrgLookupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetOrgUsersForCurrentOrgLookupOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetOrgUsersForCurrentOrgLookupUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetOrgUsersForCurrentOrgLookupForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetOrgUsersForCurrentOrgLookupInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /org/users/lookup] getOrgUsersForCurrentOrgLookup", response, response.Code())
	}
}

// NewGetOrgUsersForCurrentOrgLookupOK creates a GetOrgUsersForCurrentOrgLookupOK with default headers values
func NewGetOrgUsersForCurrentOrgLookupOK() *GetOrgUsersForCurrentOrgLookupOK {
	return &GetOrgUsersForCurrentOrgLookupOK{}
}

/*
GetOrgUsersForCurrentOrgLookupOK describes a response with status code 200, with default header values.

(empty)
*/
type GetOrgUsersForCurrentOrgLookupOK struct {
	Payload []*models.UserLookupDTO
}

// IsSuccess returns true when this get org users for current org lookup Ok response has a 2xx status code
func (o *GetOrgUsersForCurrentOrgLookupOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get org users for current org lookup Ok response has a 3xx status code
func (o *GetOrgUsersForCurrentOrgLookupOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get org users for current org lookup Ok response has a 4xx status code
func (o *GetOrgUsersForCurrentOrgLookupOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get org users for current org lookup Ok response has a 5xx status code
func (o *GetOrgUsersForCurrentOrgLookupOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get org users for current org lookup Ok response a status code equal to that given
func (o *GetOrgUsersForCurrentOrgLookupOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get org users for current org lookup Ok response
func (o *GetOrgUsersForCurrentOrgLookupOK) Code() int {
	return 200
}

func (o *GetOrgUsersForCurrentOrgLookupOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupOk %s", 200, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupOk %s", 200, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupOK) GetPayload() []*models.UserLookupDTO {
	return o.Payload
}

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

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

	return nil
}

// NewGetOrgUsersForCurrentOrgLookupUnauthorized creates a GetOrgUsersForCurrentOrgLookupUnauthorized with default headers values
func NewGetOrgUsersForCurrentOrgLookupUnauthorized() *GetOrgUsersForCurrentOrgLookupUnauthorized {
	return &GetOrgUsersForCurrentOrgLookupUnauthorized{}
}

/*
GetOrgUsersForCurrentOrgLookupUnauthorized describes a response with status code 401, with default header values.

UnauthorizedError is returned when the request is not authenticated.
*/
type GetOrgUsersForCurrentOrgLookupUnauthorized struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this get org users for current org lookup unauthorized response has a 2xx status code
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get org users for current org lookup unauthorized response has a 3xx status code
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get org users for current org lookup unauthorized response has a 4xx status code
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get org users for current org lookup unauthorized response has a 5xx status code
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get org users for current org lookup unauthorized response a status code equal to that given
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get org users for current org lookup unauthorized response
func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) Code() int {
	return 401
}

func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupUnauthorized %s", 401, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupUnauthorized %s", 401, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupUnauthorized) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewGetOrgUsersForCurrentOrgLookupForbidden creates a GetOrgUsersForCurrentOrgLookupForbidden with default headers values
func NewGetOrgUsersForCurrentOrgLookupForbidden() *GetOrgUsersForCurrentOrgLookupForbidden {
	return &GetOrgUsersForCurrentOrgLookupForbidden{}
}

/*
GetOrgUsersForCurrentOrgLookupForbidden describes a response with status code 403, with default header values.

ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
*/
type GetOrgUsersForCurrentOrgLookupForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this get org users for current org lookup forbidden response has a 2xx status code
func (o *GetOrgUsersForCurrentOrgLookupForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get org users for current org lookup forbidden response has a 3xx status code
func (o *GetOrgUsersForCurrentOrgLookupForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get org users for current org lookup forbidden response has a 4xx status code
func (o *GetOrgUsersForCurrentOrgLookupForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get org users for current org lookup forbidden response has a 5xx status code
func (o *GetOrgUsersForCurrentOrgLookupForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get org users for current org lookup forbidden response a status code equal to that given
func (o *GetOrgUsersForCurrentOrgLookupForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get org users for current org lookup forbidden response
func (o *GetOrgUsersForCurrentOrgLookupForbidden) Code() int {
	return 403
}

func (o *GetOrgUsersForCurrentOrgLookupForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupForbidden %s", 403, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupForbidden %s", 403, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupForbidden) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewGetOrgUsersForCurrentOrgLookupInternalServerError creates a GetOrgUsersForCurrentOrgLookupInternalServerError with default headers values
func NewGetOrgUsersForCurrentOrgLookupInternalServerError() *GetOrgUsersForCurrentOrgLookupInternalServerError {
	return &GetOrgUsersForCurrentOrgLookupInternalServerError{}
}

/*
GetOrgUsersForCurrentOrgLookupInternalServerError describes a response with status code 500, with default header values.

InternalServerError is a general error indicating something went wrong internally.
*/
type GetOrgUsersForCurrentOrgLookupInternalServerError struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this get org users for current org lookup internal server error response has a 2xx status code
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get org users for current org lookup internal server error response has a 3xx status code
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get org users for current org lookup internal server error response has a 4xx status code
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get org users for current org lookup internal server error response has a 5xx status code
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get org users for current org lookup internal server error response a status code equal to that given
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get org users for current org lookup internal server error response
func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) Code() int {
	return 500
}

func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupInternalServerError %s", 500, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /org/users/lookup][%d] getOrgUsersForCurrentOrgLookupInternalServerError %s", 500, payload)
}

func (o *GetOrgUsersForCurrentOrgLookupInternalServerError) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}
