github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/systeminfo/get_volumes_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package systeminfo 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 "fmt" 10 "io" 11 12 "github.com/go-openapi/runtime" 13 "github.com/go-openapi/strfmt" 14 15 "github.com/goharbor/go-client/pkg/sdk/v2.0/models" 16 ) 17 18 // GetVolumesReader is a Reader for the GetVolumes structure. 19 type GetVolumesReader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *GetVolumesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewGetVolumesOK() 28 if err := result.readResponse(response, consumer, o.formats); err != nil { 29 return nil, err 30 } 31 return result, nil 32 case 401: 33 result := NewGetVolumesUnauthorized() 34 if err := result.readResponse(response, consumer, o.formats); err != nil { 35 return nil, err 36 } 37 return nil, result 38 case 403: 39 result := NewGetVolumesForbidden() 40 if err := result.readResponse(response, consumer, o.formats); err != nil { 41 return nil, err 42 } 43 return nil, result 44 case 404: 45 result := NewGetVolumesNotFound() 46 if err := result.readResponse(response, consumer, o.formats); err != nil { 47 return nil, err 48 } 49 return nil, result 50 case 500: 51 result := NewGetVolumesInternalServerError() 52 if err := result.readResponse(response, consumer, o.formats); err != nil { 53 return nil, err 54 } 55 return nil, result 56 default: 57 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 58 } 59 } 60 61 // NewGetVolumesOK creates a GetVolumesOK with default headers values 62 func NewGetVolumesOK() *GetVolumesOK { 63 return &GetVolumesOK{} 64 } 65 66 /* 67 GetVolumesOK describes a response with status code 200, with default header values. 68 69 Get system volumes successfully. 70 */ 71 type GetVolumesOK struct { 72 Payload *models.SystemInfo 73 } 74 75 // IsSuccess returns true when this get volumes o k response has a 2xx status code 76 func (o *GetVolumesOK) IsSuccess() bool { 77 return true 78 } 79 80 // IsRedirect returns true when this get volumes o k response has a 3xx status code 81 func (o *GetVolumesOK) IsRedirect() bool { 82 return false 83 } 84 85 // IsClientError returns true when this get volumes o k response has a 4xx status code 86 func (o *GetVolumesOK) IsClientError() bool { 87 return false 88 } 89 90 // IsServerError returns true when this get volumes o k response has a 5xx status code 91 func (o *GetVolumesOK) IsServerError() bool { 92 return false 93 } 94 95 // IsCode returns true when this get volumes o k response a status code equal to that given 96 func (o *GetVolumesOK) IsCode(code int) bool { 97 return code == 200 98 } 99 100 func (o *GetVolumesOK) Error() string { 101 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesOK %+v", 200, o.Payload) 102 } 103 104 func (o *GetVolumesOK) String() string { 105 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesOK %+v", 200, o.Payload) 106 } 107 108 func (o *GetVolumesOK) GetPayload() *models.SystemInfo { 109 return o.Payload 110 } 111 112 func (o *GetVolumesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 113 114 o.Payload = new(models.SystemInfo) 115 116 // response payload 117 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 118 return err 119 } 120 121 return nil 122 } 123 124 // NewGetVolumesUnauthorized creates a GetVolumesUnauthorized with default headers values 125 func NewGetVolumesUnauthorized() *GetVolumesUnauthorized { 126 return &GetVolumesUnauthorized{} 127 } 128 129 /* 130 GetVolumesUnauthorized describes a response with status code 401, with default header values. 131 132 Unauthorized 133 */ 134 type GetVolumesUnauthorized struct { 135 136 /* The ID of the corresponding request for the response 137 */ 138 XRequestID string 139 140 Payload *models.Errors 141 } 142 143 // IsSuccess returns true when this get volumes unauthorized response has a 2xx status code 144 func (o *GetVolumesUnauthorized) IsSuccess() bool { 145 return false 146 } 147 148 // IsRedirect returns true when this get volumes unauthorized response has a 3xx status code 149 func (o *GetVolumesUnauthorized) IsRedirect() bool { 150 return false 151 } 152 153 // IsClientError returns true when this get volumes unauthorized response has a 4xx status code 154 func (o *GetVolumesUnauthorized) IsClientError() bool { 155 return true 156 } 157 158 // IsServerError returns true when this get volumes unauthorized response has a 5xx status code 159 func (o *GetVolumesUnauthorized) IsServerError() bool { 160 return false 161 } 162 163 // IsCode returns true when this get volumes unauthorized response a status code equal to that given 164 func (o *GetVolumesUnauthorized) IsCode(code int) bool { 165 return code == 401 166 } 167 168 func (o *GetVolumesUnauthorized) Error() string { 169 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesUnauthorized %+v", 401, o.Payload) 170 } 171 172 func (o *GetVolumesUnauthorized) String() string { 173 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesUnauthorized %+v", 401, o.Payload) 174 } 175 176 func (o *GetVolumesUnauthorized) GetPayload() *models.Errors { 177 return o.Payload 178 } 179 180 func (o *GetVolumesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 181 182 // hydrates response header X-Request-Id 183 hdrXRequestID := response.GetHeader("X-Request-Id") 184 185 if hdrXRequestID != "" { 186 o.XRequestID = hdrXRequestID 187 } 188 189 o.Payload = new(models.Errors) 190 191 // response payload 192 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 193 return err 194 } 195 196 return nil 197 } 198 199 // NewGetVolumesForbidden creates a GetVolumesForbidden with default headers values 200 func NewGetVolumesForbidden() *GetVolumesForbidden { 201 return &GetVolumesForbidden{} 202 } 203 204 /* 205 GetVolumesForbidden describes a response with status code 403, with default header values. 206 207 Forbidden 208 */ 209 type GetVolumesForbidden struct { 210 211 /* The ID of the corresponding request for the response 212 */ 213 XRequestID string 214 215 Payload *models.Errors 216 } 217 218 // IsSuccess returns true when this get volumes forbidden response has a 2xx status code 219 func (o *GetVolumesForbidden) IsSuccess() bool { 220 return false 221 } 222 223 // IsRedirect returns true when this get volumes forbidden response has a 3xx status code 224 func (o *GetVolumesForbidden) IsRedirect() bool { 225 return false 226 } 227 228 // IsClientError returns true when this get volumes forbidden response has a 4xx status code 229 func (o *GetVolumesForbidden) IsClientError() bool { 230 return true 231 } 232 233 // IsServerError returns true when this get volumes forbidden response has a 5xx status code 234 func (o *GetVolumesForbidden) IsServerError() bool { 235 return false 236 } 237 238 // IsCode returns true when this get volumes forbidden response a status code equal to that given 239 func (o *GetVolumesForbidden) IsCode(code int) bool { 240 return code == 403 241 } 242 243 func (o *GetVolumesForbidden) Error() string { 244 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesForbidden %+v", 403, o.Payload) 245 } 246 247 func (o *GetVolumesForbidden) String() string { 248 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesForbidden %+v", 403, o.Payload) 249 } 250 251 func (o *GetVolumesForbidden) GetPayload() *models.Errors { 252 return o.Payload 253 } 254 255 func (o *GetVolumesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 256 257 // hydrates response header X-Request-Id 258 hdrXRequestID := response.GetHeader("X-Request-Id") 259 260 if hdrXRequestID != "" { 261 o.XRequestID = hdrXRequestID 262 } 263 264 o.Payload = new(models.Errors) 265 266 // response payload 267 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 268 return err 269 } 270 271 return nil 272 } 273 274 // NewGetVolumesNotFound creates a GetVolumesNotFound with default headers values 275 func NewGetVolumesNotFound() *GetVolumesNotFound { 276 return &GetVolumesNotFound{} 277 } 278 279 /* 280 GetVolumesNotFound describes a response with status code 404, with default header values. 281 282 Not found 283 */ 284 type GetVolumesNotFound struct { 285 286 /* The ID of the corresponding request for the response 287 */ 288 XRequestID string 289 290 Payload *models.Errors 291 } 292 293 // IsSuccess returns true when this get volumes not found response has a 2xx status code 294 func (o *GetVolumesNotFound) IsSuccess() bool { 295 return false 296 } 297 298 // IsRedirect returns true when this get volumes not found response has a 3xx status code 299 func (o *GetVolumesNotFound) IsRedirect() bool { 300 return false 301 } 302 303 // IsClientError returns true when this get volumes not found response has a 4xx status code 304 func (o *GetVolumesNotFound) IsClientError() bool { 305 return true 306 } 307 308 // IsServerError returns true when this get volumes not found response has a 5xx status code 309 func (o *GetVolumesNotFound) IsServerError() bool { 310 return false 311 } 312 313 // IsCode returns true when this get volumes not found response a status code equal to that given 314 func (o *GetVolumesNotFound) IsCode(code int) bool { 315 return code == 404 316 } 317 318 func (o *GetVolumesNotFound) Error() string { 319 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesNotFound %+v", 404, o.Payload) 320 } 321 322 func (o *GetVolumesNotFound) String() string { 323 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesNotFound %+v", 404, o.Payload) 324 } 325 326 func (o *GetVolumesNotFound) GetPayload() *models.Errors { 327 return o.Payload 328 } 329 330 func (o *GetVolumesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 331 332 // hydrates response header X-Request-Id 333 hdrXRequestID := response.GetHeader("X-Request-Id") 334 335 if hdrXRequestID != "" { 336 o.XRequestID = hdrXRequestID 337 } 338 339 o.Payload = new(models.Errors) 340 341 // response payload 342 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 343 return err 344 } 345 346 return nil 347 } 348 349 // NewGetVolumesInternalServerError creates a GetVolumesInternalServerError with default headers values 350 func NewGetVolumesInternalServerError() *GetVolumesInternalServerError { 351 return &GetVolumesInternalServerError{} 352 } 353 354 /* 355 GetVolumesInternalServerError describes a response with status code 500, with default header values. 356 357 Internal server error 358 */ 359 type GetVolumesInternalServerError struct { 360 361 /* The ID of the corresponding request for the response 362 */ 363 XRequestID string 364 365 Payload *models.Errors 366 } 367 368 // IsSuccess returns true when this get volumes internal server error response has a 2xx status code 369 func (o *GetVolumesInternalServerError) IsSuccess() bool { 370 return false 371 } 372 373 // IsRedirect returns true when this get volumes internal server error response has a 3xx status code 374 func (o *GetVolumesInternalServerError) IsRedirect() bool { 375 return false 376 } 377 378 // IsClientError returns true when this get volumes internal server error response has a 4xx status code 379 func (o *GetVolumesInternalServerError) IsClientError() bool { 380 return false 381 } 382 383 // IsServerError returns true when this get volumes internal server error response has a 5xx status code 384 func (o *GetVolumesInternalServerError) IsServerError() bool { 385 return true 386 } 387 388 // IsCode returns true when this get volumes internal server error response a status code equal to that given 389 func (o *GetVolumesInternalServerError) IsCode(code int) bool { 390 return code == 500 391 } 392 393 func (o *GetVolumesInternalServerError) Error() string { 394 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesInternalServerError %+v", 500, o.Payload) 395 } 396 397 func (o *GetVolumesInternalServerError) String() string { 398 return fmt.Sprintf("[GET /systeminfo/volumes][%d] getVolumesInternalServerError %+v", 500, o.Payload) 399 } 400 401 func (o *GetVolumesInternalServerError) GetPayload() *models.Errors { 402 return o.Payload 403 } 404 405 func (o *GetVolumesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 406 407 // hydrates response header X-Request-Id 408 hdrXRequestID := response.GetHeader("X-Request-Id") 409 410 if hdrXRequestID != "" { 411 o.XRequestID = hdrXRequestID 412 } 413 414 o.Payload = new(models.Errors) 415 416 // response payload 417 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 418 return err 419 } 420 421 return nil 422 }