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

// GetAPI5OpenvpnConfigReader is a Reader for the GetAPI5OpenvpnConfig structure.
type GetAPI5OpenvpnConfigReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAPI5OpenvpnConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetApi5OpenvpnConfigOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetApi5OpenvpnConfigBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetApi5OpenvpnConfigNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetApi5OpenvpnConfigInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/5/openvpn/config] GetAPI5OpenvpnConfig", response, response.Code())
	}
}

// NewGetApi5OpenvpnConfigOK creates a GetApi5OpenvpnConfigOK with default headers values
func NewGetApi5OpenvpnConfigOK() *GetApi5OpenvpnConfigOK {
	return &GetApi5OpenvpnConfigOK{}
}

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

OK
*/
type GetApi5OpenvpnConfigOK struct {
	Payload string
}

// IsSuccess returns true when this get api5 openvpn config o k response has a 2xx status code
func (o *GetApi5OpenvpnConfigOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get api5 openvpn config o k response has a 3xx status code
func (o *GetApi5OpenvpnConfigOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get api5 openvpn config o k response has a 4xx status code
func (o *GetApi5OpenvpnConfigOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get api5 openvpn config o k response has a 5xx status code
func (o *GetApi5OpenvpnConfigOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get api5 openvpn config o k response
func (o *GetApi5OpenvpnConfigOK) Code() int {
	return 200
}

func (o *GetApi5OpenvpnConfigOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigOK %s", 200, payload)
}

func (o *GetApi5OpenvpnConfigOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigOK %s", 200, payload)
}

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

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

// NewGetApi5OpenvpnConfigBadRequest creates a GetApi5OpenvpnConfigBadRequest with default headers values
func NewGetApi5OpenvpnConfigBadRequest() *GetApi5OpenvpnConfigBadRequest {
	return &GetApi5OpenvpnConfigBadRequest{}
}

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

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

// IsSuccess returns true when this get api5 openvpn config bad request response has a 2xx status code
func (o *GetApi5OpenvpnConfigBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get api5 openvpn config bad request response has a 3xx status code
func (o *GetApi5OpenvpnConfigBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get api5 openvpn config bad request response has a 4xx status code
func (o *GetApi5OpenvpnConfigBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get api5 openvpn config bad request response has a 5xx status code
func (o *GetApi5OpenvpnConfigBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get api5 openvpn config bad request response
func (o *GetApi5OpenvpnConfigBadRequest) Code() int {
	return 400
}

func (o *GetApi5OpenvpnConfigBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigBadRequest %s", 400, payload)
}

func (o *GetApi5OpenvpnConfigBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigBadRequest %s", 400, payload)
}

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

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

// NewGetApi5OpenvpnConfigNotFound creates a GetApi5OpenvpnConfigNotFound with default headers values
func NewGetApi5OpenvpnConfigNotFound() *GetApi5OpenvpnConfigNotFound {
	return &GetApi5OpenvpnConfigNotFound{}
}

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

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

// IsSuccess returns true when this get api5 openvpn config not found response has a 2xx status code
func (o *GetApi5OpenvpnConfigNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get api5 openvpn config not found response has a 3xx status code
func (o *GetApi5OpenvpnConfigNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get api5 openvpn config not found response has a 4xx status code
func (o *GetApi5OpenvpnConfigNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get api5 openvpn config not found response has a 5xx status code
func (o *GetApi5OpenvpnConfigNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get api5 openvpn config not found response
func (o *GetApi5OpenvpnConfigNotFound) Code() int {
	return 404
}

func (o *GetApi5OpenvpnConfigNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigNotFound %s", 404, payload)
}

func (o *GetApi5OpenvpnConfigNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigNotFound %s", 404, payload)
}

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

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

// NewGetApi5OpenvpnConfigInternalServerError creates a GetApi5OpenvpnConfigInternalServerError with default headers values
func NewGetApi5OpenvpnConfigInternalServerError() *GetApi5OpenvpnConfigInternalServerError {
	return &GetApi5OpenvpnConfigInternalServerError{}
}

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

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

// IsSuccess returns true when this get api5 openvpn config internal server error response has a 2xx status code
func (o *GetApi5OpenvpnConfigInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get api5 openvpn config internal server error response has a 3xx status code
func (o *GetApi5OpenvpnConfigInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get api5 openvpn config internal server error response has a 4xx status code
func (o *GetApi5OpenvpnConfigInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get api5 openvpn config internal server error response has a 5xx status code
func (o *GetApi5OpenvpnConfigInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the get api5 openvpn config internal server error response
func (o *GetApi5OpenvpnConfigInternalServerError) Code() int {
	return 500
}

func (o *GetApi5OpenvpnConfigInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigInternalServerError %s", 500, payload)
}

func (o *GetApi5OpenvpnConfigInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/5/openvpn/config][%d] getApi5OpenvpnConfigInternalServerError %s", 500, payload)
}

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

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