github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/get_endpoint_id_config_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 "fmt" 13 "io" 14 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/strfmt" 17 18 "github.com/cilium/cilium/api/v1/models" 19 ) 20 21 // GetEndpointIDConfigReader is a Reader for the GetEndpointIDConfig structure. 22 type GetEndpointIDConfigReader struct { 23 formats strfmt.Registry 24 } 25 26 // ReadResponse reads a server response into the received o. 27 func (o *GetEndpointIDConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 28 switch response.Code() { 29 case 200: 30 result := NewGetEndpointIDConfigOK() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return result, nil 35 case 404: 36 result := NewGetEndpointIDConfigNotFound() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 case 429: 42 result := NewGetEndpointIDConfigTooManyRequests() 43 if err := result.readResponse(response, consumer, o.formats); err != nil { 44 return nil, err 45 } 46 return nil, result 47 default: 48 return nil, runtime.NewAPIError("[GET /endpoint/{id}/config] GetEndpointIDConfig", response, response.Code()) 49 } 50 } 51 52 // NewGetEndpointIDConfigOK creates a GetEndpointIDConfigOK with default headers values 53 func NewGetEndpointIDConfigOK() *GetEndpointIDConfigOK { 54 return &GetEndpointIDConfigOK{} 55 } 56 57 /* 58 GetEndpointIDConfigOK describes a response with status code 200, with default header values. 59 60 Success 61 */ 62 type GetEndpointIDConfigOK struct { 63 Payload *models.EndpointConfigurationStatus 64 } 65 66 // IsSuccess returns true when this get endpoint Id config o k response has a 2xx status code 67 func (o *GetEndpointIDConfigOK) IsSuccess() bool { 68 return true 69 } 70 71 // IsRedirect returns true when this get endpoint Id config o k response has a 3xx status code 72 func (o *GetEndpointIDConfigOK) IsRedirect() bool { 73 return false 74 } 75 76 // IsClientError returns true when this get endpoint Id config o k response has a 4xx status code 77 func (o *GetEndpointIDConfigOK) IsClientError() bool { 78 return false 79 } 80 81 // IsServerError returns true when this get endpoint Id config o k response has a 5xx status code 82 func (o *GetEndpointIDConfigOK) IsServerError() bool { 83 return false 84 } 85 86 // IsCode returns true when this get endpoint Id config o k response a status code equal to that given 87 func (o *GetEndpointIDConfigOK) IsCode(code int) bool { 88 return code == 200 89 } 90 91 // Code gets the status code for the get endpoint Id config o k response 92 func (o *GetEndpointIDConfigOK) Code() int { 93 return 200 94 } 95 96 func (o *GetEndpointIDConfigOK) Error() string { 97 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigOK %+v", 200, o.Payload) 98 } 99 100 func (o *GetEndpointIDConfigOK) String() string { 101 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigOK %+v", 200, o.Payload) 102 } 103 104 func (o *GetEndpointIDConfigOK) GetPayload() *models.EndpointConfigurationStatus { 105 return o.Payload 106 } 107 108 func (o *GetEndpointIDConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 109 110 o.Payload = new(models.EndpointConfigurationStatus) 111 112 // response payload 113 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 114 return err 115 } 116 117 return nil 118 } 119 120 // NewGetEndpointIDConfigNotFound creates a GetEndpointIDConfigNotFound with default headers values 121 func NewGetEndpointIDConfigNotFound() *GetEndpointIDConfigNotFound { 122 return &GetEndpointIDConfigNotFound{} 123 } 124 125 /* 126 GetEndpointIDConfigNotFound describes a response with status code 404, with default header values. 127 128 Endpoint not found 129 */ 130 type GetEndpointIDConfigNotFound struct { 131 } 132 133 // IsSuccess returns true when this get endpoint Id config not found response has a 2xx status code 134 func (o *GetEndpointIDConfigNotFound) IsSuccess() bool { 135 return false 136 } 137 138 // IsRedirect returns true when this get endpoint Id config not found response has a 3xx status code 139 func (o *GetEndpointIDConfigNotFound) IsRedirect() bool { 140 return false 141 } 142 143 // IsClientError returns true when this get endpoint Id config not found response has a 4xx status code 144 func (o *GetEndpointIDConfigNotFound) IsClientError() bool { 145 return true 146 } 147 148 // IsServerError returns true when this get endpoint Id config not found response has a 5xx status code 149 func (o *GetEndpointIDConfigNotFound) IsServerError() bool { 150 return false 151 } 152 153 // IsCode returns true when this get endpoint Id config not found response a status code equal to that given 154 func (o *GetEndpointIDConfigNotFound) IsCode(code int) bool { 155 return code == 404 156 } 157 158 // Code gets the status code for the get endpoint Id config not found response 159 func (o *GetEndpointIDConfigNotFound) Code() int { 160 return 404 161 } 162 163 func (o *GetEndpointIDConfigNotFound) Error() string { 164 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigNotFound ", 404) 165 } 166 167 func (o *GetEndpointIDConfigNotFound) String() string { 168 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigNotFound ", 404) 169 } 170 171 func (o *GetEndpointIDConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 172 173 return nil 174 } 175 176 // NewGetEndpointIDConfigTooManyRequests creates a GetEndpointIDConfigTooManyRequests with default headers values 177 func NewGetEndpointIDConfigTooManyRequests() *GetEndpointIDConfigTooManyRequests { 178 return &GetEndpointIDConfigTooManyRequests{} 179 } 180 181 /* 182 GetEndpointIDConfigTooManyRequests describes a response with status code 429, with default header values. 183 184 Rate-limiting too many requests in the given time frame 185 */ 186 type GetEndpointIDConfigTooManyRequests struct { 187 } 188 189 // IsSuccess returns true when this get endpoint Id config too many requests response has a 2xx status code 190 func (o *GetEndpointIDConfigTooManyRequests) IsSuccess() bool { 191 return false 192 } 193 194 // IsRedirect returns true when this get endpoint Id config too many requests response has a 3xx status code 195 func (o *GetEndpointIDConfigTooManyRequests) IsRedirect() bool { 196 return false 197 } 198 199 // IsClientError returns true when this get endpoint Id config too many requests response has a 4xx status code 200 func (o *GetEndpointIDConfigTooManyRequests) IsClientError() bool { 201 return true 202 } 203 204 // IsServerError returns true when this get endpoint Id config too many requests response has a 5xx status code 205 func (o *GetEndpointIDConfigTooManyRequests) IsServerError() bool { 206 return false 207 } 208 209 // IsCode returns true when this get endpoint Id config too many requests response a status code equal to that given 210 func (o *GetEndpointIDConfigTooManyRequests) IsCode(code int) bool { 211 return code == 429 212 } 213 214 // Code gets the status code for the get endpoint Id config too many requests response 215 func (o *GetEndpointIDConfigTooManyRequests) Code() int { 216 return 429 217 } 218 219 func (o *GetEndpointIDConfigTooManyRequests) Error() string { 220 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigTooManyRequests ", 429) 221 } 222 223 func (o *GetEndpointIDConfigTooManyRequests) String() string { 224 return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigTooManyRequests ", 429) 225 } 226 227 func (o *GetEndpointIDConfigTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 228 229 return nil 230 }