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

package organization

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

import (
	"fmt"

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

// UpdateOrgVariableReader is a Reader for the UpdateOrgVariable structure.
type UpdateOrgVariableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateOrgVariableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewUpdateOrgVariableCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewUpdateOrgVariableNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateOrgVariableBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateOrgVariableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /orgs/{org}/actions/variables/{variablename}] updateOrgVariable", response, response.Code())
	}
}

// NewUpdateOrgVariableCreated creates a UpdateOrgVariableCreated with default headers values
func NewUpdateOrgVariableCreated() *UpdateOrgVariableCreated {
	return &UpdateOrgVariableCreated{}
}

/*
UpdateOrgVariableCreated describes a response with status code 201, with default header values.

response when updating an org-level variable
*/
type UpdateOrgVariableCreated struct {
}

// IsSuccess returns true when this update org variable created response has a 2xx status code
func (o *UpdateOrgVariableCreated) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update org variable created response has a 3xx status code
func (o *UpdateOrgVariableCreated) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update org variable created response has a 4xx status code
func (o *UpdateOrgVariableCreated) IsClientError() bool {
	return false
}

// IsServerError returns true when this update org variable created response has a 5xx status code
func (o *UpdateOrgVariableCreated) IsServerError() bool {
	return false
}

// IsCode returns true when this update org variable created response a status code equal to that given
func (o *UpdateOrgVariableCreated) IsCode(code int) bool {
	return code == 201
}

// Code gets the status code for the update org variable created response
func (o *UpdateOrgVariableCreated) Code() int {
	return 201
}

func (o *UpdateOrgVariableCreated) Error() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableCreated", 201)
}

func (o *UpdateOrgVariableCreated) String() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableCreated", 201)
}

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

	return nil
}

// NewUpdateOrgVariableNoContent creates a UpdateOrgVariableNoContent with default headers values
func NewUpdateOrgVariableNoContent() *UpdateOrgVariableNoContent {
	return &UpdateOrgVariableNoContent{}
}

/*
UpdateOrgVariableNoContent describes a response with status code 204, with default header values.

response when updating an org-level variable
*/
type UpdateOrgVariableNoContent struct {
}

// IsSuccess returns true when this update org variable no content response has a 2xx status code
func (o *UpdateOrgVariableNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update org variable no content response has a 3xx status code
func (o *UpdateOrgVariableNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update org variable no content response has a 4xx status code
func (o *UpdateOrgVariableNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this update org variable no content response has a 5xx status code
func (o *UpdateOrgVariableNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this update org variable no content response a status code equal to that given
func (o *UpdateOrgVariableNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the update org variable no content response
func (o *UpdateOrgVariableNoContent) Code() int {
	return 204
}

func (o *UpdateOrgVariableNoContent) Error() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableNoContent", 204)
}

func (o *UpdateOrgVariableNoContent) String() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableNoContent", 204)
}

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

	return nil
}

// NewUpdateOrgVariableBadRequest creates a UpdateOrgVariableBadRequest with default headers values
func NewUpdateOrgVariableBadRequest() *UpdateOrgVariableBadRequest {
	return &UpdateOrgVariableBadRequest{}
}

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

APIError is error format response
*/
type UpdateOrgVariableBadRequest struct {
	Message string
	URL     string
}

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

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

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

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

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

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

func (o *UpdateOrgVariableBadRequest) Error() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableBadRequest", 400)
}

func (o *UpdateOrgVariableBadRequest) String() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableBadRequest", 400)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}

// NewUpdateOrgVariableNotFound creates a UpdateOrgVariableNotFound with default headers values
func NewUpdateOrgVariableNotFound() *UpdateOrgVariableNotFound {
	return &UpdateOrgVariableNotFound{}
}

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

APINotFound is a not found empty response
*/
type UpdateOrgVariableNotFound struct {
}

// IsSuccess returns true when this update org variable not found response has a 2xx status code
func (o *UpdateOrgVariableNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update org variable not found response has a 3xx status code
func (o *UpdateOrgVariableNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update org variable not found response has a 4xx status code
func (o *UpdateOrgVariableNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this update org variable not found response has a 5xx status code
func (o *UpdateOrgVariableNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update org variable not found response
func (o *UpdateOrgVariableNotFound) Code() int {
	return 404
}

func (o *UpdateOrgVariableNotFound) Error() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableNotFound", 404)
}

func (o *UpdateOrgVariableNotFound) String() string {
	return fmt.Sprintf("[PUT /orgs/{org}/actions/variables/{variablename}][%d] updateOrgVariableNotFound", 404)
}

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

	return nil
}
