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

package provisioning

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

// GetAPIAutoconfReader is a Reader for the GetAPIAutoconf structure.
type GetAPIAutoconfReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAPIAutoconfReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetAPIAutoconfOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetAPIAutoconfBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetAPIAutoconfNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetAPIAutoconfInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/autoconf] GetAPIAutoconf", response, response.Code())
	}
}

// NewGetAPIAutoconfOK creates a GetAPIAutoconfOK with default headers values
func NewGetAPIAutoconfOK() *GetAPIAutoconfOK {
	return &GetAPIAutoconfOK{}
}

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

OK
*/
type GetAPIAutoconfOK struct {
	Payload string
}

// IsSuccess returns true when this get Api autoconf o k response has a 2xx status code
func (o *GetAPIAutoconfOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get Api autoconf o k response has a 3xx status code
func (o *GetAPIAutoconfOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get Api autoconf o k response has a 4xx status code
func (o *GetAPIAutoconfOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get Api autoconf o k response has a 5xx status code
func (o *GetAPIAutoconfOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get Api autoconf o k response a status code equal to that given
func (o *GetAPIAutoconfOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get Api autoconf o k response
func (o *GetAPIAutoconfOK) Code() int {
	return 200
}

func (o *GetAPIAutoconfOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfOK %s", 200, payload)
}

func (o *GetAPIAutoconfOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfOK %s", 200, payload)
}

func (o *GetAPIAutoconfOK) GetPayload() string {
	return o.Payload
}

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

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

	return nil
}

// NewGetAPIAutoconfBadRequest creates a GetAPIAutoconfBadRequest with default headers values
func NewGetAPIAutoconfBadRequest() *GetAPIAutoconfBadRequest {
	return &GetAPIAutoconfBadRequest{}
}

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

Bad Request
*/
type GetAPIAutoconfBadRequest struct {
	Payload interface{}
}

// IsSuccess returns true when this get Api autoconf bad request response has a 2xx status code
func (o *GetAPIAutoconfBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get Api autoconf bad request response has a 3xx status code
func (o *GetAPIAutoconfBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get Api autoconf bad request response has a 4xx status code
func (o *GetAPIAutoconfBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get Api autoconf bad request response has a 5xx status code
func (o *GetAPIAutoconfBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this get Api autoconf bad request response a status code equal to that given
func (o *GetAPIAutoconfBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the get Api autoconf bad request response
func (o *GetAPIAutoconfBadRequest) Code() int {
	return 400
}

func (o *GetAPIAutoconfBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfBadRequest %s", 400, payload)
}

func (o *GetAPIAutoconfBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfBadRequest %s", 400, payload)
}

func (o *GetAPIAutoconfBadRequest) GetPayload() interface{} {
	return o.Payload
}

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

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

	return nil
}

// NewGetAPIAutoconfNotFound creates a GetAPIAutoconfNotFound with default headers values
func NewGetAPIAutoconfNotFound() *GetAPIAutoconfNotFound {
	return &GetAPIAutoconfNotFound{}
}

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

Not Found
*/
type GetAPIAutoconfNotFound struct {
	Payload interface{}
}

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

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

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

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

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

// Code gets the status code for the get Api autoconf not found response
func (o *GetAPIAutoconfNotFound) Code() int {
	return 404
}

func (o *GetAPIAutoconfNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfNotFound %s", 404, payload)
}

func (o *GetAPIAutoconfNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfNotFound %s", 404, payload)
}

func (o *GetAPIAutoconfNotFound) GetPayload() interface{} {
	return o.Payload
}

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

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

	return nil
}

// NewGetAPIAutoconfInternalServerError creates a GetAPIAutoconfInternalServerError with default headers values
func NewGetAPIAutoconfInternalServerError() *GetAPIAutoconfInternalServerError {
	return &GetAPIAutoconfInternalServerError{}
}

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

Internal Server Error
*/
type GetAPIAutoconfInternalServerError struct {
	Payload interface{}
}

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

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

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

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

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

// Code gets the status code for the get Api autoconf internal server error response
func (o *GetAPIAutoconfInternalServerError) Code() int {
	return 500
}

func (o *GetAPIAutoconfInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfInternalServerError %s", 500, payload)
}

func (o *GetAPIAutoconfInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/autoconf][%d] getApiAutoconfInternalServerError %s", 500, payload)
}

func (o *GetAPIAutoconfInternalServerError) GetPayload() interface{} {
	return o.Payload
}

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

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

	return nil
}
