(query string, page codersdk.Pagination)
| 479 | } |
| 480 | |
| 481 | func AIBridgeClients(query string, page codersdk.Pagination) (database.ListAIBridgeClientsParams, []codersdk.ValidationError) { |
| 482 | // nolint:exhaustruct // Empty values just means "don't filter by that field". |
| 483 | filter := database.ListAIBridgeClientsParams{ |
| 484 | // #nosec G115 - Safe conversion for pagination offset which is expected to be within int32 range |
| 485 | Offset: int32(page.Offset), |
| 486 | // #nosec G115 - Safe conversion for pagination limit which is expected to be within int32 range |
| 487 | Limit: int32(page.Limit), |
| 488 | } |
| 489 | |
| 490 | if query == "" { |
| 491 | return filter, nil |
| 492 | } |
| 493 | |
| 494 | values, errors := searchTerms(query, func(term string, values url.Values) error { |
| 495 | values.Add("client", term) |
| 496 | return nil |
| 497 | }) |
| 498 | if len(errors) > 0 { |
| 499 | return filter, errors |
| 500 | } |
| 501 | |
| 502 | parser := httpapi.NewQueryParamParser() |
| 503 | filter.Client = parser.String(values, "", "client") |
| 504 | |
| 505 | parser.ErrorExcessParams(values) |
| 506 | return filter, parser.Errors |
| 507 | } |
| 508 | |
| 509 | // Tasks parses a search query for tasks. |
| 510 | // |
no test coverage detected