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

package plan_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"
)

// ListPlansOKCode is the HTTP code returned for type ListPlansOK
const ListPlansOKCode int = 200

/*ListPlansOK list of plans returned

swagger:response listPlansOK
*/
type ListPlansOK struct {

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

// NewListPlansOK creates ListPlansOK with default headers values
func NewListPlansOK() *ListPlansOK {

	return &ListPlansOK{}
}

// WithPayload adds the payload to the list plans o k response
func (o *ListPlansOK) WithPayload(payload []*models.Plan) *ListPlansOK {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the list plans o k response
func (o *ListPlansOK) SetPayload(payload []*models.Plan) {
	o.Payload = payload
}

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

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

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

// ListPlansInternalServerErrorCode is the HTTP code returned for type ListPlansInternalServerError
const ListPlansInternalServerErrorCode int = 500

/*ListPlansInternalServerError unexpected error

swagger:response listPlansInternalServerError
*/
type ListPlansInternalServerError struct {

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

// NewListPlansInternalServerError creates ListPlansInternalServerError with default headers values
func NewListPlansInternalServerError() *ListPlansInternalServerError {

	return &ListPlansInternalServerError{}
}

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

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

// WriteResponse to the client
func (o *ListPlansInternalServerError) 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
		}
	}
}
