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

package admin

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

import (
	"context"
	"fmt"
	"io"

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

// CreateOrganizationReader is a Reader for the CreateOrganization structure.
type CreateOrganizationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CreateOrganizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewCreateOrganizationCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewCreateOrganizationUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewCreateOrganizationInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /organization] createOrganization", response, response.Code())
	}
}

// NewCreateOrganizationCreated creates a CreateOrganizationCreated with default headers values
func NewCreateOrganizationCreated() *CreateOrganizationCreated {
	return &CreateOrganizationCreated{}
}

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

organization created
*/
type CreateOrganizationCreated struct {
	Payload *CreateOrganizationCreatedBody
}

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

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

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

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

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

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

func (o *CreateOrganizationCreated) Error() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated  %+v", 201, o.Payload)
}

func (o *CreateOrganizationCreated) String() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated  %+v", 201, o.Payload)
}

func (o *CreateOrganizationCreated) GetPayload() *CreateOrganizationCreatedBody {
	return o.Payload
}

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

	o.Payload = new(CreateOrganizationCreatedBody)

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

	return nil
}

// NewCreateOrganizationUnauthorized creates a CreateOrganizationUnauthorized with default headers values
func NewCreateOrganizationUnauthorized() *CreateOrganizationUnauthorized {
	return &CreateOrganizationUnauthorized{}
}

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

unauthorized
*/
type CreateOrganizationUnauthorized struct {
}

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

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

// IsClientError returns true when this create organization unauthorized response has a 4xx status code
func (o *CreateOrganizationUnauthorized) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the create organization unauthorized response
func (o *CreateOrganizationUnauthorized) Code() int {
	return 401
}

func (o *CreateOrganizationUnauthorized) Error() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401)
}

func (o *CreateOrganizationUnauthorized) String() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401)
}

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

	return nil
}

// NewCreateOrganizationInternalServerError creates a CreateOrganizationInternalServerError with default headers values
func NewCreateOrganizationInternalServerError() *CreateOrganizationInternalServerError {
	return &CreateOrganizationInternalServerError{}
}

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

internal server error
*/
type CreateOrganizationInternalServerError struct {
}

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

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

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

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

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

// Code gets the status code for the create organization internal server error response
func (o *CreateOrganizationInternalServerError) Code() int {
	return 500
}

func (o *CreateOrganizationInternalServerError) Error() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500)
}

func (o *CreateOrganizationInternalServerError) String() string {
	return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500)
}

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

	return nil
}

/*
CreateOrganizationBody create organization body
swagger:model CreateOrganizationBody
*/
type CreateOrganizationBody struct {

	// description
	Description string `json:"description,omitempty"`
}

// Validate validates this create organization body
func (o *CreateOrganizationBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this create organization body based on context it is used
func (o *CreateOrganizationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *CreateOrganizationBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *CreateOrganizationBody) UnmarshalBinary(b []byte) error {
	var res CreateOrganizationBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
CreateOrganizationCreatedBody create organization created body
swagger:model CreateOrganizationCreatedBody
*/
type CreateOrganizationCreatedBody struct {

	// token
	Token string `json:"token,omitempty"`
}

// Validate validates this create organization created body
func (o *CreateOrganizationCreatedBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this create organization created body based on context it is used
func (o *CreateOrganizationCreatedBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) UnmarshalBinary(b []byte) error {
	var res CreateOrganizationCreatedBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}
