Skip to content

Commit c21fcff

Browse files
feat(api): add filter parameter to groups list method
1 parent 36adf59 commit c21fcff

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 175
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b6950e81b6a48c630d396d3d36e8d4cfb10e92bb9839cddf44ecc7dd06bab57b.yml
3-
openapi_spec_hash: a9719dc002914a9fbb09bea594104777
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-776b637a72fdf509d1426a6fd7529f935fb920ba7dc55e4da9e32130f63df330.yml
3+
openapi_spec_hash: 43b107cede38b82de2a9812840ebd18f
44
config_hash: 46181938e983742bbe5ea736cb76993b

src/gitpod/resources/groups/groups.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def list(
270270
*,
271271
token: str | Omit = omit,
272272
page_size: int | Omit = omit,
273+
filter: group_list_params.Filter | Omit = omit,
273274
pagination: group_list_params.Pagination | Omit = omit,
274275
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
275276
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -314,6 +315,8 @@ def list(
314315
All organization members can list groups (transparency model).
315316
316317
Args:
318+
filter: filter contains options for filtering the list of groups.
319+
317320
pagination: pagination contains the pagination options for listing groups
318321
319322
extra_headers: Send extra headers
@@ -327,7 +330,13 @@ def list(
327330
return self._get_api_list(
328331
"/gitpod.v1.GroupService/ListGroups",
329332
page=SyncGroupsPage[Group],
330-
body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams),
333+
body=maybe_transform(
334+
{
335+
"filter": filter,
336+
"pagination": pagination,
337+
},
338+
group_list_params.GroupListParams,
339+
),
331340
options=make_request_options(
332341
extra_headers=extra_headers,
333342
extra_query=extra_query,
@@ -614,6 +623,7 @@ def list(
614623
*,
615624
token: str | Omit = omit,
616625
page_size: int | Omit = omit,
626+
filter: group_list_params.Filter | Omit = omit,
617627
pagination: group_list_params.Pagination | Omit = omit,
618628
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
619629
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -658,6 +668,8 @@ def list(
658668
All organization members can list groups (transparency model).
659669
660670
Args:
671+
filter: filter contains options for filtering the list of groups.
672+
661673
pagination: pagination contains the pagination options for listing groups
662674
663675
extra_headers: Send extra headers
@@ -671,7 +683,13 @@ def list(
671683
return self._get_api_list(
672684
"/gitpod.v1.GroupService/ListGroups",
673685
page=AsyncGroupsPage[Group],
674-
body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams),
686+
body=maybe_transform(
687+
{
688+
"filter": filter,
689+
"pagination": pagination,
690+
},
691+
group_list_params.GroupListParams,
692+
),
675693
options=make_request_options(
676694
extra_headers=extra_headers,
677695
extra_query=extra_query,

src/gitpod/types/group_list_params.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,28 @@
66

77
from .._utils import PropertyInfo
88

9-
__all__ = ["GroupListParams", "Pagination"]
9+
__all__ = ["GroupListParams", "Filter", "Pagination"]
1010

1111

1212
class GroupListParams(TypedDict, total=False):
1313
token: str
1414

1515
page_size: Annotated[int, PropertyInfo(alias="pageSize")]
1616

17+
filter: Filter
18+
"""filter contains options for filtering the list of groups."""
19+
1720
pagination: Pagination
1821
"""pagination contains the pagination options for listing groups"""
1922

2023

24+
class Filter(TypedDict, total=False):
25+
"""filter contains options for filtering the list of groups."""
26+
27+
search: str
28+
"""search performs case-insensitive search across group name, description, and ID"""
29+
30+
2131
class Pagination(TypedDict, total=False):
2232
"""pagination contains the pagination options for listing groups"""
2333

tests/api_resources/test_groups.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
147147
group = client.groups.list(
148148
token="token",
149149
page_size=0,
150+
filter={"search": "search"},
150151
pagination={
151152
"token": "token",
152153
"page_size": 20,
@@ -342,6 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
342343
group = await async_client.groups.list(
343344
token="token",
344345
page_size=0,
346+
filter={"search": "search"},
345347
pagination={
346348
"token": "token",
347349
"page_size": 20,

0 commit comments

Comments
 (0)