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

// AddOrgInviteReader is a Reader for the AddOrgInvite structure.
type AddOrgInviteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AddOrgInviteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAddOrgInviteOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewAddOrgInviteBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewAddOrgInviteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewAddOrgInviteForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 412:
		result := NewAddOrgInvitePreconditionFailed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewAddOrgInviteInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /org/invites] addOrgInvite", response, response.Code())
	}
}

// NewAddOrgInviteOK creates a AddOrgInviteOK with default headers values
func NewAddOrgInviteOK() *AddOrgInviteOK {
	return &AddOrgInviteOK{}
}

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

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

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

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

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

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

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

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

func (o *AddOrgInviteOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteOk %s", 200, payload)
}

func (o *AddOrgInviteOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteOk %s", 200, payload)
}

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

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

// NewAddOrgInviteBadRequest creates a AddOrgInviteBadRequest with default headers values
func NewAddOrgInviteBadRequest() *AddOrgInviteBadRequest {
	return &AddOrgInviteBadRequest{}
}

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

// IsSuccess returns true when this add org invite bad request response has a 2xx status code
func (o *AddOrgInviteBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this add org invite bad request response has a 3xx status code
func (o *AddOrgInviteBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this add org invite bad request response has a 4xx status code
func (o *AddOrgInviteBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this add org invite bad request response has a 5xx status code
func (o *AddOrgInviteBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this add org invite bad request response a status code equal to that given
func (o *AddOrgInviteBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the add org invite bad request response
func (o *AddOrgInviteBadRequest) Code() int {
	return 400
}

func (o *AddOrgInviteBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteBadRequest %s", 400, payload)
}

func (o *AddOrgInviteBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteBadRequest %s", 400, payload)
}

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

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

// NewAddOrgInviteUnauthorized creates a AddOrgInviteUnauthorized with default headers values
func NewAddOrgInviteUnauthorized() *AddOrgInviteUnauthorized {
	return &AddOrgInviteUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *AddOrgInviteUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteUnauthorized %s", 401, payload)
}

func (o *AddOrgInviteUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteUnauthorized %s", 401, payload)
}

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

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

// NewAddOrgInviteForbidden creates a AddOrgInviteForbidden with default headers values
func NewAddOrgInviteForbidden() *AddOrgInviteForbidden {
	return &AddOrgInviteForbidden{}
}

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

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

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

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

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

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

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

func (o *AddOrgInviteForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteForbidden %s", 403, payload)
}

func (o *AddOrgInviteForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteForbidden %s", 403, payload)
}

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

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

// NewAddOrgInvitePreconditionFailed creates a AddOrgInvitePreconditionFailed with default headers values
func NewAddOrgInvitePreconditionFailed() *AddOrgInvitePreconditionFailed {
	return &AddOrgInvitePreconditionFailed{}
}

/*
AddOrgInvitePreconditionFailed describes a response with status code 412, with default header values.

(empty)
*/
type AddOrgInvitePreconditionFailed struct {
}

// IsSuccess returns true when this add org invite precondition failed response has a 2xx status code
func (o *AddOrgInvitePreconditionFailed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this add org invite precondition failed response has a 3xx status code
func (o *AddOrgInvitePreconditionFailed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this add org invite precondition failed response has a 4xx status code
func (o *AddOrgInvitePreconditionFailed) IsClientError() bool {
	return true
}

// IsServerError returns true when this add org invite precondition failed response has a 5xx status code
func (o *AddOrgInvitePreconditionFailed) IsServerError() bool {
	return false
}

// IsCode returns true when this add org invite precondition failed response a status code equal to that given
func (o *AddOrgInvitePreconditionFailed) IsCode(code int) bool {
	return code == 412
}

// Code gets the status code for the add org invite precondition failed response
func (o *AddOrgInvitePreconditionFailed) Code() int {
	return 412
}

func (o *AddOrgInvitePreconditionFailed) Error() string {
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInvitePreconditionFailed", 412)
}

func (o *AddOrgInvitePreconditionFailed) String() string {
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInvitePreconditionFailed", 412)
}

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

	return nil
}

// NewAddOrgInviteInternalServerError creates a AddOrgInviteInternalServerError with default headers values
func NewAddOrgInviteInternalServerError() *AddOrgInviteInternalServerError {
	return &AddOrgInviteInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *AddOrgInviteInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteInternalServerError %s", 500, payload)
}

func (o *AddOrgInviteInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /org/invites][%d] addOrgInviteInternalServerError %s", 500, payload)
}

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

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