// 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 (
	"net/http"

	"github.com/go-openapi/runtime"

	"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/plan-manager/models"
)

// ListCyclesOKCode is the HTTP code returned for type ListCyclesOK
const ListCyclesOKCode int = 200

/*ListCyclesOK list of cycles returned

swagger:response listCyclesOK
*/
type ListCyclesOK struct {

	/*
	  In: Body
	*/
	Payload []*models.Cycle `json:"body,omitempty"`
}

// NewListCyclesOK creates ListCyclesOK with default headers values
func NewListCyclesOK() *ListCyclesOK {

	return &ListCyclesOK{}
}

// WithPayload adds the payload to the list cycles o k response
func (o *ListCyclesOK) WithPayload(payload []*models.Cycle) *ListCyclesOK {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the list cycles o k response
func (o *ListCyclesOK) SetPayload(payload []*models.Cycle) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *ListCyclesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(200)
	payload := o.Payload
	if payload == nil {
		// return empty array
		payload = make([]*models.Cycle, 0, 50)
	}

	if err := producer.Produce(rw, payload); err != nil {
		panic(err) // let the recovery middleware deal with this
	}
}

// ListCyclesInternalServerErrorCode is the HTTP code returned for type ListCyclesInternalServerError
const ListCyclesInternalServerErrorCode int = 500

/*ListCyclesInternalServerError unexpected error

swagger:response listCyclesInternalServerError
*/
type ListCyclesInternalServerError struct {

	/*
	  In: Body
	*/
	Payload *models.ErrorResponse `json:"body,omitempty"`
}

// NewListCyclesInternalServerError creates ListCyclesInternalServerError with default headers values
func NewListCyclesInternalServerError() *ListCyclesInternalServerError {

	return &ListCyclesInternalServerError{}
}

// WithPayload adds the payload to the list cycles internal server error response
func (o *ListCyclesInternalServerError) WithPayload(payload *models.ErrorResponse) *ListCyclesInternalServerError {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the list cycles internal server error response
func (o *ListCyclesInternalServerError) SetPayload(payload *models.ErrorResponse) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *ListCyclesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(500)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}
