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

// PcloudVpnconnectionsPeersubnetsGetReader is a Reader for the PcloudVpnconnectionsPeersubnetsGet structure.
type PcloudVpnconnectionsPeersubnetsGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudVpnconnectionsPeersubnetsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudVpnconnectionsPeersubnetsGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudVpnconnectionsPeersubnetsGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudVpnconnectionsPeersubnetsGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudVpnconnectionsPeersubnetsGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudVpnconnectionsPeersubnetsGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudVpnconnectionsPeersubnetsGetInternalServerError()
		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/{vpn_connection_id}/peer-subnets] pcloud.vpnconnections.peersubnets.get", response, response.Code())
	}
}

// NewPcloudVpnconnectionsPeersubnetsGetOK creates a PcloudVpnconnectionsPeersubnetsGetOK with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetOK() *PcloudVpnconnectionsPeersubnetsGetOK {
	return &PcloudVpnconnectionsPeersubnetsGetOK{}
}

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

OK
*/
type PcloudVpnconnectionsPeersubnetsGetOK struct {
	Payload *models.PeerSubnets
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsPeersubnetsGetOK) GetPayload() *models.PeerSubnets {
	return o.Payload
}

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

	o.Payload = new(models.PeerSubnets)

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

	return nil
}

// NewPcloudVpnconnectionsPeersubnetsGetBadRequest creates a PcloudVpnconnectionsPeersubnetsGetBadRequest with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetBadRequest() *PcloudVpnconnectionsPeersubnetsGetBadRequest {
	return &PcloudVpnconnectionsPeersubnetsGetBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVpnconnectionsPeersubnetsGetUnauthorized creates a PcloudVpnconnectionsPeersubnetsGetUnauthorized with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetUnauthorized() *PcloudVpnconnectionsPeersubnetsGetUnauthorized {
	return &PcloudVpnconnectionsPeersubnetsGetUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVpnconnectionsPeersubnetsGetForbidden creates a PcloudVpnconnectionsPeersubnetsGetForbidden with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetForbidden() *PcloudVpnconnectionsPeersubnetsGetForbidden {
	return &PcloudVpnconnectionsPeersubnetsGetForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVpnconnectionsPeersubnetsGetNotFound creates a PcloudVpnconnectionsPeersubnetsGetNotFound with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetNotFound() *PcloudVpnconnectionsPeersubnetsGetNotFound {
	return &PcloudVpnconnectionsPeersubnetsGetNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVpnconnectionsPeersubnetsGetInternalServerError creates a PcloudVpnconnectionsPeersubnetsGetInternalServerError with default headers values
func NewPcloudVpnconnectionsPeersubnetsGetInternalServerError() *PcloudVpnconnectionsPeersubnetsGetInternalServerError {
	return &PcloudVpnconnectionsPeersubnetsGetInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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