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

// UpdateCurrentOrgAddressReader is a Reader for the UpdateCurrentOrgAddress structure.
type UpdateCurrentOrgAddressReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateCurrentOrgAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUpdateCurrentOrgAddressOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateCurrentOrgAddressBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewUpdateCurrentOrgAddressUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUpdateCurrentOrgAddressForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateCurrentOrgAddressInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /org/address] updateCurrentOrgAddress", response, response.Code())
	}
}

// NewUpdateCurrentOrgAddressOK creates a UpdateCurrentOrgAddressOK with default headers values
func NewUpdateCurrentOrgAddressOK() *UpdateCurrentOrgAddressOK {
	return &UpdateCurrentOrgAddressOK{}
}

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

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

// IsSuccess returns true when this update current org address Ok response has a 2xx status code
func (o *UpdateCurrentOrgAddressOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update current org address Ok response has a 3xx status code
func (o *UpdateCurrentOrgAddressOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update current org address Ok response has a 4xx status code
func (o *UpdateCurrentOrgAddressOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this update current org address Ok response has a 5xx status code
func (o *UpdateCurrentOrgAddressOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update current org address Ok response
func (o *UpdateCurrentOrgAddressOK) Code() int {
	return 200
}

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

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

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

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

// NewUpdateCurrentOrgAddressBadRequest creates a UpdateCurrentOrgAddressBadRequest with default headers values
func NewUpdateCurrentOrgAddressBadRequest() *UpdateCurrentOrgAddressBadRequest {
	return &UpdateCurrentOrgAddressBadRequest{}
}

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

// IsSuccess returns true when this update current org address bad request response has a 2xx status code
func (o *UpdateCurrentOrgAddressBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update current org address bad request response has a 3xx status code
func (o *UpdateCurrentOrgAddressBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update current org address bad request response has a 4xx status code
func (o *UpdateCurrentOrgAddressBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this update current org address bad request response has a 5xx status code
func (o *UpdateCurrentOrgAddressBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update current org address bad request response
func (o *UpdateCurrentOrgAddressBadRequest) Code() int {
	return 400
}

func (o *UpdateCurrentOrgAddressBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressBadRequest %s", 400, payload)
}

func (o *UpdateCurrentOrgAddressBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressBadRequest %s", 400, payload)
}

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

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

// NewUpdateCurrentOrgAddressUnauthorized creates a UpdateCurrentOrgAddressUnauthorized with default headers values
func NewUpdateCurrentOrgAddressUnauthorized() *UpdateCurrentOrgAddressUnauthorized {
	return &UpdateCurrentOrgAddressUnauthorized{}
}

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

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

// IsSuccess returns true when this update current org address unauthorized response has a 2xx status code
func (o *UpdateCurrentOrgAddressUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update current org address unauthorized response has a 3xx status code
func (o *UpdateCurrentOrgAddressUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update current org address unauthorized response has a 4xx status code
func (o *UpdateCurrentOrgAddressUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this update current org address unauthorized response has a 5xx status code
func (o *UpdateCurrentOrgAddressUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update current org address unauthorized response
func (o *UpdateCurrentOrgAddressUnauthorized) Code() int {
	return 401
}

func (o *UpdateCurrentOrgAddressUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressUnauthorized %s", 401, payload)
}

func (o *UpdateCurrentOrgAddressUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressUnauthorized %s", 401, payload)
}

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

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

// NewUpdateCurrentOrgAddressForbidden creates a UpdateCurrentOrgAddressForbidden with default headers values
func NewUpdateCurrentOrgAddressForbidden() *UpdateCurrentOrgAddressForbidden {
	return &UpdateCurrentOrgAddressForbidden{}
}

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

// IsSuccess returns true when this update current org address forbidden response has a 2xx status code
func (o *UpdateCurrentOrgAddressForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update current org address forbidden response has a 3xx status code
func (o *UpdateCurrentOrgAddressForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update current org address forbidden response has a 4xx status code
func (o *UpdateCurrentOrgAddressForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this update current org address forbidden response has a 5xx status code
func (o *UpdateCurrentOrgAddressForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update current org address forbidden response
func (o *UpdateCurrentOrgAddressForbidden) Code() int {
	return 403
}

func (o *UpdateCurrentOrgAddressForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressForbidden %s", 403, payload)
}

func (o *UpdateCurrentOrgAddressForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressForbidden %s", 403, payload)
}

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

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

// NewUpdateCurrentOrgAddressInternalServerError creates a UpdateCurrentOrgAddressInternalServerError with default headers values
func NewUpdateCurrentOrgAddressInternalServerError() *UpdateCurrentOrgAddressInternalServerError {
	return &UpdateCurrentOrgAddressInternalServerError{}
}

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

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

// IsSuccess returns true when this update current org address internal server error response has a 2xx status code
func (o *UpdateCurrentOrgAddressInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update current org address internal server error response has a 3xx status code
func (o *UpdateCurrentOrgAddressInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update current org address internal server error response has a 4xx status code
func (o *UpdateCurrentOrgAddressInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this update current org address internal server error response has a 5xx status code
func (o *UpdateCurrentOrgAddressInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the update current org address internal server error response
func (o *UpdateCurrentOrgAddressInternalServerError) Code() int {
	return 500
}

func (o *UpdateCurrentOrgAddressInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressInternalServerError %s", 500, payload)
}

func (o *UpdateCurrentOrgAddressInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /org/address][%d] updateCurrentOrgAddressInternalServerError %s", 500, payload)
}

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

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