windmill-api 1.475.0__py3-none-any.whl → 1.475.1__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.

@@ -0,0 +1,160 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ name: str,
14
+ ) -> Dict[str, Any]:
15
+ pass
16
+
17
+ return {
18
+ "method": "get",
19
+ "url": "/w/{workspace}/folders/exists/{name}".format(
20
+ workspace=workspace,
21
+ name=name,
22
+ ),
23
+ }
24
+
25
+
26
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[bool]:
27
+ if response.status_code == HTTPStatus.OK:
28
+ response_200 = cast(bool, response.json())
29
+ return response_200
30
+ if client.raise_on_unexpected_status:
31
+ raise errors.UnexpectedStatus(response.status_code, response.content)
32
+ else:
33
+ return None
34
+
35
+
36
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[bool]:
37
+ return Response(
38
+ status_code=HTTPStatus(response.status_code),
39
+ content=response.content,
40
+ headers=response.headers,
41
+ parsed=_parse_response(client=client, response=response),
42
+ )
43
+
44
+
45
+ def sync_detailed(
46
+ workspace: str,
47
+ name: str,
48
+ *,
49
+ client: Union[AuthenticatedClient, Client],
50
+ ) -> Response[bool]:
51
+ """exists folder
52
+
53
+ Args:
54
+ workspace (str):
55
+ name (str):
56
+
57
+ Raises:
58
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
59
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
60
+
61
+ Returns:
62
+ Response[bool]
63
+ """
64
+
65
+ kwargs = _get_kwargs(
66
+ workspace=workspace,
67
+ name=name,
68
+ )
69
+
70
+ response = client.get_httpx_client().request(
71
+ **kwargs,
72
+ )
73
+
74
+ return _build_response(client=client, response=response)
75
+
76
+
77
+ def sync(
78
+ workspace: str,
79
+ name: str,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ ) -> Optional[bool]:
83
+ """exists folder
84
+
85
+ Args:
86
+ workspace (str):
87
+ name (str):
88
+
89
+ Raises:
90
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
91
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
92
+
93
+ Returns:
94
+ bool
95
+ """
96
+
97
+ return sync_detailed(
98
+ workspace=workspace,
99
+ name=name,
100
+ client=client,
101
+ ).parsed
102
+
103
+
104
+ async def asyncio_detailed(
105
+ workspace: str,
106
+ name: str,
107
+ *,
108
+ client: Union[AuthenticatedClient, Client],
109
+ ) -> Response[bool]:
110
+ """exists folder
111
+
112
+ Args:
113
+ workspace (str):
114
+ name (str):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Response[bool]
122
+ """
123
+
124
+ kwargs = _get_kwargs(
125
+ workspace=workspace,
126
+ name=name,
127
+ )
128
+
129
+ response = await client.get_async_httpx_client().request(**kwargs)
130
+
131
+ return _build_response(client=client, response=response)
132
+
133
+
134
+ async def asyncio(
135
+ workspace: str,
136
+ name: str,
137
+ *,
138
+ client: Union[AuthenticatedClient, Client],
139
+ ) -> Optional[bool]:
140
+ """exists folder
141
+
142
+ Args:
143
+ workspace (str):
144
+ name (str):
145
+
146
+ Raises:
147
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
148
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
149
+
150
+ Returns:
151
+ bool
152
+ """
153
+
154
+ return (
155
+ await asyncio_detailed(
156
+ workspace=workspace,
157
+ name=name,
158
+ client=client,
159
+ )
160
+ ).parsed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: windmill-api
3
- Version: 1.475.0
3
+ Version: 1.475.1
4
4
  Summary: A client library for accessing Windmill API
5
5
  License: Apache-2.0
6
6
  Author: Ruben Fiszel
@@ -78,6 +78,7 @@ windmill_api/api/folder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
78
78
  windmill_api/api/folder/add_owner_to_folder.py,sha256=0d38jdOoei1PIqmSUGBRxuCviZ3LARAHUJNR2twi7sE,2881
79
79
  windmill_api/api/folder/create_folder.py,sha256=6lWyfYlT3cc7TpEU1dgZKVerkGFkYJ7L_ZO8bQZFbGw,2684
80
80
  windmill_api/api/folder/delete_folder.py,sha256=EOoPsdqCbek2-obV0ZkcoVB0C6OSsJ0Vax10jm9lQjs,2438
81
+ windmill_api/api/folder/exists_folder.py,sha256=QmgvdSKHeOPhGjhzTn9J_UIpPQyltOXxoK9CkKNoOqY,3762
81
82
  windmill_api/api/folder/get_folder.py,sha256=Rz4bS-PiptyEFiNa30CC7XLHBfFvpCFIdYiJEJN8WfA,4001
82
83
  windmill_api/api/folder/get_folder_usage.py,sha256=mo3ByvoeQXEC0sBb6AztihdaEbPTkeQ7oXx2rE1bBkw,4096
83
84
  windmill_api/api/folder/list_folder_names.py,sha256=8lAea2sdDr3ntIumUTpfP-tnQMBAD4wY5NsdjV-1w1s,4422
@@ -3798,7 +3799,7 @@ windmill_api/models/workspace_invite.py,sha256=HnAJWGv5LwxWkz1T3fhgHKIccO7RFC1li
3798
3799
  windmill_api/models/workspace_mute_critical_alerts_ui_json_body.py,sha256=y8ZwkWEZgavVc-FgLuZZ4z8YPCLxjPcMfdGdKjGM6VQ,1883
3799
3800
  windmill_api/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
3800
3801
  windmill_api/types.py,sha256=GoYub3t4hQP2Yn5tsvShsBfIY3vHUmblU0MXszDx_V0,968
3801
- windmill_api-1.475.0.dist-info/LICENSE,sha256=qJVFNTaOevCeSY6NoXeUG1SPOwQ1K-PxVQ2iEWJzX-A,11348
3802
- windmill_api-1.475.0.dist-info/METADATA,sha256=z7q2wXAExOePstS8OirQAhfdEwKWlXcaB2E_IJ-jpGI,5023
3803
- windmill_api-1.475.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
3804
- windmill_api-1.475.0.dist-info/RECORD,,
3802
+ windmill_api-1.475.1.dist-info/LICENSE,sha256=qJVFNTaOevCeSY6NoXeUG1SPOwQ1K-PxVQ2iEWJzX-A,11348
3803
+ windmill_api-1.475.1.dist-info/METADATA,sha256=LhK0VV2QIEfakF4fspk6QcymEV4ARq7niarnruDm3lM,5023
3804
+ windmill_api-1.475.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
3805
+ windmill_api-1.475.1.dist-info/RECORD,,