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

package org_invites

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

// RevokeInviteReader is a Reader for the RevokeInvite structure.
type RevokeInviteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RevokeInviteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewRevokeInviteOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewRevokeInviteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewRevokeInviteForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRevokeInviteNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewRevokeInviteInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /org/invites/{invitation_code}/revoke] revokeInvite", response, response.Code())
	}
}

// NewRevokeInviteOK creates a RevokeInviteOK with default headers values
func NewRevokeInviteOK() *RevokeInviteOK {
	return &RevokeInviteOK{}
}

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

An OKResponse is returned if the request was successful.
*/
type RevokeInviteOK struct {
	Payload *models.SuccessResponseBody
}

// IsSuccess returns true when this revoke invite Ok response has a 2xx status code
func (o *RevokeInviteOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this revoke invite Ok response has a 3xx status code
func (o *RevokeInviteOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke invite Ok response has a 4xx status code
func (o *RevokeInviteOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this revoke invite Ok response has a 5xx status code
func (o *RevokeInviteOK) IsServerError() bool {
	return false
}

// IsCode returns true when this revoke invite Ok response a status code equal to that given
func (o *RevokeInviteOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the revoke invite Ok response
func (o *RevokeInviteOK) Code() int {
	return 200
}

func (o *RevokeInviteOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteOk %s", 200, payload)
}

func (o *RevokeInviteOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteOk %s", 200, payload)
}

func (o *RevokeInviteOK) GetPayload() *models.SuccessResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.SuccessResponseBody)

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

	return nil
}

// NewRevokeInviteUnauthorized creates a RevokeInviteUnauthorized with default headers values
func NewRevokeInviteUnauthorized() *RevokeInviteUnauthorized {
	return &RevokeInviteUnauthorized{}
}

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

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

// IsSuccess returns true when this revoke invite unauthorized response has a 2xx status code
func (o *RevokeInviteUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke invite unauthorized response has a 3xx status code
func (o *RevokeInviteUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke invite unauthorized response has a 4xx status code
func (o *RevokeInviteUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke invite unauthorized response has a 5xx status code
func (o *RevokeInviteUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this revoke invite unauthorized response a status code equal to that given
func (o *RevokeInviteUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the revoke invite unauthorized response
func (o *RevokeInviteUnauthorized) Code() int {
	return 401
}

func (o *RevokeInviteUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteUnauthorized %s", 401, payload)
}

func (o *RevokeInviteUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteUnauthorized %s", 401, payload)
}

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

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

// NewRevokeInviteForbidden creates a RevokeInviteForbidden with default headers values
func NewRevokeInviteForbidden() *RevokeInviteForbidden {
	return &RevokeInviteForbidden{}
}

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

// IsSuccess returns true when this revoke invite forbidden response has a 2xx status code
func (o *RevokeInviteForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke invite forbidden response has a 3xx status code
func (o *RevokeInviteForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke invite forbidden response has a 4xx status code
func (o *RevokeInviteForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke invite forbidden response has a 5xx status code
func (o *RevokeInviteForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this revoke invite forbidden response a status code equal to that given
func (o *RevokeInviteForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the revoke invite forbidden response
func (o *RevokeInviteForbidden) Code() int {
	return 403
}

func (o *RevokeInviteForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteForbidden %s", 403, payload)
}

func (o *RevokeInviteForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteForbidden %s", 403, payload)
}

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

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

// NewRevokeInviteNotFound creates a RevokeInviteNotFound with default headers values
func NewRevokeInviteNotFound() *RevokeInviteNotFound {
	return &RevokeInviteNotFound{}
}

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

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

// IsSuccess returns true when this revoke invite not found response has a 2xx status code
func (o *RevokeInviteNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke invite not found response has a 3xx status code
func (o *RevokeInviteNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke invite not found response has a 4xx status code
func (o *RevokeInviteNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke invite not found response has a 5xx status code
func (o *RevokeInviteNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this revoke invite not found response a status code equal to that given
func (o *RevokeInviteNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the revoke invite not found response
func (o *RevokeInviteNotFound) Code() int {
	return 404
}

func (o *RevokeInviteNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteNotFound %s", 404, payload)
}

func (o *RevokeInviteNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteNotFound %s", 404, payload)
}

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

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

// NewRevokeInviteInternalServerError creates a RevokeInviteInternalServerError with default headers values
func NewRevokeInviteInternalServerError() *RevokeInviteInternalServerError {
	return &RevokeInviteInternalServerError{}
}

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

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

// IsSuccess returns true when this revoke invite internal server error response has a 2xx status code
func (o *RevokeInviteInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke invite internal server error response has a 3xx status code
func (o *RevokeInviteInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke invite internal server error response has a 4xx status code
func (o *RevokeInviteInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this revoke invite internal server error response has a 5xx status code
func (o *RevokeInviteInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the revoke invite internal server error response
func (o *RevokeInviteInternalServerError) Code() int {
	return 500
}

func (o *RevokeInviteInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteInternalServerError %s", 500, payload)
}

func (o *RevokeInviteInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /org/invites/{invitation_code}/revoke][%d] revokeInviteInternalServerError %s", 500, payload)
}

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

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