production_plan_responses.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Code generated by go-swagger; DO NOT EDIT.
  2. package operations
  3. // This file was generated by the swagger tool.
  4. // Editing this file might prove futile when you re-run the swagger generate command
  5. import (
  6. "net/http"
  7. "github.com/go-openapi/runtime"
  8. "gem-spaas-coding-challenge/models"
  9. )
  10. // ProductionPlanOKCode is the HTTP code returned for type ProductionPlanOK
  11. const ProductionPlanOKCode int = 200
  12. /*ProductionPlanOK returns optimal production plan
  13. swagger:response productionPlanOK
  14. */
  15. type ProductionPlanOK struct {
  16. /*
  17. In: Body
  18. */
  19. Payload []interface{} `json:"body,omitempty"`
  20. }
  21. // NewProductionPlanOK creates ProductionPlanOK with default headers values
  22. func NewProductionPlanOK() *ProductionPlanOK {
  23. return &ProductionPlanOK{}
  24. }
  25. // WithPayload adds the payload to the production plan o k response
  26. func (o *ProductionPlanOK) WithPayload(payload []interface{}) *ProductionPlanOK {
  27. o.Payload = payload
  28. return o
  29. }
  30. // SetPayload sets the payload to the production plan o k response
  31. func (o *ProductionPlanOK) SetPayload(payload []interface{}) {
  32. o.Payload = payload
  33. }
  34. // WriteResponse to the client
  35. func (o *ProductionPlanOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
  36. rw.WriteHeader(200)
  37. payload := o.Payload
  38. if payload == nil {
  39. // return empty array
  40. payload = make([]interface{}, 0, 50)
  41. }
  42. if err := producer.Produce(rw, payload); err != nil {
  43. panic(err) // let the recovery middleware deal with this
  44. }
  45. }
  46. /*ProductionPlanDefault generic error response
  47. swagger:response productionPlanDefault
  48. */
  49. type ProductionPlanDefault struct {
  50. _statusCode int
  51. /*
  52. In: Body
  53. */
  54. Payload *models.Error `json:"body,omitempty"`
  55. }
  56. // NewProductionPlanDefault creates ProductionPlanDefault with default headers values
  57. func NewProductionPlanDefault(code int) *ProductionPlanDefault {
  58. if code <= 0 {
  59. code = 500
  60. }
  61. return &ProductionPlanDefault{
  62. _statusCode: code,
  63. }
  64. }
  65. // WithStatusCode adds the status to the production plan default response
  66. func (o *ProductionPlanDefault) WithStatusCode(code int) *ProductionPlanDefault {
  67. o._statusCode = code
  68. return o
  69. }
  70. // SetStatusCode sets the status to the production plan default response
  71. func (o *ProductionPlanDefault) SetStatusCode(code int) {
  72. o._statusCode = code
  73. }
  74. // WithPayload adds the payload to the production plan default response
  75. func (o *ProductionPlanDefault) WithPayload(payload *models.Error) *ProductionPlanDefault {
  76. o.Payload = payload
  77. return o
  78. }
  79. // SetPayload sets the payload to the production plan default response
  80. func (o *ProductionPlanDefault) SetPayload(payload *models.Error) {
  81. o.Payload = payload
  82. }
  83. // WriteResponse to the client
  84. func (o *ProductionPlanDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
  85. rw.WriteHeader(o._statusCode)
  86. if o.Payload != nil {
  87. payload := o.Payload
  88. if err := producer.Produce(rw, payload); err != nil {
  89. panic(err) // let the recovery middleware deal with this
  90. }
  91. }
  92. }