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

// PcloudIkepoliciesPostReader is a Reader for the PcloudIkepoliciesPost structure.
type PcloudIkepoliciesPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudIkepoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudIkepoliciesPostOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudIkepoliciesPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudIkepoliciesPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudIkepoliciesPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudIkepoliciesPostConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudIkepoliciesPostUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudIkepoliciesPostInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies] pcloud.ikepolicies.post", response, response.Code())
	}
}

// NewPcloudIkepoliciesPostOK creates a PcloudIkepoliciesPostOK with default headers values
func NewPcloudIkepoliciesPostOK() *PcloudIkepoliciesPostOK {
	return &PcloudIkepoliciesPostOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPostBadRequest creates a PcloudIkepoliciesPostBadRequest with default headers values
func NewPcloudIkepoliciesPostBadRequest() *PcloudIkepoliciesPostBadRequest {
	return &PcloudIkepoliciesPostBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPostUnauthorized creates a PcloudIkepoliciesPostUnauthorized with default headers values
func NewPcloudIkepoliciesPostUnauthorized() *PcloudIkepoliciesPostUnauthorized {
	return &PcloudIkepoliciesPostUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPostForbidden creates a PcloudIkepoliciesPostForbidden with default headers values
func NewPcloudIkepoliciesPostForbidden() *PcloudIkepoliciesPostForbidden {
	return &PcloudIkepoliciesPostForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPostConflict creates a PcloudIkepoliciesPostConflict with default headers values
func NewPcloudIkepoliciesPostConflict() *PcloudIkepoliciesPostConflict {
	return &PcloudIkepoliciesPostConflict{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud ikepolicies post conflict response
func (o *PcloudIkepoliciesPostConflict) Code() int {
	return 409
}

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

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

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

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

// NewPcloudIkepoliciesPostUnprocessableEntity creates a PcloudIkepoliciesPostUnprocessableEntity with default headers values
func NewPcloudIkepoliciesPostUnprocessableEntity() *PcloudIkepoliciesPostUnprocessableEntity {
	return &PcloudIkepoliciesPostUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudIkepoliciesPostInternalServerError creates a PcloudIkepoliciesPostInternalServerError with default headers values
func NewPcloudIkepoliciesPostInternalServerError() *PcloudIkepoliciesPostInternalServerError {
	return &PcloudIkepoliciesPostInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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