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

package p_cloud_service_d_h_c_p

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

// PcloudDhcpPostReader is a Reader for the PcloudDhcpPost structure.
type PcloudDhcpPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudDhcpPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudDhcpPostAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudDhcpPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudDhcpPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudDhcpPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudDhcpPostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudDhcpPostInternalServerError()
		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}/services/dhcp] pcloud.dhcp.post", response, response.Code())
	}
}

// NewPcloudDhcpPostAccepted creates a PcloudDhcpPostAccepted with default headers values
func NewPcloudDhcpPostAccepted() *PcloudDhcpPostAccepted {
	return &PcloudDhcpPostAccepted{}
}

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

OK
*/
type PcloudDhcpPostAccepted struct {
	Payload *models.DHCPServer
}

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

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

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

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

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

// Code gets the status code for the pcloud dhcp post accepted response
func (o *PcloudDhcpPostAccepted) Code() int {
	return 202
}

func (o *PcloudDhcpPostAccepted) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted  %+v", 202, o.Payload)
}

func (o *PcloudDhcpPostAccepted) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted  %+v", 202, o.Payload)
}

func (o *PcloudDhcpPostAccepted) GetPayload() *models.DHCPServer {
	return o.Payload
}

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

	o.Payload = new(models.DHCPServer)

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

	return nil
}

// NewPcloudDhcpPostBadRequest creates a PcloudDhcpPostBadRequest with default headers values
func NewPcloudDhcpPostBadRequest() *PcloudDhcpPostBadRequest {
	return &PcloudDhcpPostBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *PcloudDhcpPostBadRequest) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudDhcpPostBadRequest) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudDhcpPostUnauthorized creates a PcloudDhcpPostUnauthorized with default headers values
func NewPcloudDhcpPostUnauthorized() *PcloudDhcpPostUnauthorized {
	return &PcloudDhcpPostUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PcloudDhcpPostUnauthorized) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudDhcpPostUnauthorized) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudDhcpPostForbidden creates a PcloudDhcpPostForbidden with default headers values
func NewPcloudDhcpPostForbidden() *PcloudDhcpPostForbidden {
	return &PcloudDhcpPostForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PcloudDhcpPostForbidden) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden  %+v", 403, o.Payload)
}

func (o *PcloudDhcpPostForbidden) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudDhcpPostNotFound creates a PcloudDhcpPostNotFound with default headers values
func NewPcloudDhcpPostNotFound() *PcloudDhcpPostNotFound {
	return &PcloudDhcpPostNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud dhcp post not found response
func (o *PcloudDhcpPostNotFound) Code() int {
	return 404
}

func (o *PcloudDhcpPostNotFound) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound  %+v", 404, o.Payload)
}

func (o *PcloudDhcpPostNotFound) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudDhcpPostInternalServerError creates a PcloudDhcpPostInternalServerError with default headers values
func NewPcloudDhcpPostInternalServerError() *PcloudDhcpPostInternalServerError {
	return &PcloudDhcpPostInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PcloudDhcpPostInternalServerError) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudDhcpPostInternalServerError) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError  %+v", 500, o.Payload)
}

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

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