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

// PcloudIkepoliciesPutReader is a Reader for the PcloudIkepoliciesPut structure.
type PcloudIkepoliciesPutReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIkepoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIkepoliciesPutOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIkepoliciesPutBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIkepoliciesPutUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIkepoliciesPutForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudIkepoliciesPutNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudIkepoliciesPutUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIkepoliciesPutInternalServerError()
		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/ike-policies/{ike_policy_id}] pcloud.ikepolicies.put", response, response.Code())
	}
}

// NewPcloudIkepoliciesPutOK creates a PcloudIkepoliciesPutOK with default headers values
func NewPcloudIkepoliciesPutOK() *PcloudIkepoliciesPutOK {
	return &PcloudIkepoliciesPutOK{}
}

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

OK
*/
type PcloudIkepoliciesPutOK struct {
	Payload *models.IKEPolicy
}

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

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

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

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

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

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

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

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

func (o *PcloudIkepoliciesPutOK) GetPayload() *models.IKEPolicy {
	return o.Payload
}

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

	o.Payload = new(models.IKEPolicy)

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

	return nil
}

// NewPcloudIkepoliciesPutBadRequest creates a PcloudIkepoliciesPutBadRequest with default headers values
func NewPcloudIkepoliciesPutBadRequest() *PcloudIkepoliciesPutBadRequest {
	return &PcloudIkepoliciesPutBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPutUnauthorized creates a PcloudIkepoliciesPutUnauthorized with default headers values
func NewPcloudIkepoliciesPutUnauthorized() *PcloudIkepoliciesPutUnauthorized {
	return &PcloudIkepoliciesPutUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPutForbidden creates a PcloudIkepoliciesPutForbidden with default headers values
func NewPcloudIkepoliciesPutForbidden() *PcloudIkepoliciesPutForbidden {
	return &PcloudIkepoliciesPutForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPutNotFound creates a PcloudIkepoliciesPutNotFound with default headers values
func NewPcloudIkepoliciesPutNotFound() *PcloudIkepoliciesPutNotFound {
	return &PcloudIkepoliciesPutNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPutUnprocessableEntity creates a PcloudIkepoliciesPutUnprocessableEntity with default headers values
func NewPcloudIkepoliciesPutUnprocessableEntity() *PcloudIkepoliciesPutUnprocessableEntity {
	return &PcloudIkepoliciesPutUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPutInternalServerError creates a PcloudIkepoliciesPutInternalServerError with default headers values
func NewPcloudIkepoliciesPutInternalServerError() *PcloudIkepoliciesPutInternalServerError {
	return &PcloudIkepoliciesPutInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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