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

// PcloudIpsecpoliciesGetallReader is a Reader for the PcloudIpsecpoliciesGetall structure.
type PcloudIpsecpoliciesGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIpsecpoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIpsecpoliciesGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIpsecpoliciesGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIpsecpoliciesGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIpsecpoliciesGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudIpsecpoliciesGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIpsecpoliciesGetallInternalServerError()
		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] pcloud.ipsecpolicies.getall", response, response.Code())
	}
}

// NewPcloudIpsecpoliciesGetallOK creates a PcloudIpsecpoliciesGetallOK with default headers values
func NewPcloudIpsecpoliciesGetallOK() *PcloudIpsecpoliciesGetallOK {
	return &PcloudIpsecpoliciesGetallOK{}
}

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

OK
*/
type PcloudIpsecpoliciesGetallOK struct {
	Payload *models.IPSecPolicies
}

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

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

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

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

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

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

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

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

func (o *PcloudIpsecpoliciesGetallOK) GetPayload() *models.IPSecPolicies {
	return o.Payload
}

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

	o.Payload = new(models.IPSecPolicies)

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

	return nil
}

// NewPcloudIpsecpoliciesGetallBadRequest creates a PcloudIpsecpoliciesGetallBadRequest with default headers values
func NewPcloudIpsecpoliciesGetallBadRequest() *PcloudIpsecpoliciesGetallBadRequest {
	return &PcloudIpsecpoliciesGetallBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetallUnauthorized creates a PcloudIpsecpoliciesGetallUnauthorized with default headers values
func NewPcloudIpsecpoliciesGetallUnauthorized() *PcloudIpsecpoliciesGetallUnauthorized {
	return &PcloudIpsecpoliciesGetallUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetallForbidden creates a PcloudIpsecpoliciesGetallForbidden with default headers values
func NewPcloudIpsecpoliciesGetallForbidden() *PcloudIpsecpoliciesGetallForbidden {
	return &PcloudIpsecpoliciesGetallForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetallNotFound creates a PcloudIpsecpoliciesGetallNotFound with default headers values
func NewPcloudIpsecpoliciesGetallNotFound() *PcloudIpsecpoliciesGetallNotFound {
	return &PcloudIpsecpoliciesGetallNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesGetallInternalServerError creates a PcloudIpsecpoliciesGetallInternalServerError with default headers values
func NewPcloudIpsecpoliciesGetallInternalServerError() *PcloudIpsecpoliciesGetallInternalServerError {
	return &PcloudIpsecpoliciesGetallInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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