Skip to content

Commit 34fb372

Browse files
feat: [backend] Introduce role and member status filtering for ListMembers
1 parent 838e74c commit 34fb372

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
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: 160
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3a8fb9d6b9645a483a08206e944cc388325e210f0bd54daa9e15ee561a37fabc.yml
3-
openapi_spec_hash: fe42cbf3b012e4aebf56f64a675c3dd3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-13ed0159480c5c02ed02394764e7c528c1110cdc42d2a0ff5fac228f48403a08.yml
3+
openapi_spec_hash: e1b4c20a8a5faee0f2dd22b449e7a106
44
config_hash: f36d04c8359fe8baec226396a18b309e

src/gitpod/types/organization_list_members_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Literal, Required, Annotated, TypedDict
67

78
from .._utils import PropertyInfo
9+
from .shared.user_status import UserStatus
10+
from .shared.organization_role import OrganizationRole
811

912
__all__ = ["OrganizationListMembersParams", "Filter", "Pagination", "Sort"]
1013

@@ -33,9 +36,15 @@ class OrganizationListMembersParams(TypedDict, total=False):
3336

3437

3538
class Filter(TypedDict, total=False):
39+
roles: List[OrganizationRole]
40+
"""roles filters members by their organization role"""
41+
3642
search: str
3743
"""search performs case-insensitive search across member name and email"""
3844

45+
statuses: List[UserStatus]
46+
"""status filters members by their user status"""
47+
3948

4049
class Pagination(TypedDict, total=False):
4150
"""pagination contains the pagination options for listing members"""

src/gitpod/types/shared_params/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .task_spec import TaskSpec as TaskSpec
88
from .secret_ref import SecretRef as SecretRef
99
from .field_value import FieldValue as FieldValue
10+
from .user_status import UserStatus as UserStatus
1011
from .resource_type import ResourceType as ResourceType
1112
from .task_metadata import TaskMetadata as TaskMetadata
1213
from .environment_class import EnvironmentClass as EnvironmentClass
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, TypeAlias
6+
7+
__all__ = ["UserStatus"]
8+
9+
UserStatus: TypeAlias = Literal[
10+
"USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"
11+
]

tests/api_resources/test_organizations.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None:
266266
organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
267267
token="token",
268268
page_size=0,
269-
filter={"search": "search"},
269+
filter={
270+
"roles": ["ORGANIZATION_ROLE_UNSPECIFIED"],
271+
"search": "search",
272+
"statuses": ["USER_STATUS_UNSPECIFIED"],
273+
},
270274
pagination={
271275
"token": "token",
272276
"page_size": 20,
@@ -599,7 +603,11 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp
599603
organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
600604
token="token",
601605
page_size=0,
602-
filter={"search": "search"},
606+
filter={
607+
"roles": ["ORGANIZATION_ROLE_UNSPECIFIED"],
608+
"search": "search",
609+
"statuses": ["USER_STATUS_UNSPECIFIED"],
610+
},
603611
pagination={
604612
"token": "token",
605613
"page_size": 20,

0 commit comments

Comments
 (0)