github.com/circl-dev/go-swagger@v0.31.0/examples/contributed-templates/stratoscale/restapi/operations/pet/pet_upload_image_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package pet 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/circl-dev/runtime" 12 13 "github.com/circl-dev/go-swagger/examples/contributed-templates/stratoscale/models" 14 ) 15 16 // PetUploadImageOKCode is the HTTP code returned for type PetUploadImageOK 17 const PetUploadImageOKCode int = 200 18 19 /*PetUploadImageOK successful operation 20 21 swagger:response petUploadImageOK 22 */ 23 type PetUploadImageOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload *models.APIResponse `json:"body,omitempty"` 29 } 30 31 // NewPetUploadImageOK creates PetUploadImageOK with default headers values 32 func NewPetUploadImageOK() *PetUploadImageOK { 33 34 return &PetUploadImageOK{} 35 } 36 37 // WithPayload adds the payload to the pet upload image o k response 38 func (o *PetUploadImageOK) WithPayload(payload *models.APIResponse) *PetUploadImageOK { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the pet upload image o k response 44 func (o *PetUploadImageOK) SetPayload(payload *models.APIResponse) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *PetUploadImageOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 50 51 rw.WriteHeader(200) 52 if o.Payload != nil { 53 payload := o.Payload 54 if err := producer.Produce(rw, payload); err != nil { 55 panic(err) // let the recovery middleware deal with this 56 } 57 } 58 }