2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Type , Optional , cast
5
+ from typing import Type , Union , Optional , cast
6
+ from datetime import datetime
7
+ from typing_extensions import Literal
6
8
7
9
import httpx
8
10
9
11
from ....._types import NOT_GIVEN , Body , Query , Headers , NotGiven
12
+ from ....._utils import (
13
+ maybe_transform ,
14
+ async_maybe_transform ,
15
+ )
10
16
from ....._compat import cached_property
11
17
from ....._resource import SyncAPIResource , AsyncAPIResource
12
18
from ....._response import (
19
25
from ....._base_client import (
20
26
make_request_options ,
21
27
)
28
+ from .....types .zero_trust .access .logs import access_request_list_params
22
29
from .....types .zero_trust .access .logs .access_request_list_response import AccessRequestListResponse
23
30
24
31
__all__ = ["AccessRequestsResource" , "AsyncAccessRequestsResource" ]
@@ -37,6 +44,10 @@ def list(
37
44
self ,
38
45
* ,
39
46
account_id : str ,
47
+ direction : Literal ["desc" , "asc" ] | NotGiven = NOT_GIVEN ,
48
+ limit : int | NotGiven = NOT_GIVEN ,
49
+ since : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
50
+ until : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
40
51
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
41
52
# The extra values given here take precedence over values defined on the client or passed to this method.
42
53
extra_headers : Headers | None = None ,
@@ -50,6 +61,14 @@ def list(
50
61
Args:
51
62
account_id: Identifier
52
63
64
+ direction: The chronological sorting order for the logs.
65
+
66
+ limit: The maximum number of log entries to retrieve.
67
+
68
+ since: The earliest event timestamp to query.
69
+
70
+ until: The latest event timestamp to query.
71
+
53
72
extra_headers: Send extra headers
54
73
55
74
extra_query: Add additional query parameters to the request
@@ -67,6 +86,15 @@ def list(
67
86
extra_query = extra_query ,
68
87
extra_body = extra_body ,
69
88
timeout = timeout ,
89
+ query = maybe_transform (
90
+ {
91
+ "direction" : direction ,
92
+ "limit" : limit ,
93
+ "since" : since ,
94
+ "until" : until ,
95
+ },
96
+ access_request_list_params .AccessRequestListParams ,
97
+ ),
70
98
post_parser = ResultWrapper [Optional [AccessRequestListResponse ]]._unwrapper ,
71
99
),
72
100
cast_to = cast (Type [Optional [AccessRequestListResponse ]], ResultWrapper [AccessRequestListResponse ]),
@@ -86,6 +114,10 @@ async def list(
86
114
self ,
87
115
* ,
88
116
account_id : str ,
117
+ direction : Literal ["desc" , "asc" ] | NotGiven = NOT_GIVEN ,
118
+ limit : int | NotGiven = NOT_GIVEN ,
119
+ since : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
120
+ until : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
89
121
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
90
122
# The extra values given here take precedence over values defined on the client or passed to this method.
91
123
extra_headers : Headers | None = None ,
@@ -99,6 +131,14 @@ async def list(
99
131
Args:
100
132
account_id: Identifier
101
133
134
+ direction: The chronological sorting order for the logs.
135
+
136
+ limit: The maximum number of log entries to retrieve.
137
+
138
+ since: The earliest event timestamp to query.
139
+
140
+ until: The latest event timestamp to query.
141
+
102
142
extra_headers: Send extra headers
103
143
104
144
extra_query: Add additional query parameters to the request
@@ -116,6 +156,15 @@ async def list(
116
156
extra_query = extra_query ,
117
157
extra_body = extra_body ,
118
158
timeout = timeout ,
159
+ query = await async_maybe_transform (
160
+ {
161
+ "direction" : direction ,
162
+ "limit" : limit ,
163
+ "since" : since ,
164
+ "until" : until ,
165
+ },
166
+ access_request_list_params .AccessRequestListParams ,
167
+ ),
119
168
post_parser = ResultWrapper [Optional [AccessRequestListResponse ]]._unwrapper ,
120
169
),
121
170
cast_to = cast (Type [Optional [AccessRequestListResponse ]], ResultWrapper [AccessRequestListResponse ]),
0 commit comments