github.com/cilium/cilium@v1.16.2/api/v1/health/server/restapi/connectivity/put_status_probe_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package connectivity 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "net/http" 13 14 "github.com/go-openapi/runtime" 15 16 "github.com/cilium/cilium/api/v1/health/models" 17 ) 18 19 // PutStatusProbeOKCode is the HTTP code returned for type PutStatusProbeOK 20 const PutStatusProbeOKCode int = 200 21 22 /* 23 PutStatusProbeOK Success 24 25 swagger:response putStatusProbeOK 26 */ 27 type PutStatusProbeOK struct { 28 29 /* 30 In: Body 31 */ 32 Payload *models.HealthStatusResponse `json:"body,omitempty"` 33 } 34 35 // NewPutStatusProbeOK creates PutStatusProbeOK with default headers values 36 func NewPutStatusProbeOK() *PutStatusProbeOK { 37 38 return &PutStatusProbeOK{} 39 } 40 41 // WithPayload adds the payload to the put status probe o k response 42 func (o *PutStatusProbeOK) WithPayload(payload *models.HealthStatusResponse) *PutStatusProbeOK { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the put status probe o k response 48 func (o *PutStatusProbeOK) SetPayload(payload *models.HealthStatusResponse) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *PutStatusProbeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 54 55 rw.WriteHeader(200) 56 if o.Payload != nil { 57 payload := o.Payload 58 if err := producer.Produce(rw, payload); err != nil { 59 panic(err) // let the recovery middleware deal with this 60 } 61 } 62 } 63 64 // PutStatusProbeForbiddenCode is the HTTP code returned for type PutStatusProbeForbidden 65 const PutStatusProbeForbiddenCode int = 403 66 67 /* 68 PutStatusProbeForbidden Forbidden 69 70 swagger:response putStatusProbeForbidden 71 */ 72 type PutStatusProbeForbidden struct { 73 } 74 75 // NewPutStatusProbeForbidden creates PutStatusProbeForbidden with default headers values 76 func NewPutStatusProbeForbidden() *PutStatusProbeForbidden { 77 78 return &PutStatusProbeForbidden{} 79 } 80 81 // WriteResponse to the client 82 func (o *PutStatusProbeForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 83 84 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 85 86 rw.WriteHeader(403) 87 } 88 89 // PutStatusProbeFailedCode is the HTTP code returned for type PutStatusProbeFailed 90 const PutStatusProbeFailedCode int = 500 91 92 /* 93 PutStatusProbeFailed Internal error occurred while conducting connectivity probe 94 95 swagger:response putStatusProbeFailed 96 */ 97 type PutStatusProbeFailed struct { 98 99 /* 100 In: Body 101 */ 102 Payload models.Error `json:"body,omitempty"` 103 } 104 105 // NewPutStatusProbeFailed creates PutStatusProbeFailed with default headers values 106 func NewPutStatusProbeFailed() *PutStatusProbeFailed { 107 108 return &PutStatusProbeFailed{} 109 } 110 111 // WithPayload adds the payload to the put status probe failed response 112 func (o *PutStatusProbeFailed) WithPayload(payload models.Error) *PutStatusProbeFailed { 113 o.Payload = payload 114 return o 115 } 116 117 // SetPayload sets the payload to the put status probe failed response 118 func (o *PutStatusProbeFailed) SetPayload(payload models.Error) { 119 o.Payload = payload 120 } 121 122 // WriteResponse to the client 123 func (o *PutStatusProbeFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 124 125 rw.WriteHeader(500) 126 payload := o.Payload 127 if err := producer.Produce(rw, payload); err != nil { 128 panic(err) // let the recovery middleware deal with this 129 } 130 }