windmill-api 1.474.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.
- windmill_api/api/folder/exists_folder.py +160 -0
- windmill_api/api/helpers/file_download.py +4 -4
- windmill_api/api/mqtt_trigger/__init__.py +0 -0
- windmill_api/api/mqtt_trigger/create_mqtt_trigger.py +105 -0
- windmill_api/api/mqtt_trigger/delete_mqtt_trigger.py +101 -0
- windmill_api/api/mqtt_trigger/exists_mqtt_trigger.py +160 -0
- windmill_api/api/mqtt_trigger/get_mqtt_trigger.py +166 -0
- windmill_api/api/mqtt_trigger/list_mqtt_triggers.py +237 -0
- windmill_api/api/mqtt_trigger/set_mqtt_trigger_enabled.py +113 -0
- windmill_api/api/mqtt_trigger/test_mqtt_connection.py +105 -0
- windmill_api/api/mqtt_trigger/update_mqtt_trigger.py +113 -0
- windmill_api/models/add_granular_acls_kind.py +1 -0
- windmill_api/models/app_with_last_version_policy.py +22 -0
- windmill_api/models/app_with_last_version_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/app_with_last_version_w_draft_policy.py +26 -0
- windmill_api/models/app_with_last_version_w_draft_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/capture_config_trigger_kind.py +1 -0
- windmill_api/models/capture_trigger_kind.py +1 -0
- windmill_api/models/create_app_json_body_policy.py +22 -0
- windmill_api/models/create_app_json_body_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/create_mqtt_trigger_json_body.py +177 -0
- windmill_api/models/create_mqtt_trigger_json_body_client_version.py +9 -0
- windmill_api/models/create_mqtt_trigger_json_body_subscribe_topics_item.py +70 -0
- windmill_api/models/create_mqtt_trigger_json_body_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/create_mqtt_trigger_json_body_v3_config.py +58 -0
- windmill_api/models/create_mqtt_trigger_json_body_v5_config.py +74 -0
- windmill_api/models/edit_mqtt_trigger.py +171 -0
- windmill_api/models/edit_mqtt_trigger_client_version.py +9 -0
- windmill_api/models/edit_mqtt_trigger_subscribe_topics_item.py +68 -0
- windmill_api/models/edit_mqtt_trigger_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/edit_mqtt_trigger_v3_config.py +58 -0
- windmill_api/models/edit_mqtt_trigger_v5_config.py +74 -0
- windmill_api/models/edit_workspace_deploy_ui_settings_json_body_deploy_ui_settings_include_type_item.py +1 -0
- windmill_api/models/get_app_by_path_response_200_policy.py +26 -0
- windmill_api/models/get_app_by_path_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_app_by_path_with_draft_response_200_policy.py +28 -0
- windmill_api/models/get_app_by_path_with_draft_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_app_by_version_response_200_policy.py +28 -0
- windmill_api/models/get_app_by_version_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_app_lite_by_path_response_200_policy.py +28 -0
- windmill_api/models/get_app_lite_by_path_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_capture_configs_response_200_item_trigger_kind.py +1 -0
- windmill_api/models/get_capture_response_200_trigger_kind.py +1 -0
- windmill_api/models/get_granular_acls_kind.py +1 -0
- windmill_api/models/get_mqtt_trigger_response_200.py +249 -0
- windmill_api/models/get_mqtt_trigger_response_200_client_version.py +9 -0
- windmill_api/models/get_mqtt_trigger_response_200_extra_perms.py +44 -0
- windmill_api/models/get_mqtt_trigger_response_200_subscribe_topics_item.py +70 -0
- windmill_api/models/get_mqtt_trigger_response_200_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/get_mqtt_trigger_response_200v3_config.py +58 -0
- windmill_api/models/get_mqtt_trigger_response_200v5_config.py +74 -0
- windmill_api/models/get_public_app_by_custom_path_response_200_policy.py +28 -0
- windmill_api/models/get_public_app_by_custom_path_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_public_app_by_secret_response_200_policy.py +28 -0
- windmill_api/models/get_public_app_by_secret_response_200_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/get_settings_response_200_deploy_ui_include_type_item.py +1 -0
- windmill_api/models/get_triggers_count_of_flow_response_200.py +8 -0
- windmill_api/models/get_triggers_count_of_script_response_200.py +8 -0
- windmill_api/models/get_used_triggers_response_200.py +7 -0
- windmill_api/models/list_captures_response_200_item_trigger_kind.py +1 -0
- windmill_api/models/list_captures_trigger_kind.py +1 -0
- windmill_api/models/list_mqtt_triggers_response_200_item.py +251 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_client_version.py +9 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_extra_perms.py +44 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_subscribe_topics_item.py +70 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_v3_config.py +58 -0
- windmill_api/models/list_mqtt_triggers_response_200_item_v5_config.py +74 -0
- windmill_api/models/mqtt_client_version.py +9 -0
- windmill_api/models/mqtt_qo_s.py +10 -0
- windmill_api/models/mqtt_subscribe_topic.py +68 -0
- windmill_api/models/mqtt_subscribe_topic_qos.py +10 -0
- windmill_api/models/mqtt_trigger.py +245 -0
- windmill_api/models/mqtt_trigger_client_version.py +9 -0
- windmill_api/models/mqtt_trigger_extra_perms.py +44 -0
- windmill_api/models/mqtt_trigger_subscribe_topics_item.py +68 -0
- windmill_api/models/mqtt_trigger_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/mqtt_trigger_v3_config.py +58 -0
- windmill_api/models/mqtt_trigger_v5_config.py +74 -0
- windmill_api/models/mqtt_v3_config.py +58 -0
- windmill_api/models/mqtt_v5_config.py +74 -0
- windmill_api/models/new_mqtt_trigger.py +173 -0
- windmill_api/models/new_mqtt_trigger_client_version.py +9 -0
- windmill_api/models/new_mqtt_trigger_subscribe_topics_item.py +68 -0
- windmill_api/models/new_mqtt_trigger_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/new_mqtt_trigger_v3_config.py +58 -0
- windmill_api/models/new_mqtt_trigger_v5_config.py +74 -0
- windmill_api/models/ping_capture_config_trigger_kind.py +1 -0
- windmill_api/models/policy.py +22 -0
- windmill_api/models/policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/remove_granular_acls_kind.py +1 -0
- windmill_api/models/set_capture_config_json_body_trigger_kind.py +1 -0
- windmill_api/models/set_mqtt_trigger_enabled_json_body.py +58 -0
- windmill_api/models/test_mqtt_connection_json_body.py +64 -0
- windmill_api/models/test_mqtt_connection_json_body_connection.py +44 -0
- windmill_api/models/triggers_count.py +8 -0
- windmill_api/models/update_app_json_body_policy.py +22 -0
- windmill_api/models/update_app_json_body_policy_allowed_s3_keys_item.py +66 -0
- windmill_api/models/update_mqtt_trigger_json_body.py +175 -0
- windmill_api/models/update_mqtt_trigger_json_body_client_version.py +9 -0
- windmill_api/models/update_mqtt_trigger_json_body_subscribe_topics_item.py +70 -0
- windmill_api/models/update_mqtt_trigger_json_body_subscribe_topics_item_qos.py +10 -0
- windmill_api/models/update_mqtt_trigger_json_body_v3_config.py +58 -0
- windmill_api/models/update_mqtt_trigger_json_body_v5_config.py +74 -0
- windmill_api/models/workspace_deploy_ui_settings_include_type_item.py +1 -0
- {windmill_api-1.474.0.dist-info → windmill_api-1.475.1.dist-info}/METADATA +1 -1
- {windmill_api-1.474.0.dist-info → windmill_api-1.475.1.dist-info}/RECORD +109 -34
- {windmill_api-1.474.0.dist-info → windmill_api-1.475.1.dist-info}/LICENSE +0 -0
- {windmill_api-1.474.0.dist-info → windmill_api-1.475.1.dist-info}/WHEEL +0 -0
|
@@ -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
|
|
@@ -68,7 +68,7 @@ def sync_detailed(
|
|
|
68
68
|
resource_type: Union[Unset, None, str] = UNSET,
|
|
69
69
|
storage: Union[Unset, None, str] = UNSET,
|
|
70
70
|
) -> Response[File]:
|
|
71
|
-
"""Download file
|
|
71
|
+
"""Download file from S3 bucket
|
|
72
72
|
|
|
73
73
|
Args:
|
|
74
74
|
workspace (str):
|
|
@@ -109,7 +109,7 @@ def sync(
|
|
|
109
109
|
resource_type: Union[Unset, None, str] = UNSET,
|
|
110
110
|
storage: Union[Unset, None, str] = UNSET,
|
|
111
111
|
) -> Optional[File]:
|
|
112
|
-
"""Download file
|
|
112
|
+
"""Download file from S3 bucket
|
|
113
113
|
|
|
114
114
|
Args:
|
|
115
115
|
workspace (str):
|
|
@@ -145,7 +145,7 @@ async def asyncio_detailed(
|
|
|
145
145
|
resource_type: Union[Unset, None, str] = UNSET,
|
|
146
146
|
storage: Union[Unset, None, str] = UNSET,
|
|
147
147
|
) -> Response[File]:
|
|
148
|
-
"""Download file
|
|
148
|
+
"""Download file from S3 bucket
|
|
149
149
|
|
|
150
150
|
Args:
|
|
151
151
|
workspace (str):
|
|
@@ -184,7 +184,7 @@ async def asyncio(
|
|
|
184
184
|
resource_type: Union[Unset, None, str] = UNSET,
|
|
185
185
|
storage: Union[Unset, None, str] = UNSET,
|
|
186
186
|
) -> Optional[File]:
|
|
187
|
-
"""Download file
|
|
187
|
+
"""Download file from S3 bucket
|
|
188
188
|
|
|
189
189
|
Args:
|
|
190
190
|
workspace (str):
|
|
File without changes
|
|
@@ -0,0 +1,105 @@
|
|
|
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.create_mqtt_trigger_json_body import CreateMqttTriggerJsonBody
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
*,
|
|
15
|
+
json_body: CreateMqttTriggerJsonBody,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
json_json_body = json_body.to_dict()
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
"method": "post",
|
|
23
|
+
"url": "/w/{workspace}/mqtt_triggers/create".format(
|
|
24
|
+
workspace=workspace,
|
|
25
|
+
),
|
|
26
|
+
"json": json_json_body,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
31
|
+
if client.raise_on_unexpected_status:
|
|
32
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
33
|
+
else:
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
|
38
|
+
return Response(
|
|
39
|
+
status_code=HTTPStatus(response.status_code),
|
|
40
|
+
content=response.content,
|
|
41
|
+
headers=response.headers,
|
|
42
|
+
parsed=_parse_response(client=client, response=response),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def sync_detailed(
|
|
47
|
+
workspace: str,
|
|
48
|
+
*,
|
|
49
|
+
client: Union[AuthenticatedClient, Client],
|
|
50
|
+
json_body: CreateMqttTriggerJsonBody,
|
|
51
|
+
) -> Response[Any]:
|
|
52
|
+
"""create mqtt trigger
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
workspace (str):
|
|
56
|
+
json_body (CreateMqttTriggerJsonBody):
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
60
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Response[Any]
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
kwargs = _get_kwargs(
|
|
67
|
+
workspace=workspace,
|
|
68
|
+
json_body=json_body,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
response = client.get_httpx_client().request(
|
|
72
|
+
**kwargs,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return _build_response(client=client, response=response)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
async def asyncio_detailed(
|
|
79
|
+
workspace: str,
|
|
80
|
+
*,
|
|
81
|
+
client: Union[AuthenticatedClient, Client],
|
|
82
|
+
json_body: CreateMqttTriggerJsonBody,
|
|
83
|
+
) -> Response[Any]:
|
|
84
|
+
"""create mqtt trigger
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
workspace (str):
|
|
88
|
+
json_body (CreateMqttTriggerJsonBody):
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
92
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
Response[Any]
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
kwargs = _get_kwargs(
|
|
99
|
+
workspace=workspace,
|
|
100
|
+
json_body=json_body,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
@@ -0,0 +1,101 @@
|
|
|
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 ...types import Response
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _get_kwargs(
|
|
12
|
+
workspace: str,
|
|
13
|
+
path: str,
|
|
14
|
+
) -> Dict[str, Any]:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
"method": "delete",
|
|
19
|
+
"url": "/w/{workspace}/mqtt_triggers/delete/{path}".format(
|
|
20
|
+
workspace=workspace,
|
|
21
|
+
path=path,
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
27
|
+
if client.raise_on_unexpected_status:
|
|
28
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
29
|
+
else:
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
|
34
|
+
return Response(
|
|
35
|
+
status_code=HTTPStatus(response.status_code),
|
|
36
|
+
content=response.content,
|
|
37
|
+
headers=response.headers,
|
|
38
|
+
parsed=_parse_response(client=client, response=response),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sync_detailed(
|
|
43
|
+
workspace: str,
|
|
44
|
+
path: str,
|
|
45
|
+
*,
|
|
46
|
+
client: Union[AuthenticatedClient, Client],
|
|
47
|
+
) -> Response[Any]:
|
|
48
|
+
"""delete mqtt trigger
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
workspace (str):
|
|
52
|
+
path (str):
|
|
53
|
+
|
|
54
|
+
Raises:
|
|
55
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
56
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
Response[Any]
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
kwargs = _get_kwargs(
|
|
63
|
+
workspace=workspace,
|
|
64
|
+
path=path,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
response = client.get_httpx_client().request(
|
|
68
|
+
**kwargs,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return _build_response(client=client, response=response)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
async def asyncio_detailed(
|
|
75
|
+
workspace: str,
|
|
76
|
+
path: str,
|
|
77
|
+
*,
|
|
78
|
+
client: Union[AuthenticatedClient, Client],
|
|
79
|
+
) -> Response[Any]:
|
|
80
|
+
"""delete mqtt trigger
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
workspace (str):
|
|
84
|
+
path (str):
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Response[Any]
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
kwargs = _get_kwargs(
|
|
95
|
+
workspace=workspace,
|
|
96
|
+
path=path,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
@@ -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
|
+
path: str,
|
|
14
|
+
) -> Dict[str, Any]:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/w/{workspace}/mqtt_triggers/exists/{path}".format(
|
|
20
|
+
workspace=workspace,
|
|
21
|
+
path=path,
|
|
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
|
+
path: str,
|
|
48
|
+
*,
|
|
49
|
+
client: Union[AuthenticatedClient, Client],
|
|
50
|
+
) -> Response[bool]:
|
|
51
|
+
"""does mqtt trigger exists
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
workspace (str):
|
|
55
|
+
path (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
|
+
path=path,
|
|
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
|
+
path: str,
|
|
80
|
+
*,
|
|
81
|
+
client: Union[AuthenticatedClient, Client],
|
|
82
|
+
) -> Optional[bool]:
|
|
83
|
+
"""does mqtt trigger exists
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
workspace (str):
|
|
87
|
+
path (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
|
+
path=path,
|
|
100
|
+
client=client,
|
|
101
|
+
).parsed
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
async def asyncio_detailed(
|
|
105
|
+
workspace: str,
|
|
106
|
+
path: str,
|
|
107
|
+
*,
|
|
108
|
+
client: Union[AuthenticatedClient, Client],
|
|
109
|
+
) -> Response[bool]:
|
|
110
|
+
"""does mqtt trigger exists
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
workspace (str):
|
|
114
|
+
path (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
|
+
path=path,
|
|
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
|
+
path: str,
|
|
137
|
+
*,
|
|
138
|
+
client: Union[AuthenticatedClient, Client],
|
|
139
|
+
) -> Optional[bool]:
|
|
140
|
+
"""does mqtt trigger exists
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
workspace (str):
|
|
144
|
+
path (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
|
+
path=path,
|
|
158
|
+
client=client,
|
|
159
|
+
)
|
|
160
|
+
).parsed
|