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

// PcloudIkepoliciesGetallReader is a Reader for the PcloudIkepoliciesGetall structure.
type PcloudIkepoliciesGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIkepoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIkepoliciesGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIkepoliciesGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIkepoliciesGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIkepoliciesGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudIkepoliciesGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIkepoliciesGetallInternalServerError()
		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/ike-policies] pcloud.ikepolicies.getall", response, response.Code())
	}
}

// NewPcloudIkepoliciesGetallOK creates a PcloudIkepoliciesGetallOK with default headers values
func NewPcloudIkepoliciesGetallOK() *PcloudIkepoliciesGetallOK {
	return &PcloudIkepoliciesGetallOK{}
}

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

OK
*/
type PcloudIkepoliciesGetallOK struct {
	Payload *models.IKEPolicies
}

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

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

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

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

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

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

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

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

func (o *PcloudIkepoliciesGetallOK) GetPayload() *models.IKEPolicies {
	return o.Payload
}

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

	o.Payload = new(models.IKEPolicies)

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

	return nil
}

// NewPcloudIkepoliciesGetallBadRequest creates a PcloudIkepoliciesGetallBadRequest with default headers values
func NewPcloudIkepoliciesGetallBadRequest() *PcloudIkepoliciesGetallBadRequest {
	return &PcloudIkepoliciesGetallBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesGetallUnauthorized creates a PcloudIkepoliciesGetallUnauthorized with default headers values
func NewPcloudIkepoliciesGetallUnauthorized() *PcloudIkepoliciesGetallUnauthorized {
	return &PcloudIkepoliciesGetallUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesGetallForbidden creates a PcloudIkepoliciesGetallForbidden with default headers values
func NewPcloudIkepoliciesGetallForbidden() *PcloudIkepoliciesGetallForbidden {
	return &PcloudIkepoliciesGetallForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesGetallNotFound creates a PcloudIkepoliciesGetallNotFound with default headers values
func NewPcloudIkepoliciesGetallNotFound() *PcloudIkepoliciesGetallNotFound {
	return &PcloudIkepoliciesGetallNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesGetallInternalServerError creates a PcloudIkepoliciesGetallInternalServerError with default headers values
func NewPcloudIkepoliciesGetallInternalServerError() *PcloudIkepoliciesGetallInternalServerError {
	return &PcloudIkepoliciesGetallInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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