windmill-api 1.559.0__py3-none-any.whl → 1.561.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of windmill-api might be problematic. Click here for more details.
- windmill_api/api/helpers/check_s3_folder_exists.py +172 -0
- windmill_api/api/helpers/git_repo_viewer_file_upload.py +262 -0
- windmill_api/api/helpers/list_git_repo_files.py +221 -0
- windmill_api/api/helpers/load_git_repo_file_metadata.py +187 -0
- windmill_api/api/helpers/load_git_repo_file_preview.py +277 -0
- windmill_api/api/resource/get_git_commit_hash.py +166 -0
- windmill_api/models/check_s3_folder_exists_response_200.py +65 -0
- windmill_api/models/get_git_commit_hash_response_200.py +58 -0
- windmill_api/models/git_repo_viewer_file_upload_response_200.py +58 -0
- windmill_api/models/list_git_repo_files_response_200.py +98 -0
- windmill_api/models/list_git_repo_files_response_200_windmill_large_files_item.py +58 -0
- windmill_api/models/load_git_repo_file_metadata_response_200.py +108 -0
- windmill_api/models/load_git_repo_file_preview_response_200.py +78 -0
- windmill_api/models/load_git_repo_file_preview_response_200_content_type.py +11 -0
- {windmill_api-1.559.0.dist-info → windmill_api-1.561.0.dist-info}/METADATA +1 -1
- {windmill_api-1.559.0.dist-info → windmill_api-1.561.0.dist-info}/RECORD +18 -4
- {windmill_api-1.559.0.dist-info → windmill_api-1.561.0.dist-info}/LICENSE +0 -0
- {windmill_api-1.559.0.dist-info → windmill_api-1.561.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.check_s3_folder_exists_response_200 import CheckS3FolderExistsResponse200
|
|
9
|
+
from ...types import UNSET, Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
*,
|
|
15
|
+
file_key: str,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
params: Dict[str, Any] = {}
|
|
20
|
+
params["file_key"] = file_key
|
|
21
|
+
|
|
22
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
"method": "get",
|
|
26
|
+
"url": "/w/{workspace}/job_helpers/check_s3_folder_exists".format(
|
|
27
|
+
workspace=workspace,
|
|
28
|
+
),
|
|
29
|
+
"params": params,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Optional[CheckS3FolderExistsResponse200]:
|
|
36
|
+
if response.status_code == HTTPStatus.OK:
|
|
37
|
+
response_200 = CheckS3FolderExistsResponse200.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
if client.raise_on_unexpected_status:
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
|
+
else:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _build_response(
|
|
47
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
48
|
+
) -> Response[CheckS3FolderExistsResponse200]:
|
|
49
|
+
return Response(
|
|
50
|
+
status_code=HTTPStatus(response.status_code),
|
|
51
|
+
content=response.content,
|
|
52
|
+
headers=response.headers,
|
|
53
|
+
parsed=_parse_response(client=client, response=response),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def sync_detailed(
|
|
58
|
+
workspace: str,
|
|
59
|
+
*,
|
|
60
|
+
client: Union[AuthenticatedClient, Client],
|
|
61
|
+
file_key: str,
|
|
62
|
+
) -> Response[CheckS3FolderExistsResponse200]:
|
|
63
|
+
"""Check if S3 path exists and is a folder
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
workspace (str):
|
|
67
|
+
file_key (str):
|
|
68
|
+
|
|
69
|
+
Raises:
|
|
70
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
71
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Response[CheckS3FolderExistsResponse200]
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
workspace=workspace,
|
|
79
|
+
file_key=file_key,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
response = client.get_httpx_client().request(
|
|
83
|
+
**kwargs,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return _build_response(client=client, response=response)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def sync(
|
|
90
|
+
workspace: str,
|
|
91
|
+
*,
|
|
92
|
+
client: Union[AuthenticatedClient, Client],
|
|
93
|
+
file_key: str,
|
|
94
|
+
) -> Optional[CheckS3FolderExistsResponse200]:
|
|
95
|
+
"""Check if S3 path exists and is a folder
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
workspace (str):
|
|
99
|
+
file_key (str):
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
CheckS3FolderExistsResponse200
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
return sync_detailed(
|
|
110
|
+
workspace=workspace,
|
|
111
|
+
client=client,
|
|
112
|
+
file_key=file_key,
|
|
113
|
+
).parsed
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio_detailed(
|
|
117
|
+
workspace: str,
|
|
118
|
+
*,
|
|
119
|
+
client: Union[AuthenticatedClient, Client],
|
|
120
|
+
file_key: str,
|
|
121
|
+
) -> Response[CheckS3FolderExistsResponse200]:
|
|
122
|
+
"""Check if S3 path exists and is a folder
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
workspace (str):
|
|
126
|
+
file_key (str):
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
Response[CheckS3FolderExistsResponse200]
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
kwargs = _get_kwargs(
|
|
137
|
+
workspace=workspace,
|
|
138
|
+
file_key=file_key,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
142
|
+
|
|
143
|
+
return _build_response(client=client, response=response)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio(
|
|
147
|
+
workspace: str,
|
|
148
|
+
*,
|
|
149
|
+
client: Union[AuthenticatedClient, Client],
|
|
150
|
+
file_key: str,
|
|
151
|
+
) -> Optional[CheckS3FolderExistsResponse200]:
|
|
152
|
+
"""Check if S3 path exists and is a folder
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
workspace (str):
|
|
156
|
+
file_key (str):
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
CheckS3FolderExistsResponse200
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
await asyncio_detailed(
|
|
168
|
+
workspace=workspace,
|
|
169
|
+
client=client,
|
|
170
|
+
file_key=file_key,
|
|
171
|
+
)
|
|
172
|
+
).parsed
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.git_repo_viewer_file_upload_response_200 import GitRepoViewerFileUploadResponse200
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
*,
|
|
15
|
+
file_key: Union[Unset, None, str] = UNSET,
|
|
16
|
+
file_extension: Union[Unset, None, str] = UNSET,
|
|
17
|
+
s3_resource_path: Union[Unset, None, str] = UNSET,
|
|
18
|
+
resource_type: Union[Unset, None, str] = UNSET,
|
|
19
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
20
|
+
content_type: Union[Unset, None, str] = UNSET,
|
|
21
|
+
content_disposition: Union[Unset, None, str] = UNSET,
|
|
22
|
+
) -> Dict[str, Any]:
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
params: Dict[str, Any] = {}
|
|
26
|
+
params["file_key"] = file_key
|
|
27
|
+
|
|
28
|
+
params["file_extension"] = file_extension
|
|
29
|
+
|
|
30
|
+
params["s3_resource_path"] = s3_resource_path
|
|
31
|
+
|
|
32
|
+
params["resource_type"] = resource_type
|
|
33
|
+
|
|
34
|
+
params["storage"] = storage
|
|
35
|
+
|
|
36
|
+
params["content_type"] = content_type
|
|
37
|
+
|
|
38
|
+
params["content_disposition"] = content_disposition
|
|
39
|
+
|
|
40
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
"method": "post",
|
|
44
|
+
"url": "/w/{workspace}/job_helpers/upload_git_repo_file_to_instance_storage".format(
|
|
45
|
+
workspace=workspace,
|
|
46
|
+
),
|
|
47
|
+
"params": params,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _parse_response(
|
|
52
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
53
|
+
) -> Optional[GitRepoViewerFileUploadResponse200]:
|
|
54
|
+
if response.status_code == HTTPStatus.OK:
|
|
55
|
+
response_200 = GitRepoViewerFileUploadResponse200.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
return response_200
|
|
58
|
+
if client.raise_on_unexpected_status:
|
|
59
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
60
|
+
else:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _build_response(
|
|
65
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
66
|
+
) -> Response[GitRepoViewerFileUploadResponse200]:
|
|
67
|
+
return Response(
|
|
68
|
+
status_code=HTTPStatus(response.status_code),
|
|
69
|
+
content=response.content,
|
|
70
|
+
headers=response.headers,
|
|
71
|
+
parsed=_parse_response(client=client, response=response),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def sync_detailed(
|
|
76
|
+
workspace: str,
|
|
77
|
+
*,
|
|
78
|
+
client: Union[AuthenticatedClient, Client],
|
|
79
|
+
file_key: Union[Unset, None, str] = UNSET,
|
|
80
|
+
file_extension: Union[Unset, None, str] = UNSET,
|
|
81
|
+
s3_resource_path: Union[Unset, None, str] = UNSET,
|
|
82
|
+
resource_type: Union[Unset, None, str] = UNSET,
|
|
83
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
84
|
+
content_type: Union[Unset, None, str] = UNSET,
|
|
85
|
+
content_disposition: Union[Unset, None, str] = UNSET,
|
|
86
|
+
) -> Response[GitRepoViewerFileUploadResponse200]:
|
|
87
|
+
"""Upload a file to the instance storage gitrepos section for viewing
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
workspace (str):
|
|
91
|
+
file_key (Union[Unset, None, str]):
|
|
92
|
+
file_extension (Union[Unset, None, str]):
|
|
93
|
+
s3_resource_path (Union[Unset, None, str]):
|
|
94
|
+
resource_type (Union[Unset, None, str]):
|
|
95
|
+
storage (Union[Unset, None, str]):
|
|
96
|
+
content_type (Union[Unset, None, str]):
|
|
97
|
+
content_disposition (Union[Unset, None, str]):
|
|
98
|
+
|
|
99
|
+
Raises:
|
|
100
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
101
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
Response[GitRepoViewerFileUploadResponse200]
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
kwargs = _get_kwargs(
|
|
108
|
+
workspace=workspace,
|
|
109
|
+
file_key=file_key,
|
|
110
|
+
file_extension=file_extension,
|
|
111
|
+
s3_resource_path=s3_resource_path,
|
|
112
|
+
resource_type=resource_type,
|
|
113
|
+
storage=storage,
|
|
114
|
+
content_type=content_type,
|
|
115
|
+
content_disposition=content_disposition,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
response = client.get_httpx_client().request(
|
|
119
|
+
**kwargs,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
return _build_response(client=client, response=response)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def sync(
|
|
126
|
+
workspace: str,
|
|
127
|
+
*,
|
|
128
|
+
client: Union[AuthenticatedClient, Client],
|
|
129
|
+
file_key: Union[Unset, None, str] = UNSET,
|
|
130
|
+
file_extension: Union[Unset, None, str] = UNSET,
|
|
131
|
+
s3_resource_path: Union[Unset, None, str] = UNSET,
|
|
132
|
+
resource_type: Union[Unset, None, str] = UNSET,
|
|
133
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
134
|
+
content_type: Union[Unset, None, str] = UNSET,
|
|
135
|
+
content_disposition: Union[Unset, None, str] = UNSET,
|
|
136
|
+
) -> Optional[GitRepoViewerFileUploadResponse200]:
|
|
137
|
+
"""Upload a file to the instance storage gitrepos section for viewing
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
workspace (str):
|
|
141
|
+
file_key (Union[Unset, None, str]):
|
|
142
|
+
file_extension (Union[Unset, None, str]):
|
|
143
|
+
s3_resource_path (Union[Unset, None, str]):
|
|
144
|
+
resource_type (Union[Unset, None, str]):
|
|
145
|
+
storage (Union[Unset, None, str]):
|
|
146
|
+
content_type (Union[Unset, None, str]):
|
|
147
|
+
content_disposition (Union[Unset, None, str]):
|
|
148
|
+
|
|
149
|
+
Raises:
|
|
150
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
151
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
GitRepoViewerFileUploadResponse200
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
return sync_detailed(
|
|
158
|
+
workspace=workspace,
|
|
159
|
+
client=client,
|
|
160
|
+
file_key=file_key,
|
|
161
|
+
file_extension=file_extension,
|
|
162
|
+
s3_resource_path=s3_resource_path,
|
|
163
|
+
resource_type=resource_type,
|
|
164
|
+
storage=storage,
|
|
165
|
+
content_type=content_type,
|
|
166
|
+
content_disposition=content_disposition,
|
|
167
|
+
).parsed
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
async def asyncio_detailed(
|
|
171
|
+
workspace: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Union[AuthenticatedClient, Client],
|
|
174
|
+
file_key: Union[Unset, None, str] = UNSET,
|
|
175
|
+
file_extension: Union[Unset, None, str] = UNSET,
|
|
176
|
+
s3_resource_path: Union[Unset, None, str] = UNSET,
|
|
177
|
+
resource_type: Union[Unset, None, str] = UNSET,
|
|
178
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
179
|
+
content_type: Union[Unset, None, str] = UNSET,
|
|
180
|
+
content_disposition: Union[Unset, None, str] = UNSET,
|
|
181
|
+
) -> Response[GitRepoViewerFileUploadResponse200]:
|
|
182
|
+
"""Upload a file to the instance storage gitrepos section for viewing
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
workspace (str):
|
|
186
|
+
file_key (Union[Unset, None, str]):
|
|
187
|
+
file_extension (Union[Unset, None, str]):
|
|
188
|
+
s3_resource_path (Union[Unset, None, str]):
|
|
189
|
+
resource_type (Union[Unset, None, str]):
|
|
190
|
+
storage (Union[Unset, None, str]):
|
|
191
|
+
content_type (Union[Unset, None, str]):
|
|
192
|
+
content_disposition (Union[Unset, None, str]):
|
|
193
|
+
|
|
194
|
+
Raises:
|
|
195
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
196
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
Response[GitRepoViewerFileUploadResponse200]
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
kwargs = _get_kwargs(
|
|
203
|
+
workspace=workspace,
|
|
204
|
+
file_key=file_key,
|
|
205
|
+
file_extension=file_extension,
|
|
206
|
+
s3_resource_path=s3_resource_path,
|
|
207
|
+
resource_type=resource_type,
|
|
208
|
+
storage=storage,
|
|
209
|
+
content_type=content_type,
|
|
210
|
+
content_disposition=content_disposition,
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
214
|
+
|
|
215
|
+
return _build_response(client=client, response=response)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
async def asyncio(
|
|
219
|
+
workspace: str,
|
|
220
|
+
*,
|
|
221
|
+
client: Union[AuthenticatedClient, Client],
|
|
222
|
+
file_key: Union[Unset, None, str] = UNSET,
|
|
223
|
+
file_extension: Union[Unset, None, str] = UNSET,
|
|
224
|
+
s3_resource_path: Union[Unset, None, str] = UNSET,
|
|
225
|
+
resource_type: Union[Unset, None, str] = UNSET,
|
|
226
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
227
|
+
content_type: Union[Unset, None, str] = UNSET,
|
|
228
|
+
content_disposition: Union[Unset, None, str] = UNSET,
|
|
229
|
+
) -> Optional[GitRepoViewerFileUploadResponse200]:
|
|
230
|
+
"""Upload a file to the instance storage gitrepos section for viewing
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
workspace (str):
|
|
234
|
+
file_key (Union[Unset, None, str]):
|
|
235
|
+
file_extension (Union[Unset, None, str]):
|
|
236
|
+
s3_resource_path (Union[Unset, None, str]):
|
|
237
|
+
resource_type (Union[Unset, None, str]):
|
|
238
|
+
storage (Union[Unset, None, str]):
|
|
239
|
+
content_type (Union[Unset, None, str]):
|
|
240
|
+
content_disposition (Union[Unset, None, str]):
|
|
241
|
+
|
|
242
|
+
Raises:
|
|
243
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
244
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
GitRepoViewerFileUploadResponse200
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
return (
|
|
251
|
+
await asyncio_detailed(
|
|
252
|
+
workspace=workspace,
|
|
253
|
+
client=client,
|
|
254
|
+
file_key=file_key,
|
|
255
|
+
file_extension=file_extension,
|
|
256
|
+
s3_resource_path=s3_resource_path,
|
|
257
|
+
resource_type=resource_type,
|
|
258
|
+
storage=storage,
|
|
259
|
+
content_type=content_type,
|
|
260
|
+
content_disposition=content_disposition,
|
|
261
|
+
)
|
|
262
|
+
).parsed
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.list_git_repo_files_response_200 import ListGitRepoFilesResponse200
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
*,
|
|
15
|
+
max_keys: int,
|
|
16
|
+
marker: Union[Unset, None, str] = UNSET,
|
|
17
|
+
prefix: Union[Unset, None, str] = UNSET,
|
|
18
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
19
|
+
) -> Dict[str, Any]:
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
params: Dict[str, Any] = {}
|
|
23
|
+
params["max_keys"] = max_keys
|
|
24
|
+
|
|
25
|
+
params["marker"] = marker
|
|
26
|
+
|
|
27
|
+
params["prefix"] = prefix
|
|
28
|
+
|
|
29
|
+
params["storage"] = storage
|
|
30
|
+
|
|
31
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
"method": "get",
|
|
35
|
+
"url": "/w/{workspace}/job_helpers/list_git_repo_files".format(
|
|
36
|
+
workspace=workspace,
|
|
37
|
+
),
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _parse_response(
|
|
43
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
44
|
+
) -> Optional[ListGitRepoFilesResponse200]:
|
|
45
|
+
if response.status_code == HTTPStatus.OK:
|
|
46
|
+
response_200 = ListGitRepoFilesResponse200.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_200
|
|
49
|
+
if client.raise_on_unexpected_status:
|
|
50
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
51
|
+
else:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _build_response(
|
|
56
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
57
|
+
) -> Response[ListGitRepoFilesResponse200]:
|
|
58
|
+
return Response(
|
|
59
|
+
status_code=HTTPStatus(response.status_code),
|
|
60
|
+
content=response.content,
|
|
61
|
+
headers=response.headers,
|
|
62
|
+
parsed=_parse_response(client=client, response=response),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def sync_detailed(
|
|
67
|
+
workspace: str,
|
|
68
|
+
*,
|
|
69
|
+
client: Union[AuthenticatedClient, Client],
|
|
70
|
+
max_keys: int,
|
|
71
|
+
marker: Union[Unset, None, str] = UNSET,
|
|
72
|
+
prefix: Union[Unset, None, str] = UNSET,
|
|
73
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
74
|
+
) -> Response[ListGitRepoFilesResponse200]:
|
|
75
|
+
"""List the file keys available in instance object storage with resource-based access control
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
workspace (str):
|
|
79
|
+
max_keys (int):
|
|
80
|
+
marker (Union[Unset, None, str]):
|
|
81
|
+
prefix (Union[Unset, None, str]): Must follow format
|
|
82
|
+
gitrepos/{workspace_id}/{resource_path}/...
|
|
83
|
+
storage (Union[Unset, None, str]):
|
|
84
|
+
|
|
85
|
+
Raises:
|
|
86
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
87
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Response[ListGitRepoFilesResponse200]
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
kwargs = _get_kwargs(
|
|
94
|
+
workspace=workspace,
|
|
95
|
+
max_keys=max_keys,
|
|
96
|
+
marker=marker,
|
|
97
|
+
prefix=prefix,
|
|
98
|
+
storage=storage,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def sync(
|
|
109
|
+
workspace: str,
|
|
110
|
+
*,
|
|
111
|
+
client: Union[AuthenticatedClient, Client],
|
|
112
|
+
max_keys: int,
|
|
113
|
+
marker: Union[Unset, None, str] = UNSET,
|
|
114
|
+
prefix: Union[Unset, None, str] = UNSET,
|
|
115
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
116
|
+
) -> Optional[ListGitRepoFilesResponse200]:
|
|
117
|
+
"""List the file keys available in instance object storage with resource-based access control
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
workspace (str):
|
|
121
|
+
max_keys (int):
|
|
122
|
+
marker (Union[Unset, None, str]):
|
|
123
|
+
prefix (Union[Unset, None, str]): Must follow format
|
|
124
|
+
gitrepos/{workspace_id}/{resource_path}/...
|
|
125
|
+
storage (Union[Unset, None, str]):
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
ListGitRepoFilesResponse200
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
return sync_detailed(
|
|
136
|
+
workspace=workspace,
|
|
137
|
+
client=client,
|
|
138
|
+
max_keys=max_keys,
|
|
139
|
+
marker=marker,
|
|
140
|
+
prefix=prefix,
|
|
141
|
+
storage=storage,
|
|
142
|
+
).parsed
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
async def asyncio_detailed(
|
|
146
|
+
workspace: str,
|
|
147
|
+
*,
|
|
148
|
+
client: Union[AuthenticatedClient, Client],
|
|
149
|
+
max_keys: int,
|
|
150
|
+
marker: Union[Unset, None, str] = UNSET,
|
|
151
|
+
prefix: Union[Unset, None, str] = UNSET,
|
|
152
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
153
|
+
) -> Response[ListGitRepoFilesResponse200]:
|
|
154
|
+
"""List the file keys available in instance object storage with resource-based access control
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
workspace (str):
|
|
158
|
+
max_keys (int):
|
|
159
|
+
marker (Union[Unset, None, str]):
|
|
160
|
+
prefix (Union[Unset, None, str]): Must follow format
|
|
161
|
+
gitrepos/{workspace_id}/{resource_path}/...
|
|
162
|
+
storage (Union[Unset, None, str]):
|
|
163
|
+
|
|
164
|
+
Raises:
|
|
165
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
166
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
167
|
+
|
|
168
|
+
Returns:
|
|
169
|
+
Response[ListGitRepoFilesResponse200]
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
kwargs = _get_kwargs(
|
|
173
|
+
workspace=workspace,
|
|
174
|
+
max_keys=max_keys,
|
|
175
|
+
marker=marker,
|
|
176
|
+
prefix=prefix,
|
|
177
|
+
storage=storage,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
181
|
+
|
|
182
|
+
return _build_response(client=client, response=response)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
async def asyncio(
|
|
186
|
+
workspace: str,
|
|
187
|
+
*,
|
|
188
|
+
client: Union[AuthenticatedClient, Client],
|
|
189
|
+
max_keys: int,
|
|
190
|
+
marker: Union[Unset, None, str] = UNSET,
|
|
191
|
+
prefix: Union[Unset, None, str] = UNSET,
|
|
192
|
+
storage: Union[Unset, None, str] = UNSET,
|
|
193
|
+
) -> Optional[ListGitRepoFilesResponse200]:
|
|
194
|
+
"""List the file keys available in instance object storage with resource-based access control
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
workspace (str):
|
|
198
|
+
max_keys (int):
|
|
199
|
+
marker (Union[Unset, None, str]):
|
|
200
|
+
prefix (Union[Unset, None, str]): Must follow format
|
|
201
|
+
gitrepos/{workspace_id}/{resource_path}/...
|
|
202
|
+
storage (Union[Unset, None, str]):
|
|
203
|
+
|
|
204
|
+
Raises:
|
|
205
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
206
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
ListGitRepoFilesResponse200
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
await asyncio_detailed(
|
|
214
|
+
workspace=workspace,
|
|
215
|
+
client=client,
|
|
216
|
+
max_keys=max_keys,
|
|
217
|
+
marker=marker,
|
|
218
|
+
prefix=prefix,
|
|
219
|
+
storage=storage,
|
|
220
|
+
)
|
|
221
|
+
).parsed
|