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

package enterprise

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

// UpdateTeamLBACRulesAPIReader is a Reader for the UpdateTeamLBACRulesAPI structure.
type UpdateTeamLBACRulesAPIReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateTeamLBACRulesAPIReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUpdateTeamLBACRulesAPIOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateTeamLBACRulesAPIBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewUpdateTeamLBACRulesAPIUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUpdateTeamLBACRulesAPIForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateTeamLBACRulesAPINotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateTeamLBACRulesAPIInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /datasources/uid/{uid}/lbac/teams] updateTeamLBACRulesApi", response, response.Code())
	}
}

// NewUpdateTeamLBACRulesAPIOK creates a UpdateTeamLBACRulesAPIOK with default headers values
func NewUpdateTeamLBACRulesAPIOK() *UpdateTeamLBACRulesAPIOK {
	return &UpdateTeamLBACRulesAPIOK{}
}

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

(empty)
*/
type UpdateTeamLBACRulesAPIOK struct {
	Payload *models.UpdateTeamLBACRulesAPIOKBody
}

// IsSuccess returns true when this update team l b a c rules Api Ok response has a 2xx status code
func (o *UpdateTeamLBACRulesAPIOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update team l b a c rules Api Ok response has a 3xx status code
func (o *UpdateTeamLBACRulesAPIOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api Ok response has a 4xx status code
func (o *UpdateTeamLBACRulesAPIOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this update team l b a c rules Api Ok response has a 5xx status code
func (o *UpdateTeamLBACRulesAPIOK) IsServerError() bool {
	return false
}

// IsCode returns true when this update team l b a c rules Api Ok response a status code equal to that given
func (o *UpdateTeamLBACRulesAPIOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the update team l b a c rules Api Ok response
func (o *UpdateTeamLBACRulesAPIOK) Code() int {
	return 200
}

func (o *UpdateTeamLBACRulesAPIOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiOk %s", 200, payload)
}

func (o *UpdateTeamLBACRulesAPIOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiOk %s", 200, payload)
}

func (o *UpdateTeamLBACRulesAPIOK) GetPayload() *models.UpdateTeamLBACRulesAPIOKBody {
	return o.Payload
}

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

	o.Payload = new(models.UpdateTeamLBACRulesAPIOKBody)

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

	return nil
}

// NewUpdateTeamLBACRulesAPIBadRequest creates a UpdateTeamLBACRulesAPIBadRequest with default headers values
func NewUpdateTeamLBACRulesAPIBadRequest() *UpdateTeamLBACRulesAPIBadRequest {
	return &UpdateTeamLBACRulesAPIBadRequest{}
}

/*
UpdateTeamLBACRulesAPIBadRequest describes a response with status code 400, with default header values.

BadRequestError is returned when the request is invalid and it cannot be processed.
*/
type UpdateTeamLBACRulesAPIBadRequest struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this update team l b a c rules Api bad request response has a 2xx status code
func (o *UpdateTeamLBACRulesAPIBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update team l b a c rules Api bad request response has a 3xx status code
func (o *UpdateTeamLBACRulesAPIBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api bad request response has a 4xx status code
func (o *UpdateTeamLBACRulesAPIBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this update team l b a c rules Api bad request response has a 5xx status code
func (o *UpdateTeamLBACRulesAPIBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this update team l b a c rules Api bad request response a status code equal to that given
func (o *UpdateTeamLBACRulesAPIBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the update team l b a c rules Api bad request response
func (o *UpdateTeamLBACRulesAPIBadRequest) Code() int {
	return 400
}

func (o *UpdateTeamLBACRulesAPIBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiBadRequest %s", 400, payload)
}

func (o *UpdateTeamLBACRulesAPIBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiBadRequest %s", 400, payload)
}

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

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

// NewUpdateTeamLBACRulesAPIUnauthorized creates a UpdateTeamLBACRulesAPIUnauthorized with default headers values
func NewUpdateTeamLBACRulesAPIUnauthorized() *UpdateTeamLBACRulesAPIUnauthorized {
	return &UpdateTeamLBACRulesAPIUnauthorized{}
}

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

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

// IsSuccess returns true when this update team l b a c rules Api unauthorized response has a 2xx status code
func (o *UpdateTeamLBACRulesAPIUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update team l b a c rules Api unauthorized response has a 3xx status code
func (o *UpdateTeamLBACRulesAPIUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api unauthorized response has a 4xx status code
func (o *UpdateTeamLBACRulesAPIUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this update team l b a c rules Api unauthorized response has a 5xx status code
func (o *UpdateTeamLBACRulesAPIUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this update team l b a c rules Api unauthorized response a status code equal to that given
func (o *UpdateTeamLBACRulesAPIUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the update team l b a c rules Api unauthorized response
func (o *UpdateTeamLBACRulesAPIUnauthorized) Code() int {
	return 401
}

func (o *UpdateTeamLBACRulesAPIUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiUnauthorized %s", 401, payload)
}

func (o *UpdateTeamLBACRulesAPIUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiUnauthorized %s", 401, payload)
}

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

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

// NewUpdateTeamLBACRulesAPIForbidden creates a UpdateTeamLBACRulesAPIForbidden with default headers values
func NewUpdateTeamLBACRulesAPIForbidden() *UpdateTeamLBACRulesAPIForbidden {
	return &UpdateTeamLBACRulesAPIForbidden{}
}

/*
UpdateTeamLBACRulesAPIForbidden 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 UpdateTeamLBACRulesAPIForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this update team l b a c rules Api forbidden response has a 2xx status code
func (o *UpdateTeamLBACRulesAPIForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update team l b a c rules Api forbidden response has a 3xx status code
func (o *UpdateTeamLBACRulesAPIForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api forbidden response has a 4xx status code
func (o *UpdateTeamLBACRulesAPIForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this update team l b a c rules Api forbidden response has a 5xx status code
func (o *UpdateTeamLBACRulesAPIForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this update team l b a c rules Api forbidden response a status code equal to that given
func (o *UpdateTeamLBACRulesAPIForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the update team l b a c rules Api forbidden response
func (o *UpdateTeamLBACRulesAPIForbidden) Code() int {
	return 403
}

func (o *UpdateTeamLBACRulesAPIForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiForbidden %s", 403, payload)
}

func (o *UpdateTeamLBACRulesAPIForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiForbidden %s", 403, payload)
}

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

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

// NewUpdateTeamLBACRulesAPINotFound creates a UpdateTeamLBACRulesAPINotFound with default headers values
func NewUpdateTeamLBACRulesAPINotFound() *UpdateTeamLBACRulesAPINotFound {
	return &UpdateTeamLBACRulesAPINotFound{}
}

/*
UpdateTeamLBACRulesAPINotFound describes a response with status code 404, with default header values.

NotFoundError is returned when the requested resource was not found.
*/
type UpdateTeamLBACRulesAPINotFound struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this update team l b a c rules Api not found response has a 2xx status code
func (o *UpdateTeamLBACRulesAPINotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update team l b a c rules Api not found response has a 3xx status code
func (o *UpdateTeamLBACRulesAPINotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api not found response has a 4xx status code
func (o *UpdateTeamLBACRulesAPINotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this update team l b a c rules Api not found response has a 5xx status code
func (o *UpdateTeamLBACRulesAPINotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this update team l b a c rules Api not found response a status code equal to that given
func (o *UpdateTeamLBACRulesAPINotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the update team l b a c rules Api not found response
func (o *UpdateTeamLBACRulesAPINotFound) Code() int {
	return 404
}

func (o *UpdateTeamLBACRulesAPINotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiNotFound %s", 404, payload)
}

func (o *UpdateTeamLBACRulesAPINotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiNotFound %s", 404, payload)
}

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

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

// NewUpdateTeamLBACRulesAPIInternalServerError creates a UpdateTeamLBACRulesAPIInternalServerError with default headers values
func NewUpdateTeamLBACRulesAPIInternalServerError() *UpdateTeamLBACRulesAPIInternalServerError {
	return &UpdateTeamLBACRulesAPIInternalServerError{}
}

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

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

// IsSuccess returns true when this update team l b a c rules Api internal server error response has a 2xx status code
func (o *UpdateTeamLBACRulesAPIInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update team l b a c rules Api internal server error response has a 3xx status code
func (o *UpdateTeamLBACRulesAPIInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update team l b a c rules Api internal server error response has a 4xx status code
func (o *UpdateTeamLBACRulesAPIInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this update team l b a c rules Api internal server error response has a 5xx status code
func (o *UpdateTeamLBACRulesAPIInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this update team l b a c rules Api internal server error response a status code equal to that given
func (o *UpdateTeamLBACRulesAPIInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the update team l b a c rules Api internal server error response
func (o *UpdateTeamLBACRulesAPIInternalServerError) Code() int {
	return 500
}

func (o *UpdateTeamLBACRulesAPIInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiInternalServerError %s", 500, payload)
}

func (o *UpdateTeamLBACRulesAPIInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /datasources/uid/{uid}/lbac/teams][%d] updateTeamLBACRulesApiInternalServerError %s", 500, payload)
}

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

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