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

package p_cloud_v_p_n_policies

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

// PcloudIpsecpoliciesGetReader is a Reader for the PcloudIpsecpoliciesGet structure.
type PcloudIpsecpoliciesGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIpsecpoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIpsecpoliciesGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIpsecpoliciesGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIpsecpoliciesGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIpsecpoliciesGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudIpsecpoliciesGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudIpsecpoliciesGetUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIpsecpoliciesGetInternalServerError()
		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/ipsec-policies/{ipsec_policy_id}] pcloud.ipsecpolicies.get", response, response.Code())
	}
}

// NewPcloudIpsecpoliciesGetOK creates a PcloudIpsecpoliciesGetOK with default headers values
func NewPcloudIpsecpoliciesGetOK() *PcloudIpsecpoliciesGetOK {
	return &PcloudIpsecpoliciesGetOK{}
}

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

OK
*/
type PcloudIpsecpoliciesGetOK struct {
	Payload *models.IPSecPolicy
}

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

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

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

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

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

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

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

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

func (o *PcloudIpsecpoliciesGetOK) GetPayload() *models.IPSecPolicy {
	return o.Payload
}

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

	o.Payload = new(models.IPSecPolicy)

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

	return nil
}

// NewPcloudIpsecpoliciesGetBadRequest creates a PcloudIpsecpoliciesGetBadRequest with default headers values
func NewPcloudIpsecpoliciesGetBadRequest() *PcloudIpsecpoliciesGetBadRequest {
	return &PcloudIpsecpoliciesGetBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetUnauthorized creates a PcloudIpsecpoliciesGetUnauthorized with default headers values
func NewPcloudIpsecpoliciesGetUnauthorized() *PcloudIpsecpoliciesGetUnauthorized {
	return &PcloudIpsecpoliciesGetUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetForbidden creates a PcloudIpsecpoliciesGetForbidden with default headers values
func NewPcloudIpsecpoliciesGetForbidden() *PcloudIpsecpoliciesGetForbidden {
	return &PcloudIpsecpoliciesGetForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetNotFound creates a PcloudIpsecpoliciesGetNotFound with default headers values
func NewPcloudIpsecpoliciesGetNotFound() *PcloudIpsecpoliciesGetNotFound {
	return &PcloudIpsecpoliciesGetNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetUnprocessableEntity creates a PcloudIpsecpoliciesGetUnprocessableEntity with default headers values
func NewPcloudIpsecpoliciesGetUnprocessableEntity() *PcloudIpsecpoliciesGetUnprocessableEntity {
	return &PcloudIpsecpoliciesGetUnprocessableEntity{}
}

/*
PcloudIpsecpoliciesGetUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity
*/
type PcloudIpsecpoliciesGetUnprocessableEntity struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud ipsecpolicies get unprocessable entity response has a 2xx status code
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud ipsecpolicies get unprocessable entity response has a 3xx status code
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud ipsecpolicies get unprocessable entity response has a 4xx status code
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud ipsecpolicies get unprocessable entity response has a 5xx status code
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud ipsecpolicies get unprocessable entity response a status code equal to that given
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the pcloud ipsecpolicies get unprocessable entity response
func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Code() int {
	return 422
}

func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PcloudIpsecpoliciesGetUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPcloudIpsecpoliciesGetInternalServerError creates a PcloudIpsecpoliciesGetInternalServerError with default headers values
func NewPcloudIpsecpoliciesGetInternalServerError() *PcloudIpsecpoliciesGetInternalServerError {
	return &PcloudIpsecpoliciesGetInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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