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

package p_cloud_images

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

// PcloudV2ImagesExportGetReader is a Reader for the PcloudV2ImagesExportGet structure.
type PcloudV2ImagesExportGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudV2ImagesExportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudV2ImagesExportGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudV2ImagesExportGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudV2ImagesExportGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudV2ImagesExportGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudV2ImagesExportGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudV2ImagesExportGetInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export] pcloud.v2.images.export.get", response, response.Code())
	}
}

// NewPcloudV2ImagesExportGetOK creates a PcloudV2ImagesExportGetOK with default headers values
func NewPcloudV2ImagesExportGetOK() *PcloudV2ImagesExportGetOK {
	return &PcloudV2ImagesExportGetOK{}
}

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

OK
*/
type PcloudV2ImagesExportGetOK struct {
	Payload *models.Job
}

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get o k response
func (o *PcloudV2ImagesExportGetOK) Code() int {
	return 200
}

func (o *PcloudV2ImagesExportGetOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK  %+v", 200, o.Payload)
}

func (o *PcloudV2ImagesExportGetOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK  %+v", 200, o.Payload)
}

func (o *PcloudV2ImagesExportGetOK) GetPayload() *models.Job {
	return o.Payload
}

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

	o.Payload = new(models.Job)

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

	return nil
}

// NewPcloudV2ImagesExportGetBadRequest creates a PcloudV2ImagesExportGetBadRequest with default headers values
func NewPcloudV2ImagesExportGetBadRequest() *PcloudV2ImagesExportGetBadRequest {
	return &PcloudV2ImagesExportGetBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get bad request response
func (o *PcloudV2ImagesExportGetBadRequest) Code() int {
	return 400
}

func (o *PcloudV2ImagesExportGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudV2ImagesExportGetBadRequest) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudV2ImagesExportGetUnauthorized creates a PcloudV2ImagesExportGetUnauthorized with default headers values
func NewPcloudV2ImagesExportGetUnauthorized() *PcloudV2ImagesExportGetUnauthorized {
	return &PcloudV2ImagesExportGetUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get unauthorized response
func (o *PcloudV2ImagesExportGetUnauthorized) Code() int {
	return 401
}

func (o *PcloudV2ImagesExportGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudV2ImagesExportGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudV2ImagesExportGetForbidden creates a PcloudV2ImagesExportGetForbidden with default headers values
func NewPcloudV2ImagesExportGetForbidden() *PcloudV2ImagesExportGetForbidden {
	return &PcloudV2ImagesExportGetForbidden{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get forbidden response
func (o *PcloudV2ImagesExportGetForbidden) Code() int {
	return 403
}

func (o *PcloudV2ImagesExportGetForbidden) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden  %+v", 403, o.Payload)
}

func (o *PcloudV2ImagesExportGetForbidden) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudV2ImagesExportGetNotFound creates a PcloudV2ImagesExportGetNotFound with default headers values
func NewPcloudV2ImagesExportGetNotFound() *PcloudV2ImagesExportGetNotFound {
	return &PcloudV2ImagesExportGetNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get not found response
func (o *PcloudV2ImagesExportGetNotFound) Code() int {
	return 404
}

func (o *PcloudV2ImagesExportGetNotFound) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound  %+v", 404, o.Payload)
}

func (o *PcloudV2ImagesExportGetNotFound) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudV2ImagesExportGetInternalServerError creates a PcloudV2ImagesExportGetInternalServerError with default headers values
func NewPcloudV2ImagesExportGetInternalServerError() *PcloudV2ImagesExportGetInternalServerError {
	return &PcloudV2ImagesExportGetInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud v2 images export get internal server error response
func (o *PcloudV2ImagesExportGetInternalServerError) Code() int {
	return 500
}

func (o *PcloudV2ImagesExportGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudV2ImagesExportGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError  %+v", 500, o.Payload)
}

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

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