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

package p_cloud_v_p_n_connections

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

import (
	"fmt"
	"io"

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

	"github.com/IBM-Cloud/power-go-client/power/models"
)

// PcloudVpnconnectionsGetallReader is a Reader for the PcloudVpnconnectionsGetall structure.
type PcloudVpnconnectionsGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudVpnconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudVpnconnectionsGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudVpnconnectionsGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudVpnconnectionsGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudVpnconnectionsGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudVpnconnectionsGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudVpnconnectionsGetallInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections] pcloud.vpnconnections.getall", response, response.Code())
	}
}

// NewPcloudVpnconnectionsGetallOK creates a PcloudVpnconnectionsGetallOK with default headers values
func NewPcloudVpnconnectionsGetallOK() *PcloudVpnconnectionsGetallOK {
	return &PcloudVpnconnectionsGetallOK{}
}

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

OK
*/
type PcloudVpnconnectionsGetallOK struct {
	Payload *models.VPNConnections
}

// IsSuccess returns true when this pcloud vpnconnections getall o k response has a 2xx status code
func (o *PcloudVpnconnectionsGetallOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this pcloud vpnconnections getall o k response has a 3xx status code
func (o *PcloudVpnconnectionsGetallOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud vpnconnections getall o k response has a 4xx status code
func (o *PcloudVpnconnectionsGetallOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud vpnconnections getall o k response has a 5xx status code
func (o *PcloudVpnconnectionsGetallOK) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud vpnconnections getall o k response a status code equal to that given
func (o *PcloudVpnconnectionsGetallOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the pcloud vpnconnections getall o k response
func (o *PcloudVpnconnectionsGetallOK) Code() int {
	return 200
}

func (o *PcloudVpnconnectionsGetallOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK  %+v", 200, o.Payload)
}

func (o *PcloudVpnconnectionsGetallOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK  %+v", 200, o.Payload)
}

func (o *PcloudVpnconnectionsGetallOK) GetPayload() *models.VPNConnections {
	return o.Payload
}

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

	o.Payload = new(models.VPNConnections)

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

	return nil
}

// NewPcloudVpnconnectionsGetallBadRequest creates a PcloudVpnconnectionsGetallBadRequest with default headers values
func NewPcloudVpnconnectionsGetallBadRequest() *PcloudVpnconnectionsGetallBadRequest {
	return &PcloudVpnconnectionsGetallBadRequest{}
}

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

Bad Request
*/
type PcloudVpnconnectionsGetallBadRequest struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud vpnconnections getall bad request response has a 2xx status code
func (o *PcloudVpnconnectionsGetallBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud vpnconnections getall bad request response has a 3xx status code
func (o *PcloudVpnconnectionsGetallBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud vpnconnections getall bad request response has a 4xx status code
func (o *PcloudVpnconnectionsGetallBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud vpnconnections getall bad request response has a 5xx status code
func (o *PcloudVpnconnectionsGetallBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud vpnconnections getall bad request response a status code equal to that given
func (o *PcloudVpnconnectionsGetallBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the pcloud vpnconnections getall bad request response
func (o *PcloudVpnconnectionsGetallBadRequest) Code() int {
	return 400
}

func (o *PcloudVpnconnectionsGetallBadRequest) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudVpnconnectionsGetallBadRequest) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudVpnconnectionsGetallBadRequest) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewPcloudVpnconnectionsGetallUnauthorized creates a PcloudVpnconnectionsGetallUnauthorized with default headers values
func NewPcloudVpnconnectionsGetallUnauthorized() *PcloudVpnconnectionsGetallUnauthorized {
	return &PcloudVpnconnectionsGetallUnauthorized{}
}

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

Unauthorized
*/
type PcloudVpnconnectionsGetallUnauthorized struct {
	Payload *models.Error
}

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

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

// IsClientError returns true when this pcloud vpnconnections getall unauthorized response has a 4xx status code
func (o *PcloudVpnconnectionsGetallUnauthorized) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the pcloud vpnconnections getall unauthorized response
func (o *PcloudVpnconnectionsGetallUnauthorized) Code() int {
	return 401
}

func (o *PcloudVpnconnectionsGetallUnauthorized) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudVpnconnectionsGetallUnauthorized) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudVpnconnectionsGetallUnauthorized) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewPcloudVpnconnectionsGetallForbidden creates a PcloudVpnconnectionsGetallForbidden with default headers values
func NewPcloudVpnconnectionsGetallForbidden() *PcloudVpnconnectionsGetallForbidden {
	return &PcloudVpnconnectionsGetallForbidden{}
}

/*
PcloudVpnconnectionsGetallForbidden describes a response with status code 403, with default header values.

Forbidden
*/
type PcloudVpnconnectionsGetallForbidden struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud vpnconnections getall forbidden response has a 2xx status code
func (o *PcloudVpnconnectionsGetallForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud vpnconnections getall forbidden response has a 3xx status code
func (o *PcloudVpnconnectionsGetallForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud vpnconnections getall forbidden response has a 4xx status code
func (o *PcloudVpnconnectionsGetallForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud vpnconnections getall forbidden response has a 5xx status code
func (o *PcloudVpnconnectionsGetallForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud vpnconnections getall forbidden response a status code equal to that given
func (o *PcloudVpnconnectionsGetallForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the pcloud vpnconnections getall forbidden response
func (o *PcloudVpnconnectionsGetallForbidden) Code() int {
	return 403
}

func (o *PcloudVpnconnectionsGetallForbidden) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden  %+v", 403, o.Payload)
}

func (o *PcloudVpnconnectionsGetallForbidden) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden  %+v", 403, o.Payload)
}

func (o *PcloudVpnconnectionsGetallForbidden) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewPcloudVpnconnectionsGetallNotFound creates a PcloudVpnconnectionsGetallNotFound with default headers values
func NewPcloudVpnconnectionsGetallNotFound() *PcloudVpnconnectionsGetallNotFound {
	return &PcloudVpnconnectionsGetallNotFound{}
}

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

Not Found
*/
type PcloudVpnconnectionsGetallNotFound struct {
	Payload *models.Error
}

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

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

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

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

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

// Code gets the status code for the pcloud vpnconnections getall not found response
func (o *PcloudVpnconnectionsGetallNotFound) Code() int {
	return 404
}

func (o *PcloudVpnconnectionsGetallNotFound) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound  %+v", 404, o.Payload)
}

func (o *PcloudVpnconnectionsGetallNotFound) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound  %+v", 404, o.Payload)
}

func (o *PcloudVpnconnectionsGetallNotFound) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewPcloudVpnconnectionsGetallInternalServerError creates a PcloudVpnconnectionsGetallInternalServerError with default headers values
func NewPcloudVpnconnectionsGetallInternalServerError() *PcloudVpnconnectionsGetallInternalServerError {
	return &PcloudVpnconnectionsGetallInternalServerError{}
}

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

Internal Server Error
*/
type PcloudVpnconnectionsGetallInternalServerError struct {
	Payload *models.Error
}

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

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

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

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

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

// Code gets the status code for the pcloud vpnconnections getall internal server error response
func (o *PcloudVpnconnectionsGetallInternalServerError) Code() int {
	return 500
}

func (o *PcloudVpnconnectionsGetallInternalServerError) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudVpnconnectionsGetallInternalServerError) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudVpnconnectionsGetallInternalServerError) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}
