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

package cycle_management

// 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/Cyclops-Labs/cyclops-4-hpc.git/services/plan-manager/models"
)

// UpdateCycleReader is a Reader for the UpdateCycle structure.
type UpdateCycleReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateCycleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUpdateCycleOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewUpdateCycleNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateCycleInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewUpdateCycleOK creates a UpdateCycleOK with default headers values
func NewUpdateCycleOK() *UpdateCycleOK {
	return &UpdateCycleOK{}
}

/*UpdateCycleOK handles this case with default header values.

updated cycle
*/
type UpdateCycleOK struct {
	Payload *models.Cycle
}

func (o *UpdateCycleOK) Error() string {
	return fmt.Sprintf("[PUT /cycle/{id}][%d] updateCycleOK  %+v", 200, o.Payload)
}

func (o *UpdateCycleOK) GetPayload() *models.Cycle {
	return o.Payload
}

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

	o.Payload = new(models.Cycle)

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

	return nil
}

// NewUpdateCycleNotFound creates a UpdateCycleNotFound with default headers values
func NewUpdateCycleNotFound() *UpdateCycleNotFound {
	return &UpdateCycleNotFound{}
}

/*UpdateCycleNotFound handles this case with default header values.

cycle with id not found
*/
type UpdateCycleNotFound struct {
	Payload *models.ErrorResponse
}

func (o *UpdateCycleNotFound) Error() string {
	return fmt.Sprintf("[PUT /cycle/{id}][%d] updateCycleNotFound  %+v", 404, o.Payload)
}

func (o *UpdateCycleNotFound) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}

// NewUpdateCycleInternalServerError creates a UpdateCycleInternalServerError with default headers values
func NewUpdateCycleInternalServerError() *UpdateCycleInternalServerError {
	return &UpdateCycleInternalServerError{}
}

/*UpdateCycleInternalServerError handles this case with default header values.

unexpected error
*/
type UpdateCycleInternalServerError struct {
	Payload *models.ErrorResponse
}

func (o *UpdateCycleInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /cycle/{id}][%d] updateCycleInternalServerError  %+v", 500, o.Payload)
}

func (o *UpdateCycleInternalServerError) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}
