// Code generated by go-swagger; DO NOT EDIT.

package p_cloud_v_p_n_connections

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

// PcloudVpnconnectionsNetworksPutReader is a Reader for the PcloudVpnconnectionsNetworksPut structure.
type PcloudVpnconnectionsNetworksPutReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudVpnconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudVpnconnectionsNetworksPutAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudVpnconnectionsNetworksPutBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudVpnconnectionsNetworksPutUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudVpnconnectionsNetworksPutForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudVpnconnectionsNetworksPutNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudVpnconnectionsNetworksPutUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudVpnconnectionsNetworksPutInternalServerError()
		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/vpn-connections/{vpn_connection_id}/networks] pcloud.vpnconnections.networks.put", response, response.Code())
	}
}

// NewPcloudVpnconnectionsNetworksPutAccepted creates a PcloudVpnconnectionsNetworksPutAccepted with default headers values
func NewPcloudVpnconnectionsNetworksPutAccepted() *PcloudVpnconnectionsNetworksPutAccepted {
	return &PcloudVpnconnectionsNetworksPutAccepted{}
}

/*
PcloudVpnconnectionsNetworksPutAccepted describes a response with status code 202, with default header values.

Accepted
*/
type PcloudVpnconnectionsNetworksPutAccepted struct {
	Payload *models.JobReference
}

// IsSuccess returns true when this pcloud vpnconnections networks put accepted response has a 2xx status code
func (o *PcloudVpnconnectionsNetworksPutAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this pcloud vpnconnections networks put accepted response has a 3xx status code
func (o *PcloudVpnconnectionsNetworksPutAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud vpnconnections networks put accepted response has a 4xx status code
func (o *PcloudVpnconnectionsNetworksPutAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud vpnconnections networks put accepted response has a 5xx status code
func (o *PcloudVpnconnectionsNetworksPutAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud vpnconnections networks put accepted response a status code equal to that given
func (o *PcloudVpnconnectionsNetworksPutAccepted) IsCode(code int) bool {
	return code == 202
}

// Code gets the status code for the pcloud vpnconnections networks put accepted response
func (o *PcloudVpnconnectionsNetworksPutAccepted) Code() int {
	return 202
}

func (o *PcloudVpnconnectionsNetworksPutAccepted) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted  %+v", 202, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutAccepted) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted  %+v", 202, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutAccepted) GetPayload() *models.JobReference {
	return o.Payload
}

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

	o.Payload = new(models.JobReference)

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

	return nil
}

// NewPcloudVpnconnectionsNetworksPutBadRequest creates a PcloudVpnconnectionsNetworksPutBadRequest with default headers values
func NewPcloudVpnconnectionsNetworksPutBadRequest() *PcloudVpnconnectionsNetworksPutBadRequest {
	return &PcloudVpnconnectionsNetworksPutBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutBadRequest) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutBadRequest) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudVpnconnectionsNetworksPutUnauthorized creates a PcloudVpnconnectionsNetworksPutUnauthorized with default headers values
func NewPcloudVpnconnectionsNetworksPutUnauthorized() *PcloudVpnconnectionsNetworksPutUnauthorized {
	return &PcloudVpnconnectionsNetworksPutUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutUnauthorized) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudVpnconnectionsNetworksPutForbidden creates a PcloudVpnconnectionsNetworksPutForbidden with default headers values
func NewPcloudVpnconnectionsNetworksPutForbidden() *PcloudVpnconnectionsNetworksPutForbidden {
	return &PcloudVpnconnectionsNetworksPutForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutForbidden) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden  %+v", 403, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutForbidden) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudVpnconnectionsNetworksPutNotFound creates a PcloudVpnconnectionsNetworksPutNotFound with default headers values
func NewPcloudVpnconnectionsNetworksPutNotFound() *PcloudVpnconnectionsNetworksPutNotFound {
	return &PcloudVpnconnectionsNetworksPutNotFound{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutNotFound) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound  %+v", 404, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutNotFound) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudVpnconnectionsNetworksPutUnprocessableEntity creates a PcloudVpnconnectionsNetworksPutUnprocessableEntity with default headers values
func NewPcloudVpnconnectionsNetworksPutUnprocessableEntity() *PcloudVpnconnectionsNetworksPutUnprocessableEntity {
	return &PcloudVpnconnectionsNetworksPutUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPcloudVpnconnectionsNetworksPutInternalServerError creates a PcloudVpnconnectionsNetworksPutInternalServerError with default headers values
func NewPcloudVpnconnectionsNetworksPutInternalServerError() *PcloudVpnconnectionsNetworksPutInternalServerError {
	return &PcloudVpnconnectionsNetworksPutInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudVpnconnectionsNetworksPutInternalServerError) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError  %+v", 500, o.Payload)
}

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

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