| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- // Code generated by go-swagger; DO NOT EDIT.
- package operations
- // 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"
- "gem-spaas-coding-challenge/models"
- )
- // ProductionPlanOKCode is the HTTP code returned for type ProductionPlanOK
- const ProductionPlanOKCode int = 200
- /*ProductionPlanOK returns optimal production plan
- swagger:response productionPlanOK
- */
- type ProductionPlanOK struct {
- /*
- In: Body
- */
- Payload []interface{} `json:"body,omitempty"`
- }
- // NewProductionPlanOK creates ProductionPlanOK with default headers values
- func NewProductionPlanOK() *ProductionPlanOK {
- return &ProductionPlanOK{}
- }
- // WithPayload adds the payload to the production plan o k response
- func (o *ProductionPlanOK) WithPayload(payload []interface{}) *ProductionPlanOK {
- o.Payload = payload
- return o
- }
- // SetPayload sets the payload to the production plan o k response
- func (o *ProductionPlanOK) SetPayload(payload []interface{}) {
- o.Payload = payload
- }
- // WriteResponse to the client
- func (o *ProductionPlanOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
- rw.WriteHeader(200)
- payload := o.Payload
- if payload == nil {
- // return empty array
- payload = make([]interface{}, 0, 50)
- }
- if err := producer.Produce(rw, payload); err != nil {
- panic(err) // let the recovery middleware deal with this
- }
- }
- /*ProductionPlanDefault generic error response
- swagger:response productionPlanDefault
- */
- type ProductionPlanDefault struct {
- _statusCode int
- /*
- In: Body
- */
- Payload *models.Error `json:"body,omitempty"`
- }
- // NewProductionPlanDefault creates ProductionPlanDefault with default headers values
- func NewProductionPlanDefault(code int) *ProductionPlanDefault {
- if code <= 0 {
- code = 500
- }
- return &ProductionPlanDefault{
- _statusCode: code,
- }
- }
- // WithStatusCode adds the status to the production plan default response
- func (o *ProductionPlanDefault) WithStatusCode(code int) *ProductionPlanDefault {
- o._statusCode = code
- return o
- }
- // SetStatusCode sets the status to the production plan default response
- func (o *ProductionPlanDefault) SetStatusCode(code int) {
- o._statusCode = code
- }
- // WithPayload adds the payload to the production plan default response
- func (o *ProductionPlanDefault) WithPayload(payload *models.Error) *ProductionPlanDefault {
- o.Payload = payload
- return o
- }
- // SetPayload sets the payload to the production plan default response
- func (o *ProductionPlanDefault) SetPayload(payload *models.Error) {
- o.Payload = payload
- }
- // WriteResponse to the client
- func (o *ProductionPlanDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
- rw.WriteHeader(o._statusCode)
- if o.Payload != nil {
- payload := o.Payload
- if err := producer.Produce(rw, payload); err != nil {
- panic(err) // let the recovery middleware deal with this
- }
- }
- }
|