github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/examples/contributed-templates/stratoscale/restapi/operations/store/order_get_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package store 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "net/http" 10 11 "github.com/go-openapi/runtime" 12 13 "github.com/thetreep/go-swagger/examples/contributed-templates/stratoscale/models" 14 ) 15 16 // OrderGetOKCode is the HTTP code returned for type OrderGetOK 17 const OrderGetOKCode int = 200 18 19 /* 20 OrderGetOK successful operation 21 22 swagger:response orderGetOK 23 */ 24 type OrderGetOK struct { 25 26 /* 27 In: Body 28 */ 29 Payload *models.Order `json:"body,omitempty"` 30 } 31 32 // NewOrderGetOK creates OrderGetOK with default headers values 33 func NewOrderGetOK() *OrderGetOK { 34 35 return &OrderGetOK{} 36 } 37 38 // WithPayload adds the payload to the order get o k response 39 func (o *OrderGetOK) WithPayload(payload *models.Order) *OrderGetOK { 40 o.Payload = payload 41 return o 42 } 43 44 // SetPayload sets the payload to the order get o k response 45 func (o *OrderGetOK) SetPayload(payload *models.Order) { 46 o.Payload = payload 47 } 48 49 // WriteResponse to the client 50 func (o *OrderGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 51 52 rw.WriteHeader(200) 53 if o.Payload != nil { 54 payload := o.Payload 55 if err := producer.Produce(rw, payload); err != nil { 56 panic(err) // let the recovery middleware deal with this 57 } 58 } 59 } 60 61 // OrderGetBadRequestCode is the HTTP code returned for type OrderGetBadRequest 62 const OrderGetBadRequestCode int = 400 63 64 /* 65 OrderGetBadRequest Invalid ID supplied 66 67 swagger:response orderGetBadRequest 68 */ 69 type OrderGetBadRequest struct { 70 } 71 72 // NewOrderGetBadRequest creates OrderGetBadRequest with default headers values 73 func NewOrderGetBadRequest() *OrderGetBadRequest { 74 75 return &OrderGetBadRequest{} 76 } 77 78 // WriteResponse to the client 79 func (o *OrderGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 80 81 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 82 83 rw.WriteHeader(400) 84 } 85 86 // OrderGetNotFoundCode is the HTTP code returned for type OrderGetNotFound 87 const OrderGetNotFoundCode int = 404 88 89 /* 90 OrderGetNotFound Order not found 91 92 swagger:response orderGetNotFound 93 */ 94 type OrderGetNotFound struct { 95 } 96 97 // NewOrderGetNotFound creates OrderGetNotFound with default headers values 98 func NewOrderGetNotFound() *OrderGetNotFound { 99 100 return &OrderGetNotFound{} 101 } 102 103 // WriteResponse to the client 104 func (o *OrderGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 105 106 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 107 108 rw.WriteHeader(404) 109 }