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

package p_cloud_cloud_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"
)

// PcloudCloudconnectionsGetReader is a Reader for the PcloudCloudconnectionsGet structure.
type PcloudCloudconnectionsGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudCloudconnectionsGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudCloudconnectionsGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudCloudconnectionsGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudCloudconnectionsGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudCloudconnectionsGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 408:
		result := NewPcloudCloudconnectionsGetRequestTimeout()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudCloudconnectionsGetInternalServerError()
		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}/cloud-connections/{cloud_connection_id}] pcloud.cloudconnections.get", response, response.Code())
	}
}

// NewPcloudCloudconnectionsGetOK creates a PcloudCloudconnectionsGetOK with default headers values
func NewPcloudCloudconnectionsGetOK() *PcloudCloudconnectionsGetOK {
	return &PcloudCloudconnectionsGetOK{}
}

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

OK
*/
type PcloudCloudconnectionsGetOK struct {
	Payload *models.CloudConnection
}

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get o k response
func (o *PcloudCloudconnectionsGetOK) Code() int {
	return 200
}

func (o *PcloudCloudconnectionsGetOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK  %+v", 200, o.Payload)
}

func (o *PcloudCloudconnectionsGetOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK  %+v", 200, o.Payload)
}

func (o *PcloudCloudconnectionsGetOK) GetPayload() *models.CloudConnection {
	return o.Payload
}

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

	o.Payload = new(models.CloudConnection)

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

	return nil
}

// NewPcloudCloudconnectionsGetBadRequest creates a PcloudCloudconnectionsGetBadRequest with default headers values
func NewPcloudCloudconnectionsGetBadRequest() *PcloudCloudconnectionsGetBadRequest {
	return &PcloudCloudconnectionsGetBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get bad request response
func (o *PcloudCloudconnectionsGetBadRequest) Code() int {
	return 400
}

func (o *PcloudCloudconnectionsGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudCloudconnectionsGetBadRequest) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudCloudconnectionsGetUnauthorized creates a PcloudCloudconnectionsGetUnauthorized with default headers values
func NewPcloudCloudconnectionsGetUnauthorized() *PcloudCloudconnectionsGetUnauthorized {
	return &PcloudCloudconnectionsGetUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get unauthorized response
func (o *PcloudCloudconnectionsGetUnauthorized) Code() int {
	return 401
}

func (o *PcloudCloudconnectionsGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudCloudconnectionsGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudCloudconnectionsGetForbidden creates a PcloudCloudconnectionsGetForbidden with default headers values
func NewPcloudCloudconnectionsGetForbidden() *PcloudCloudconnectionsGetForbidden {
	return &PcloudCloudconnectionsGetForbidden{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get forbidden response
func (o *PcloudCloudconnectionsGetForbidden) Code() int {
	return 403
}

func (o *PcloudCloudconnectionsGetForbidden) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden  %+v", 403, o.Payload)
}

func (o *PcloudCloudconnectionsGetForbidden) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudCloudconnectionsGetNotFound creates a PcloudCloudconnectionsGetNotFound with default headers values
func NewPcloudCloudconnectionsGetNotFound() *PcloudCloudconnectionsGetNotFound {
	return &PcloudCloudconnectionsGetNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get not found response
func (o *PcloudCloudconnectionsGetNotFound) Code() int {
	return 404
}

func (o *PcloudCloudconnectionsGetNotFound) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound  %+v", 404, o.Payload)
}

func (o *PcloudCloudconnectionsGetNotFound) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudCloudconnectionsGetRequestTimeout creates a PcloudCloudconnectionsGetRequestTimeout with default headers values
func NewPcloudCloudconnectionsGetRequestTimeout() *PcloudCloudconnectionsGetRequestTimeout {
	return &PcloudCloudconnectionsGetRequestTimeout{}
}

/*
PcloudCloudconnectionsGetRequestTimeout describes a response with status code 408, with default header values.

Request Timeout
*/
type PcloudCloudconnectionsGetRequestTimeout struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud cloudconnections get request timeout response has a 2xx status code
func (o *PcloudCloudconnectionsGetRequestTimeout) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud cloudconnections get request timeout response has a 3xx status code
func (o *PcloudCloudconnectionsGetRequestTimeout) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud cloudconnections get request timeout response has a 4xx status code
func (o *PcloudCloudconnectionsGetRequestTimeout) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud cloudconnections get request timeout response has a 5xx status code
func (o *PcloudCloudconnectionsGetRequestTimeout) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud cloudconnections get request timeout response a status code equal to that given
func (o *PcloudCloudconnectionsGetRequestTimeout) IsCode(code int) bool {
	return code == 408
}

// Code gets the status code for the pcloud cloudconnections get request timeout response
func (o *PcloudCloudconnectionsGetRequestTimeout) Code() int {
	return 408
}

func (o *PcloudCloudconnectionsGetRequestTimeout) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout  %+v", 408, o.Payload)
}

func (o *PcloudCloudconnectionsGetRequestTimeout) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout  %+v", 408, o.Payload)
}

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

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

// NewPcloudCloudconnectionsGetInternalServerError creates a PcloudCloudconnectionsGetInternalServerError with default headers values
func NewPcloudCloudconnectionsGetInternalServerError() *PcloudCloudconnectionsGetInternalServerError {
	return &PcloudCloudconnectionsGetInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud cloudconnections get internal server error response
func (o *PcloudCloudconnectionsGetInternalServerError) Code() int {
	return 500
}

func (o *PcloudCloudconnectionsGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudCloudconnectionsGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError  %+v", 500, o.Payload)
}

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

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