Skip to content

Commit 19af3c6

Browse files
feat(api): add sort option to ListAuditLogs
1 parent 95504c7 commit 19af3c6

15 files changed

Lines changed: 75 additions & 20 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 180
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6afce08fcd8bf2db43a1bf23cd3d0e26cfd58038a4886a0b93905ed32a270976.yml
3-
openapi_spec_hash: 7e68abc261b93d149fe5274a4033fe7f
4-
config_hash: 929b044c214da0da793e235847333d89
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-426f3adea47f1f9969b3ace193806d0b5c6cca002b59f1306ff55a53ba184d41.yml
3+
openapi_spec_hash: c4f8786a933b74d658f315ed5587b4bd
4+
config_hash: 65442903d648b9f87a032fc0a4823e62

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ from gitpod.types import (
1818
ResourceType,
1919
RunsOn,
2020
SecretRef,
21+
Sort,
22+
SortOrder,
2123
State,
2224
Subject,
2325
Task,
@@ -572,8 +574,6 @@ from gitpod.types import (
572574
ProjectPhase,
573575
ProjectPrebuildConfiguration,
574576
RecommendedEditors,
575-
Sort,
576-
SortOrder,
577577
ProjectCreateResponse,
578578
ProjectRetrieveResponse,
579579
ProjectUpdateResponse,

src/gitpod/resources/events.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ..pagination import SyncEntriesPage, AsyncEntriesPage
2121
from .._base_client import AsyncPaginator, make_request_options
2222
from .._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder
23+
from ..types.shared_params.sort import Sort
2324
from ..types.event_list_response import EventListResponse
2425
from ..types.event_watch_response import EventWatchResponse
2526

@@ -53,6 +54,7 @@ def list(
5354
page_size: int | Omit = omit,
5455
filter: event_list_params.Filter | Omit = omit,
5556
pagination: event_list_params.Pagination | Omit = omit,
57+
sort: Sort | Omit = omit,
5658
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5759
# The extra values given here take precedence over values defined on the client or passed to this method.
5860
extra_headers: Headers | None = None,
@@ -99,7 +101,10 @@ def list(
99101
```
100102
101103
Args:
102-
pagination: pagination contains the pagination options for listing environments
104+
pagination: pagination contains the pagination options for listing audit logs
105+
106+
sort: sort specifies the order of results. When unspecified, results are sorted by
107+
creation time descending (newest first). Supported sort fields: createdAt.
103108
104109
extra_headers: Send extra headers
105110
@@ -116,6 +121,7 @@ def list(
116121
{
117122
"filter": filter,
118123
"pagination": pagination,
124+
"sort": sort,
119125
},
120126
event_list_params.EventListParams,
121127
),
@@ -235,6 +241,7 @@ def list(
235241
page_size: int | Omit = omit,
236242
filter: event_list_params.Filter | Omit = omit,
237243
pagination: event_list_params.Pagination | Omit = omit,
244+
sort: Sort | Omit = omit,
238245
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
239246
# The extra values given here take precedence over values defined on the client or passed to this method.
240247
extra_headers: Headers | None = None,
@@ -281,7 +288,10 @@ def list(
281288
```
282289
283290
Args:
284-
pagination: pagination contains the pagination options for listing environments
291+
pagination: pagination contains the pagination options for listing audit logs
292+
293+
sort: sort specifies the order of results. When unspecified, results are sorted by
294+
creation time descending (newest first). Supported sort fields: createdAt.
285295
286296
extra_headers: Send extra headers
287297
@@ -298,6 +308,7 @@ def list(
298308
{
299309
"filter": filter,
300310
"pagination": pagination,
311+
"sort": sort,
301312
},
302313
event_list_params.EventListParams,
303314
),

src/gitpod/resources/projects/projects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from ...pagination import SyncProjectsPage, AsyncProjectsPage
3939
from ..._base_client import AsyncPaginator, make_request_options
4040
from ...types.project import Project
41-
from ...types.sort_param import SortParam
4241
from .environment_clases import (
4342
EnvironmentClasesResource,
4443
AsyncEnvironmentClasesResource,
@@ -47,6 +46,7 @@
4746
EnvironmentClasesResourceWithStreamingResponse,
4847
AsyncEnvironmentClasesResourceWithStreamingResponse,
4948
)
49+
from ...types.shared_params.sort import Sort
5050
from ...types.project_create_response import ProjectCreateResponse
5151
from ...types.project_update_response import ProjectUpdateResponse
5252
from ...types.project_retrieve_response import ProjectRetrieveResponse
@@ -365,7 +365,7 @@ def list(
365365
page_size: int | Omit = omit,
366366
filter: project_list_params.Filter | Omit = omit,
367367
pagination: project_list_params.Pagination | Omit = omit,
368-
sort: SortParam | Omit = omit,
368+
sort: Sort | Omit = omit,
369369
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
370370
# The extra values given here take precedence over values defined on the client or passed to this method.
371371
extra_headers: Headers | None = None,
@@ -1020,7 +1020,7 @@ def list(
10201020
page_size: int | Omit = omit,
10211021
filter: project_list_params.Filter | Omit = omit,
10221022
pagination: project_list_params.Pagination | Omit = omit,
1023-
sort: SortParam | Omit = omit,
1023+
sort: Sort | Omit = omit,
10241024
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10251025
# The extra values given here take precedence over values defined on the client or passed to this method.
10261026
extra_headers: Headers | None = None,

src/gitpod/types/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from .runner import Runner as Runner
1313
from .secret import Secret as Secret
1414
from .shared import (
15+
Sort as Sort,
1516
Task as Task,
1617
State as State,
1718
RunsOn as RunsOn,
@@ -21,6 +22,7 @@
2122
ErrorCode as ErrorCode,
2223
Principal as Principal,
2324
SecretRef as SecretRef,
25+
SortOrder as SortOrder,
2426
FieldValue as FieldValue,
2527
UserStatus as UserStatus,
2628
ResourceRole as ResourceRole,
@@ -46,8 +48,6 @@
4648
from .log_level import LogLevel as LogLevel
4749
from .warm_pool import WarmPool as WarmPool
4850
from .agent_mode import AgentMode as AgentMode
49-
from .sort_order import SortOrder as SortOrder
50-
from .sort_param import SortParam as SortParam
5151
from .veto_param import VetoParam as VetoParam
5252
from .environment import Environment as Environment
5353
from .error_level import ErrorLevel as ErrorLevel

src/gitpod/types/event_list_params.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .._types import SequenceNotStr
1010
from .._utils import PropertyInfo
1111
from .shared.principal import Principal
12+
from .shared_params.sort import Sort
1213
from .shared.resource_type import ResourceType
1314

1415
__all__ = ["EventListParams", "Filter", "Pagination"]
@@ -22,7 +23,14 @@ class EventListParams(TypedDict, total=False):
2223
filter: Filter
2324

2425
pagination: Pagination
25-
"""pagination contains the pagination options for listing environments"""
26+
"""pagination contains the pagination options for listing audit logs"""
27+
28+
sort: Sort
29+
"""sort specifies the order of results.
30+
31+
When unspecified, results are sorted by creation time descending (newest first).
32+
Supported sort fields: createdAt.
33+
"""
2634

2735

2836
_FilterReservedKeywords = TypedDict(
@@ -48,7 +56,7 @@ class Filter(_FilterReservedKeywords, total=False):
4856

4957

5058
class Pagination(TypedDict, total=False):
51-
"""pagination contains the pagination options for listing environments"""
59+
"""pagination contains the pagination options for listing audit logs"""
5260

5361
token: str
5462
"""

src/gitpod/types/organization_list_members_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
10-
from .sort_order import SortOrder
10+
from .shared.sort_order import SortOrder
1111
from .shared.user_status import UserStatus
1212
from .shared.organization_role import OrganizationRole
1313

src/gitpod/types/project_list_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
10-
from .sort_param import SortParam
1110
from .runner_kind import RunnerKind
11+
from .shared_params.sort import Sort
1212

1313
__all__ = ["ProjectListParams", "Filter", "Pagination"]
1414

@@ -23,7 +23,7 @@ class ProjectListParams(TypedDict, total=False):
2323
pagination: Pagination
2424
"""pagination contains the pagination options for listing organizations"""
2525

26-
sort: SortParam
26+
sort: Sort
2727
"""sort specifies the order of results. Defaults to popularity descending.
2828
2929
Supported fields:

src/gitpod/types/shared/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .sort import Sort as Sort
34
from .task import Task as Task
45
from .state import State as State
56
from .gateway import Gateway as Gateway
@@ -9,6 +10,7 @@
910
from .task_spec import TaskSpec as TaskSpec
1011
from .error_code import ErrorCode as ErrorCode
1112
from .secret_ref import SecretRef as SecretRef
13+
from .sort_order import SortOrder as SortOrder
1214
from .field_value import FieldValue as FieldValue
1315
from .user_status import UserStatus as UserStatus
1416
from .resource_role import ResourceRole as ResourceRole

src/gitpod/types/shared/sort.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from ..._models import BaseModel
6+
from .sort_order import SortOrder
7+
8+
__all__ = ["Sort"]
9+
10+
11+
class Sort(BaseModel):
12+
field: Optional[str] = None
13+
"""Field name to sort by, in camelCase."""
14+
15+
order: Optional[SortOrder] = None

0 commit comments

Comments
 (0)