sqlx
This commit is contained in:
167
python-client/windmill-api/windmill_api/api/job/cancel_all.py
Normal file
167
python-client/windmill-api/windmill_api/api/job/cancel_all.py
Normal file
@@ -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": "post",
|
||||
"url": "/w/{workspace}/jobs/queue/cancel_all".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]]:
|
||||
""" cancel all jobs
|
||||
|
||||
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]]:
|
||||
""" cancel all jobs
|
||||
|
||||
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]]:
|
||||
""" cancel all jobs
|
||||
|
||||
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]]:
|
||||
""" cancel all jobs
|
||||
|
||||
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
|
||||
@@ -0,0 +1,133 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.cancel_persistent_queued_jobs_json_body import CancelPersistentQueuedJobsJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: CancelPersistentQueuedJobsJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs_u/queue/cancel_persistent/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelPersistentQueuedJobsJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel all queued jobs for persistent script
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
json_body (CancelPersistentQueuedJobsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelPersistentQueuedJobsJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel all queued jobs for persistent script
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
json_body (CancelPersistentQueuedJobsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.cancel_queued_job_json_body import CancelQueuedJobJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
json_body: CancelQueuedJobJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs_u/queue/cancel/{id}".format(workspace=workspace,id=id,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelQueuedJobJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel queued job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (CancelQueuedJobJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelQueuedJobJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel queued job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (CancelQueuedJobJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}".format(workspace=workspace,id=id,resume_id=resume_id,signature=signature,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.cancel_suspended_job_post_json_body import CancelSuspendedJobPostJsonBody
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
json_body: CancelSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}".format(workspace=workspace,id=id,resume_id=resume_id,signature=signature,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
json_body (CancelSuspendedJobPostJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
json_body=json_body,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CancelSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" cancel a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
json_body (CancelSuspendedJobPostJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
json_body=json_body,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/job_signature/{id}/{resume_id}".format(workspace=workspace,id=id,resume_id=resume_id,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create an HMac signature given a job id and a resume id
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" create an HMac signature given a job id and a resume id
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from ...models.delete_completed_job_response_200 import DeleteCompletedJobResponse200
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/completed/delete/{id}".format(workspace=workspace,id=id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DeleteCompletedJobResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = DeleteCompletedJobResponse200.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[DeleteCompletedJobResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[DeleteCompletedJobResponse200]:
|
||||
""" delete completed job (erase content but keep run id)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[DeleteCompletedJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[DeleteCompletedJobResponse200]:
|
||||
""" delete completed job (erase content but keep run id)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
DeleteCompletedJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[DeleteCompletedJobResponse200]:
|
||||
""" delete completed job (erase content but keep run id)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[DeleteCompletedJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[DeleteCompletedJobResponse200]:
|
||||
""" delete completed job (erase content but keep run id)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
DeleteCompletedJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,133 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.force_cancel_queued_job_json_body import ForceCancelQueuedJobJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
json_body: ForceCancelQueuedJobJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs_u/queue/force_cancel/{id}".format(workspace=workspace,id=id,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ForceCancelQueuedJobJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" force cancel queued job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (ForceCancelQueuedJobJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ForceCancelQueuedJobJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" force cancel queued job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (ForceCancelQueuedJobJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -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.get_completed_count_response_200 import GetCompletedCountResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/completed/count".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetCompletedCountResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetCompletedCountResponse200.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[GetCompletedCountResponse200]:
|
||||
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[GetCompletedCountResponse200]:
|
||||
""" get completed count
|
||||
|
||||
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[GetCompletedCountResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetCompletedCountResponse200]:
|
||||
""" get completed count
|
||||
|
||||
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:
|
||||
GetCompletedCountResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetCompletedCountResponse200]:
|
||||
""" get completed count
|
||||
|
||||
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[GetCompletedCountResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetCompletedCountResponse200]:
|
||||
""" get completed count
|
||||
|
||||
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:
|
||||
GetCompletedCountResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,184 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.get_completed_job_response_200 import GetCompletedJobResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/completed/get/{id}".format(workspace=workspace,id=id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetCompletedJobResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetCompletedJobResponse200.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[GetCompletedJobResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetCompletedJobResponse200]:
|
||||
""" get completed job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[GetCompletedJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetCompletedJobResponse200]:
|
||||
""" get completed job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
GetCompletedJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetCompletedJobResponse200]:
|
||||
""" get completed job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[GetCompletedJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetCompletedJobResponse200]:
|
||||
""" get completed job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
GetCompletedJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,121 @@
|
||||
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,
|
||||
id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/completed/get_result/{id}".format(workspace=workspace,id=id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get completed job result
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get completed job result
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.get_completed_job_result_maybe_response_200 import GetCompletedJobResultMaybeResponse200
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
get_started: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["get_started"] = get_started
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/completed/get_result_maybe/{id}".format(workspace=workspace,id=id,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetCompletedJobResultMaybeResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetCompletedJobResultMaybeResponse200.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[GetCompletedJobResultMaybeResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
get_started: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[GetCompletedJobResultMaybeResponse200]:
|
||||
""" get completed job result if job is completed
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
get_started (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[GetCompletedJobResultMaybeResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
get_started=get_started,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
get_started: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[GetCompletedJobResultMaybeResponse200]:
|
||||
""" get completed job result if job is completed
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
get_started (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:
|
||||
GetCompletedJobResultMaybeResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
get_started=get_started,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
get_started: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[GetCompletedJobResultMaybeResponse200]:
|
||||
""" get completed job result if job is completed
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
get_started (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[GetCompletedJobResultMaybeResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
get_started=get_started,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
get_started: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[GetCompletedJobResultMaybeResponse200]:
|
||||
""" get completed job result if job is completed
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
get_started (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:
|
||||
GetCompletedJobResultMaybeResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
get_started=get_started,
|
||||
|
||||
)).parsed
|
||||
144
python-client/windmill-api/windmill_api/api/job/get_db_clock.py
Normal file
144
python-client/windmill-api/windmill_api/api/job/get_db_clock.py
Normal file
@@ -0,0 +1,144 @@
|
||||
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": "/jobs/db_clock",
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[int]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(int, 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[int]:
|
||||
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[int]:
|
||||
""" get db clock
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[int]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[int]:
|
||||
""" get db clock
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
int
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[int]:
|
||||
""" get db clock
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[int]
|
||||
"""
|
||||
|
||||
|
||||
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[int]:
|
||||
""" get db clock
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
int
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
184
python-client/windmill-api/windmill_api/api/job/get_job.py
Normal file
184
python-client/windmill-api/windmill_api/api/job/get_job.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 ...models.get_job_response_200 import GetJobResponse200
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/get/{id}".format(workspace=workspace,id=id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetJobResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetJobResponse200.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[GetJobResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetJobResponse200]:
|
||||
""" get job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[GetJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetJobResponse200]:
|
||||
""" get job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
GetJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetJobResponse200]:
|
||||
""" get job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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[GetJobResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Optional[GetJobResponse200]:
|
||||
""" get job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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:
|
||||
GetJobResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
119
python-client/windmill-api/windmill_api/api/job/get_job_logs.py
Normal file
119
python-client/windmill-api/windmill_api/api/job/get_job_logs.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,
|
||||
id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/get_logs/{id}".format(workspace=workspace,id=id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get job logs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get job logs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (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,
|
||||
id=id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.get_job_updates_response_200 import GetJobUpdatesResponse200
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
log_offset: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["running"] = running
|
||||
|
||||
|
||||
params["log_offset"] = log_offset
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/getupdate/{id}".format(workspace=workspace,id=id,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetJobUpdatesResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetJobUpdatesResponse200.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[GetJobUpdatesResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
log_offset: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[GetJobUpdatesResponse200]:
|
||||
""" get job updates
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
running (Union[Unset, None, bool]):
|
||||
log_offset (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[GetJobUpdatesResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
running=running,
|
||||
log_offset=log_offset,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
log_offset: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[GetJobUpdatesResponse200]:
|
||||
""" get job updates
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
running (Union[Unset, None, bool]):
|
||||
log_offset (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:
|
||||
GetJobUpdatesResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
running=running,
|
||||
log_offset=log_offset,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
log_offset: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[GetJobUpdatesResponse200]:
|
||||
""" get job updates
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
running (Union[Unset, None, bool]):
|
||||
log_offset (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[GetJobUpdatesResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
running=running,
|
||||
log_offset=log_offset,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
log_offset: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[GetJobUpdatesResponse200]:
|
||||
""" get job updates
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
running (Union[Unset, None, bool]):
|
||||
log_offset (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:
|
||||
GetJobUpdatesResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
running=running,
|
||||
log_offset=log_offset,
|
||||
|
||||
)).parsed
|
||||
@@ -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.get_queue_count_response_200 import GetQueueCountResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/queue/count".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetQueueCountResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetQueueCountResponse200.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[GetQueueCountResponse200]:
|
||||
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[GetQueueCountResponse200]:
|
||||
""" get queue count
|
||||
|
||||
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[GetQueueCountResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetQueueCountResponse200]:
|
||||
""" get queue count
|
||||
|
||||
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:
|
||||
GetQueueCountResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[GetQueueCountResponse200]:
|
||||
""" get queue count
|
||||
|
||||
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[GetQueueCountResponse200]
|
||||
"""
|
||||
|
||||
|
||||
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[GetQueueCountResponse200]:
|
||||
""" get queue count
|
||||
|
||||
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:
|
||||
GetQueueCountResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,221 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.get_resume_urls_response_200 import GetResumeUrlsResponse200
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/resume_urls/{id}/{resume_id}".format(workspace=workspace,id=id,resume_id=resume_id,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetResumeUrlsResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetResumeUrlsResponse200.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[GetResumeUrlsResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[GetResumeUrlsResponse200]:
|
||||
""" get resume urls given a job_id, resume_id and a nonce to resume a flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[GetResumeUrlsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[GetResumeUrlsResponse200]:
|
||||
""" get resume urls given a job_id, resume_id and a nonce to resume a flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetResumeUrlsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
client=client,
|
||||
approver=approver,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[GetResumeUrlsResponse200]:
|
||||
""" get resume urls given a job_id, resume_id and a nonce to resume a flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[GetResumeUrlsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[GetResumeUrlsResponse200]:
|
||||
""" get resume urls given a job_id, resume_id and a nonce to resume a flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetResumeUrlsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
client=client,
|
||||
approver=approver,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,234 @@
|
||||
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 ...models.get_suspended_job_flow_response_200 import GetSuspendedJobFlowResponse200
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}".format(workspace=workspace,id=id,resume_id=resume_id,signature=signature,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetSuspendedJobFlowResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = GetSuspendedJobFlowResponse200.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[GetSuspendedJobFlowResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[GetSuspendedJobFlowResponse200]:
|
||||
""" get parent flow job of suspended job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[GetSuspendedJobFlowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[GetSuspendedJobFlowResponse200]:
|
||||
""" get parent flow job of suspended job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetSuspendedJobFlowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
client=client,
|
||||
approver=approver,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[GetSuspendedJobFlowResponse200]:
|
||||
""" get parent flow job of suspended job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[GetSuspendedJobFlowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[GetSuspendedJobFlowResponse200]:
|
||||
""" get parent flow job of suspended job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
GetSuspendedJobFlowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
client=client,
|
||||
approver=approver,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,451 @@
|
||||
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
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from ...models.list_completed_jobs_response_200_item import ListCompletedJobsResponse200Item
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["order_desc"] = order_desc
|
||||
|
||||
|
||||
params["created_by"] = created_by
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["script_path_exact"] = script_path_exact
|
||||
|
||||
|
||||
params["script_path_start"] = script_path_start
|
||||
|
||||
|
||||
params["schedule_path"] = schedule_path
|
||||
|
||||
|
||||
params["script_hash"] = script_hash
|
||||
|
||||
|
||||
json_started_before: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_before, Unset):
|
||||
json_started_before = started_before.isoformat() if started_before else None
|
||||
|
||||
params["started_before"] = json_started_before
|
||||
|
||||
|
||||
json_started_after: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_after, Unset):
|
||||
json_started_after = started_after.isoformat() if started_after else None
|
||||
|
||||
params["started_after"] = json_started_after
|
||||
|
||||
|
||||
params["success"] = success
|
||||
|
||||
|
||||
params["job_kinds"] = job_kinds
|
||||
|
||||
|
||||
params["args"] = args
|
||||
|
||||
|
||||
params["result"] = result
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["is_skipped"] = is_skipped
|
||||
|
||||
|
||||
params["is_flow_step"] = is_flow_step
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/completed/list".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListCompletedJobsResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListCompletedJobsResponse200Item.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['ListCompletedJobsResponse200Item']]:
|
||||
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],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListCompletedJobsResponse200Item']]:
|
||||
""" list all completed jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (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['ListCompletedJobsResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListCompletedJobsResponse200Item']]:
|
||||
""" list all completed jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (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['ListCompletedJobsResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListCompletedJobsResponse200Item']]:
|
||||
""" list all completed jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (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['ListCompletedJobsResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
|
||||
)
|
||||
|
||||
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],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListCompletedJobsResponse200Item']]:
|
||||
""" list all completed jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (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['ListCompletedJobsResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
|
||||
)).parsed
|
||||
507
python-client/windmill-api/windmill_api/api/job/list_jobs.py
Normal file
507
python-client/windmill-api/windmill_api/api/job/list_jobs.py
Normal file
@@ -0,0 +1,507 @@
|
||||
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_jobs_response_200_item import ListJobsResponse200Item
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
created_or_started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
created_or_started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["created_by"] = created_by
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["script_path_exact"] = script_path_exact
|
||||
|
||||
|
||||
params["script_path_start"] = script_path_start
|
||||
|
||||
|
||||
params["schedule_path"] = schedule_path
|
||||
|
||||
|
||||
params["script_hash"] = script_hash
|
||||
|
||||
|
||||
json_started_before: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_before, Unset):
|
||||
json_started_before = started_before.isoformat() if started_before else None
|
||||
|
||||
params["started_before"] = json_started_before
|
||||
|
||||
|
||||
json_started_after: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_after, Unset):
|
||||
json_started_after = started_after.isoformat() if started_after else None
|
||||
|
||||
params["started_after"] = json_started_after
|
||||
|
||||
|
||||
json_created_or_started_before: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(created_or_started_before, Unset):
|
||||
json_created_or_started_before = created_or_started_before.isoformat() if created_or_started_before else None
|
||||
|
||||
params["created_or_started_before"] = json_created_or_started_before
|
||||
|
||||
|
||||
params["running"] = running
|
||||
|
||||
|
||||
params["scheduled_for_before_now"] = scheduled_for_before_now
|
||||
|
||||
|
||||
json_created_or_started_after: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(created_or_started_after, Unset):
|
||||
json_created_or_started_after = created_or_started_after.isoformat() if created_or_started_after else None
|
||||
|
||||
params["created_or_started_after"] = json_created_or_started_after
|
||||
|
||||
|
||||
params["job_kinds"] = job_kinds
|
||||
|
||||
|
||||
params["args"] = args
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["result"] = result
|
||||
|
||||
|
||||
params["is_skipped"] = is_skipped
|
||||
|
||||
|
||||
params["is_flow_step"] = is_flow_step
|
||||
|
||||
|
||||
params["success"] = success
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/list".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListJobsResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListJobsResponse200Item.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['ListJobsResponse200Item']]:
|
||||
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],
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
created_or_started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
created_or_started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListJobsResponse200Item']]:
|
||||
""" list all jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
created_or_started_before (Union[Unset, None, datetime.datetime]):
|
||||
running (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
created_or_started_after (Union[Unset, None, datetime.datetime]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (Union[Unset, None, bool]):
|
||||
success (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['ListJobsResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
created_or_started_before=created_or_started_before,
|
||||
running=running,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
created_or_started_after=created_or_started_after,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
tag=tag,
|
||||
result=result,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
success=success,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
created_or_started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
created_or_started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListJobsResponse200Item']]:
|
||||
""" list all jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
created_or_started_before (Union[Unset, None, datetime.datetime]):
|
||||
running (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
created_or_started_after (Union[Unset, None, datetime.datetime]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (Union[Unset, None, bool]):
|
||||
success (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['ListJobsResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
created_or_started_before=created_or_started_before,
|
||||
running=running,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
created_or_started_after=created_or_started_after,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
tag=tag,
|
||||
result=result,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
success=success,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
created_or_started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
created_or_started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[List['ListJobsResponse200Item']]:
|
||||
""" list all jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
created_or_started_before (Union[Unset, None, datetime.datetime]):
|
||||
running (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
created_or_started_after (Union[Unset, None, datetime.datetime]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (Union[Unset, None, bool]):
|
||||
success (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['ListJobsResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
created_or_started_before=created_or_started_before,
|
||||
running=running,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
created_or_started_after=created_or_started_after,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
tag=tag,
|
||||
result=result,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
success=success,
|
||||
|
||||
)
|
||||
|
||||
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],
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
created_or_started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
created_or_started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
is_skipped: Union[Unset, None, bool] = UNSET,
|
||||
is_flow_step: Union[Unset, None, bool] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Optional[List['ListJobsResponse200Item']]:
|
||||
""" list all jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
created_or_started_before (Union[Unset, None, datetime.datetime]):
|
||||
running (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
created_or_started_after (Union[Unset, None, datetime.datetime]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
args (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
is_skipped (Union[Unset, None, bool]):
|
||||
is_flow_step (Union[Unset, None, bool]):
|
||||
success (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['ListJobsResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
created_or_started_before=created_or_started_before,
|
||||
running=running,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
created_or_started_after=created_or_started_after,
|
||||
job_kinds=job_kinds,
|
||||
args=args,
|
||||
tag=tag,
|
||||
result=result,
|
||||
is_skipped=is_skipped,
|
||||
is_flow_step=is_flow_step,
|
||||
success=success,
|
||||
|
||||
)).parsed
|
||||
467
python-client/windmill-api/windmill_api/api/job/list_queue.py
Normal file
467
python-client/windmill-api/windmill_api/api/job/list_queue.py
Normal file
@@ -0,0 +1,467 @@
|
||||
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
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...models.list_queue_response_200_item import ListQueueResponse200Item
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
suspended: Union[Unset, None, bool] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["order_desc"] = order_desc
|
||||
|
||||
|
||||
params["created_by"] = created_by
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["script_path_exact"] = script_path_exact
|
||||
|
||||
|
||||
params["script_path_start"] = script_path_start
|
||||
|
||||
|
||||
params["schedule_path"] = schedule_path
|
||||
|
||||
|
||||
params["script_hash"] = script_hash
|
||||
|
||||
|
||||
json_started_before: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_before, Unset):
|
||||
json_started_before = started_before.isoformat() if started_before else None
|
||||
|
||||
params["started_before"] = json_started_before
|
||||
|
||||
|
||||
json_started_after: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(started_after, Unset):
|
||||
json_started_after = started_after.isoformat() if started_after else None
|
||||
|
||||
params["started_after"] = json_started_after
|
||||
|
||||
|
||||
params["success"] = success
|
||||
|
||||
|
||||
params["scheduled_for_before_now"] = scheduled_for_before_now
|
||||
|
||||
|
||||
params["job_kinds"] = job_kinds
|
||||
|
||||
|
||||
params["suspended"] = suspended
|
||||
|
||||
|
||||
params["running"] = running
|
||||
|
||||
|
||||
params["args"] = args
|
||||
|
||||
|
||||
params["result"] = result
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/queue/list".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListQueueResponse200Item']]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in (_response_200):
|
||||
response_200_item = ListQueueResponse200Item.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['ListQueueResponse200Item']]:
|
||||
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],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
suspended: Union[Unset, None, bool] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[List['ListQueueResponse200Item']]:
|
||||
""" list all queued jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
suspended (Union[Unset, None, bool]):
|
||||
running (Union[Unset, None, bool]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[List['ListQueueResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
job_kinds=job_kinds,
|
||||
suspended=suspended,
|
||||
running=running,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
suspended: Union[Unset, None, bool] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[List['ListQueueResponse200Item']]:
|
||||
""" list all queued jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
suspended (Union[Unset, None, bool]):
|
||||
running (Union[Unset, None, bool]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
List['ListQueueResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
job_kinds=job_kinds,
|
||||
suspended=suspended,
|
||||
running=running,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
suspended: Union[Unset, None, bool] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[List['ListQueueResponse200Item']]:
|
||||
""" list all queued jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
suspended (Union[Unset, None, bool]):
|
||||
running (Union[Unset, None, bool]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[List['ListQueueResponse200Item']]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
job_kinds=job_kinds,
|
||||
suspended=suspended,
|
||||
running=running,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
|
||||
)
|
||||
|
||||
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],
|
||||
order_desc: Union[Unset, None, bool] = UNSET,
|
||||
created_by: Union[Unset, None, str] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
script_path_exact: Union[Unset, None, str] = UNSET,
|
||||
script_path_start: Union[Unset, None, str] = UNSET,
|
||||
schedule_path: Union[Unset, None, str] = UNSET,
|
||||
script_hash: Union[Unset, None, str] = UNSET,
|
||||
started_before: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
started_after: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
success: Union[Unset, None, bool] = UNSET,
|
||||
scheduled_for_before_now: Union[Unset, None, bool] = UNSET,
|
||||
job_kinds: Union[Unset, None, str] = UNSET,
|
||||
suspended: Union[Unset, None, bool] = UNSET,
|
||||
running: Union[Unset, None, bool] = UNSET,
|
||||
args: Union[Unset, None, str] = UNSET,
|
||||
result: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[List['ListQueueResponse200Item']]:
|
||||
""" list all queued jobs
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
order_desc (Union[Unset, None, bool]):
|
||||
created_by (Union[Unset, None, str]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
script_path_exact (Union[Unset, None, str]):
|
||||
script_path_start (Union[Unset, None, str]):
|
||||
schedule_path (Union[Unset, None, str]):
|
||||
script_hash (Union[Unset, None, str]):
|
||||
started_before (Union[Unset, None, datetime.datetime]):
|
||||
started_after (Union[Unset, None, datetime.datetime]):
|
||||
success (Union[Unset, None, bool]):
|
||||
scheduled_for_before_now (Union[Unset, None, bool]):
|
||||
job_kinds (Union[Unset, None, str]):
|
||||
suspended (Union[Unset, None, bool]):
|
||||
running (Union[Unset, None, bool]):
|
||||
args (Union[Unset, None, str]):
|
||||
result (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
List['ListQueueResponse200Item']
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
order_desc=order_desc,
|
||||
created_by=created_by,
|
||||
parent_job=parent_job,
|
||||
script_path_exact=script_path_exact,
|
||||
script_path_start=script_path_start,
|
||||
schedule_path=schedule_path,
|
||||
script_hash=script_hash,
|
||||
started_before=started_before,
|
||||
started_after=started_after,
|
||||
success=success,
|
||||
scheduled_for_before_now=scheduled_for_before_now,
|
||||
job_kinds=job_kinds,
|
||||
suspended=suspended,
|
||||
running=running,
|
||||
args=args,
|
||||
result=result,
|
||||
tag=tag,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,172 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.openai_sync_flow_by_path_json_body import OpenaiSyncFlowByPathJsonBody
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: OpenaiSyncFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["queue_limit"] = queue_limit
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/openai_sync/f/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: OpenaiSyncFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path and wait until completion in openai format
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (OpenaiSyncFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: OpenaiSyncFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path and wait until completion in openai format
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (OpenaiSyncFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.openai_sync_script_by_path_json_body import OpenaiSyncScriptByPathJsonBody
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: OpenaiSyncScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["queue_limit"] = queue_limit
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/openai_sync/p/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: OpenaiSyncScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path in openai format
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
json_body (OpenaiSyncScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
parent_job=parent_job,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: OpenaiSyncScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path in openai format
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
json_body (OpenaiSyncScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
parent_job=parent_job,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.restart_flow_at_step_json_body import RestartFlowAtStepJsonBody
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
step_id: str,
|
||||
branch_or_iteration_n: int,
|
||||
*,
|
||||
json_body: RestartFlowAtStepJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
json_scheduled_for: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(scheduled_for, Unset):
|
||||
json_scheduled_for = scheduled_for.isoformat() if scheduled_for else None
|
||||
|
||||
params["scheduled_for"] = json_scheduled_for
|
||||
|
||||
|
||||
params["scheduled_in_secs"] = scheduled_in_secs
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}".format(workspace=workspace,id=id,step_id=step_id,branch_or_iteration_n=branch_or_iteration_n,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
step_id: str,
|
||||
branch_or_iteration_n: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RestartFlowAtStepJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" restart a completed flow at a given step
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
step_id (str):
|
||||
branch_or_iteration_n (int):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RestartFlowAtStepJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
step_id=step_id,
|
||||
branch_or_iteration_n=branch_or_iteration_n,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
step_id: str,
|
||||
branch_or_iteration_n: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RestartFlowAtStepJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" restart a completed flow at a given step
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
step_id (str):
|
||||
branch_or_iteration_n (int):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RestartFlowAtStepJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
step_id=step_id,
|
||||
branch_or_iteration_n=branch_or_iteration_n,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
128
python-client/windmill-api/windmill_api/api/job/result_by_id.py
Normal file
128
python-client/windmill-api/windmill_api/api/job/result_by_id.py
Normal file
@@ -0,0 +1,128 @@
|
||||
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,
|
||||
flow_job_id: str,
|
||||
node_id: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}".format(workspace=workspace,flow_job_id=flow_job_id,node_id=node_id,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
flow_job_id: str,
|
||||
node_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get job result by id
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
flow_job_id (str):
|
||||
node_id (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,
|
||||
flow_job_id=flow_job_id,
|
||||
node_id=node_id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
flow_job_id: str,
|
||||
node_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" get job result by id
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
flow_job_id (str):
|
||||
node_id (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,
|
||||
flow_job_id=flow_job_id,
|
||||
node_id=node_id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.resume_suspended_flow_as_owner_json_body import ResumeSuspendedFlowAsOwnerJsonBody
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
json_body: ResumeSuspendedFlowAsOwnerJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/flow/resume/{id}".format(workspace=workspace,id=id,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ResumeSuspendedFlowAsOwnerJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow as an owner
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (ResumeSuspendedFlowAsOwnerJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ResumeSuspendedFlowAsOwnerJsonBody,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow as an owner
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (ResumeSuspendedFlowAsOwnerJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["payload"] = payload
|
||||
|
||||
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}".format(workspace=workspace,id=id,resume_id=resume_id,signature=signature,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
payload (Union[Unset, None, str]):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
payload=payload,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
payload (Union[Unset, None, str]):
|
||||
approver (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
payload=payload,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.resume_suspended_job_post_json_body import ResumeSuspendedJobPostJsonBody
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
json_body: ResumeSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["approver"] = approver
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}".format(workspace=workspace,id=id,resume_id=resume_id,signature=signature,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ResumeSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
json_body (ResumeSuspendedJobPostJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
json_body=json_body,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
resume_id: int,
|
||||
signature: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: ResumeSuspendedJobPostJsonBody,
|
||||
approver: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" resume a job for a suspended flow
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
resume_id (int):
|
||||
signature (str):
|
||||
approver (Union[Unset, None, str]):
|
||||
json_body (ResumeSuspendedJobPostJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
resume_id=resume_id,
|
||||
signature=signature,
|
||||
json_body=json_body,
|
||||
approver=approver,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.run_flow_by_path_json_body import RunFlowByPathJsonBody
|
||||
from typing import Dict
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: RunFlowByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
json_scheduled_for: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(scheduled_for, Unset):
|
||||
json_scheduled_for = scheduled_for.isoformat() if scheduled_for else None
|
||||
|
||||
params["scheduled_for"] = json_scheduled_for
|
||||
|
||||
|
||||
params["scheduled_in_secs"] = scheduled_in_secs
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/f/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunFlowByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunFlowByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.run_flow_preview_json_body import RunFlowPreviewJsonBody
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: RunFlowPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/preview_flow".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
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: RunFlowPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow preview
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunFlowPreviewJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
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: RunFlowPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow preview
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunFlowPreviewJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
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.run_raw_script_dependencies_json_body import RunRawScriptDependenciesJsonBody
|
||||
from ...models.run_raw_script_dependencies_response_201 import RunRawScriptDependenciesResponse201
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: RunRawScriptDependenciesJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/dependencies".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[RunRawScriptDependenciesResponse201]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = RunRawScriptDependenciesResponse201.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_201
|
||||
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[RunRawScriptDependenciesResponse201]:
|
||||
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: RunRawScriptDependenciesJsonBody,
|
||||
|
||||
) -> Response[RunRawScriptDependenciesResponse201]:
|
||||
""" run a one-off dependencies job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (RunRawScriptDependenciesJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[RunRawScriptDependenciesResponse201]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunRawScriptDependenciesJsonBody,
|
||||
|
||||
) -> Optional[RunRawScriptDependenciesResponse201]:
|
||||
""" run a one-off dependencies job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (RunRawScriptDependenciesJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
RunRawScriptDependenciesResponse201
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunRawScriptDependenciesJsonBody,
|
||||
|
||||
) -> Response[RunRawScriptDependenciesResponse201]:
|
||||
""" run a one-off dependencies job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (RunRawScriptDependenciesJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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[RunRawScriptDependenciesResponse201]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunRawScriptDependenciesJsonBody,
|
||||
|
||||
) -> Optional[RunRawScriptDependenciesResponse201]:
|
||||
""" run a one-off dependencies job
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (RunRawScriptDependenciesJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
RunRawScriptDependenciesResponse201
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,216 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
from ...models.run_script_by_hash_json_body import RunScriptByHashJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
json_body: RunScriptByHashJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
json_scheduled_for: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(scheduled_for, Unset):
|
||||
json_scheduled_for = scheduled_for.isoformat() if scheduled_for else None
|
||||
|
||||
params["scheduled_for"] = json_scheduled_for
|
||||
|
||||
|
||||
params["scheduled_in_secs"] = scheduled_in_secs
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/h/{hash}".format(workspace=workspace,hash=hash_,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
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,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunScriptByHashJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunScriptByHashJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
hash_=hash_,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunScriptByHashJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunScriptByHashJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
hash_=hash_,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.run_script_by_path_json_body import RunScriptByPathJsonBody
|
||||
import datetime
|
||||
from dateutil.parser import isoparse
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: RunScriptByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
json_scheduled_for: Union[Unset, None, str] = UNSET
|
||||
if not isinstance(scheduled_for, Unset):
|
||||
json_scheduled_for = scheduled_for.isoformat() if scheduled_for else None
|
||||
|
||||
params["scheduled_for"] = json_scheduled_for
|
||||
|
||||
|
||||
params["scheduled_in_secs"] = scheduled_in_secs
|
||||
|
||||
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/p/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunScriptByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunScriptByPathJsonBody,
|
||||
scheduled_for: Union[Unset, None, datetime.datetime] = UNSET,
|
||||
scheduled_in_secs: Union[Unset, None, int] = UNSET,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
scheduled_for (Union[Unset, None, datetime.datetime]):
|
||||
scheduled_in_secs (Union[Unset, None, int]):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
json_body (RunScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
scheduled_for=scheduled_for,
|
||||
scheduled_in_secs=scheduled_in_secs,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.run_script_preview_json_body import RunScriptPreviewJsonBody
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: RunScriptPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["invisible_to_owner"] = invisible_to_owner
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run/preview".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
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: RunScriptPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script preview
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunScriptPreviewJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
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: RunScriptPreviewJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
invisible_to_owner: Union[Unset, None, bool] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script preview
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
invisible_to_owner (Union[Unset, None, bool]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunScriptPreviewJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server 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,
|
||||
include_header=include_header,
|
||||
invisible_to_owner=invisible_to_owner,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.run_wait_result_flow_by_path_json_body import RunWaitResultFlowByPathJsonBody
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: RunWaitResultFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["queue_limit"] = queue_limit
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run_wait_result/f/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunWaitResultFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path and wait until completion
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunWaitResultFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunWaitResultFlowByPathJsonBody,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run flow by path and wait until completion
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
json_body (RunWaitResultFlowByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
job_id=job_id,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.run_wait_result_script_by_path_json_body import RunWaitResultScriptByPathJsonBody
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
json_body: RunWaitResultScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["queue_limit"] = queue_limit
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/jobs/run_wait_result/p/{path}".format(workspace=workspace,path=path,),
|
||||
"json": json_json_body,
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunWaitResultScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
json_body (RunWaitResultScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: RunWaitResultScriptByPathJsonBody,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
json_body (RunWaitResultScriptByPathJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
json_body=json_body,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["parent_job"] = parent_job
|
||||
|
||||
|
||||
params["tag"] = tag
|
||||
|
||||
|
||||
params["job_id"] = job_id
|
||||
|
||||
|
||||
params["include_header"] = include_header
|
||||
|
||||
|
||||
params["queue_limit"] = queue_limit
|
||||
|
||||
|
||||
params["payload"] = payload
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/jobs/run_wait_result/p/{path}".format(workspace=workspace,path=path,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path with get
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
payload (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
payload=payload,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
parent_job: Union[Unset, None, str] = UNSET,
|
||||
tag: Union[Unset, None, str] = UNSET,
|
||||
job_id: Union[Unset, None, str] = UNSET,
|
||||
include_header: Union[Unset, None, str] = UNSET,
|
||||
queue_limit: Union[Unset, None, str] = UNSET,
|
||||
payload: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" run script by path with get
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
parent_job (Union[Unset, None, str]):
|
||||
tag (Union[Unset, None, str]):
|
||||
job_id (Union[Unset, None, str]):
|
||||
include_header (Union[Unset, None, str]):
|
||||
queue_limit (Union[Unset, None, str]):
|
||||
payload (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
parent_job=parent_job,
|
||||
tag=tag,
|
||||
job_id=job_id,
|
||||
include_header=include_header,
|
||||
queue_limit=queue_limit,
|
||||
payload=payload,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
Reference in New Issue
Block a user