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

// CreateOrgVariableReader is a Reader for the CreateOrgVariable structure.
type CreateOrgVariableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CreateOrgVariableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewCreateOrgVariableCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewCreateOrgVariableNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewCreateOrgVariableBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewCreateOrgVariableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /orgs/{org}/actions/variables/{variablename}] createOrgVariable", response, response.Code())
	}
}

// NewCreateOrgVariableCreated creates a CreateOrgVariableCreated with default headers values
func NewCreateOrgVariableCreated() *CreateOrgVariableCreated {
	return &CreateOrgVariableCreated{}
}

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

response when creating an org-level variable
*/
type CreateOrgVariableCreated struct {
}

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

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

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

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

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

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

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

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

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

	return nil
}

// NewCreateOrgVariableNoContent creates a CreateOrgVariableNoContent with default headers values
func NewCreateOrgVariableNoContent() *CreateOrgVariableNoContent {
	return &CreateOrgVariableNoContent{}
}

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

response when creating an org-level variable
*/
type CreateOrgVariableNoContent struct {
}

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

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

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

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

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

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

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

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

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

	return nil
}

// NewCreateOrgVariableBadRequest creates a CreateOrgVariableBadRequest with default headers values
func NewCreateOrgVariableBadRequest() *CreateOrgVariableBadRequest {
	return &CreateOrgVariableBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewCreateOrgVariableNotFound creates a CreateOrgVariableNotFound with default headers values
func NewCreateOrgVariableNotFound() *CreateOrgVariableNotFound {
	return &CreateOrgVariableNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

	return nil
}
