github.com/Bio-core/jtree@v0.0.0-20190705165106-1d7a7e7d6272/restapi/operations/get_samples_by_query_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package operations 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 models "github.com/Bio-core/jtree/models" 14 ) 15 16 // GetSamplesByQueryOKCode is the HTTP code returned for type GetSamplesByQueryOK 17 const GetSamplesByQueryOKCode int = 200 18 19 /*GetSamplesByQueryOK OK 20 21 swagger:response getSamplesByQueryOK 22 */ 23 type GetSamplesByQueryOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload models.GetSamplesByQueryOKBody `json:"body,omitempty"` 29 } 30 31 // NewGetSamplesByQueryOK creates GetSamplesByQueryOK with default headers values 32 func NewGetSamplesByQueryOK() *GetSamplesByQueryOK { 33 return &GetSamplesByQueryOK{} 34 } 35 36 // WithPayload adds the payload to the get samples by query o k response 37 func (o *GetSamplesByQueryOK) WithPayload(payload models.GetSamplesByQueryOKBody) *GetSamplesByQueryOK { 38 o.Payload = payload 39 return o 40 } 41 42 // SetPayload sets the payload to the get samples by query o k response 43 func (o *GetSamplesByQueryOK) SetPayload(payload models.GetSamplesByQueryOKBody) { 44 o.Payload = payload 45 } 46 47 // WriteResponse to the client 48 func (o *GetSamplesByQueryOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 49 // rw.Header().Set("Access-Control-Allow-Origin", "*") 50 // rw.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE") 51 // rw.Header().Set("Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization") 52 // rw.Header().Set("Access-Control-Allow-Credentials", "true") 53 rw.WriteHeader(200) 54 payload := o.Payload 55 if payload == nil { 56 payload = make(models.GetSamplesByQueryOKBody, 0, 50) 57 } 58 59 if err := producer.Produce(rw, payload); err != nil { 60 panic(err) // let the recovery middleware deal with this 61 } 62 63 } 64 65 // GetSamplesByQueryNotFoundCode is the HTTP code returned for type GetSamplesByQueryNotFound 66 const GetSamplesByQueryNotFoundCode int = 404 67 68 /*GetSamplesByQueryNotFound Sample not found 69 70 swagger:response getSamplesByQueryNotFound 71 */ 72 type GetSamplesByQueryNotFound struct { 73 } 74 75 // NewGetSamplesByQueryNotFound creates GetSamplesByQueryNotFound with default headers values 76 func NewGetSamplesByQueryNotFound() *GetSamplesByQueryNotFound { 77 return &GetSamplesByQueryNotFound{} 78 } 79 80 // WriteResponse to the client 81 func (o *GetSamplesByQueryNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 82 // rw.Header().Set("Access-Control-Allow-Origin", "*") 83 84 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 85 86 rw.WriteHeader(404) 87 }