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

// PcloudIpsecpoliciesPutReader is a Reader for the PcloudIpsecpoliciesPut structure.
type PcloudIpsecpoliciesPutReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIpsecpoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIpsecpoliciesPutOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIpsecpoliciesPutBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIpsecpoliciesPutUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIpsecpoliciesPutForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudIpsecpoliciesPutNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudIpsecpoliciesPutConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudIpsecpoliciesPutUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIpsecpoliciesPutInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}] pcloud.ipsecpolicies.put", response, response.Code())
	}
}

// NewPcloudIpsecpoliciesPutOK creates a PcloudIpsecpoliciesPutOK with default headers values
func NewPcloudIpsecpoliciesPutOK() *PcloudIpsecpoliciesPutOK {
	return &PcloudIpsecpoliciesPutOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutBadRequest creates a PcloudIpsecpoliciesPutBadRequest with default headers values
func NewPcloudIpsecpoliciesPutBadRequest() *PcloudIpsecpoliciesPutBadRequest {
	return &PcloudIpsecpoliciesPutBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutUnauthorized creates a PcloudIpsecpoliciesPutUnauthorized with default headers values
func NewPcloudIpsecpoliciesPutUnauthorized() *PcloudIpsecpoliciesPutUnauthorized {
	return &PcloudIpsecpoliciesPutUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutForbidden creates a PcloudIpsecpoliciesPutForbidden with default headers values
func NewPcloudIpsecpoliciesPutForbidden() *PcloudIpsecpoliciesPutForbidden {
	return &PcloudIpsecpoliciesPutForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutNotFound creates a PcloudIpsecpoliciesPutNotFound with default headers values
func NewPcloudIpsecpoliciesPutNotFound() *PcloudIpsecpoliciesPutNotFound {
	return &PcloudIpsecpoliciesPutNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutConflict creates a PcloudIpsecpoliciesPutConflict with default headers values
func NewPcloudIpsecpoliciesPutConflict() *PcloudIpsecpoliciesPutConflict {
	return &PcloudIpsecpoliciesPutConflict{}
}

/*
PcloudIpsecpoliciesPutConflict describes a response with status code 409, with default header values.

Conflict
*/
type PcloudIpsecpoliciesPutConflict struct {
	Payload *models.Error
}

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

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

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

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

// IsCode returns true when this pcloud ipsecpolicies put conflict response a status code equal to that given
func (o *PcloudIpsecpoliciesPutConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the pcloud ipsecpolicies put conflict response
func (o *PcloudIpsecpoliciesPutConflict) Code() int {
	return 409
}

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

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

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

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

// NewPcloudIpsecpoliciesPutUnprocessableEntity creates a PcloudIpsecpoliciesPutUnprocessableEntity with default headers values
func NewPcloudIpsecpoliciesPutUnprocessableEntity() *PcloudIpsecpoliciesPutUnprocessableEntity {
	return &PcloudIpsecpoliciesPutUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIpsecpoliciesPutInternalServerError creates a PcloudIpsecpoliciesPutInternalServerError with default headers values
func NewPcloudIpsecpoliciesPutInternalServerError() *PcloudIpsecpoliciesPutInternalServerError {
	return &PcloudIpsecpoliciesPutInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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