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

package environment

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

// EnableReader is a Reader for the Enable structure.
type EnableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *EnableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewEnableCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewEnableUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewEnableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewEnableInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /enable] enable", response, response.Code())
	}
}

// NewEnableCreated creates a EnableCreated with default headers values
func NewEnableCreated() *EnableCreated {
	return &EnableCreated{}
}

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

environment enabled
*/
type EnableCreated struct {
	Payload *EnableCreatedBody
}

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

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

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

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

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

// Code gets the status code for the enable created response
func (o *EnableCreated) Code() int {
	return 201
}

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

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

func (o *EnableCreated) GetPayload() *EnableCreatedBody {
	return o.Payload
}

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

	o.Payload = new(EnableCreatedBody)

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

	return nil
}

// NewEnableUnauthorized creates a EnableUnauthorized with default headers values
func NewEnableUnauthorized() *EnableUnauthorized {
	return &EnableUnauthorized{}
}

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

unauthorized
*/
type EnableUnauthorized struct {
}

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

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

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

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

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

// Code gets the status code for the enable unauthorized response
func (o *EnableUnauthorized) Code() int {
	return 401
}

func (o *EnableUnauthorized) Error() string {
	return fmt.Sprintf("[POST /enable][%d] enableUnauthorized ", 401)
}

func (o *EnableUnauthorized) String() string {
	return fmt.Sprintf("[POST /enable][%d] enableUnauthorized ", 401)
}

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

	return nil
}

// NewEnableNotFound creates a EnableNotFound with default headers values
func NewEnableNotFound() *EnableNotFound {
	return &EnableNotFound{}
}

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

account not found
*/
type EnableNotFound struct {
}

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

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

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

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

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

// Code gets the status code for the enable not found response
func (o *EnableNotFound) Code() int {
	return 404
}

func (o *EnableNotFound) Error() string {
	return fmt.Sprintf("[POST /enable][%d] enableNotFound ", 404)
}

func (o *EnableNotFound) String() string {
	return fmt.Sprintf("[POST /enable][%d] enableNotFound ", 404)
}

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

	return nil
}

// NewEnableInternalServerError creates a EnableInternalServerError with default headers values
func NewEnableInternalServerError() *EnableInternalServerError {
	return &EnableInternalServerError{}
}

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

internal server error
*/
type EnableInternalServerError struct {
}

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

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

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

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

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

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

func (o *EnableInternalServerError) Error() string {
	return fmt.Sprintf("[POST /enable][%d] enableInternalServerError ", 500)
}

func (o *EnableInternalServerError) String() string {
	return fmt.Sprintf("[POST /enable][%d] enableInternalServerError ", 500)
}

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

	return nil
}

/*
EnableBody enable body
swagger:model EnableBody
*/
type EnableBody struct {

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

	// host
	Host string `json:"host,omitempty"`
}

// Validate validates this enable body
func (o *EnableBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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

/*
EnableCreatedBody enable created body
swagger:model EnableCreatedBody
*/
type EnableCreatedBody struct {

	// cfg
	Cfg string `json:"cfg,omitempty"`

	// identity
	Identity string `json:"identity,omitempty"`
}

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

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

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

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