Skip to content

Commit 0eb24b8

Browse files
feat: [backend/api] add backend search for group members
1 parent b10dcb9 commit 0eb24b8

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
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-10e4732dd5dee452719295e8f173113c23a344aef1303c499da41483996eebd3.yml
3-
openapi_spec_hash: 8bd2f5a641f38119443a9441e6b2f509
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0ce6b31b2b602e71c429c0a3b6badb639c6a8efdda66ae724abaf57cdd279429.yml
3+
openapi_spec_hash: 36b42ad4f9be97ce27e8d2243a3f9e1c
44
config_hash: 616ec36ed369bae528a26b639b765754

src/gitpod/resources/groups/memberships.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def list(
182182
*,
183183
token: str | Omit = omit,
184184
page_size: int | Omit = omit,
185+
filter: membership_list_params.Filter | Omit = omit,
185186
group_id: str | Omit = omit,
186187
pagination: membership_list_params.Pagination | Omit = omit,
187188
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -216,6 +217,8 @@ def list(
216217
All organization members can view group membership (transparency model).
217218
218219
Args:
220+
filter: filter contains options for filtering the list of memberships.
221+
219222
pagination: pagination contains the pagination options for listing memberships
220223
221224
extra_headers: Send extra headers
@@ -231,6 +234,7 @@ def list(
231234
page=SyncMembersPage[GroupMembership],
232235
body=maybe_transform(
233236
{
237+
"filter": filter,
234238
"group_id": group_id,
235239
"pagination": pagination,
236240
},
@@ -460,6 +464,7 @@ def list(
460464
*,
461465
token: str | Omit = omit,
462466
page_size: int | Omit = omit,
467+
filter: membership_list_params.Filter | Omit = omit,
463468
group_id: str | Omit = omit,
464469
pagination: membership_list_params.Pagination | Omit = omit,
465470
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -494,6 +499,8 @@ def list(
494499
All organization members can view group membership (transparency model).
495500
496501
Args:
502+
filter: filter contains options for filtering the list of memberships.
503+
497504
pagination: pagination contains the pagination options for listing memberships
498505
499506
extra_headers: Send extra headers
@@ -509,6 +516,7 @@ def list(
509516
page=AsyncMembersPage[GroupMembership],
510517
body=maybe_transform(
511518
{
519+
"filter": filter,
512520
"group_id": group_id,
513521
"pagination": pagination,
514522
},

src/gitpod/types/groups/membership_list_params.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,33 @@
66

77
from ..._utils import PropertyInfo
88

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

1111

1212
class MembershipListParams(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 memberships."""
19+
1720
group_id: Annotated[str, PropertyInfo(alias="groupId")]
1821

1922
pagination: Pagination
2023
"""pagination contains the pagination options for listing memberships"""
2124

2225

26+
class Filter(TypedDict, total=False):
27+
"""filter contains options for filtering the list of memberships."""
28+
29+
search: str
30+
"""
31+
search performs case-insensitive search across member name, email, ID, and
32+
service account name and description
33+
"""
34+
35+
2336
class Pagination(TypedDict, total=False):
2437
"""pagination contains the pagination options for listing memberships"""
2538

tests/api_resources/groups/test_memberships.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
120120
membership = client.groups.memberships.list(
121121
token="token",
122122
page_size=0,
123+
filter={"search": "search"},
123124
group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
124125
pagination={
125126
"token": "token",
@@ -290,6 +291,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
290291
membership = await async_client.groups.memberships.list(
291292
token="token",
292293
page_size=0,
294+
filter={"search": "search"},
293295
group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
294296
pagination={
295297
"token": "token",

0 commit comments

Comments
 (0)