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

package p_cloud_tasks

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

// PcloudTasksDeleteReader is a Reader for the PcloudTasksDelete structure.
type PcloudTasksDeleteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudTasksDeleteOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudTasksDeleteBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudTasksDeleteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudTasksDeleteForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudTasksDeleteNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 410:
		result := NewPcloudTasksDeleteGone()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudTasksDeleteInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /pcloud/v1/tasks/{task_id}] pcloud.tasks.delete", response, response.Code())
	}
}

// NewPcloudTasksDeleteOK creates a PcloudTasksDeleteOK with default headers values
func NewPcloudTasksDeleteOK() *PcloudTasksDeleteOK {
	return &PcloudTasksDeleteOK{}
}

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

OK
*/
type PcloudTasksDeleteOK struct {
	Payload models.Object
}

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete o k response
func (o *PcloudTasksDeleteOK) Code() int {
	return 200
}

func (o *PcloudTasksDeleteOK) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK  %+v", 200, o.Payload)
}

func (o *PcloudTasksDeleteOK) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK  %+v", 200, o.Payload)
}

func (o *PcloudTasksDeleteOK) GetPayload() models.Object {
	return o.Payload
}

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

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

	return nil
}

// NewPcloudTasksDeleteBadRequest creates a PcloudTasksDeleteBadRequest with default headers values
func NewPcloudTasksDeleteBadRequest() *PcloudTasksDeleteBadRequest {
	return &PcloudTasksDeleteBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete bad request response
func (o *PcloudTasksDeleteBadRequest) Code() int {
	return 400
}

func (o *PcloudTasksDeleteBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudTasksDeleteBadRequest) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudTasksDeleteUnauthorized creates a PcloudTasksDeleteUnauthorized with default headers values
func NewPcloudTasksDeleteUnauthorized() *PcloudTasksDeleteUnauthorized {
	return &PcloudTasksDeleteUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete unauthorized response
func (o *PcloudTasksDeleteUnauthorized) Code() int {
	return 401
}

func (o *PcloudTasksDeleteUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudTasksDeleteUnauthorized) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudTasksDeleteForbidden creates a PcloudTasksDeleteForbidden with default headers values
func NewPcloudTasksDeleteForbidden() *PcloudTasksDeleteForbidden {
	return &PcloudTasksDeleteForbidden{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete forbidden response
func (o *PcloudTasksDeleteForbidden) Code() int {
	return 403
}

func (o *PcloudTasksDeleteForbidden) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden  %+v", 403, o.Payload)
}

func (o *PcloudTasksDeleteForbidden) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudTasksDeleteNotFound creates a PcloudTasksDeleteNotFound with default headers values
func NewPcloudTasksDeleteNotFound() *PcloudTasksDeleteNotFound {
	return &PcloudTasksDeleteNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete not found response
func (o *PcloudTasksDeleteNotFound) Code() int {
	return 404
}

func (o *PcloudTasksDeleteNotFound) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound  %+v", 404, o.Payload)
}

func (o *PcloudTasksDeleteNotFound) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudTasksDeleteGone creates a PcloudTasksDeleteGone with default headers values
func NewPcloudTasksDeleteGone() *PcloudTasksDeleteGone {
	return &PcloudTasksDeleteGone{}
}

/*
PcloudTasksDeleteGone describes a response with status code 410, with default header values.

Gone
*/
type PcloudTasksDeleteGone struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud tasks delete gone response has a 2xx status code
func (o *PcloudTasksDeleteGone) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tasks delete gone response has a 3xx status code
func (o *PcloudTasksDeleteGone) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tasks delete gone response has a 4xx status code
func (o *PcloudTasksDeleteGone) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud tasks delete gone response has a 5xx status code
func (o *PcloudTasksDeleteGone) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud tasks delete gone response a status code equal to that given
func (o *PcloudTasksDeleteGone) IsCode(code int) bool {
	return code == 410
}

// Code gets the status code for the pcloud tasks delete gone response
func (o *PcloudTasksDeleteGone) Code() int {
	return 410
}

func (o *PcloudTasksDeleteGone) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone  %+v", 410, o.Payload)
}

func (o *PcloudTasksDeleteGone) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone  %+v", 410, o.Payload)
}

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

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

// NewPcloudTasksDeleteInternalServerError creates a PcloudTasksDeleteInternalServerError with default headers values
func NewPcloudTasksDeleteInternalServerError() *PcloudTasksDeleteInternalServerError {
	return &PcloudTasksDeleteInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud tasks delete internal server error response
func (o *PcloudTasksDeleteInternalServerError) Code() int {
	return 500
}

func (o *PcloudTasksDeleteInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudTasksDeleteInternalServerError) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError  %+v", 500, o.Payload)
}

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

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