mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
sqlx
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
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
|
||||
@@ -0,0 +1,184 @@
|
||||
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
|
||||
@@ -0,0 +1,191 @@
|
||||
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
|
||||
@@ -0,0 +1,217 @@
|
||||
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
|
||||
@@ -0,0 +1,133 @@
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user