fal 0.12.3__tar.gz → 0.12.5__tar.gz
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 fal might be problematic. Click here for more details.
- {fal-0.12.3 → fal-0.12.5}/PKG-INFO +2 -2
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/__init__.py +1 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/create_or_update_workflow_workflows_post.py +172 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/delete_workflow_workflows_user_id_workflow_name_delete.py +175 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +268 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/get_workflow_workflows_user_id_workflow_name_get.py +181 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/get_workflows_workflows_get.py +189 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/__init__.py +53 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/app_metadata_response_app_metadata.py +1 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/customer_details.py +15 -14
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0.py +44 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0.py +44 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/page_workflow_item.py +107 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/typed_workflow.py +85 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_contents.py +98 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_contents_nodes.py +59 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_contents_output.py +44 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_detail.py +149 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_detail_contents_type_0.py +44 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_item.py +80 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_node.py +74 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_node_type.py +9 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_schema.py +73 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_schema_input.py +44 -0
- fal-0.12.5/openapi-fal-rest/openapi_fal_rest/models/workflow_schema_output.py +44 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/types.py +1 -0
- {fal-0.12.3 → fal-0.12.5}/pyproject.toml +2 -2
- {fal-0.12.3 → fal-0.12.5}/setup.py +4 -2
- {fal-0.12.3 → fal-0.12.5}/src/fal/auth/__init__.py +13 -1
- {fal-0.12.3 → fal-0.12.5}/src/fal/auth/auth0.py +3 -3
- {fal-0.12.3 → fal-0.12.5}/src/fal/cli.py +9 -1
- {fal-0.12.3 → fal-0.12.5}/src/fal/flags.py +1 -0
- fal-0.12.5/src/fal/py.typed +0 -0
- fal-0.12.5/src/fal/workflows.py +481 -0
- fal-0.12.3/openapi-fal-rest/openapi_fal_rest/models/__init__.py +0 -19
- {fal-0.12.3 → fal-0.12.5}/README.md +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/applications/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/applications/app_metadata.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/billing/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/billing/get_user_details.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/files/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/files/check_dir_hash.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/api/files/upload_local_file.py +0 -0
- /fal-0.12.3/src/fal/py.typed → /fal-0.12.5/openapi-fal-rest/openapi_fal_rest/api/workflows/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/client.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/errors.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/body_upload_local_file.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/hash_check.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/http_validation_error.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/lock_reason.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/models/validation_error.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/openapi-fal-rest/openapi_fal_rest/py.typed +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/_serialization.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/api.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/app.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/apps.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/auth/local.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/console/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/console/icons.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/console/ux.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/env.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/exceptions/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/exceptions/_base.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/exceptions/auth.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/exceptions/handlers.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/logging/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/logging/isolate.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/logging/style.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/logging/trace.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/logging/user.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/rest_client.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/sdk.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/sync.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/exceptions.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/file.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/providers/fal.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/providers/gcp.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/providers/r2.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/file/types.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/image/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/image/image.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/mainify.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/optimize.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/utils/__init__.py +0 -0
- {fal-0.12.3 → fal-0.12.5}/src/fal/toolkit/utils/download_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fal
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.5
|
|
4
4
|
Summary: fal is an easy-to-use Serverless Python Framework
|
|
5
5
|
Author: Features & Labels
|
|
6
6
|
Author-email: hello@fal.ai
|
|
@@ -19,7 +19,7 @@ Requires-Dist: grpc-interceptor (>=0.15.0,<0.16.0)
|
|
|
19
19
|
Requires-Dist: grpcio (>=1.50.0,<2.0.0)
|
|
20
20
|
Requires-Dist: httpx (>=0.15.4)
|
|
21
21
|
Requires-Dist: importlib-metadata (>=4.4) ; python_version < "3.10"
|
|
22
|
-
Requires-Dist: isolate-proto (
|
|
22
|
+
Requires-Dist: isolate-proto (>=0.3.4,<0.4.0)
|
|
23
23
|
Requires-Dist: isolate[build] (>=0.12.3,<1.0)
|
|
24
24
|
Requires-Dist: msgpack (>=1.0.7,<2.0.0)
|
|
25
25
|
Requires-Dist: opentelemetry-api (>=1.15.0,<2.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 Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.typed_workflow import TypedWorkflow
|
|
10
|
+
from ...models.workflow_detail import WorkflowDetail
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
client: Client,
|
|
17
|
+
json_body: TypedWorkflow,
|
|
18
|
+
) -> Dict[str, Any]:
|
|
19
|
+
url = "{}/workflows/".format(client.base_url)
|
|
20
|
+
|
|
21
|
+
headers: Dict[str, str] = client.get_headers()
|
|
22
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
23
|
+
|
|
24
|
+
json_json_body = json_body.to_dict()
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
"method": "post",
|
|
28
|
+
"url": url,
|
|
29
|
+
"headers": headers,
|
|
30
|
+
"cookies": cookies,
|
|
31
|
+
"timeout": client.get_timeout(),
|
|
32
|
+
"follow_redirects": client.follow_redirects,
|
|
33
|
+
"json": json_json_body,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: Client, response: httpx.Response
|
|
39
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
40
|
+
if response.status_code == HTTPStatus.CREATED:
|
|
41
|
+
response_201 = WorkflowDetail.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_201
|
|
44
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
45
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_422
|
|
48
|
+
if client.raise_on_unexpected_status:
|
|
49
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
50
|
+
else:
|
|
51
|
+
return None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _build_response(
|
|
55
|
+
*, client: Client, response: httpx.Response
|
|
56
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
57
|
+
return Response(
|
|
58
|
+
status_code=HTTPStatus(response.status_code),
|
|
59
|
+
content=response.content,
|
|
60
|
+
headers=response.headers,
|
|
61
|
+
parsed=_parse_response(client=client, response=response),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def sync_detailed(
|
|
66
|
+
*,
|
|
67
|
+
client: Client,
|
|
68
|
+
json_body: TypedWorkflow,
|
|
69
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
70
|
+
"""Create Or Update Workflow
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
json_body (TypedWorkflow):
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[Union[HTTPValidationError, WorkflowDetail]]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
client=client,
|
|
85
|
+
json_body=json_body,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
response = httpx.request(
|
|
89
|
+
verify=client.verify_ssl,
|
|
90
|
+
**kwargs,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return _build_response(client=client, response=response)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def sync(
|
|
97
|
+
*,
|
|
98
|
+
client: Client,
|
|
99
|
+
json_body: TypedWorkflow,
|
|
100
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
101
|
+
"""Create Or Update Workflow
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
json_body (TypedWorkflow):
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Union[HTTPValidationError, WorkflowDetail]
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return sync_detailed(
|
|
115
|
+
client=client,
|
|
116
|
+
json_body=json_body,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
*,
|
|
122
|
+
client: Client,
|
|
123
|
+
json_body: TypedWorkflow,
|
|
124
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
125
|
+
"""Create Or Update Workflow
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
json_body (TypedWorkflow):
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
132
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Response[Union[HTTPValidationError, WorkflowDetail]]
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
kwargs = _get_kwargs(
|
|
139
|
+
client=client,
|
|
140
|
+
json_body=json_body,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
144
|
+
response = await _client.request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
*,
|
|
151
|
+
client: Client,
|
|
152
|
+
json_body: TypedWorkflow,
|
|
153
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
154
|
+
"""Create Or Update Workflow
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
json_body (TypedWorkflow):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Union[HTTPValidationError, WorkflowDetail]
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
await asyncio_detailed(
|
|
169
|
+
client=client,
|
|
170
|
+
json_body=json_body,
|
|
171
|
+
)
|
|
172
|
+
).parsed
|
|
@@ -0,0 +1,175 @@
|
|
|
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 Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
user_id: str,
|
|
14
|
+
workflow_name: str,
|
|
15
|
+
*,
|
|
16
|
+
client: Client,
|
|
17
|
+
) -> Dict[str, Any]:
|
|
18
|
+
url = "{}/workflows/{user_id}/{workflow_name}".format(client.base_url, user_id=user_id, workflow_name=workflow_name)
|
|
19
|
+
|
|
20
|
+
headers: Dict[str, str] = client.get_headers()
|
|
21
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
"method": "delete",
|
|
25
|
+
"url": url,
|
|
26
|
+
"headers": headers,
|
|
27
|
+
"cookies": cookies,
|
|
28
|
+
"timeout": client.get_timeout(),
|
|
29
|
+
"follow_redirects": client.follow_redirects,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
|
|
34
|
+
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
35
|
+
response_204 = cast(Any, None)
|
|
36
|
+
return response_204
|
|
37
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
38
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_422
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
|
|
48
|
+
return Response(
|
|
49
|
+
status_code=HTTPStatus(response.status_code),
|
|
50
|
+
content=response.content,
|
|
51
|
+
headers=response.headers,
|
|
52
|
+
parsed=_parse_response(client=client, response=response),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def sync_detailed(
|
|
57
|
+
user_id: str,
|
|
58
|
+
workflow_name: str,
|
|
59
|
+
*,
|
|
60
|
+
client: Client,
|
|
61
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
62
|
+
"""Delete Workflow
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
user_id (str):
|
|
66
|
+
workflow_name (str):
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Response[Union[Any, HTTPValidationError]]
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = _get_kwargs(
|
|
77
|
+
user_id=user_id,
|
|
78
|
+
workflow_name=workflow_name,
|
|
79
|
+
client=client,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
response = httpx.request(
|
|
83
|
+
verify=client.verify_ssl,
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return _build_response(client=client, response=response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def sync(
|
|
91
|
+
user_id: str,
|
|
92
|
+
workflow_name: str,
|
|
93
|
+
*,
|
|
94
|
+
client: Client,
|
|
95
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
96
|
+
"""Delete Workflow
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
user_id (str):
|
|
100
|
+
workflow_name (str):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Union[Any, HTTPValidationError]
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
user_id=user_id,
|
|
112
|
+
workflow_name=workflow_name,
|
|
113
|
+
client=client,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
user_id: str,
|
|
119
|
+
workflow_name: str,
|
|
120
|
+
*,
|
|
121
|
+
client: Client,
|
|
122
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
123
|
+
"""Delete Workflow
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
user_id (str):
|
|
127
|
+
workflow_name (str):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Response[Union[Any, HTTPValidationError]]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
kwargs = _get_kwargs(
|
|
138
|
+
user_id=user_id,
|
|
139
|
+
workflow_name=workflow_name,
|
|
140
|
+
client=client,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
144
|
+
response = await _client.request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
user_id: str,
|
|
151
|
+
workflow_name: str,
|
|
152
|
+
*,
|
|
153
|
+
client: Client,
|
|
154
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
155
|
+
"""Delete Workflow
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
user_id (str):
|
|
159
|
+
workflow_name (str):
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
Union[Any, HTTPValidationError]
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
await asyncio_detailed(
|
|
171
|
+
user_id=user_id,
|
|
172
|
+
workflow_name=workflow_name,
|
|
173
|
+
client=client,
|
|
174
|
+
)
|
|
175
|
+
).parsed
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import Client
|
|
8
|
+
from ...models.execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0 import (
|
|
9
|
+
ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0,
|
|
10
|
+
)
|
|
11
|
+
from ...models.execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0 import (
|
|
12
|
+
ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0,
|
|
13
|
+
)
|
|
14
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
15
|
+
from ...types import Response
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
user_id: str,
|
|
20
|
+
workflow_name: str,
|
|
21
|
+
*,
|
|
22
|
+
client: Client,
|
|
23
|
+
json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
|
|
24
|
+
) -> Dict[str, Any]:
|
|
25
|
+
url = "{}/workflows/{user_id}/{workflow_name}".format(client.base_url, user_id=user_id, workflow_name=workflow_name)
|
|
26
|
+
|
|
27
|
+
headers: Dict[str, str] = client.get_headers()
|
|
28
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
29
|
+
|
|
30
|
+
json_json_body: Union[Dict[str, Any], List[Any], bool, float, int, str]
|
|
31
|
+
|
|
32
|
+
if isinstance(json_body, ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0):
|
|
33
|
+
json_json_body = json_body.to_dict()
|
|
34
|
+
|
|
35
|
+
elif isinstance(json_body, list):
|
|
36
|
+
json_json_body = json_body
|
|
37
|
+
|
|
38
|
+
else:
|
|
39
|
+
json_json_body = json_body
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
"method": "post",
|
|
43
|
+
"url": url,
|
|
44
|
+
"headers": headers,
|
|
45
|
+
"cookies": cookies,
|
|
46
|
+
"timeout": client.get_timeout(),
|
|
47
|
+
"follow_redirects": client.follow_redirects,
|
|
48
|
+
"json": json_json_body,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[
|
|
53
|
+
Union[
|
|
54
|
+
HTTPValidationError,
|
|
55
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
56
|
+
]
|
|
57
|
+
]:
|
|
58
|
+
if response.status_code == HTTPStatus.OK:
|
|
59
|
+
|
|
60
|
+
def _parse_response_200(
|
|
61
|
+
data: object,
|
|
62
|
+
) -> Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str]:
|
|
63
|
+
try:
|
|
64
|
+
if not isinstance(data, dict):
|
|
65
|
+
raise TypeError()
|
|
66
|
+
response_200_type_0 = ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0.from_dict(data)
|
|
67
|
+
|
|
68
|
+
return response_200_type_0
|
|
69
|
+
except: # noqa: E722
|
|
70
|
+
pass
|
|
71
|
+
try:
|
|
72
|
+
if not isinstance(data, list):
|
|
73
|
+
raise TypeError()
|
|
74
|
+
response_200_type_1 = cast(List[Any], data)
|
|
75
|
+
|
|
76
|
+
return response_200_type_1
|
|
77
|
+
except: # noqa: E722
|
|
78
|
+
pass
|
|
79
|
+
return cast(
|
|
80
|
+
Union[
|
|
81
|
+
"ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str
|
|
82
|
+
],
|
|
83
|
+
data,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
response_200 = _parse_response_200(response.json())
|
|
87
|
+
|
|
88
|
+
return response_200
|
|
89
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
90
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
91
|
+
|
|
92
|
+
return response_422
|
|
93
|
+
if client.raise_on_unexpected_status:
|
|
94
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
95
|
+
else:
|
|
96
|
+
return None
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[
|
|
100
|
+
Union[
|
|
101
|
+
HTTPValidationError,
|
|
102
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
103
|
+
]
|
|
104
|
+
]:
|
|
105
|
+
return Response(
|
|
106
|
+
status_code=HTTPStatus(response.status_code),
|
|
107
|
+
content=response.content,
|
|
108
|
+
headers=response.headers,
|
|
109
|
+
parsed=_parse_response(client=client, response=response),
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def sync_detailed(
|
|
114
|
+
user_id: str,
|
|
115
|
+
workflow_name: str,
|
|
116
|
+
*,
|
|
117
|
+
client: Client,
|
|
118
|
+
json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
|
|
119
|
+
) -> Response[
|
|
120
|
+
Union[
|
|
121
|
+
HTTPValidationError,
|
|
122
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
123
|
+
]
|
|
124
|
+
]:
|
|
125
|
+
"""Execute Workflow
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
user_id (str):
|
|
129
|
+
workflow_name (str):
|
|
130
|
+
json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
|
|
131
|
+
bool, float, int, str]):
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
135
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Response[Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]]
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
user_id=user_id,
|
|
143
|
+
workflow_name=workflow_name,
|
|
144
|
+
client=client,
|
|
145
|
+
json_body=json_body,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
response = httpx.request(
|
|
149
|
+
verify=client.verify_ssl,
|
|
150
|
+
**kwargs,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
return _build_response(client=client, response=response)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def sync(
|
|
157
|
+
user_id: str,
|
|
158
|
+
workflow_name: str,
|
|
159
|
+
*,
|
|
160
|
+
client: Client,
|
|
161
|
+
json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
|
|
162
|
+
) -> Optional[
|
|
163
|
+
Union[
|
|
164
|
+
HTTPValidationError,
|
|
165
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
166
|
+
]
|
|
167
|
+
]:
|
|
168
|
+
"""Execute Workflow
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
user_id (str):
|
|
172
|
+
workflow_name (str):
|
|
173
|
+
json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
|
|
174
|
+
bool, float, int, str]):
|
|
175
|
+
|
|
176
|
+
Raises:
|
|
177
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
178
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
return sync_detailed(
|
|
185
|
+
user_id=user_id,
|
|
186
|
+
workflow_name=workflow_name,
|
|
187
|
+
client=client,
|
|
188
|
+
json_body=json_body,
|
|
189
|
+
).parsed
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async def asyncio_detailed(
|
|
193
|
+
user_id: str,
|
|
194
|
+
workflow_name: str,
|
|
195
|
+
*,
|
|
196
|
+
client: Client,
|
|
197
|
+
json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
|
|
198
|
+
) -> Response[
|
|
199
|
+
Union[
|
|
200
|
+
HTTPValidationError,
|
|
201
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
202
|
+
]
|
|
203
|
+
]:
|
|
204
|
+
"""Execute Workflow
|
|
205
|
+
|
|
206
|
+
Args:
|
|
207
|
+
user_id (str):
|
|
208
|
+
workflow_name (str):
|
|
209
|
+
json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
|
|
210
|
+
bool, float, int, str]):
|
|
211
|
+
|
|
212
|
+
Raises:
|
|
213
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
214
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
Response[Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]]
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
kwargs = _get_kwargs(
|
|
221
|
+
user_id=user_id,
|
|
222
|
+
workflow_name=workflow_name,
|
|
223
|
+
client=client,
|
|
224
|
+
json_body=json_body,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
228
|
+
response = await _client.request(**kwargs)
|
|
229
|
+
|
|
230
|
+
return _build_response(client=client, response=response)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
async def asyncio(
|
|
234
|
+
user_id: str,
|
|
235
|
+
workflow_name: str,
|
|
236
|
+
*,
|
|
237
|
+
client: Client,
|
|
238
|
+
json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
|
|
239
|
+
) -> Optional[
|
|
240
|
+
Union[
|
|
241
|
+
HTTPValidationError,
|
|
242
|
+
Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
|
|
243
|
+
]
|
|
244
|
+
]:
|
|
245
|
+
"""Execute Workflow
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
user_id (str):
|
|
249
|
+
workflow_name (str):
|
|
250
|
+
json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
|
|
251
|
+
bool, float, int, str]):
|
|
252
|
+
|
|
253
|
+
Raises:
|
|
254
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
255
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
await asyncio_detailed(
|
|
263
|
+
user_id=user_id,
|
|
264
|
+
workflow_name=workflow_name,
|
|
265
|
+
client=client,
|
|
266
|
+
json_body=json_body,
|
|
267
|
+
)
|
|
268
|
+
).parsed
|