2
2
3
3
from __future__ import annotations
4
4
5
+ import httpx
6
+
7
+ from ...types import app_list_params
8
+ from ..._types import NOT_GIVEN , Body , Query , Headers , NotGiven
9
+ from ..._utils import maybe_transform , async_maybe_transform
5
10
from ..._compat import cached_property
6
11
from ..._resource import SyncAPIResource , AsyncAPIResource
12
+ from ..._response import (
13
+ to_raw_response_wrapper ,
14
+ to_streamed_response_wrapper ,
15
+ async_to_raw_response_wrapper ,
16
+ async_to_streamed_response_wrapper ,
17
+ )
7
18
from .deployments import (
8
19
DeploymentsResource ,
9
20
AsyncDeploymentsResource ,
20
31
InvocationsResourceWithStreamingResponse ,
21
32
AsyncInvocationsResourceWithStreamingResponse ,
22
33
)
34
+ from ..._base_client import make_request_options
35
+ from ...types .app_list_response import AppListResponse
23
36
24
37
__all__ = ["AppsResource" , "AsyncAppsResource" ]
25
38
@@ -52,6 +65,54 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse:
52
65
"""
53
66
return AppsResourceWithStreamingResponse (self )
54
67
68
+ def list (
69
+ self ,
70
+ * ,
71
+ app_name : str | NotGiven = NOT_GIVEN ,
72
+ version : str | NotGiven = NOT_GIVEN ,
73
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
74
+ # The extra values given here take precedence over values defined on the client or passed to this method.
75
+ extra_headers : Headers | None = None ,
76
+ extra_query : Query | None = None ,
77
+ extra_body : Body | None = None ,
78
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
79
+ ) -> AppListResponse :
80
+ """List application versions for the authenticated user.
81
+
82
+ Optionally filter by app
83
+ name and/or version label.
84
+
85
+ Args:
86
+ app_name: Filter results by application name.
87
+
88
+ version: Filter results by version label.
89
+
90
+ extra_headers: Send extra headers
91
+
92
+ extra_query: Add additional query parameters to the request
93
+
94
+ extra_body: Add additional JSON properties to the request
95
+
96
+ timeout: Override the client-level default timeout for this request, in seconds
97
+ """
98
+ return self ._get (
99
+ "/apps" ,
100
+ options = make_request_options (
101
+ extra_headers = extra_headers ,
102
+ extra_query = extra_query ,
103
+ extra_body = extra_body ,
104
+ timeout = timeout ,
105
+ query = maybe_transform (
106
+ {
107
+ "app_name" : app_name ,
108
+ "version" : version ,
109
+ },
110
+ app_list_params .AppListParams ,
111
+ ),
112
+ ),
113
+ cast_to = AppListResponse ,
114
+ )
115
+
55
116
56
117
class AsyncAppsResource (AsyncAPIResource ):
57
118
@cached_property
@@ -81,11 +142,63 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse:
81
142
"""
82
143
return AsyncAppsResourceWithStreamingResponse (self )
83
144
145
+ async def list (
146
+ self ,
147
+ * ,
148
+ app_name : str | NotGiven = NOT_GIVEN ,
149
+ version : str | NotGiven = NOT_GIVEN ,
150
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
151
+ # The extra values given here take precedence over values defined on the client or passed to this method.
152
+ extra_headers : Headers | None = None ,
153
+ extra_query : Query | None = None ,
154
+ extra_body : Body | None = None ,
155
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
156
+ ) -> AppListResponse :
157
+ """List application versions for the authenticated user.
158
+
159
+ Optionally filter by app
160
+ name and/or version label.
161
+
162
+ Args:
163
+ app_name: Filter results by application name.
164
+
165
+ version: Filter results by version label.
166
+
167
+ extra_headers: Send extra headers
168
+
169
+ extra_query: Add additional query parameters to the request
170
+
171
+ extra_body: Add additional JSON properties to the request
172
+
173
+ timeout: Override the client-level default timeout for this request, in seconds
174
+ """
175
+ return await self ._get (
176
+ "/apps" ,
177
+ options = make_request_options (
178
+ extra_headers = extra_headers ,
179
+ extra_query = extra_query ,
180
+ extra_body = extra_body ,
181
+ timeout = timeout ,
182
+ query = await async_maybe_transform (
183
+ {
184
+ "app_name" : app_name ,
185
+ "version" : version ,
186
+ },
187
+ app_list_params .AppListParams ,
188
+ ),
189
+ ),
190
+ cast_to = AppListResponse ,
191
+ )
192
+
84
193
85
194
class AppsResourceWithRawResponse :
86
195
def __init__ (self , apps : AppsResource ) -> None :
87
196
self ._apps = apps
88
197
198
+ self .list = to_raw_response_wrapper (
199
+ apps .list ,
200
+ )
201
+
89
202
@cached_property
90
203
def deployments (self ) -> DeploymentsResourceWithRawResponse :
91
204
return DeploymentsResourceWithRawResponse (self ._apps .deployments )
@@ -99,6 +212,10 @@ class AsyncAppsResourceWithRawResponse:
99
212
def __init__ (self , apps : AsyncAppsResource ) -> None :
100
213
self ._apps = apps
101
214
215
+ self .list = async_to_raw_response_wrapper (
216
+ apps .list ,
217
+ )
218
+
102
219
@cached_property
103
220
def deployments (self ) -> AsyncDeploymentsResourceWithRawResponse :
104
221
return AsyncDeploymentsResourceWithRawResponse (self ._apps .deployments )
@@ -112,6 +229,10 @@ class AppsResourceWithStreamingResponse:
112
229
def __init__ (self , apps : AppsResource ) -> None :
113
230
self ._apps = apps
114
231
232
+ self .list = to_streamed_response_wrapper (
233
+ apps .list ,
234
+ )
235
+
115
236
@cached_property
116
237
def deployments (self ) -> DeploymentsResourceWithStreamingResponse :
117
238
return DeploymentsResourceWithStreamingResponse (self ._apps .deployments )
@@ -125,6 +246,10 @@ class AsyncAppsResourceWithStreamingResponse:
125
246
def __init__ (self , apps : AsyncAppsResource ) -> None :
126
247
self ._apps = apps
127
248
249
+ self .list = async_to_streamed_response_wrapper (
250
+ apps .list ,
251
+ )
252
+
128
253
@cached_property
129
254
def deployments (self ) -> AsyncDeploymentsResourceWithStreamingResponse :
130
255
return AsyncDeploymentsResourceWithStreamingResponse (self ._apps .deployments )
0 commit comments