windmill-api 1.495.1__py3-none-any.whl → 1.496.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.

@@ -0,0 +1,109 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.create_http_triggers_json_body_item import CreateHttpTriggersJsonBodyItem
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ *,
15
+ json_body: List["CreateHttpTriggersJsonBodyItem"],
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ json_json_body = []
20
+ for json_body_item_data in json_body:
21
+ json_body_item = json_body_item_data.to_dict()
22
+
23
+ json_json_body.append(json_body_item)
24
+
25
+ return {
26
+ "method": "post",
27
+ "url": "/w/{workspace}/http_triggers/create_many".format(
28
+ workspace=workspace,
29
+ ),
30
+ "json": json_json_body,
31
+ }
32
+
33
+
34
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
35
+ if client.raise_on_unexpected_status:
36
+ raise errors.UnexpectedStatus(response.status_code, response.content)
37
+ else:
38
+ return None
39
+
40
+
41
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(client=client, response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ workspace: str,
52
+ *,
53
+ client: Union[AuthenticatedClient, Client],
54
+ json_body: List["CreateHttpTriggersJsonBodyItem"],
55
+ ) -> Response[Any]:
56
+ """create many HTTP triggers
57
+
58
+ Args:
59
+ workspace (str):
60
+ json_body (List['CreateHttpTriggersJsonBodyItem']):
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[Any]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ workspace=workspace,
72
+ json_body=json_body,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ async def asyncio_detailed(
83
+ workspace: str,
84
+ *,
85
+ client: Union[AuthenticatedClient, Client],
86
+ json_body: List["CreateHttpTriggersJsonBodyItem"],
87
+ ) -> Response[Any]:
88
+ """create many HTTP triggers
89
+
90
+ Args:
91
+ workspace (str):
92
+ json_body (List['CreateHttpTriggersJsonBodyItem']):
93
+
94
+ Raises:
95
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
96
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
97
+
98
+ Returns:
99
+ Response[Any]
100
+ """
101
+
102
+ kwargs = _get_kwargs(
103
+ workspace=workspace,
104
+ json_body=json_body,
105
+ )
106
+
107
+ response = await client.get_async_httpx_client().request(**kwargs)
108
+
109
+ return _build_response(client=client, response=response)
@@ -0,0 +1,173 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.create_http_triggers_json_body_item_authentication_method import (
7
+ CreateHttpTriggersJsonBodyItemAuthenticationMethod,
8
+ )
9
+ from ..models.create_http_triggers_json_body_item_http_method import CreateHttpTriggersJsonBodyItemHttpMethod
10
+ from ..types import UNSET, Unset
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.create_http_triggers_json_body_item_static_asset_config import (
14
+ CreateHttpTriggersJsonBodyItemStaticAssetConfig,
15
+ )
16
+
17
+
18
+ T = TypeVar("T", bound="CreateHttpTriggersJsonBodyItem")
19
+
20
+
21
+ @_attrs_define
22
+ class CreateHttpTriggersJsonBodyItem:
23
+ """
24
+ Attributes:
25
+ path (str):
26
+ script_path (str):
27
+ route_path (str):
28
+ is_flow (bool):
29
+ http_method (CreateHttpTriggersJsonBodyItemHttpMethod):
30
+ is_async (bool):
31
+ authentication_method (CreateHttpTriggersJsonBodyItemAuthenticationMethod):
32
+ is_static_website (bool):
33
+ workspaced_route (Union[Unset, bool]):
34
+ static_asset_config (Union[Unset, CreateHttpTriggersJsonBodyItemStaticAssetConfig]):
35
+ authentication_resource_path (Union[Unset, str]):
36
+ wrap_body (Union[Unset, bool]):
37
+ raw_string (Union[Unset, bool]):
38
+ """
39
+
40
+ path: str
41
+ script_path: str
42
+ route_path: str
43
+ is_flow: bool
44
+ http_method: CreateHttpTriggersJsonBodyItemHttpMethod
45
+ is_async: bool
46
+ authentication_method: CreateHttpTriggersJsonBodyItemAuthenticationMethod
47
+ is_static_website: bool
48
+ workspaced_route: Union[Unset, bool] = UNSET
49
+ static_asset_config: Union[Unset, "CreateHttpTriggersJsonBodyItemStaticAssetConfig"] = UNSET
50
+ authentication_resource_path: Union[Unset, str] = UNSET
51
+ wrap_body: Union[Unset, bool] = UNSET
52
+ raw_string: Union[Unset, bool] = UNSET
53
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ path = self.path
57
+ script_path = self.script_path
58
+ route_path = self.route_path
59
+ is_flow = self.is_flow
60
+ http_method = self.http_method.value
61
+
62
+ is_async = self.is_async
63
+ authentication_method = self.authentication_method.value
64
+
65
+ is_static_website = self.is_static_website
66
+ workspaced_route = self.workspaced_route
67
+ static_asset_config: Union[Unset, Dict[str, Any]] = UNSET
68
+ if not isinstance(self.static_asset_config, Unset):
69
+ static_asset_config = self.static_asset_config.to_dict()
70
+
71
+ authentication_resource_path = self.authentication_resource_path
72
+ wrap_body = self.wrap_body
73
+ raw_string = self.raw_string
74
+
75
+ field_dict: Dict[str, Any] = {}
76
+ field_dict.update(self.additional_properties)
77
+ field_dict.update(
78
+ {
79
+ "path": path,
80
+ "script_path": script_path,
81
+ "route_path": route_path,
82
+ "is_flow": is_flow,
83
+ "http_method": http_method,
84
+ "is_async": is_async,
85
+ "authentication_method": authentication_method,
86
+ "is_static_website": is_static_website,
87
+ }
88
+ )
89
+ if workspaced_route is not UNSET:
90
+ field_dict["workspaced_route"] = workspaced_route
91
+ if static_asset_config is not UNSET:
92
+ field_dict["static_asset_config"] = static_asset_config
93
+ if authentication_resource_path is not UNSET:
94
+ field_dict["authentication_resource_path"] = authentication_resource_path
95
+ if wrap_body is not UNSET:
96
+ field_dict["wrap_body"] = wrap_body
97
+ if raw_string is not UNSET:
98
+ field_dict["raw_string"] = raw_string
99
+
100
+ return field_dict
101
+
102
+ @classmethod
103
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
104
+ from ..models.create_http_triggers_json_body_item_static_asset_config import (
105
+ CreateHttpTriggersJsonBodyItemStaticAssetConfig,
106
+ )
107
+
108
+ d = src_dict.copy()
109
+ path = d.pop("path")
110
+
111
+ script_path = d.pop("script_path")
112
+
113
+ route_path = d.pop("route_path")
114
+
115
+ is_flow = d.pop("is_flow")
116
+
117
+ http_method = CreateHttpTriggersJsonBodyItemHttpMethod(d.pop("http_method"))
118
+
119
+ is_async = d.pop("is_async")
120
+
121
+ authentication_method = CreateHttpTriggersJsonBodyItemAuthenticationMethod(d.pop("authentication_method"))
122
+
123
+ is_static_website = d.pop("is_static_website")
124
+
125
+ workspaced_route = d.pop("workspaced_route", UNSET)
126
+
127
+ _static_asset_config = d.pop("static_asset_config", UNSET)
128
+ static_asset_config: Union[Unset, CreateHttpTriggersJsonBodyItemStaticAssetConfig]
129
+ if isinstance(_static_asset_config, Unset):
130
+ static_asset_config = UNSET
131
+ else:
132
+ static_asset_config = CreateHttpTriggersJsonBodyItemStaticAssetConfig.from_dict(_static_asset_config)
133
+
134
+ authentication_resource_path = d.pop("authentication_resource_path", UNSET)
135
+
136
+ wrap_body = d.pop("wrap_body", UNSET)
137
+
138
+ raw_string = d.pop("raw_string", UNSET)
139
+
140
+ create_http_triggers_json_body_item = cls(
141
+ path=path,
142
+ script_path=script_path,
143
+ route_path=route_path,
144
+ is_flow=is_flow,
145
+ http_method=http_method,
146
+ is_async=is_async,
147
+ authentication_method=authentication_method,
148
+ is_static_website=is_static_website,
149
+ workspaced_route=workspaced_route,
150
+ static_asset_config=static_asset_config,
151
+ authentication_resource_path=authentication_resource_path,
152
+ wrap_body=wrap_body,
153
+ raw_string=raw_string,
154
+ )
155
+
156
+ create_http_triggers_json_body_item.additional_properties = d
157
+ return create_http_triggers_json_body_item
158
+
159
+ @property
160
+ def additional_keys(self) -> List[str]:
161
+ return list(self.additional_properties.keys())
162
+
163
+ def __getitem__(self, key: str) -> Any:
164
+ return self.additional_properties[key]
165
+
166
+ def __setitem__(self, key: str, value: Any) -> None:
167
+ self.additional_properties[key] = value
168
+
169
+ def __delitem__(self, key: str) -> None:
170
+ del self.additional_properties[key]
171
+
172
+ def __contains__(self, key: str) -> bool:
173
+ return key in self.additional_properties
@@ -0,0 +1,13 @@
1
+ from enum import Enum
2
+
3
+
4
+ class CreateHttpTriggersJsonBodyItemAuthenticationMethod(str, Enum):
5
+ API_KEY = "api_key"
6
+ BASIC_HTTP = "basic_http"
7
+ CUSTOM_SCRIPT = "custom_script"
8
+ NONE = "none"
9
+ SIGNATURE = "signature"
10
+ WINDMILL = "windmill"
11
+
12
+ def __str__(self) -> str:
13
+ return str(self.value)
@@ -0,0 +1,12 @@
1
+ from enum import Enum
2
+
3
+
4
+ class CreateHttpTriggersJsonBodyItemHttpMethod(str, Enum):
5
+ DELETE = "delete"
6
+ GET = "get"
7
+ PATCH = "patch"
8
+ POST = "post"
9
+ PUT = "put"
10
+
11
+ def __str__(self) -> str:
12
+ return str(self.value)
@@ -0,0 +1,76 @@
1
+ from typing import Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="CreateHttpTriggersJsonBodyItemStaticAssetConfig")
9
+
10
+
11
+ @_attrs_define
12
+ class CreateHttpTriggersJsonBodyItemStaticAssetConfig:
13
+ """
14
+ Attributes:
15
+ s3 (str):
16
+ storage (Union[Unset, str]):
17
+ filename (Union[Unset, str]):
18
+ """
19
+
20
+ s3: str
21
+ storage: Union[Unset, str] = UNSET
22
+ filename: Union[Unset, str] = UNSET
23
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
24
+
25
+ def to_dict(self) -> Dict[str, Any]:
26
+ s3 = self.s3
27
+ storage = self.storage
28
+ filename = self.filename
29
+
30
+ field_dict: Dict[str, Any] = {}
31
+ field_dict.update(self.additional_properties)
32
+ field_dict.update(
33
+ {
34
+ "s3": s3,
35
+ }
36
+ )
37
+ if storage is not UNSET:
38
+ field_dict["storage"] = storage
39
+ if filename is not UNSET:
40
+ field_dict["filename"] = filename
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
46
+ d = src_dict.copy()
47
+ s3 = d.pop("s3")
48
+
49
+ storage = d.pop("storage", UNSET)
50
+
51
+ filename = d.pop("filename", UNSET)
52
+
53
+ create_http_triggers_json_body_item_static_asset_config = cls(
54
+ s3=s3,
55
+ storage=storage,
56
+ filename=filename,
57
+ )
58
+
59
+ create_http_triggers_json_body_item_static_asset_config.additional_properties = d
60
+ return create_http_triggers_json_body_item_static_asset_config
61
+
62
+ @property
63
+ def additional_keys(self) -> List[str]:
64
+ return list(self.additional_properties.keys())
65
+
66
+ def __getitem__(self, key: str) -> Any:
67
+ return self.additional_properties[key]
68
+
69
+ def __setitem__(self, key: str, value: Any) -> None:
70
+ self.additional_properties[key] = value
71
+
72
+ def __delitem__(self, key: str) -> None:
73
+ del self.additional_properties[key]
74
+
75
+ def __contains__(self, key: str) -> bool:
76
+ return key in self.additional_properties
@@ -0,0 +1,12 @@
1
+ from enum import Enum
2
+
3
+
4
+ class HttpMethod(str, Enum):
5
+ DELETE = "delete"
6
+ GET = "get"
7
+ PATCH = "patch"
8
+ POST = "post"
9
+ PUT = "put"
10
+
11
+ def __str__(self) -> str:
12
+ return str(self.value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: windmill-api
3
- Version: 1.495.1
3
+ Version: 1.496.0
4
4
  Summary: A client library for accessing Windmill API
5
5
  License: Apache-2.0
6
6
  Author: Ruben Fiszel
@@ -153,6 +153,7 @@ windmill_api/api/helpers/polars_connection_settings_v2.py,sha256=L_8zy2D5JE_r6CA
153
153
  windmill_api/api/helpers/s_3_resource_info.py,sha256=QLQKtqSrqEHDpssiCK5smNbmi0Vd-HyDoiEY79oeCEA,4799
154
154
  windmill_api/api/http_trigger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
155
  windmill_api/api/http_trigger/create_http_trigger.py,sha256=DHKStt46zzeXi5akyyHgoEGbj88MYOQpckdfO06PF60,2738
156
+ windmill_api/api/http_trigger/create_http_triggers.py,sha256=b2CdsoIRaui7PYx6wwWqUQQrm_tK7RWkqFM12sqtNbg,2964
156
157
  windmill_api/api/http_trigger/delete_http_trigger.py,sha256=dDKkjwvvnDI1MwYq-SY64iseY1DkQJbqo6VO_OdCofU,2456
157
158
  windmill_api/api/http_trigger/exists_http_trigger.py,sha256=tdP7cfAAd__AjcNEsdFe0Jo1dqlSP8r0JpfhG9L8AhU,3812
158
159
  windmill_api/api/http_trigger/exists_route.py,sha256=yAsHiX7bERpVnvl1uU-lYo_v2wsxRzQI-1WBDPUItAs,4136
@@ -806,6 +807,10 @@ windmill_api/models/create_http_trigger_json_body.py,sha256=GzU1dsrH3GAdYrxklxyF
806
807
  windmill_api/models/create_http_trigger_json_body_authentication_method.py,sha256=LjPtWr9A-WFWQY8KdURiqYvW0vFTNRflICjqbkv0vUY,312
807
808
  windmill_api/models/create_http_trigger_json_body_http_method.py,sha256=ZhVY_jUbOVXcckh4w56I0N9fGd0dYYYNViIhOM3495I,232
808
809
  windmill_api/models/create_http_trigger_json_body_static_asset_config.py,sha256=SqNzKOi6BLVpyb7Gb72V452jrnWh3KRijIwr5Eiwox4,2134
810
+ windmill_api/models/create_http_triggers_json_body_item.py,sha256=92GEWlaYV4ThZ_cpETol6WZDQYjShfrXAmTabWOrits,6346
811
+ windmill_api/models/create_http_triggers_json_body_item_authentication_method.py,sha256=CxT_urqmohlod14KHV0H5ykrzV0A80x8p4hTzVy2qiU,317
812
+ windmill_api/models/create_http_triggers_json_body_item_http_method.py,sha256=6QDXJnFs04v1UduAySZysTioISbVJ4c0X5uG7AYNP78,237
813
+ windmill_api/models/create_http_triggers_json_body_item_static_asset_config.py,sha256=nRAbZRN4M7aeV-daihDYrKqglAUX0o75SxWyTgM-oy0,2162
809
814
  windmill_api/models/create_input.py,sha256=xs-GIXxzoMlg4-fsHYmxOJe-9PK3YyaIKxsKZKzn32I,1780
810
815
  windmill_api/models/create_input_args.py,sha256=W4GFeXhf_QKetct0a3RbaGfzAIq6MGso76p3l4D9mIs,1233
811
816
  windmill_api/models/create_input_json_body.py,sha256=MBQlyMI3UAcTgya7cg6_Vzz-mwt4zNhZLjPtIE9umbU,1886
@@ -2442,6 +2447,7 @@ windmill_api/models/global_whoami_response_200.py,sha256=P2YzOuDmowq7fAsrlFQnBgi
2442
2447
  windmill_api/models/global_whoami_response_200_login_type.py,sha256=grlKtkJE27qxpXSUFBUoLo1-wQf45s82n_hoU7V7PaE,185
2443
2448
  windmill_api/models/group.py,sha256=yEfHcI9FEtk1tV6RS9B3r_vAPK0rqNCCLgIJoLAUZ8M,2890
2444
2449
  windmill_api/models/group_extra_perms.py,sha256=hn0wzgNVtx0HO3XwPsVOie8BJpV6-FypTN5u_851dvg,1236
2450
+ windmill_api/models/http_method.py,sha256=JQ01zN1w-a5wLW9fcb522rWrmwwJwAY0V5gnWDN_TjU,207
2445
2451
  windmill_api/models/http_trigger.py,sha256=vtqHx1rzHVTV-Ek7KBZiCmJHkRGxoDppbiVv7HnOp_A,6868
2446
2452
  windmill_api/models/http_trigger_authentication_method.py,sha256=wFUsd7a-HE98BoadQk7kVOhZu4dev1JmMuLu21IqyZU,298
2447
2453
  windmill_api/models/http_trigger_extra_perms.py,sha256=zoXtrNWbIaURFZKJ2TJlzI3oScR9gJMuhvZdWxRqoGE,1269
@@ -3971,7 +3977,7 @@ windmill_api/models/workspace_invite.py,sha256=HnAJWGv5LwxWkz1T3fhgHKIccO7RFC1li
3971
3977
  windmill_api/models/workspace_mute_critical_alerts_ui_json_body.py,sha256=y8ZwkWEZgavVc-FgLuZZ4z8YPCLxjPcMfdGdKjGM6VQ,1883
3972
3978
  windmill_api/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
3973
3979
  windmill_api/types.py,sha256=GoYub3t4hQP2Yn5tsvShsBfIY3vHUmblU0MXszDx_V0,968
3974
- windmill_api-1.495.1.dist-info/LICENSE,sha256=qJVFNTaOevCeSY6NoXeUG1SPOwQ1K-PxVQ2iEWJzX-A,11348
3975
- windmill_api-1.495.1.dist-info/METADATA,sha256=ysIfppCGdMPro5wq7cGUKJ3P8P-53_WFMv2QOq28W_0,5023
3976
- windmill_api-1.495.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
3977
- windmill_api-1.495.1.dist-info/RECORD,,
3980
+ windmill_api-1.496.0.dist-info/LICENSE,sha256=qJVFNTaOevCeSY6NoXeUG1SPOwQ1K-PxVQ2iEWJzX-A,11348
3981
+ windmill_api-1.496.0.dist-info/METADATA,sha256=1_kwEoXhKHDbLAQzw4ZJ82wEMhitXdqB2aooUp_Kvvg,5023
3982
+ windmill_api-1.496.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
3983
+ windmill_api-1.496.0.dist-info/RECORD,,