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