fal 1.0.7__py3-none-any.whl → 1.1.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 fal might be problematic. Click here for more details.
- fal/_fal_version.py +2 -2
- fal/api.py +116 -29
- fal/app.py +63 -1
- fal/cli/deploy.py +18 -8
- fal/cli/doctor.py +37 -0
- fal/cli/main.py +2 -2
- fal/sdk.py +6 -2
- fal/toolkit/file/providers/fal.py +1 -0
- fal/workflows.py +1 -1
- {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/METADATA +2 -1
- {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/RECORD +49 -27
- {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/WHEEL +1 -1
- openapi_fal_rest/api/comfy/__init__.py +0 -0
- openapi_fal_rest/api/comfy/create_workflow.py +172 -0
- openapi_fal_rest/api/comfy/delete_workflow.py +175 -0
- openapi_fal_rest/api/comfy/get_workflow.py +181 -0
- openapi_fal_rest/api/comfy/list_user_workflows.py +189 -0
- openapi_fal_rest/api/comfy/update_workflow.py +198 -0
- openapi_fal_rest/api/users/__init__.py +0 -0
- openapi_fal_rest/api/users/get_current_user.py +143 -0
- openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py} +4 -4
- openapi_fal_rest/api/workflows/{get_workflows_workflows_get.py → list_user_workflows.py} +4 -4
- openapi_fal_rest/api/workflows/update_workflow.py +198 -0
- openapi_fal_rest/models/__init__.py +32 -10
- openapi_fal_rest/models/comfy_workflow_detail.py +109 -0
- openapi_fal_rest/models/comfy_workflow_item.py +88 -0
- openapi_fal_rest/models/comfy_workflow_schema.py +119 -0
- openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0.py → comfy_workflow_schema_extra_data.py} +5 -5
- openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0.py → comfy_workflow_schema_fal_inputs.py} +5 -5
- openapi_fal_rest/models/comfy_workflow_schema_fal_inputs_dev_info.py +44 -0
- openapi_fal_rest/models/{workflow_detail_contents_type_0.py → comfy_workflow_schema_prompt.py} +5 -5
- openapi_fal_rest/models/current_user.py +138 -0
- openapi_fal_rest/models/customer_details.py +8 -8
- openapi_fal_rest/models/lock_reason.py +3 -0
- openapi_fal_rest/models/page_comfy_workflow_item.py +107 -0
- openapi_fal_rest/models/team_role.py +10 -0
- openapi_fal_rest/models/typed_comfy_workflow.py +85 -0
- openapi_fal_rest/models/typed_comfy_workflow_update.py +95 -0
- openapi_fal_rest/models/typed_workflow_update.py +95 -0
- openapi_fal_rest/models/user_member.py +87 -0
- openapi_fal_rest/models/workflow_contents.py +20 -1
- openapi_fal_rest/models/workflow_contents_metadata.py +44 -0
- openapi_fal_rest/models/workflow_detail.py +18 -59
- openapi_fal_rest/models/workflow_detail_contents.py +44 -0
- openapi_fal_rest/models/workflow_item.py +19 -1
- openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +0 -268
- {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/entry_points.txt +0 -0
- {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/top_level.txt +0 -0
- /openapi_fal_rest/api/workflows/{delete_workflow_workflows_user_id_workflow_name_delete.py → delete_workflow.py} +0 -0
- /openapi_fal_rest/api/workflows/{get_workflow_workflows_user_id_workflow_name_get.py → get_workflow.py} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
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.page_comfy_workflow_item import PageComfyWorkflowItem
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
client: Client,
|
|
16
|
+
page: Union[Unset, None, int] = 1,
|
|
17
|
+
size: Union[Unset, None, int] = 50,
|
|
18
|
+
) -> Dict[str, Any]:
|
|
19
|
+
url = "{}/comfy/".format(client.base_url)
|
|
20
|
+
|
|
21
|
+
headers: Dict[str, str] = client.get_headers()
|
|
22
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
23
|
+
|
|
24
|
+
params: Dict[str, Any] = {}
|
|
25
|
+
params["page"] = page
|
|
26
|
+
|
|
27
|
+
params["size"] = size
|
|
28
|
+
|
|
29
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
"method": "get",
|
|
33
|
+
"url": url,
|
|
34
|
+
"headers": headers,
|
|
35
|
+
"cookies": cookies,
|
|
36
|
+
"timeout": client.get_timeout(),
|
|
37
|
+
"follow_redirects": client.follow_redirects,
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _parse_response(
|
|
43
|
+
*, client: Client, response: httpx.Response
|
|
44
|
+
) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
45
|
+
if response.status_code == HTTPStatus.OK:
|
|
46
|
+
response_200 = PageComfyWorkflowItem.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_200
|
|
49
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
50
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_422
|
|
53
|
+
if client.raise_on_unexpected_status:
|
|
54
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
55
|
+
else:
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _build_response(
|
|
60
|
+
*, client: Client, response: httpx.Response
|
|
61
|
+
) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
62
|
+
return Response(
|
|
63
|
+
status_code=HTTPStatus(response.status_code),
|
|
64
|
+
content=response.content,
|
|
65
|
+
headers=response.headers,
|
|
66
|
+
parsed=_parse_response(client=client, response=response),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync_detailed(
|
|
71
|
+
*,
|
|
72
|
+
client: Client,
|
|
73
|
+
page: Union[Unset, None, int] = 1,
|
|
74
|
+
size: Union[Unset, None, int] = 50,
|
|
75
|
+
) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
76
|
+
"""List User Workflows
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
page (Union[Unset, None, int]): Default: 1.
|
|
80
|
+
size (Union[Unset, None, int]): Default: 50.
|
|
81
|
+
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Response[Union[HTTPValidationError, PageComfyWorkflowItem]]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
kwargs = _get_kwargs(
|
|
91
|
+
client=client,
|
|
92
|
+
page=page,
|
|
93
|
+
size=size,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = httpx.request(
|
|
97
|
+
verify=client.verify_ssl,
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
*,
|
|
106
|
+
client: Client,
|
|
107
|
+
page: Union[Unset, None, int] = 1,
|
|
108
|
+
size: Union[Unset, None, int] = 50,
|
|
109
|
+
) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
110
|
+
"""List User Workflows
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
page (Union[Unset, None, int]): Default: 1.
|
|
114
|
+
size (Union[Unset, None, int]): Default: 50.
|
|
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
|
+
Union[HTTPValidationError, PageComfyWorkflowItem]
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
return sync_detailed(
|
|
125
|
+
client=client,
|
|
126
|
+
page=page,
|
|
127
|
+
size=size,
|
|
128
|
+
).parsed
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
async def asyncio_detailed(
|
|
132
|
+
*,
|
|
133
|
+
client: Client,
|
|
134
|
+
page: Union[Unset, None, int] = 1,
|
|
135
|
+
size: Union[Unset, None, int] = 50,
|
|
136
|
+
) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
137
|
+
"""List User Workflows
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
page (Union[Unset, None, int]): Default: 1.
|
|
141
|
+
size (Union[Unset, None, int]): Default: 50.
|
|
142
|
+
|
|
143
|
+
Raises:
|
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
Response[Union[HTTPValidationError, PageComfyWorkflowItem]]
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
kwargs = _get_kwargs(
|
|
152
|
+
client=client,
|
|
153
|
+
page=page,
|
|
154
|
+
size=size,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
158
|
+
response = await _client.request(**kwargs)
|
|
159
|
+
|
|
160
|
+
return _build_response(client=client, response=response)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def asyncio(
|
|
164
|
+
*,
|
|
165
|
+
client: Client,
|
|
166
|
+
page: Union[Unset, None, int] = 1,
|
|
167
|
+
size: Union[Unset, None, int] = 50,
|
|
168
|
+
) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
|
|
169
|
+
"""List User Workflows
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
page (Union[Unset, None, int]): Default: 1.
|
|
173
|
+
size (Union[Unset, None, int]): Default: 50.
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
Union[HTTPValidationError, PageComfyWorkflowItem]
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
await asyncio_detailed(
|
|
185
|
+
client=client,
|
|
186
|
+
page=page,
|
|
187
|
+
size=size,
|
|
188
|
+
)
|
|
189
|
+
).parsed
|
|
@@ -0,0 +1,198 @@
|
|
|
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.comfy_workflow_detail import ComfyWorkflowDetail
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.typed_comfy_workflow_update import TypedComfyWorkflowUpdate
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
user_id: str,
|
|
16
|
+
name: str,
|
|
17
|
+
*,
|
|
18
|
+
client: Client,
|
|
19
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
20
|
+
) -> Dict[str, Any]:
|
|
21
|
+
url = "{}/comfy/{user_id}/{name}".format(client.base_url, user_id=user_id, name=name)
|
|
22
|
+
|
|
23
|
+
headers: Dict[str, str] = client.get_headers()
|
|
24
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
25
|
+
|
|
26
|
+
json_json_body = json_body.to_dict()
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
"method": "patch",
|
|
30
|
+
"url": url,
|
|
31
|
+
"headers": headers,
|
|
32
|
+
"cookies": cookies,
|
|
33
|
+
"timeout": client.get_timeout(),
|
|
34
|
+
"follow_redirects": client.follow_redirects,
|
|
35
|
+
"json": json_json_body,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: Client, response: httpx.Response
|
|
41
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
42
|
+
if response.status_code == HTTPStatus.CREATED:
|
|
43
|
+
response_201 = ComfyWorkflowDetail.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_201
|
|
46
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
47
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Client, response: httpx.Response
|
|
58
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
user_id: str,
|
|
69
|
+
name: str,
|
|
70
|
+
*,
|
|
71
|
+
client: Client,
|
|
72
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
73
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
74
|
+
"""Update Workflow
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
user_id (str):
|
|
78
|
+
name (str):
|
|
79
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
83
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
user_id=user_id,
|
|
91
|
+
name=name,
|
|
92
|
+
client=client,
|
|
93
|
+
json_body=json_body,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = httpx.request(
|
|
97
|
+
verify=client.verify_ssl,
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
user_id: str,
|
|
106
|
+
name: str,
|
|
107
|
+
*,
|
|
108
|
+
client: Client,
|
|
109
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
110
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
111
|
+
"""Update Workflow
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
user_id (str):
|
|
115
|
+
name (str):
|
|
116
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Union[ComfyWorkflowDetail, HTTPValidationError]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
return sync_detailed(
|
|
127
|
+
user_id=user_id,
|
|
128
|
+
name=name,
|
|
129
|
+
client=client,
|
|
130
|
+
json_body=json_body,
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
async def asyncio_detailed(
|
|
135
|
+
user_id: str,
|
|
136
|
+
name: str,
|
|
137
|
+
*,
|
|
138
|
+
client: Client,
|
|
139
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
140
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
141
|
+
"""Update Workflow
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
user_id (str):
|
|
145
|
+
name (str):
|
|
146
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
kwargs = _get_kwargs(
|
|
157
|
+
user_id=user_id,
|
|
158
|
+
name=name,
|
|
159
|
+
client=client,
|
|
160
|
+
json_body=json_body,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
164
|
+
response = await _client.request(**kwargs)
|
|
165
|
+
|
|
166
|
+
return _build_response(client=client, response=response)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def asyncio(
|
|
170
|
+
user_id: str,
|
|
171
|
+
name: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Client,
|
|
174
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
175
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
176
|
+
"""Update Workflow
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
user_id (str):
|
|
180
|
+
name (str):
|
|
181
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Union[ComfyWorkflowDetail, HTTPValidationError]
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
await asyncio_detailed(
|
|
193
|
+
user_id=user_id,
|
|
194
|
+
name=name,
|
|
195
|
+
client=client,
|
|
196
|
+
json_body=json_body,
|
|
197
|
+
)
|
|
198
|
+
).parsed
|
|
File without changes
|
|
@@ -0,0 +1,143 @@
|
|
|
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.current_user import CurrentUser
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
client: Client,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
url = "{}/users/current".format(client.base_url)
|
|
18
|
+
|
|
19
|
+
headers: Dict[str, str] = client.get_headers()
|
|
20
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
"method": "get",
|
|
24
|
+
"url": url,
|
|
25
|
+
"headers": headers,
|
|
26
|
+
"cookies": cookies,
|
|
27
|
+
"timeout": client.get_timeout(),
|
|
28
|
+
"follow_redirects": client.follow_redirects,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
33
|
+
if response.status_code == HTTPStatus.OK:
|
|
34
|
+
response_200 = CurrentUser.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
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[CurrentUser, 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
|
+
*,
|
|
58
|
+
client: Client,
|
|
59
|
+
) -> Response[Union[CurrentUser, HTTPValidationError]]:
|
|
60
|
+
"""Get Current User
|
|
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[Union[CurrentUser, HTTPValidationError]]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
kwargs = _get_kwargs(
|
|
71
|
+
client=client,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
response = httpx.request(
|
|
75
|
+
verify=client.verify_ssl,
|
|
76
|
+
**kwargs,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return _build_response(client=client, response=response)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync(
|
|
83
|
+
*,
|
|
84
|
+
client: Client,
|
|
85
|
+
) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
86
|
+
"""Get Current User
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Union[CurrentUser, HTTPValidationError]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
return sync_detailed(
|
|
97
|
+
client=client,
|
|
98
|
+
).parsed
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
async def asyncio_detailed(
|
|
102
|
+
*,
|
|
103
|
+
client: Client,
|
|
104
|
+
) -> Response[Union[CurrentUser, HTTPValidationError]]:
|
|
105
|
+
"""Get Current User
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response[Union[CurrentUser, HTTPValidationError]]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kwargs = _get_kwargs(
|
|
116
|
+
client=client,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
120
|
+
response = await _client.request(**kwargs)
|
|
121
|
+
|
|
122
|
+
return _build_response(client=client, response=response)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
async def asyncio(
|
|
126
|
+
*,
|
|
127
|
+
client: Client,
|
|
128
|
+
) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
129
|
+
"""Get Current User
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Union[CurrentUser, HTTPValidationError]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
await asyncio_detailed(
|
|
141
|
+
client=client,
|
|
142
|
+
)
|
|
143
|
+
).parsed
|
openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py}
RENAMED
|
@@ -67,7 +67,7 @@ def sync_detailed(
|
|
|
67
67
|
client: Client,
|
|
68
68
|
json_body: TypedWorkflow,
|
|
69
69
|
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
70
|
-
"""Create
|
|
70
|
+
"""Create Workflow
|
|
71
71
|
|
|
72
72
|
Args:
|
|
73
73
|
json_body (TypedWorkflow):
|
|
@@ -98,7 +98,7 @@ def sync(
|
|
|
98
98
|
client: Client,
|
|
99
99
|
json_body: TypedWorkflow,
|
|
100
100
|
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
101
|
-
"""Create
|
|
101
|
+
"""Create Workflow
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
104
|
json_body (TypedWorkflow):
|
|
@@ -122,7 +122,7 @@ async def asyncio_detailed(
|
|
|
122
122
|
client: Client,
|
|
123
123
|
json_body: TypedWorkflow,
|
|
124
124
|
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
125
|
-
"""Create
|
|
125
|
+
"""Create Workflow
|
|
126
126
|
|
|
127
127
|
Args:
|
|
128
128
|
json_body (TypedWorkflow):
|
|
@@ -151,7 +151,7 @@ async def asyncio(
|
|
|
151
151
|
client: Client,
|
|
152
152
|
json_body: TypedWorkflow,
|
|
153
153
|
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
154
|
-
"""Create
|
|
154
|
+
"""Create Workflow
|
|
155
155
|
|
|
156
156
|
Args:
|
|
157
157
|
json_body (TypedWorkflow):
|
|
@@ -73,7 +73,7 @@ def sync_detailed(
|
|
|
73
73
|
page: Union[Unset, None, int] = 1,
|
|
74
74
|
size: Union[Unset, None, int] = 50,
|
|
75
75
|
) -> Response[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
76
|
-
"""Get Workflows
|
|
76
|
+
"""Get User Workflows
|
|
77
77
|
|
|
78
78
|
Args:
|
|
79
79
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -107,7 +107,7 @@ def sync(
|
|
|
107
107
|
page: Union[Unset, None, int] = 1,
|
|
108
108
|
size: Union[Unset, None, int] = 50,
|
|
109
109
|
) -> Optional[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
110
|
-
"""Get Workflows
|
|
110
|
+
"""Get User Workflows
|
|
111
111
|
|
|
112
112
|
Args:
|
|
113
113
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -134,7 +134,7 @@ async def asyncio_detailed(
|
|
|
134
134
|
page: Union[Unset, None, int] = 1,
|
|
135
135
|
size: Union[Unset, None, int] = 50,
|
|
136
136
|
) -> Response[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
137
|
-
"""Get Workflows
|
|
137
|
+
"""Get User Workflows
|
|
138
138
|
|
|
139
139
|
Args:
|
|
140
140
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -166,7 +166,7 @@ async def asyncio(
|
|
|
166
166
|
page: Union[Unset, None, int] = 1,
|
|
167
167
|
size: Union[Unset, None, int] = 50,
|
|
168
168
|
) -> Optional[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
169
|
-
"""Get Workflows
|
|
169
|
+
"""Get User Workflows
|
|
170
170
|
|
|
171
171
|
Args:
|
|
172
172
|
page (Union[Unset, None, int]): Default: 1.
|