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