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

// Get5OpenvpnCertReader is a Reader for the Get5OpenvpnCert structure.
type Get5OpenvpnCertReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *Get5OpenvpnCertReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGet5OpenvpnCertOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGet5OpenvpnCertBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGet5OpenvpnCertNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGet5OpenvpnCertInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /5/openvpn/cert] Get5OpenvpnCert", response, response.Code())
	}
}

// NewGet5OpenvpnCertOK creates a Get5OpenvpnCertOK with default headers values
func NewGet5OpenvpnCertOK() *Get5OpenvpnCertOK {
	return &Get5OpenvpnCertOK{}
}

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

OK
*/
type Get5OpenvpnCertOK struct {
	Payload string
}

// IsSuccess returns true when this get5 openvpn cert o k response has a 2xx status code
func (o *Get5OpenvpnCertOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get5 openvpn cert o k response has a 3xx status code
func (o *Get5OpenvpnCertOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get5 openvpn cert o k response has a 4xx status code
func (o *Get5OpenvpnCertOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get5 openvpn cert o k response has a 5xx status code
func (o *Get5OpenvpnCertOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get5 openvpn cert o k response
func (o *Get5OpenvpnCertOK) Code() int {
	return 200
}

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

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

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

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

// NewGet5OpenvpnCertBadRequest creates a Get5OpenvpnCertBadRequest with default headers values
func NewGet5OpenvpnCertBadRequest() *Get5OpenvpnCertBadRequest {
	return &Get5OpenvpnCertBadRequest{}
}

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

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

// IsSuccess returns true when this get5 openvpn cert bad request response has a 2xx status code
func (o *Get5OpenvpnCertBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get5 openvpn cert bad request response has a 3xx status code
func (o *Get5OpenvpnCertBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get5 openvpn cert bad request response has a 4xx status code
func (o *Get5OpenvpnCertBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get5 openvpn cert bad request response has a 5xx status code
func (o *Get5OpenvpnCertBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get5 openvpn cert bad request response
func (o *Get5OpenvpnCertBadRequest) Code() int {
	return 400
}

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

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

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

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

// NewGet5OpenvpnCertNotFound creates a Get5OpenvpnCertNotFound with default headers values
func NewGet5OpenvpnCertNotFound() *Get5OpenvpnCertNotFound {
	return &Get5OpenvpnCertNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get5 openvpn cert not found response
func (o *Get5OpenvpnCertNotFound) Code() int {
	return 404
}

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

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

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

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

// NewGet5OpenvpnCertInternalServerError creates a Get5OpenvpnCertInternalServerError with default headers values
func NewGet5OpenvpnCertInternalServerError() *Get5OpenvpnCertInternalServerError {
	return &Get5OpenvpnCertInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get5 openvpn cert internal server error response
func (o *Get5OpenvpnCertInternalServerError) Code() int {
	return 500
}

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

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

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

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