github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/get_endpoint_id_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 endpoint 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/models" 17 ) 18 19 // GetEndpointIDOKCode is the HTTP code returned for type GetEndpointIDOK 20 const GetEndpointIDOKCode int = 200 21 22 /* 23 GetEndpointIDOK Success 24 25 swagger:response getEndpointIdOK 26 */ 27 type GetEndpointIDOK struct { 28 29 /* 30 In: Body 31 */ 32 Payload *models.Endpoint `json:"body,omitempty"` 33 } 34 35 // NewGetEndpointIDOK creates GetEndpointIDOK with default headers values 36 func NewGetEndpointIDOK() *GetEndpointIDOK { 37 38 return &GetEndpointIDOK{} 39 } 40 41 // WithPayload adds the payload to the get endpoint Id o k response 42 func (o *GetEndpointIDOK) WithPayload(payload *models.Endpoint) *GetEndpointIDOK { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the get endpoint Id o k response 48 func (o *GetEndpointIDOK) SetPayload(payload *models.Endpoint) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *GetEndpointIDOK) 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 // GetEndpointIDInvalidCode is the HTTP code returned for type GetEndpointIDInvalid 65 const GetEndpointIDInvalidCode int = 400 66 67 /* 68 GetEndpointIDInvalid Invalid endpoint ID format for specified type 69 70 swagger:response getEndpointIdInvalid 71 */ 72 type GetEndpointIDInvalid struct { 73 74 /* 75 In: Body 76 */ 77 Payload models.Error `json:"body,omitempty"` 78 } 79 80 // NewGetEndpointIDInvalid creates GetEndpointIDInvalid with default headers values 81 func NewGetEndpointIDInvalid() *GetEndpointIDInvalid { 82 83 return &GetEndpointIDInvalid{} 84 } 85 86 // WithPayload adds the payload to the get endpoint Id invalid response 87 func (o *GetEndpointIDInvalid) WithPayload(payload models.Error) *GetEndpointIDInvalid { 88 o.Payload = payload 89 return o 90 } 91 92 // SetPayload sets the payload to the get endpoint Id invalid response 93 func (o *GetEndpointIDInvalid) SetPayload(payload models.Error) { 94 o.Payload = payload 95 } 96 97 // WriteResponse to the client 98 func (o *GetEndpointIDInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 99 100 rw.WriteHeader(400) 101 payload := o.Payload 102 if err := producer.Produce(rw, payload); err != nil { 103 panic(err) // let the recovery middleware deal with this 104 } 105 } 106 107 // GetEndpointIDNotFoundCode is the HTTP code returned for type GetEndpointIDNotFound 108 const GetEndpointIDNotFoundCode int = 404 109 110 /* 111 GetEndpointIDNotFound Endpoint not found 112 113 swagger:response getEndpointIdNotFound 114 */ 115 type GetEndpointIDNotFound struct { 116 } 117 118 // NewGetEndpointIDNotFound creates GetEndpointIDNotFound with default headers values 119 func NewGetEndpointIDNotFound() *GetEndpointIDNotFound { 120 121 return &GetEndpointIDNotFound{} 122 } 123 124 // WriteResponse to the client 125 func (o *GetEndpointIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 126 127 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 128 129 rw.WriteHeader(404) 130 } 131 132 // GetEndpointIDTooManyRequestsCode is the HTTP code returned for type GetEndpointIDTooManyRequests 133 const GetEndpointIDTooManyRequestsCode int = 429 134 135 /* 136 GetEndpointIDTooManyRequests Rate-limiting too many requests in the given time frame 137 138 swagger:response getEndpointIdTooManyRequests 139 */ 140 type GetEndpointIDTooManyRequests struct { 141 } 142 143 // NewGetEndpointIDTooManyRequests creates GetEndpointIDTooManyRequests with default headers values 144 func NewGetEndpointIDTooManyRequests() *GetEndpointIDTooManyRequests { 145 146 return &GetEndpointIDTooManyRequests{} 147 } 148 149 // WriteResponse to the client 150 func (o *GetEndpointIDTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 151 152 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 153 154 rw.WriteHeader(429) 155 }