sqlx
This commit is contained in:
@@ -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
|
||||
|
||||
from ...models.accept_invite_json_body import AcceptInviteJsonBody
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: AcceptInviteJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/accept_invite",
|
||||
"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: AcceptInviteJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" accept invite to workspace
|
||||
|
||||
Args:
|
||||
json_body (AcceptInviteJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: AcceptInviteJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" accept invite to workspace
|
||||
|
||||
Args:
|
||||
json_body (AcceptInviteJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
119
python-client/windmill-api/windmill_api/api/user/create_token.py
Normal file
119
python-client/windmill-api/windmill_api/api/user/create_token.py
Normal file
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.create_token_json_body import CreateTokenJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: CreateTokenJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/tokens/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: CreateTokenJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create token
|
||||
|
||||
Args:
|
||||
json_body (CreateTokenJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: CreateTokenJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create token
|
||||
|
||||
Args:
|
||||
json_body (CreateTokenJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from ...models.create_token_impersonate_json_body import CreateTokenImpersonateJsonBody
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: CreateTokenImpersonateJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/tokens/impersonate",
|
||||
"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: CreateTokenImpersonateJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create token to impersonate a user (require superadmin)
|
||||
|
||||
Args:
|
||||
json_body (CreateTokenImpersonateJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: CreateTokenImpersonateJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create token to impersonate a user (require superadmin)
|
||||
|
||||
Args:
|
||||
json_body (CreateTokenImpersonateJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
126
python-client/windmill-api/windmill_api/api/user/create_user.py
Normal file
126
python-client/windmill-api/windmill_api/api/user/create_user.py
Normal file
@@ -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 ...models.create_user_json_body import CreateUserJsonBody
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: CreateUserJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/users/add".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: CreateUserJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateUserJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: CreateUserJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateUserJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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
|
||||
|
||||
from typing import cast
|
||||
from ...models.create_user_globally_json_body import CreateUserGloballyJsonBody
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: CreateUserGloballyJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/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: CreateUserGloballyJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create user
|
||||
|
||||
Args:
|
||||
json_body (CreateUserGloballyJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: CreateUserGloballyJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create user
|
||||
|
||||
Args:
|
||||
json_body (CreateUserGloballyJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from ...models.decline_invite_json_body import DeclineInviteJsonBody
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: DeclineInviteJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/decline_invite",
|
||||
"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: DeclineInviteJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" decline invite to workspace
|
||||
|
||||
Args:
|
||||
json_body (DeclineInviteJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: DeclineInviteJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" decline invite to workspace
|
||||
|
||||
Args:
|
||||
json_body (DeclineInviteJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
112
python-client/windmill-api/windmill_api/api/user/delete_token.py
Normal file
112
python-client/windmill-api/windmill_api/api/user/delete_token.py
Normal file
@@ -0,0 +1,112 @@
|
||||
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(
|
||||
token_prefix: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/users/tokens/delete/{token_prefix}".format(token_prefix=token_prefix,),
|
||||
}
|
||||
|
||||
|
||||
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(
|
||||
token_prefix: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" delete token
|
||||
|
||||
Args:
|
||||
token_prefix (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(
|
||||
token_prefix=token_prefix,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token_prefix: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" delete token
|
||||
|
||||
Args:
|
||||
token_prefix (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(
|
||||
token_prefix=token_prefix,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
119
python-client/windmill-api/windmill_api/api/user/delete_user.py
Normal file
119
python-client/windmill-api/windmill_api/api/user/delete_user.py
Normal file
@@ -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,
|
||||
username: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/w/{workspace}/users/delete/{username}".format(workspace=workspace,username=username,),
|
||||
}
|
||||
|
||||
|
||||
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,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" delete user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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,
|
||||
username=username,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" delete user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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,
|
||||
username=username,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
165
python-client/windmill-api/windmill_api/api/user/exists_email.py
Normal file
165
python-client/windmill-api/windmill_api/api/user/exists_email.py
Normal file
@@ -0,0 +1,165 @@
|
||||
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(
|
||||
email: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/exists/{email}".format(email=email,),
|
||||
}
|
||||
|
||||
|
||||
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(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[bool]:
|
||||
""" exists email
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[bool]:
|
||||
""" exists email
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[bool]:
|
||||
""" exists email
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[bool]:
|
||||
""" exists email
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,101 @@
|
||||
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(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/email",
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get current user email (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get current user email (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
150
python-client/windmill-api/windmill_api/api/user/get_runnable.py
Normal file
150
python-client/windmill-api/windmill_api/api/user/get_runnable.py
Normal file
@@ -0,0 +1,150 @@
|
||||
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_runnable_response_200 import GetRunnableResponse200
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/all_runnables",
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetRunnableResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetRunnableResponse200.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[GetRunnableResponse200]:
|
||||
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[GetRunnableResponse200]:
|
||||
""" get all runnables in every workspace
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GetRunnableResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetRunnableResponse200]:
|
||||
""" get all runnables in every workspace
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetRunnableResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetRunnableResponse200]:
|
||||
""" get all runnables in every workspace
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GetRunnableResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetRunnableResponse200]:
|
||||
""" get all runnables in every workspace
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetRunnableResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,150 @@
|
||||
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_tutorial_progress_response_200 import GetTutorialProgressResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/tutorial_progress",
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetTutorialProgressResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetTutorialProgressResponse200.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[GetTutorialProgressResponse200]:
|
||||
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[GetTutorialProgressResponse200]:
|
||||
""" get tutorial progress
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GetTutorialProgressResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetTutorialProgressResponse200]:
|
||||
""" get tutorial progress
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetTutorialProgressResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetTutorialProgressResponse200]:
|
||||
""" get tutorial progress
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GetTutorialProgressResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetTutorialProgressResponse200]:
|
||||
""" get tutorial progress
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetTutorialProgressResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
101
python-client/windmill-api/windmill_api/api/user/get_usage.py
Normal file
101
python-client/windmill-api/windmill_api/api/user/get_usage.py
Normal file
@@ -0,0 +1,101 @@
|
||||
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(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/usage",
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get current usage outside of premium workspaces
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get current usage outside of premium workspaces
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
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(
|
||||
email: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/users/delete/{email}".format(email=email,),
|
||||
}
|
||||
|
||||
|
||||
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(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" global delete user (require super admin)
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" global delete user (require super admin)
|
||||
|
||||
Args:
|
||||
email (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(
|
||||
email=email,
|
||||
|
||||
)
|
||||
|
||||
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.global_user_update_json_body import GlobalUserUpdateJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
email: str,
|
||||
*,
|
||||
json_body: GlobalUserUpdateJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/update/{email}".format(email=email,),
|
||||
"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(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: GlobalUserUpdateJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" global update user (require super admin)
|
||||
|
||||
Args:
|
||||
email (str):
|
||||
json_body (GlobalUserUpdateJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
email=email,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
email: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: GlobalUserUpdateJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" global update user (require super admin)
|
||||
|
||||
Args:
|
||||
email (str):
|
||||
json_body (GlobalUserUpdateJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
email=email,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
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.global_whoami_response_200 import GlobalWhoamiResponse200
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/whoami",
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GlobalWhoamiResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GlobalWhoamiResponse200.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[GlobalWhoamiResponse200]:
|
||||
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[GlobalWhoamiResponse200]:
|
||||
""" get current global whoami (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GlobalWhoamiResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GlobalWhoamiResponse200]:
|
||||
""" get current global whoami (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GlobalWhoamiResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GlobalWhoamiResponse200]:
|
||||
""" get current global whoami (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[GlobalWhoamiResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GlobalWhoamiResponse200]:
|
||||
""" get current global whoami (if logged in)
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GlobalWhoamiResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,178 @@
|
||||
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}/users/is_owner/{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]:
|
||||
""" is owner of 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]:
|
||||
""" is owner of 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]:
|
||||
""" is owner of 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]:
|
||||
""" is owner of 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
|
||||
@@ -0,0 +1,101 @@
|
||||
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(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/leave_instance",
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" leave instance
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" leave instance
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
188
python-client/windmill-api/windmill_api/api/user/list_tokens.py
Normal file
188
python-client/windmill-api/windmill_api/api/user/list_tokens.py
Normal file
@@ -0,0 +1,188 @@
|
||||
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 typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
from ...models.list_tokens_response_200_item import ListTokensResponse200Item
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
exclude_ephemeral: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["exclude_ephemeral"] = exclude_ephemeral
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/tokens/list",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListTokensResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListTokensResponse200Item.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['ListTokensResponse200Item']]:
|
||||
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],
|
||||
exclude_ephemeral: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListTokensResponse200Item']]:
|
||||
""" list token
|
||||
|
||||
Args:
|
||||
exclude_ephemeral (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['ListTokensResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
exclude_ephemeral=exclude_ephemeral,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
exclude_ephemeral: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListTokensResponse200Item']]:
|
||||
""" list token
|
||||
|
||||
Args:
|
||||
exclude_ephemeral (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['ListTokensResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
exclude_ephemeral=exclude_ephemeral,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
exclude_ephemeral: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListTokensResponse200Item']]:
|
||||
""" list token
|
||||
|
||||
Args:
|
||||
exclude_ephemeral (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['ListTokensResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
exclude_ephemeral=exclude_ephemeral,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
exclude_ephemeral: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListTokensResponse200Item']]:
|
||||
""" list token
|
||||
|
||||
Args:
|
||||
exclude_ephemeral (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['ListTokensResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
exclude_ephemeral=exclude_ephemeral,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,167 @@
|
||||
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, List
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/users/list_usernames".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[List[str]]:
|
||||
""" list usernames
|
||||
|
||||
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[str]]
|
||||
"""
|
||||
|
||||
|
||||
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[str]]:
|
||||
""" list usernames
|
||||
|
||||
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[str]
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[List[str]]:
|
||||
""" list usernames
|
||||
|
||||
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[str]]
|
||||
"""
|
||||
|
||||
|
||||
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[str]]:
|
||||
""" list usernames
|
||||
|
||||
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[str]
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
177
python-client/windmill-api/windmill_api/api/user/list_users.py
Normal file
177
python-client/windmill-api/windmill_api/api/user/list_users.py
Normal file
@@ -0,0 +1,177 @@
|
||||
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_users_response_200_item import ListUsersResponse200Item
|
||||
from typing import Dict
|
||||
from typing import cast, List
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/users/list".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListUsersResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListUsersResponse200Item.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['ListUsersResponse200Item']]:
|
||||
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['ListUsersResponse200Item']]:
|
||||
""" list users
|
||||
|
||||
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['ListUsersResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
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['ListUsersResponse200Item']]:
|
||||
""" list users
|
||||
|
||||
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['ListUsersResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[List['ListUsersResponse200Item']]:
|
||||
""" list users
|
||||
|
||||
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['ListUsersResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
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['ListUsersResponse200Item']]:
|
||||
""" list users
|
||||
|
||||
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['ListUsersResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
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_users_as_super_admin_response_200_item import ListUsersAsSuperAdminResponse200Item
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
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": "/users/list_as_super_admin",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListUsersAsSuperAdminResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListUsersAsSuperAdminResponse200Item.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['ListUsersAsSuperAdminResponse200Item']]:
|
||||
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],
|
||||
page: Union[Unset, None, int] = UNSET,
|
||||
per_page: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[List['ListUsersAsSuperAdminResponse200Item']]:
|
||||
""" list all users as super admin (require to be super amdin)
|
||||
|
||||
Args:
|
||||
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['ListUsersAsSuperAdminResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
page=page,
|
||||
per_page=per_page,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
page: Union[Unset, None, int] = UNSET,
|
||||
per_page: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[List['ListUsersAsSuperAdminResponse200Item']]:
|
||||
""" list all users as super admin (require to be super amdin)
|
||||
|
||||
Args:
|
||||
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['ListUsersAsSuperAdminResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
page=page,
|
||||
per_page=per_page,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
page: Union[Unset, None, int] = UNSET,
|
||||
per_page: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[List['ListUsersAsSuperAdminResponse200Item']]:
|
||||
""" list all users as super admin (require to be super amdin)
|
||||
|
||||
Args:
|
||||
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['ListUsersAsSuperAdminResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
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(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
page: Union[Unset, None, int] = UNSET,
|
||||
per_page: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[List['ListUsersAsSuperAdminResponse200Item']]:
|
||||
""" list all users as super admin (require to be super amdin)
|
||||
|
||||
Args:
|
||||
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['ListUsersAsSuperAdminResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
page=page,
|
||||
per_page=per_page,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,156 @@
|
||||
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_workspace_invites_response_200_item import ListWorkspaceInvitesResponse200Item
|
||||
from typing import Dict
|
||||
from typing import cast, List
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/list_invites",
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListWorkspaceInvitesResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListWorkspaceInvitesResponse200Item.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['ListWorkspaceInvitesResponse200Item']]:
|
||||
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['ListWorkspaceInvitesResponse200Item']]:
|
||||
""" list all workspace invites
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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['ListWorkspaceInvitesResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
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['ListWorkspaceInvitesResponse200Item']]:
|
||||
""" list all workspace invites
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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['ListWorkspaceInvitesResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[List['ListWorkspaceInvitesResponse200Item']]:
|
||||
""" list all workspace invites
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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['ListWorkspaceInvitesResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
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['ListWorkspaceInvitesResponse200Item']]:
|
||||
""" list all workspace invites
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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['ListWorkspaceInvitesResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
119
python-client/windmill-api/windmill_api/api/user/login.py
Normal file
119
python-client/windmill-api/windmill_api/api/user/login.py
Normal file
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from ...models.login_json_body import LoginJsonBody
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: LoginJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/auth/login",
|
||||
"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: LoginJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" login with password
|
||||
|
||||
Args:
|
||||
json_body (LoginJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: LoginJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" login with password
|
||||
|
||||
Args:
|
||||
json_body (LoginJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
@@ -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.login_with_oauth_json_body import LoginWithOauthJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
client_name: str,
|
||||
*,
|
||||
json_body: LoginWithOauthJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/oauth/login_callback/{client_name}".format(client_name=client_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(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: LoginWithOauthJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" login with oauth authorization flow
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (LoginWithOauthJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
client_name=client_name,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: LoginWithOauthJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" login with oauth authorization flow
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (LoginWithOauthJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
client_name=client_name,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
101
python-client/windmill-api/windmill_api/api/user/logout.py
Normal file
101
python-client/windmill-api/windmill_api/api/user/logout.py
Normal file
@@ -0,0 +1,101 @@
|
||||
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(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/auth/logout",
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" logout
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" logout
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
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(
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/users/refresh_token",
|
||||
}
|
||||
|
||||
|
||||
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],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" refresh the current token
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" refresh the current token
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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(
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
119
python-client/windmill-api/windmill_api/api/user/set_password.py
Normal file
119
python-client/windmill-api/windmill_api/api/user/set_password.py
Normal file
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.set_password_json_body import SetPasswordJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: SetPasswordJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/setpassword",
|
||||
"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: SetPasswordJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" set password
|
||||
|
||||
Args:
|
||||
json_body (SetPasswordJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: SetPasswordJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" set password
|
||||
|
||||
Args:
|
||||
json_body (SetPasswordJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.update_tutorial_progress_json_body import UpdateTutorialProgressJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
json_body: UpdateTutorialProgressJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/users/tutorial_progress",
|
||||
"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: UpdateTutorialProgressJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" update tutorial progress
|
||||
|
||||
Args:
|
||||
json_body (UpdateTutorialProgressJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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: UpdateTutorialProgressJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" update tutorial progress
|
||||
|
||||
Args:
|
||||
json_body (UpdateTutorialProgressJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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)
|
||||
|
||||
133
python-client/windmill-api/windmill_api/api/user/update_user.py
Normal file
133
python-client/windmill-api/windmill_api/api/user/update_user.py
Normal file
@@ -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.update_user_json_body import UpdateUserJsonBody
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
json_body: UpdateUserJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/users/update/{username}".format(workspace=workspace,username=username,),
|
||||
"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,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: UpdateUserJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" update user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (str):
|
||||
json_body (UpdateUserJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
username=username,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: UpdateUserJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" update user (require admin privilege)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (str):
|
||||
json_body (UpdateUserJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
username=username,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
171
python-client/windmill-api/windmill_api/api/user/whoami.py
Normal file
171
python-client/windmill-api/windmill_api/api/user/whoami.py
Normal file
@@ -0,0 +1,171 @@
|
||||
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.whoami_response_200 import WhoamiResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/users/whoami".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[WhoamiResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = WhoamiResponse200.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[WhoamiResponse200]:
|
||||
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[WhoamiResponse200]:
|
||||
""" whoami
|
||||
|
||||
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[WhoamiResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[WhoamiResponse200]:
|
||||
""" whoami
|
||||
|
||||
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:
|
||||
WhoamiResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[WhoamiResponse200]:
|
||||
""" whoami
|
||||
|
||||
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[WhoamiResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[WhoamiResponse200]:
|
||||
""" whoami
|
||||
|
||||
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:
|
||||
WhoamiResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
184
python-client/windmill-api/windmill_api/api/user/whois.py
Normal file
184
python-client/windmill-api/windmill_api/api/user/whois.py
Normal file
@@ -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.whois_response_200 import WhoisResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
username: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/users/whois/{username}".format(workspace=workspace,username=username,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[WhoisResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = WhoisResponse200.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[WhoisResponse200]:
|
||||
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,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[WhoisResponse200]:
|
||||
""" whois
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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[WhoisResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
username=username,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[WhoisResponse200]:
|
||||
""" whois
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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:
|
||||
WhoisResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
username=username,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[WhoisResponse200]:
|
||||
""" whois
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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[WhoisResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
username=username,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
username: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[WhoisResponse200]:
|
||||
""" whois
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
username (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:
|
||||
WhoisResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
username=username,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
Reference in New Issue
Block a user