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