github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/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/go-openapi/runtime" 12 13 "github.com/thetreep/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 /* 20 PetUploadImageOK successful operation 21 22 swagger:response petUploadImageOK 23 */ 24 type PetUploadImageOK struct { 25 26 /* 27 In: Body 28 */ 29 Payload *models.APIResponse `json:"body,omitempty"` 30 } 31 32 // NewPetUploadImageOK creates PetUploadImageOK with default headers values 33 func NewPetUploadImageOK() *PetUploadImageOK { 34 35 return &PetUploadImageOK{} 36 } 37 38 // WithPayload adds the payload to the pet upload image o k response 39 func (o *PetUploadImageOK) WithPayload(payload *models.APIResponse) *PetUploadImageOK { 40 o.Payload = payload 41 return o 42 } 43 44 // SetPayload sets the payload to the pet upload image o k response 45 func (o *PetUploadImageOK) SetPayload(payload *models.APIResponse) { 46 o.Payload = payload 47 } 48 49 // WriteResponse to the client 50 func (o *PetUploadImageOK) 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 }