This commit is contained in:
Ruben Fiszel
2024-01-16 23:47:42 +01:00
parent c73e2760d4
commit 5610330e2e
1696 changed files with 0 additions and 160145 deletions
-23
View File
@@ -1,23 +0,0 @@
__pycache__/
build/
dist/
*.egg-info/
.pytest_cache/
# pyenv
.python-version
# Environments
.env
.venv
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# JetBrains
.idea/
/coverage.xml
/.coverage
-201
View File
@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2022 Windmill Labs, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-114
View File
@@ -1,114 +0,0 @@
# Autogenerated Windmill OpenApi Client
This is the raw autogenerated api client. You are most likely more interested in [wmill](https://pypi.org/project/wmill/) which leverages this client to offer an user friendly experience. We use [this openapi python client generator](https://github.com/openapi-generators/openapi-python-client/)
# windmill-api
A client library for accessing Windmill API
## Usage
First, create a client:
```python
from windmill_api import Client
client = Client(base_url="https://api.example.com")
```
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
```python
from windmill_api import AuthenticatedClient
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
```
Now call your endpoint and use your models:
```python
from windmill_api.models import MyDataModel
from windmill_api.api.my_tag import get_my_data_model
from windmill_api.types import Response
with client as client:
my_data: MyDataModel = get_my_data_model.sync(client=client)
# or if you need more info (e.g. status_code)
response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
```
Or do the same thing with an async version:
```python
from windmill_api.models import MyDataModel
from windmill_api.api.my_tag import get_my_data_model
from windmill_api.types import Response
async with client as client:
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
```
By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
```python
client = AuthenticatedClient(
base_url="https://internal_api.example.com",
token="SuperSecretToken",
verify_ssl="/path/to/certificate_bundle.pem",
)
```
You can also disable certificate validation altogether, but beware that **this is a security risk**.
```python
client = AuthenticatedClient(
base_url="https://internal_api.example.com",
token="SuperSecretToken",
verify_ssl=False
)
```
Things to know:
1. Every path/method combo becomes a Python module with four functions:
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
1. `asyncio`: Like `sync` but async instead of blocking
1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
1. All path/query params, and bodies become method arguments.
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
1. Any endpoint which did not have a tag will be in `windmill_api.api.default`
## Advanced customizations
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
```python
from windmill_api import Client
def log_request(request):
print(f"Request event hook: {request.method} {request.url} - Waiting for response")
def log_response(response):
request = response.request
print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
client = Client(
base_url="https://api.example.com",
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
)
# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
```
You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
```python
import httpx
from windmill_api import Client
client = Client(
base_url="https://api.example.com",
)
# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
```
-40
View File
@@ -1,40 +0,0 @@
[tool.poetry]
name = "windmill-api"
version = "1.245.0"
description = "A client library for accessing Windmill API"
license = "Apache-2.0"
authors = ["Ruben Fiszel <ruben@windmill.dev>"]
readme = "README.md"
packages = [
{include = "windmill_api"},
]
include = ["CHANGELOG.md", "windmill_api/py.typed"]
[tool.poetry.dependencies]
python = "^3.8"
httpx = ">=0.20.0,<0.25.0"
attrs = ">=21.3.0"
python-dateutil = "^2.8.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
target_version = ['py38', 'py39', 'py310', 'py311']
exclude = '''
(
/(
| \.git
| \.venv
| \.mypy_cache
)/
)
'''
[tool.isort]
line_length = 120
profile = "black"
@@ -1,8 +0,0 @@
""" A client library for accessing Windmill API """
from .client import AuthenticatedClient, Client
__all__ = (
"AuthenticatedClient",
"Client",
)
@@ -1 +0,0 @@
""" Contains methods for accessing the API """
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.create_app_json_body import CreateAppJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: CreateAppJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/apps/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateAppJsonBody,
) -> Response[Any]:
""" create app
Args:
workspace (str):
json_body (CreateAppJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateAppJsonBody,
) -> Response[Any]:
""" create app
Args:
workspace (str):
json_body (CreateAppJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/w/{workspace}/apps/delete/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete app
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete app
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.execute_component_json_body import ExecuteComponentJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: ExecuteComponentJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/apps_u/execute_component/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ExecuteComponentJsonBody,
) -> Response[Any]:
""" executeComponent
Args:
workspace (str):
path (str):
json_body (ExecuteComponentJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ExecuteComponentJsonBody,
) -> Response[Any]:
""" executeComponent
Args:
workspace (str):
path (str):
json_body (ExecuteComponentJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,178 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/exists/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[bool]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[bool]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" does an app exisst at path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" does an app exisst at path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
bool
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" does an app exisst at path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" does an app exisst at path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
bool
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.get_app_by_path_response_200 import GetAppByPathResponse200
from typing import cast
from typing import Dict
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/get/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetAppByPathResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetAppByPathResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetAppByPathResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByPathResponse200]:
""" get app by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByPathResponse200]:
""" get app by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByPathResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByPathResponse200]:
""" get app by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByPathResponse200]:
""" get app by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByPathResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_app_by_path_with_draft_response_200 import GetAppByPathWithDraftResponse200
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/get/draft/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetAppByPathWithDraftResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetAppByPathWithDraftResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetAppByPathWithDraftResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByPathWithDraftResponse200]:
""" get app by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByPathWithDraftResponse200]:
""" get app by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByPathWithDraftResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByPathWithDraftResponse200]:
""" get app by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByPathWithDraftResponse200]:
""" get app by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByPathWithDraftResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.get_app_by_version_response_200 import GetAppByVersionResponse200
from typing import cast
from typing import Dict
def _get_kwargs(
workspace: str,
id: int,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/get/v/{id}".format(workspace=workspace,id=id,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetAppByVersionResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetAppByVersionResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetAppByVersionResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByVersionResponse200]:
""" get app by version
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByVersionResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByVersionResponse200]:
""" get app by version
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByVersionResponse200
"""
return sync_detailed(
workspace=workspace,
id=id,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAppByVersionResponse200]:
""" get app by version
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAppByVersionResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAppByVersionResponse200]:
""" get app by version
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAppByVersionResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
id=id,
client=client,
)).parsed
@@ -1,190 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.get_app_history_by_path_response_200_item import GetAppHistoryByPathResponse200Item
from typing import cast
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/history/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['GetAppHistoryByPathResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = GetAppHistoryByPathResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['GetAppHistoryByPathResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['GetAppHistoryByPathResponse200Item']]:
""" get app history by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['GetAppHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['GetAppHistoryByPathResponse200Item']]:
""" get app history by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['GetAppHistoryByPathResponse200Item']
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['GetAppHistoryByPathResponse200Item']]:
""" get app history by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['GetAppHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['GetAppHistoryByPathResponse200Item']]:
""" get app history by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['GetAppHistoryByPathResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,171 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_hub_app_by_id_response_200 import GetHubAppByIdResponse200
def _get_kwargs(
id: int,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/apps/hub/get/{id}".format(id=id,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetHubAppByIdResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetHubAppByIdResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetHubAppByIdResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubAppByIdResponse200]:
""" get hub app by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetHubAppByIdResponse200]
"""
kwargs = _get_kwargs(
id=id,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubAppByIdResponse200]:
""" get hub app by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetHubAppByIdResponse200
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubAppByIdResponse200]:
""" get hub app by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetHubAppByIdResponse200]
"""
kwargs = _get_kwargs(
id=id,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubAppByIdResponse200]:
""" get hub app by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetHubAppByIdResponse200
"""
return (await asyncio_detailed(
id=id,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_public_app_by_secret_response_200 import GetPublicAppBySecretResponse200
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps_u/public_app/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetPublicAppBySecretResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetPublicAppBySecretResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetPublicAppBySecretResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetPublicAppBySecretResponse200]:
""" get public app by secret
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetPublicAppBySecretResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetPublicAppBySecretResponse200]:
""" get public app by secret
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetPublicAppBySecretResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetPublicAppBySecretResponse200]:
""" get public app by secret
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetPublicAppBySecretResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetPublicAppBySecretResponse200]:
""" get public app by secret
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetPublicAppBySecretResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,121 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps_u/public_resource/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get public resource
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get public resource
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/secret_of/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get public secret of app
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get public secret of app
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,297 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from ...models.list_apps_response_200_item import ListAppsResponse200Item
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params["order_desc"] = order_desc
params["created_by"] = created_by
params["path_start"] = path_start
params["path_exact"] = path_exact
params["starred_only"] = starred_only
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/apps/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListAppsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListAppsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListAppsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListAppsResponse200Item']]:
""" list all apps
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListAppsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
starred_only=starred_only,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListAppsResponse200Item']]:
""" list all apps
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListAppsResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
starred_only=starred_only,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListAppsResponse200Item']]:
""" list all apps
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListAppsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
starred_only=starred_only,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListAppsResponse200Item']]:
""" list all apps
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListAppsResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
starred_only=starred_only,
)).parsed
@@ -1,150 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.list_hub_apps_response_200 import ListHubAppsResponse200
from typing import cast
from typing import Dict
def _get_kwargs(
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/apps/hub/list",
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ListHubAppsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = ListHubAppsResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ListHubAppsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ListHubAppsResponse200]:
""" list all hub apps
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListHubAppsResponse200]
"""
kwargs = _get_kwargs(
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ListHubAppsResponse200]:
""" list all hub apps
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListHubAppsResponse200
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ListHubAppsResponse200]:
""" list all hub apps
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListHubAppsResponse200]
"""
kwargs = _get_kwargs(
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ListHubAppsResponse200]:
""" list all hub apps
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListHubAppsResponse200
"""
return (await asyncio_detailed(
client=client,
)).parsed
@@ -1,177 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.list_search_app_response_200_item import ListSearchAppResponse200Item
from typing import cast, List
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/apps/list_search".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListSearchAppResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListSearchAppResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListSearchAppResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListSearchAppResponse200Item']]:
""" list apps for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListSearchAppResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListSearchAppResponse200Item']]:
""" list apps for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListSearchAppResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListSearchAppResponse200Item']]:
""" list apps for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListSearchAppResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListSearchAppResponse200Item']]:
""" list apps for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListSearchAppResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
)).parsed
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_app_json_body import UpdateAppJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: UpdateAppJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/apps/update/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateAppJsonBody,
) -> Response[Any]:
""" update app
Args:
workspace (str):
path (str):
json_body (UpdateAppJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateAppJsonBody,
) -> Response[Any]:
""" update app
Args:
workspace (str):
path (str):
json_body (UpdateAppJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,140 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_app_history_json_body import UpdateAppHistoryJsonBody
def _get_kwargs(
workspace: str,
id: int,
version: int,
*,
json_body: UpdateAppHistoryJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/apps/history_update/a/{id}/v/{version}".format(workspace=workspace,id=id,version=version,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
id: int,
version: int,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateAppHistoryJsonBody,
) -> Response[Any]:
""" update app history
Args:
workspace (str):
id (int):
version (int):
json_body (UpdateAppHistoryJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
version=version,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
id: int,
version: int,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateAppHistoryJsonBody,
) -> Response[Any]:
""" update app history
Args:
workspace (str):
id (int):
version (int):
json_body (UpdateAppHistoryJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
version=version,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_audit_log_response_200 import GetAuditLogResponse200
def _get_kwargs(
workspace: str,
id: int,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/audit/get/{id}".format(workspace=workspace,id=id,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetAuditLogResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetAuditLogResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetAuditLogResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAuditLogResponse200]:
""" get audit log (requires admin privilege)
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAuditLogResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAuditLogResponse200]:
""" get audit log (requires admin privilege)
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAuditLogResponse200
"""
return sync_detailed(
workspace=workspace,
id=id,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetAuditLogResponse200]:
""" get audit log (requires admin privilege)
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetAuditLogResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
id=id,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetAuditLogResponse200]:
""" get audit log (requires admin privilege)
Args:
workspace (str):
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetAuditLogResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
id=id,
client=client,
)).parsed
@@ -1,328 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from typing import Dict
from ...models.list_audit_logs_action_kind import ListAuditLogsActionKind
import datetime
from dateutil.parser import isoparse
from ...models.list_audit_logs_response_200_item import ListAuditLogsResponse200Item
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
before: Union[Unset, None, datetime.datetime] = UNSET,
after: Union[Unset, None, datetime.datetime] = UNSET,
username: Union[Unset, None, str] = UNSET,
operation: Union[Unset, None, str] = UNSET,
resource: Union[Unset, None, str] = UNSET,
action_kind: Union[Unset, None, ListAuditLogsActionKind] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
json_before: Union[Unset, None, str] = UNSET
if not isinstance(before, Unset):
json_before = before.isoformat() if before else None
params["before"] = json_before
json_after: Union[Unset, None, str] = UNSET
if not isinstance(after, Unset):
json_after = after.isoformat() if after else None
params["after"] = json_after
params["username"] = username
params["operation"] = operation
params["resource"] = resource
json_action_kind: Union[Unset, None, str] = UNSET
if not isinstance(action_kind, Unset):
json_action_kind = action_kind.value if action_kind else None
params["action_kind"] = json_action_kind
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/audit/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListAuditLogsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListAuditLogsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListAuditLogsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
before: Union[Unset, None, datetime.datetime] = UNSET,
after: Union[Unset, None, datetime.datetime] = UNSET,
username: Union[Unset, None, str] = UNSET,
operation: Union[Unset, None, str] = UNSET,
resource: Union[Unset, None, str] = UNSET,
action_kind: Union[Unset, None, ListAuditLogsActionKind] = UNSET,
) -> Response[List['ListAuditLogsResponse200Item']]:
""" list audit logs (requires admin privilege)
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
before (Union[Unset, None, datetime.datetime]):
after (Union[Unset, None, datetime.datetime]):
username (Union[Unset, None, str]):
operation (Union[Unset, None, str]):
resource (Union[Unset, None, str]):
action_kind (Union[Unset, None, ListAuditLogsActionKind]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListAuditLogsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
before=before,
after=after,
username=username,
operation=operation,
resource=resource,
action_kind=action_kind,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
before: Union[Unset, None, datetime.datetime] = UNSET,
after: Union[Unset, None, datetime.datetime] = UNSET,
username: Union[Unset, None, str] = UNSET,
operation: Union[Unset, None, str] = UNSET,
resource: Union[Unset, None, str] = UNSET,
action_kind: Union[Unset, None, ListAuditLogsActionKind] = UNSET,
) -> Optional[List['ListAuditLogsResponse200Item']]:
""" list audit logs (requires admin privilege)
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
before (Union[Unset, None, datetime.datetime]):
after (Union[Unset, None, datetime.datetime]):
username (Union[Unset, None, str]):
operation (Union[Unset, None, str]):
resource (Union[Unset, None, str]):
action_kind (Union[Unset, None, ListAuditLogsActionKind]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListAuditLogsResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
before=before,
after=after,
username=username,
operation=operation,
resource=resource,
action_kind=action_kind,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
before: Union[Unset, None, datetime.datetime] = UNSET,
after: Union[Unset, None, datetime.datetime] = UNSET,
username: Union[Unset, None, str] = UNSET,
operation: Union[Unset, None, str] = UNSET,
resource: Union[Unset, None, str] = UNSET,
action_kind: Union[Unset, None, ListAuditLogsActionKind] = UNSET,
) -> Response[List['ListAuditLogsResponse200Item']]:
""" list audit logs (requires admin privilege)
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
before (Union[Unset, None, datetime.datetime]):
after (Union[Unset, None, datetime.datetime]):
username (Union[Unset, None, str]):
operation (Union[Unset, None, str]):
resource (Union[Unset, None, str]):
action_kind (Union[Unset, None, ListAuditLogsActionKind]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListAuditLogsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
before=before,
after=after,
username=username,
operation=operation,
resource=resource,
action_kind=action_kind,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
before: Union[Unset, None, datetime.datetime] = UNSET,
after: Union[Unset, None, datetime.datetime] = UNSET,
username: Union[Unset, None, str] = UNSET,
operation: Union[Unset, None, str] = UNSET,
resource: Union[Unset, None, str] = UNSET,
action_kind: Union[Unset, None, ListAuditLogsActionKind] = UNSET,
) -> Optional[List['ListAuditLogsResponse200Item']]:
""" list audit logs (requires admin privilege)
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
before (Union[Unset, None, datetime.datetime]):
after (Union[Unset, None, datetime.datetime]):
username (Union[Unset, None, str]):
operation (Union[Unset, None, str]):
resource (Union[Unset, None, str]):
action_kind (Union[Unset, None, ListAuditLogsActionKind]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListAuditLogsResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
before=before,
after=after,
username=username,
operation=operation,
resource=resource,
action_kind=action_kind,
)).parsed
@@ -1,121 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "put",
"url": "/w/{workspace}/capture/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.CREATED:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" create flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" create flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,123 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/capture/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if response.status_code == HTTPStatus.NOT_FOUND:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,121 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "post",
"url": "/w/{workspace}/capture_u/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.NO_CONTENT:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" update flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" update flow preview capture
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,112 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/configs/update/{name}".format(name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" Delete Config
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" Delete Config
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,114 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/configs/get/{name}".format(name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get config
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get config
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,156 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.list_worker_groups_response_200_item import ListWorkerGroupsResponse200Item
from typing import Dict
from typing import cast, List
def _get_kwargs(
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/configs/list_worker_groups",
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListWorkerGroupsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListWorkerGroupsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListWorkerGroupsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListWorkerGroupsResponse200Item']]:
""" list worker groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListWorkerGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListWorkerGroupsResponse200Item']]:
""" list worker groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListWorkerGroupsResponse200Item']
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListWorkerGroupsResponse200Item']]:
""" list worker groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListWorkerGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListWorkerGroupsResponse200Item']]:
""" list worker groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListWorkerGroupsResponse200Item']
"""
return (await asyncio_detailed(
client=client,
)).parsed
@@ -1,122 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
name: str,
*,
json_body: Any,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body
return {
"method": "post",
"url": "/configs/update/{name}".format(name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: Any,
) -> Response[Any]:
""" Update config
Args:
name (str):
json_body (Any):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: Any,
) -> Response[Any]:
""" Update config
Args:
name (str):
json_body (Any):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.create_draft_json_body import CreateDraftJsonBody
from typing import cast
from typing import Dict
def _get_kwargs(
workspace: str,
*,
json_body: CreateDraftJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/drafts/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateDraftJsonBody,
) -> Response[Any]:
""" create draft
Args:
workspace (str):
json_body (CreateDraftJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateDraftJsonBody,
) -> Response[Any]:
""" create draft
Args:
workspace (str):
json_body (CreateDraftJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,127 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.delete_draft_kind import DeleteDraftKind
def _get_kwargs(
workspace: str,
kind: DeleteDraftKind,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/w/{workspace}/drafts/delete/{kind}/{path}".format(workspace=workspace,kind=kind,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
kind: DeleteDraftKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete draft
Args:
workspace (str):
kind (DeleteDraftKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
kind: DeleteDraftKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete draft
Args:
workspace (str):
kind (DeleteDraftKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,128 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.star_json_body import StarJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: StarJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/favorites/star".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: StarJsonBody,
) -> Response[Any]:
""" star item
Args:
workspace (str):
json_body (StarJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: StarJsonBody,
) -> Response[Any]:
""" star item
Args:
workspace (str):
json_body (StarJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,128 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.unstar_json_body import UnstarJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: UnstarJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/favorites/unstar".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UnstarJsonBody,
) -> Response[Any]:
""" unstar item
Args:
workspace (str):
json_body (UnstarJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UnstarJsonBody,
) -> Response[Any]:
""" unstar item
Args:
workspace (str):
json_body (UnstarJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.archive_flow_by_path_json_body import ArchiveFlowByPathJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: ArchiveFlowByPathJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/flows/archive/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ArchiveFlowByPathJsonBody,
) -> Response[Any]:
""" archive flow by path
Args:
workspace (str):
path (str):
json_body (ArchiveFlowByPathJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ArchiveFlowByPathJsonBody,
) -> Response[Any]:
""" archive flow by path
Args:
workspace (str):
path (str):
json_body (ArchiveFlowByPathJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.create_flow_json_body import CreateFlowJsonBody
from typing import cast
from typing import Dict
def _get_kwargs(
workspace: str,
*,
json_body: CreateFlowJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/flows/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateFlowJsonBody,
) -> Response[Any]:
""" create flow
Args:
workspace (str):
json_body (CreateFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateFlowJsonBody,
) -> Response[Any]:
""" create flow
Args:
workspace (str):
json_body (CreateFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/w/{workspace}/flows/delete/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,178 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/flows/exists/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[bool]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[bool]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" exists flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" exists flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
bool
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" exists flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" exists flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
bool
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.get_flow_by_path_response_200 import GetFlowByPathResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/flows/get/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetFlowByPathResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetFlowByPathResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetFlowByPathResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFlowByPathResponse200]:
""" get flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFlowByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFlowByPathResponse200]:
""" get flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFlowByPathResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFlowByPathResponse200]:
""" get flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFlowByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFlowByPathResponse200]:
""" get flow by path
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFlowByPathResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.get_flow_by_path_with_draft_response_200 import GetFlowByPathWithDraftResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/flows/get/draft/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetFlowByPathWithDraftResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetFlowByPathWithDraftResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetFlowByPathWithDraftResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFlowByPathWithDraftResponse200]:
""" get flow by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFlowByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFlowByPathWithDraftResponse200]:
""" get flow by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFlowByPathWithDraftResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFlowByPathWithDraftResponse200]:
""" get flow by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFlowByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFlowByPathWithDraftResponse200]:
""" get flow by path with draft
Args:
workspace (str):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFlowByPathWithDraftResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed
@@ -1,230 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from typing import Dict
from ...models.get_flow_input_history_by_path_response_200_item import GetFlowInputHistoryByPathResponse200Item
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
path: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/flows/input_history/p/{path}".format(workspace=workspace,path=path,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['GetFlowInputHistoryByPathResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = GetFlowInputHistoryByPathResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['GetFlowInputHistoryByPathResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['GetFlowInputHistoryByPathResponse200Item']]:
""" list inputs for previous completed flow jobs
Args:
workspace (str):
path (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['GetFlowInputHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
page=page,
per_page=per_page,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['GetFlowInputHistoryByPathResponse200Item']]:
""" list inputs for previous completed flow jobs
Args:
workspace (str):
path (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['GetFlowInputHistoryByPathResponse200Item']
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
page=page,
per_page=per_page,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['GetFlowInputHistoryByPathResponse200Item']]:
""" list inputs for previous completed flow jobs
Args:
workspace (str):
path (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['GetFlowInputHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
page=page,
per_page=per_page,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['GetFlowInputHistoryByPathResponse200Item']]:
""" list inputs for previous completed flow jobs
Args:
workspace (str):
path (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['GetFlowInputHistoryByPathResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
page=page,
per_page=per_page,
)).parsed
@@ -1,171 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.get_hub_flow_by_id_response_200 import GetHubFlowByIdResponse200
from typing import cast
from typing import Dict
def _get_kwargs(
id: int,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/flows/hub/get/{id}".format(id=id,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetHubFlowByIdResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetHubFlowByIdResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetHubFlowByIdResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubFlowByIdResponse200]:
""" get hub flow by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetHubFlowByIdResponse200]
"""
kwargs = _get_kwargs(
id=id,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubFlowByIdResponse200]:
""" get hub flow by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetHubFlowByIdResponse200
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubFlowByIdResponse200]:
""" get hub flow by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetHubFlowByIdResponse200]
"""
kwargs = _get_kwargs(
id=id,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
id: int,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubFlowByIdResponse200]:
""" get hub flow by id
Args:
id (int):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetHubFlowByIdResponse200
"""
return (await asyncio_detailed(
id=id,
client=client,
)).parsed
@@ -1,112 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/flows/list_paths".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" list all flow paths
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" list all flow paths
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,313 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from typing import Dict
from ...models.list_flows_response_200_item import ListFlowsResponse200Item
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params["order_desc"] = order_desc
params["created_by"] = created_by
params["path_start"] = path_start
params["path_exact"] = path_exact
params["show_archived"] = show_archived
params["starred_only"] = starred_only
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/flows/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListFlowsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListFlowsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListFlowsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListFlowsResponse200Item']]:
""" list all flows
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListFlowsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
show_archived=show_archived,
starred_only=starred_only,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListFlowsResponse200Item']]:
""" list all flows
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListFlowsResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
show_archived=show_archived,
starred_only=starred_only,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListFlowsResponse200Item']]:
""" list all flows
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListFlowsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
show_archived=show_archived,
starred_only=starred_only,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListFlowsResponse200Item']]:
""" list all flows
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
starred_only (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListFlowsResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
show_archived=show_archived,
starred_only=starred_only,
)).parsed
@@ -1,150 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.list_hub_flows_response_200 import ListHubFlowsResponse200
from typing import cast
from typing import Dict
def _get_kwargs(
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/flows/hub/list",
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ListHubFlowsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = ListHubFlowsResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ListHubFlowsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ListHubFlowsResponse200]:
""" list all hub flows
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListHubFlowsResponse200]
"""
kwargs = _get_kwargs(
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ListHubFlowsResponse200]:
""" list all hub flows
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListHubFlowsResponse200
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ListHubFlowsResponse200]:
""" list all hub flows
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListHubFlowsResponse200]
"""
kwargs = _get_kwargs(
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ListHubFlowsResponse200]:
""" list all hub flows
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListHubFlowsResponse200
"""
return (await asyncio_detailed(
client=client,
)).parsed
@@ -1,177 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.list_search_flow_response_200_item import ListSearchFlowResponse200Item
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/flows/list_search".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListSearchFlowResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListSearchFlowResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListSearchFlowResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListSearchFlowResponse200Item']]:
""" list flows for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListSearchFlowResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListSearchFlowResponse200Item']]:
""" list flows for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListSearchFlowResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListSearchFlowResponse200Item']]:
""" list flows for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListSearchFlowResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListSearchFlowResponse200Item']]:
""" list flows for search
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListSearchFlowResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
)).parsed
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.toggle_workspace_error_handler_for_flow_json_body import ToggleWorkspaceErrorHandlerForFlowJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: ToggleWorkspaceErrorHandlerForFlowJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/flows/toggle_workspace_error_handler/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ToggleWorkspaceErrorHandlerForFlowJsonBody,
) -> Response[Any]:
""" Toggle ON and OFF the workspace error handler for a given flow
Args:
workspace (str):
path (str):
json_body (ToggleWorkspaceErrorHandlerForFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ToggleWorkspaceErrorHandlerForFlowJsonBody,
) -> Response[Any]:
""" Toggle ON and OFF the workspace error handler for a given flow
Args:
workspace (str):
path (str):
json_body (ToggleWorkspaceErrorHandlerForFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_flow_json_body import UpdateFlowJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: UpdateFlowJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/flows/update/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateFlowJsonBody,
) -> Response[Any]:
""" update flow
Args:
workspace (str):
path (str):
json_body (UpdateFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateFlowJsonBody,
) -> Response[Any]:
""" update flow
Args:
workspace (str):
path (str):
json_body (UpdateFlowJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.add_owner_to_folder_json_body import AddOwnerToFolderJsonBody
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: AddOwnerToFolderJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/folders/addowner/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddOwnerToFolderJsonBody,
) -> Response[Any]:
""" add owner to folder
Args:
workspace (str):
name (str):
json_body (AddOwnerToFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddOwnerToFolderJsonBody,
) -> Response[Any]:
""" add owner to folder
Args:
workspace (str):
name (str):
json_body (AddOwnerToFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.create_folder_json_body import CreateFolderJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: CreateFolderJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/folders/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateFolderJsonBody,
) -> Response[Any]:
""" create folder
Args:
workspace (str):
json_body (CreateFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateFolderJsonBody,
) -> Response[Any]:
""" create folder
Args:
workspace (str):
json_body (CreateFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/w/{workspace}/folders/delete/{name}".format(workspace=workspace,name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_folder_response_200 import GetFolderResponse200
def _get_kwargs(
workspace: str,
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/folders/get/{name}".format(workspace=workspace,name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetFolderResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetFolderResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetFolderResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFolderResponse200]:
""" get folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFolderResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFolderResponse200]:
""" get folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFolderResponse200
"""
return sync_detailed(
workspace=workspace,
name=name,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFolderResponse200]:
""" get folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFolderResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFolderResponse200]:
""" get folder
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFolderResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
name=name,
client=client,
)).parsed
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_folder_usage_response_200 import GetFolderUsageResponse200
def _get_kwargs(
workspace: str,
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/folders/getusage/{name}".format(workspace=workspace,name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetFolderUsageResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetFolderUsageResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetFolderUsageResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFolderUsageResponse200]:
""" get folder usage
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFolderUsageResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFolderUsageResponse200]:
""" get folder usage
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFolderUsageResponse200
"""
return sync_detailed(
workspace=workspace,
name=name,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetFolderUsageResponse200]:
""" get folder usage
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetFolderUsageResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetFolderUsageResponse200]:
""" get folder usage
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetFolderUsageResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
name=name,
client=client,
)).parsed
@@ -1,191 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import Optional
from typing import cast, List
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["only_member_of"] = only_member_of
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/folders/listnames".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(List[str], response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Response[List[str]]:
""" list folder names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List[str]]
"""
kwargs = _get_kwargs(
workspace=workspace,
only_member_of=only_member_of,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Optional[List[str]]:
""" list folder names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List[str]
"""
return sync_detailed(
workspace=workspace,
client=client,
only_member_of=only_member_of,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Response[List[str]]:
""" list folder names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List[str]]
"""
kwargs = _get_kwargs(
workspace=workspace,
only_member_of=only_member_of,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Optional[List[str]]:
""" list folder names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List[str]
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
only_member_of=only_member_of,
)).parsed
@@ -1,217 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from typing import Dict
from ...models.list_folders_response_200_item import ListFoldersResponse200Item
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/folders/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListFoldersResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListFoldersResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListFoldersResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['ListFoldersResponse200Item']]:
""" list folders
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListFoldersResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['ListFoldersResponse200Item']]:
""" list folders
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListFoldersResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['ListFoldersResponse200Item']]:
""" list folders
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListFoldersResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['ListFoldersResponse200Item']]:
""" list folders
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListFoldersResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
)).parsed
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.remove_owner_to_folder_json_body import RemoveOwnerToFolderJsonBody
from typing import Dict
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: RemoveOwnerToFolderJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/folders/removeowner/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveOwnerToFolderJsonBody,
) -> Response[Any]:
""" remove owner to folder
Args:
workspace (str):
name (str):
json_body (RemoveOwnerToFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveOwnerToFolderJsonBody,
) -> Response[Any]:
""" remove owner to folder
Args:
workspace (str):
name (str):
json_body (RemoveOwnerToFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_folder_json_body import UpdateFolderJsonBody
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: UpdateFolderJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/folders/update/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateFolderJsonBody,
) -> Response[Any]:
""" update folder
Args:
workspace (str):
name (str):
json_body (UpdateFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateFolderJsonBody,
) -> Response[Any]:
""" update folder
Args:
workspace (str):
name (str):
json_body (UpdateFolderJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,141 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.add_granular_acls_json_body import AddGranularAclsJsonBody
from typing import Dict
from ...models.add_granular_acls_kind import AddGranularAclsKind
def _get_kwargs(
workspace: str,
kind: AddGranularAclsKind,
path: str,
*,
json_body: AddGranularAclsJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/acls/add/{kind}/{path}".format(workspace=workspace,kind=kind,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
kind: AddGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddGranularAclsJsonBody,
) -> Response[Any]:
""" add granular acls
Args:
workspace (str):
kind (AddGranularAclsKind):
path (str):
json_body (AddGranularAclsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
kind: AddGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddGranularAclsJsonBody,
) -> Response[Any]:
""" add granular acls
Args:
workspace (str):
kind (AddGranularAclsKind):
path (str):
json_body (AddGranularAclsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,198 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.get_granular_acls_kind import GetGranularAclsKind
from typing import cast
from ...models.get_granular_acls_response_200 import GetGranularAclsResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
kind: GetGranularAclsKind,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/acls/get/{kind}/{path}".format(workspace=workspace,kind=kind,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetGranularAclsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetGranularAclsResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetGranularAclsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
kind: GetGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetGranularAclsResponse200]:
""" get granular acls
Args:
workspace (str):
kind (GetGranularAclsKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetGranularAclsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
kind: GetGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetGranularAclsResponse200]:
""" get granular acls
Args:
workspace (str):
kind (GetGranularAclsKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetGranularAclsResponse200
"""
return sync_detailed(
workspace=workspace,
kind=kind,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
kind: GetGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetGranularAclsResponse200]:
""" get granular acls
Args:
workspace (str):
kind (GetGranularAclsKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetGranularAclsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
kind: GetGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetGranularAclsResponse200]:
""" get granular acls
Args:
workspace (str):
kind (GetGranularAclsKind):
path (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetGranularAclsResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
kind=kind,
path=path,
client=client,
)).parsed
@@ -1,141 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.remove_granular_acls_json_body import RemoveGranularAclsJsonBody
from typing import cast
from ...models.remove_granular_acls_kind import RemoveGranularAclsKind
from typing import Dict
def _get_kwargs(
workspace: str,
kind: RemoveGranularAclsKind,
path: str,
*,
json_body: RemoveGranularAclsJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/acls/remove/{kind}/{path}".format(workspace=workspace,kind=kind,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
kind: RemoveGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveGranularAclsJsonBody,
) -> Response[Any]:
""" remove granular acls
Args:
workspace (str):
kind (RemoveGranularAclsKind):
path (str):
json_body (RemoveGranularAclsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
kind: RemoveGranularAclsKind,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveGranularAclsJsonBody,
) -> Response[Any]:
""" remove granular acls
Args:
workspace (str):
kind (RemoveGranularAclsKind):
path (str):
json_body (RemoveGranularAclsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
kind=kind,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.add_user_to_group_json_body import AddUserToGroupJsonBody
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: AddUserToGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/groups/adduser/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddUserToGroupJsonBody,
) -> Response[Any]:
""" add user to group
Args:
workspace (str):
name (str):
json_body (AddUserToGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddUserToGroupJsonBody,
) -> Response[Any]:
""" add user to group
Args:
workspace (str):
name (str):
json_body (AddUserToGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.add_user_to_instance_group_json_body import AddUserToInstanceGroupJsonBody
def _get_kwargs(
name: str,
*,
json_body: AddUserToInstanceGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/groups/adduser/{name}".format(name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddUserToInstanceGroupJsonBody,
) -> Response[Any]:
""" add user to instance group
Args:
name (str):
json_body (AddUserToInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: AddUserToInstanceGroupJsonBody,
) -> Response[Any]:
""" add user to instance group
Args:
name (str):
json_body (AddUserToInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.create_group_json_body import CreateGroupJsonBody
from typing import Dict
def _get_kwargs(
workspace: str,
*,
json_body: CreateGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/groups/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateGroupJsonBody,
) -> Response[Any]:
""" create group
Args:
workspace (str):
json_body (CreateGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateGroupJsonBody,
) -> Response[Any]:
""" create group
Args:
workspace (str):
json_body (CreateGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.create_instance_group_json_body import CreateInstanceGroupJsonBody
def _get_kwargs(
*,
json_body: CreateInstanceGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/groups/create",
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateInstanceGroupJsonBody,
) -> Response[Any]:
""" create instance group
Args:
json_body (CreateInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateInstanceGroupJsonBody,
) -> Response[Any]:
""" create instance group
Args:
json_body (CreateInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,119 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/w/{workspace}/groups/delete/{name}".format(workspace=workspace,name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,112 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "delete",
"url": "/groups/delete/{name}".format(name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" delete instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,184 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.get_group_response_200 import GetGroupResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/groups/get/{name}".format(workspace=workspace,name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetGroupResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetGroupResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetGroupResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetGroupResponse200]:
""" get group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetGroupResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetGroupResponse200]:
""" get group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetGroupResponse200
"""
return sync_detailed(
workspace=workspace,
name=name,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetGroupResponse200]:
""" get group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetGroupResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetGroupResponse200]:
""" get group
Args:
workspace (str):
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetGroupResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
name=name,
client=client,
)).parsed
@@ -1,171 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.get_instance_group_response_200 import GetInstanceGroupResponse200
def _get_kwargs(
name: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/groups/get/{name}".format(name=name,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetInstanceGroupResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetInstanceGroupResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[GetInstanceGroupResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetInstanceGroupResponse200]:
""" get instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetInstanceGroupResponse200]
"""
kwargs = _get_kwargs(
name=name,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetInstanceGroupResponse200]:
""" get instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetInstanceGroupResponse200
"""
return sync_detailed(
name=name,
client=client,
).parsed
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetInstanceGroupResponse200]:
""" get instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[GetInstanceGroupResponse200]
"""
kwargs = _get_kwargs(
name=name,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
name: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetInstanceGroupResponse200]:
""" get instance group
Args:
name (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
GetInstanceGroupResponse200
"""
return (await asyncio_detailed(
name=name,
client=client,
)).parsed
@@ -1,191 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import Optional
from typing import cast, List
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["only_member_of"] = only_member_of
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/groups/listnames".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(List[str], response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Response[List[str]]:
""" list group names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List[str]]
"""
kwargs = _get_kwargs(
workspace=workspace,
only_member_of=only_member_of,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Optional[List[str]]:
""" list group names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List[str]
"""
return sync_detailed(
workspace=workspace,
client=client,
only_member_of=only_member_of,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Response[List[str]]:
""" list group names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List[str]]
"""
kwargs = _get_kwargs(
workspace=workspace,
only_member_of=only_member_of,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
only_member_of: Union[Unset, None, bool] = UNSET,
) -> Optional[List[str]]:
""" list group names
Args:
workspace (str):
only_member_of (Union[Unset, None, bool]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List[str]
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
only_member_of=only_member_of,
)).parsed
@@ -1,217 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import cast, List
from ...models.list_groups_response_200_item import ListGroupsResponse200Item
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/groups/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListGroupsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListGroupsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListGroupsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['ListGroupsResponse200Item']]:
""" list groups
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['ListGroupsResponse200Item']]:
""" list groups
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListGroupsResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Response[List['ListGroupsResponse200Item']]:
""" list groups
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
) -> Optional[List['ListGroupsResponse200Item']]:
""" list groups
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListGroupsResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
)).parsed
@@ -1,156 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.list_instance_groups_response_200_item import ListInstanceGroupsResponse200Item
from typing import cast, List
def _get_kwargs(
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/groups/list",
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListInstanceGroupsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListInstanceGroupsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List['ListInstanceGroupsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListInstanceGroupsResponse200Item']]:
""" list instance groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListInstanceGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListInstanceGroupsResponse200Item']]:
""" list instance groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListInstanceGroupsResponse200Item']
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListInstanceGroupsResponse200Item']]:
""" list instance groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[List['ListInstanceGroupsResponse200Item']]
"""
kwargs = _get_kwargs(
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListInstanceGroupsResponse200Item']]:
""" list instance groups
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
List['ListInstanceGroupsResponse200Item']
"""
return (await asyncio_detailed(
client=client,
)).parsed
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.remove_user_from_instance_group_json_body import RemoveUserFromInstanceGroupJsonBody
def _get_kwargs(
name: str,
*,
json_body: RemoveUserFromInstanceGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/groups/removeuser/{name}".format(name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveUserFromInstanceGroupJsonBody,
) -> Response[Any]:
""" remove user from instance group
Args:
name (str):
json_body (RemoveUserFromInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveUserFromInstanceGroupJsonBody,
) -> Response[Any]:
""" remove user from instance group
Args:
name (str):
json_body (RemoveUserFromInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from ...models.remove_user_to_group_json_body import RemoveUserToGroupJsonBody
from typing import cast
from typing import Dict
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: RemoveUserToGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/groups/removeuser/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveUserToGroupJsonBody,
) -> Response[Any]:
""" remove user to group
Args:
workspace (str):
name (str):
json_body (RemoveUserToGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: RemoveUserToGroupJsonBody,
) -> Response[Any]:
""" remove user to group
Args:
workspace (str):
name (str):
json_body (RemoveUserToGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,133 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_group_json_body import UpdateGroupJsonBody
def _get_kwargs(
workspace: str,
name: str,
*,
json_body: UpdateGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/groups/update/{name}".format(workspace=workspace,name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateGroupJsonBody,
) -> Response[Any]:
""" update group
Args:
workspace (str):
name (str):
json_body (UpdateGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateGroupJsonBody,
) -> Response[Any]:
""" update group
Args:
workspace (str):
name (str):
json_body (UpdateGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,126 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.update_instance_group_json_body import UpdateInstanceGroupJsonBody
def _get_kwargs(
name: str,
*,
json_body: UpdateInstanceGroupJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/groups/update/{name}".format(name=name,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateInstanceGroupJsonBody,
) -> Response[Any]:
""" update instance group
Args:
name (str):
json_body (UpdateInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
name: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateInstanceGroupJsonBody,
) -> Response[Any]:
""" update instance group
Args:
name (str):
json_body (UpdateInstanceGroupJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
name=name,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,114 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/job_helpers/test_connection".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" Test connection to the workspace datasets storage
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" Test connection to the workspace datasets storage
Args:
workspace (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,129 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
*,
file_key: str,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["file_key"] = file_key
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "delete",
"url": "/w/{workspace}/job_helpers/delete_s3_file".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Response[Any]:
""" Permanently delete file from S3
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Response[Any]:
""" Permanently delete file from S3
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.duckdb_connection_settings_json_body import DuckdbConnectionSettingsJsonBody
from ...models.duckdb_connection_settings_response_200 import DuckdbConnectionSettingsResponse200
def _get_kwargs(
workspace: str,
*,
json_body: DuckdbConnectionSettingsJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/duckdb_connection_settings".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DuckdbConnectionSettingsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = DuckdbConnectionSettingsResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DuckdbConnectionSettingsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsJsonBody,
) -> Response[DuckdbConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[DuckdbConnectionSettingsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsJsonBody,
) -> Optional[DuckdbConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
DuckdbConnectionSettingsResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsJsonBody,
) -> Response[DuckdbConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[DuckdbConnectionSettingsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsJsonBody,
) -> Optional[DuckdbConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
DuckdbConnectionSettingsResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.duckdb_connection_settings_v2_json_body import DuckdbConnectionSettingsV2JsonBody
from typing import Dict
from ...models.duckdb_connection_settings_v2_response_200 import DuckdbConnectionSettingsV2Response200
def _get_kwargs(
workspace: str,
*,
json_body: DuckdbConnectionSettingsV2JsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/v2/duckdb_connection_settings".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DuckdbConnectionSettingsV2Response200]:
if response.status_code == HTTPStatus.OK:
response_200 = DuckdbConnectionSettingsV2Response200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DuckdbConnectionSettingsV2Response200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsV2JsonBody,
) -> Response[DuckdbConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[DuckdbConnectionSettingsV2Response200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsV2JsonBody,
) -> Optional[DuckdbConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
DuckdbConnectionSettingsV2Response200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsV2JsonBody,
) -> Response[DuckdbConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[DuckdbConnectionSettingsV2Response200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: DuckdbConnectionSettingsV2JsonBody,
) -> Optional[DuckdbConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
Args:
workspace (str):
json_body (DuckdbConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
DuckdbConnectionSettingsV2Response200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed
@@ -1,211 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import Dict
from ...models.list_stored_files_response_200 import ListStoredFilesResponse200
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
max_keys: int,
marker: Union[Unset, None, str] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["max_keys"] = max_keys
params["marker"] = marker
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/job_helpers/list_stored_files".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ListStoredFilesResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = ListStoredFilesResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ListStoredFilesResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
max_keys: int,
marker: Union[Unset, None, str] = UNSET,
) -> Response[ListStoredFilesResponse200]:
""" List the file keys available in the workspace files storage (S3)
Args:
workspace (str):
max_keys (int):
marker (Union[Unset, None, str]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListStoredFilesResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
max_keys=max_keys,
marker=marker,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
max_keys: int,
marker: Union[Unset, None, str] = UNSET,
) -> Optional[ListStoredFilesResponse200]:
""" List the file keys available in the workspace files storage (S3)
Args:
workspace (str):
max_keys (int):
marker (Union[Unset, None, str]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListStoredFilesResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
max_keys=max_keys,
marker=marker,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
max_keys: int,
marker: Union[Unset, None, str] = UNSET,
) -> Response[ListStoredFilesResponse200]:
""" List the file keys available in the workspace files storage (S3)
Args:
workspace (str):
max_keys (int):
marker (Union[Unset, None, str]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[ListStoredFilesResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
max_keys=max_keys,
marker=marker,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
max_keys: int,
marker: Union[Unset, None, str] = UNSET,
) -> Optional[ListStoredFilesResponse200]:
""" List the file keys available in the workspace files storage (S3)
Args:
workspace (str):
max_keys (int):
marker (Union[Unset, None, str]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
ListStoredFilesResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
max_keys=max_keys,
marker=marker,
)).parsed
@@ -1,192 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.load_file_metadata_response_200 import LoadFileMetadataResponse200
def _get_kwargs(
workspace: str,
*,
file_key: str,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["file_key"] = file_key
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/job_helpers/load_file_metadata".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoadFileMetadataResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = LoadFileMetadataResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoadFileMetadataResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Response[LoadFileMetadataResponse200]:
""" Load metadata of the file
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[LoadFileMetadataResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Optional[LoadFileMetadataResponse200]:
""" Load metadata of the file
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
LoadFileMetadataResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
file_key=file_key,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Response[LoadFileMetadataResponse200]:
""" Load metadata of the file
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[LoadFileMetadataResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
) -> Optional[LoadFileMetadataResponse200]:
""" Load metadata of the file
Args:
workspace (str):
file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
LoadFileMetadataResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
file_key=file_key,
)).parsed
@@ -1,291 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from ...models.load_file_preview_response_200 import LoadFilePreviewResponse200
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
file_key: str,
file_size_in_bytes: Union[Unset, None, int] = UNSET,
file_mime_type: Union[Unset, None, str] = UNSET,
csv_separator: Union[Unset, None, str] = UNSET,
csv_has_header: Union[Unset, None, bool] = UNSET,
read_bytes_from: Union[Unset, None, int] = UNSET,
read_bytes_length: Union[Unset, None, int] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["file_key"] = file_key
params["file_size_in_bytes"] = file_size_in_bytes
params["file_mime_type"] = file_mime_type
params["csv_separator"] = csv_separator
params["csv_has_header"] = csv_has_header
params["read_bytes_from"] = read_bytes_from
params["read_bytes_length"] = read_bytes_length
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/job_helpers/load_file_preview".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoadFilePreviewResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = LoadFilePreviewResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoadFilePreviewResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
file_size_in_bytes: Union[Unset, None, int] = UNSET,
file_mime_type: Union[Unset, None, str] = UNSET,
csv_separator: Union[Unset, None, str] = UNSET,
csv_has_header: Union[Unset, None, bool] = UNSET,
read_bytes_from: Union[Unset, None, int] = UNSET,
read_bytes_length: Union[Unset, None, int] = UNSET,
) -> Response[LoadFilePreviewResponse200]:
""" Load a preview of the file
Args:
workspace (str):
file_key (str):
file_size_in_bytes (Union[Unset, None, int]):
file_mime_type (Union[Unset, None, str]):
csv_separator (Union[Unset, None, str]):
csv_has_header (Union[Unset, None, bool]):
read_bytes_from (Union[Unset, None, int]):
read_bytes_length (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[LoadFilePreviewResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
file_size_in_bytes=file_size_in_bytes,
file_mime_type=file_mime_type,
csv_separator=csv_separator,
csv_has_header=csv_has_header,
read_bytes_from=read_bytes_from,
read_bytes_length=read_bytes_length,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
file_size_in_bytes: Union[Unset, None, int] = UNSET,
file_mime_type: Union[Unset, None, str] = UNSET,
csv_separator: Union[Unset, None, str] = UNSET,
csv_has_header: Union[Unset, None, bool] = UNSET,
read_bytes_from: Union[Unset, None, int] = UNSET,
read_bytes_length: Union[Unset, None, int] = UNSET,
) -> Optional[LoadFilePreviewResponse200]:
""" Load a preview of the file
Args:
workspace (str):
file_key (str):
file_size_in_bytes (Union[Unset, None, int]):
file_mime_type (Union[Unset, None, str]):
csv_separator (Union[Unset, None, str]):
csv_has_header (Union[Unset, None, bool]):
read_bytes_from (Union[Unset, None, int]):
read_bytes_length (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
LoadFilePreviewResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
file_key=file_key,
file_size_in_bytes=file_size_in_bytes,
file_mime_type=file_mime_type,
csv_separator=csv_separator,
csv_has_header=csv_has_header,
read_bytes_from=read_bytes_from,
read_bytes_length=read_bytes_length,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
file_size_in_bytes: Union[Unset, None, int] = UNSET,
file_mime_type: Union[Unset, None, str] = UNSET,
csv_separator: Union[Unset, None, str] = UNSET,
csv_has_header: Union[Unset, None, bool] = UNSET,
read_bytes_from: Union[Unset, None, int] = UNSET,
read_bytes_length: Union[Unset, None, int] = UNSET,
) -> Response[LoadFilePreviewResponse200]:
""" Load a preview of the file
Args:
workspace (str):
file_key (str):
file_size_in_bytes (Union[Unset, None, int]):
file_mime_type (Union[Unset, None, str]):
csv_separator (Union[Unset, None, str]):
csv_has_header (Union[Unset, None, bool]):
read_bytes_from (Union[Unset, None, int]):
read_bytes_length (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[LoadFilePreviewResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
file_key=file_key,
file_size_in_bytes=file_size_in_bytes,
file_mime_type=file_mime_type,
csv_separator=csv_separator,
csv_has_header=csv_has_header,
read_bytes_from=read_bytes_from,
read_bytes_length=read_bytes_length,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
file_key: str,
file_size_in_bytes: Union[Unset, None, int] = UNSET,
file_mime_type: Union[Unset, None, str] = UNSET,
csv_separator: Union[Unset, None, str] = UNSET,
csv_has_header: Union[Unset, None, bool] = UNSET,
read_bytes_from: Union[Unset, None, int] = UNSET,
read_bytes_length: Union[Unset, None, int] = UNSET,
) -> Optional[LoadFilePreviewResponse200]:
""" Load a preview of the file
Args:
workspace (str):
file_key (str):
file_size_in_bytes (Union[Unset, None, int]):
file_mime_type (Union[Unset, None, str]):
csv_separator (Union[Unset, None, str]):
csv_has_header (Union[Unset, None, bool]):
read_bytes_from (Union[Unset, None, int]):
read_bytes_length (Union[Unset, None, int]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
LoadFilePreviewResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
file_key=file_key,
file_size_in_bytes=file_size_in_bytes,
file_mime_type=file_mime_type,
csv_separator=csv_separator,
csv_has_header=csv_has_header,
read_bytes_from=read_bytes_from,
read_bytes_length=read_bytes_length,
)).parsed
@@ -1,139 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
def _get_kwargs(
workspace: str,
*,
src_file_key: str,
dest_file_key: str,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["src_file_key"] = src_file_key
params["dest_file_key"] = dest_file_key
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/w/{workspace}/job_helpers/move_s3_file".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
if response.status_code == HTTPStatus.OK:
return None
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
src_file_key: str,
dest_file_key: str,
) -> Response[Any]:
""" Move a S3 file from one path to the other within the same bucket
Args:
workspace (str):
src_file_key (str):
dest_file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
src_file_key=src_file_key,
dest_file_key=dest_file_key,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
src_file_key: str,
dest_file_key: str,
) -> Response[Any]:
""" Move a S3 file from one path to the other within the same bucket
Args:
workspace (str):
src_file_key (str):
dest_file_key (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Any]
"""
kwargs = _get_kwargs(
workspace=workspace,
src_file_key=src_file_key,
dest_file_key=dest_file_key,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.multipart_file_upload_response_200 import MultipartFileUploadResponse200
from typing import Dict
from ...models.multipart_file_upload_json_body import MultipartFileUploadJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: MultipartFileUploadJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/multipart_upload_s3_file".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MultipartFileUploadResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = MultipartFileUploadResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MultipartFileUploadResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: MultipartFileUploadJsonBody,
) -> Response[MultipartFileUploadResponse200]:
""" Upload file to S3 bucket using multipart upload
Args:
workspace (str):
json_body (MultipartFileUploadJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[MultipartFileUploadResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: MultipartFileUploadJsonBody,
) -> Optional[MultipartFileUploadResponse200]:
""" Upload file to S3 bucket using multipart upload
Args:
workspace (str):
json_body (MultipartFileUploadJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
MultipartFileUploadResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: MultipartFileUploadJsonBody,
) -> Response[MultipartFileUploadResponse200]:
""" Upload file to S3 bucket using multipart upload
Args:
workspace (str):
json_body (MultipartFileUploadJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[MultipartFileUploadResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: MultipartFileUploadJsonBody,
) -> Optional[MultipartFileUploadResponse200]:
""" Upload file to S3 bucket using multipart upload
Args:
workspace (str):
json_body (MultipartFileUploadJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
MultipartFileUploadResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.polars_connection_settings_json_body import PolarsConnectionSettingsJsonBody
from ...models.polars_connection_settings_response_200 import PolarsConnectionSettingsResponse200
def _get_kwargs(
workspace: str,
*,
json_body: PolarsConnectionSettingsJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/polars_connection_settings".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PolarsConnectionSettingsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = PolarsConnectionSettingsResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PolarsConnectionSettingsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsJsonBody,
) -> Response[PolarsConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[PolarsConnectionSettingsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsJsonBody,
) -> Optional[PolarsConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
PolarsConnectionSettingsResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsJsonBody,
) -> Response[PolarsConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[PolarsConnectionSettingsResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsJsonBody,
) -> Optional[PolarsConnectionSettingsResponse200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
PolarsConnectionSettingsResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from typing import Dict
from ...models.polars_connection_settings_v2_json_body import PolarsConnectionSettingsV2JsonBody
from ...models.polars_connection_settings_v2_response_200 import PolarsConnectionSettingsV2Response200
def _get_kwargs(
workspace: str,
*,
json_body: PolarsConnectionSettingsV2JsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/v2/polars_connection_settings".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PolarsConnectionSettingsV2Response200]:
if response.status_code == HTTPStatus.OK:
response_200 = PolarsConnectionSettingsV2Response200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PolarsConnectionSettingsV2Response200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsV2JsonBody,
) -> Response[PolarsConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[PolarsConnectionSettingsV2Response200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsV2JsonBody,
) -> Optional[PolarsConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
PolarsConnectionSettingsV2Response200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsV2JsonBody,
) -> Response[PolarsConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[PolarsConnectionSettingsV2Response200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: PolarsConnectionSettingsV2JsonBody,
) -> Optional[PolarsConnectionSettingsV2Response200]:
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
Args:
workspace (str):
json_body (PolarsConnectionSettingsV2JsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
PolarsConnectionSettingsV2Response200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed
@@ -1,189 +0,0 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import cast
from ...models.s3_resource_info_response_200 import S3ResourceInfoResponse200
from typing import Dict
from ...models.s3_resource_info_json_body import S3ResourceInfoJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: S3ResourceInfoJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/job_helpers/v2/s3_resource_info".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[S3ResourceInfoResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = S3ResourceInfoResponse200.from_dict(response.json())
return response_200
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[S3ResourceInfoResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: S3ResourceInfoJsonBody,
) -> Response[S3ResourceInfoResponse200]:
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
Args:
workspace (str):
json_body (S3ResourceInfoJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[S3ResourceInfoResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: S3ResourceInfoJsonBody,
) -> Optional[S3ResourceInfoResponse200]:
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
Args:
workspace (str):
json_body (S3ResourceInfoJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
S3ResourceInfoResponse200
"""
return sync_detailed(
workspace=workspace,
client=client,
json_body=json_body,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: S3ResourceInfoJsonBody,
) -> Response[S3ResourceInfoResponse200]:
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
Args:
workspace (str):
json_body (S3ResourceInfoJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[S3ResourceInfoResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: S3ResourceInfoJsonBody,
) -> Optional[S3ResourceInfoResponse200]:
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
Args:
workspace (str):
json_body (S3ResourceInfoJsonBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
S3ResourceInfoResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
json_body=json_body,
)).parsed

Some files were not shown because too many files have changed in this diff Show More