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