re-uploading work
This commit is contained in:
1
tests/generated_client/api/workflows/__init__.py
Normal file
1
tests/generated_client/api/workflows/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
""" Contains endpoint functions for accessing the API """
|
||||
191
tests/generated_client/api/workflows/create_workflow.py
Normal file
191
tests/generated_client/api/workflows/create_workflow.py
Normal file
@@ -0,0 +1,191 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.create_workflow_request import CreateWorkflowRequest
|
||||
from ...models.create_workflow_response_201 import CreateWorkflowResponse201
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: CreateWorkflowRequest,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v1/workflows",
|
||||
}
|
||||
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | CreateWorkflowResponse201 | None:
|
||||
if response.status_code == 201:
|
||||
response_201 = CreateWorkflowResponse201.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_201
|
||||
|
||||
if response.status_code == 400:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
|
||||
if response.status_code == 404:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
|
||||
if response.status_code == 409:
|
||||
response_409 = cast(Any, None)
|
||||
return response_409
|
||||
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | CreateWorkflowResponse201]:
|
||||
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: AuthenticatedClient,
|
||||
body: CreateWorkflowRequest,
|
||||
|
||||
) -> Response[Any | CreateWorkflowResponse201]:
|
||||
""" Create a new workflow
|
||||
|
||||
Args:
|
||||
body (CreateWorkflowRequest): Request DTO for creating a new workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | CreateWorkflowResponse201]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: CreateWorkflowRequest,
|
||||
|
||||
) -> Any | CreateWorkflowResponse201 | None:
|
||||
""" Create a new workflow
|
||||
|
||||
Args:
|
||||
body (CreateWorkflowRequest): Request DTO for creating a new workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | CreateWorkflowResponse201
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: CreateWorkflowRequest,
|
||||
|
||||
) -> Response[Any | CreateWorkflowResponse201]:
|
||||
""" Create a new workflow
|
||||
|
||||
Args:
|
||||
body (CreateWorkflowRequest): Request DTO for creating a new workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | CreateWorkflowResponse201]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: CreateWorkflowRequest,
|
||||
|
||||
) -> Any | CreateWorkflowResponse201 | None:
|
||||
""" Create a new workflow
|
||||
|
||||
Args:
|
||||
body (CreateWorkflowRequest): Request DTO for creating a new workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | CreateWorkflowResponse201
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
|
||||
)).parsed
|
||||
175
tests/generated_client/api/workflows/delete_workflow.py
Normal file
175
tests/generated_client/api/workflows/delete_workflow.py
Normal file
@@ -0,0 +1,175 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.success_response import SuccessResponse
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
ref: str,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": "/api/v1/workflows/{ref}".format(ref=quote(str(ref), safe=""),),
|
||||
}
|
||||
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | SuccessResponse | None:
|
||||
if response.status_code == 200:
|
||||
response_200 = SuccessResponse.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
|
||||
if response.status_code == 404:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | SuccessResponse]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Response[Any | SuccessResponse]:
|
||||
""" Delete a workflow
|
||||
|
||||
Args:
|
||||
ref (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 | SuccessResponse]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Any | SuccessResponse | None:
|
||||
""" Delete a workflow
|
||||
|
||||
Args:
|
||||
ref (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:
|
||||
Any | SuccessResponse
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Response[Any | SuccessResponse]:
|
||||
""" Delete a workflow
|
||||
|
||||
Args:
|
||||
ref (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 | SuccessResponse]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Any | SuccessResponse | None:
|
||||
""" Delete a workflow
|
||||
|
||||
Args:
|
||||
ref (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:
|
||||
Any | SuccessResponse
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
175
tests/generated_client/api/workflows/get_workflow.py
Normal file
175
tests/generated_client/api/workflows/get_workflow.py
Normal file
@@ -0,0 +1,175 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.get_workflow_response_200 import GetWorkflowResponse200
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
ref: str,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v1/workflows/{ref}".format(ref=quote(str(ref), safe=""),),
|
||||
}
|
||||
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | GetWorkflowResponse200 | None:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetWorkflowResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
|
||||
if response.status_code == 404:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | GetWorkflowResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Response[Any | GetWorkflowResponse200]:
|
||||
""" Get a single workflow by reference
|
||||
|
||||
Args:
|
||||
ref (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 | GetWorkflowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Any | GetWorkflowResponse200 | None:
|
||||
""" Get a single workflow by reference
|
||||
|
||||
Args:
|
||||
ref (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:
|
||||
Any | GetWorkflowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Response[Any | GetWorkflowResponse200]:
|
||||
""" Get a single workflow by reference
|
||||
|
||||
Args:
|
||||
ref (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 | GetWorkflowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
|
||||
) -> Any | GetWorkflowResponse200 | None:
|
||||
""" Get a single workflow by reference
|
||||
|
||||
Args:
|
||||
ref (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:
|
||||
Any | GetWorkflowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
|
||||
)).parsed
|
||||
275
tests/generated_client/api/workflows/list_workflows.py
Normal file
275
tests/generated_client/api/workflows/list_workflows.py
Normal file
@@ -0,0 +1,275 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.paginated_response_workflow_summary import PaginatedResponseWorkflowSummary
|
||||
from ...types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
tags: None | str | Unset = UNSET,
|
||||
enabled: bool | None | Unset = UNSET,
|
||||
search: None | str | Unset = UNSET,
|
||||
pack_ref: None | str | Unset = UNSET,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
|
||||
|
||||
|
||||
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["page"] = page
|
||||
|
||||
params["page_size"] = page_size
|
||||
|
||||
json_tags: None | str | Unset
|
||||
if isinstance(tags, Unset):
|
||||
json_tags = UNSET
|
||||
else:
|
||||
json_tags = tags
|
||||
params["tags"] = json_tags
|
||||
|
||||
json_enabled: bool | None | Unset
|
||||
if isinstance(enabled, Unset):
|
||||
json_enabled = UNSET
|
||||
else:
|
||||
json_enabled = enabled
|
||||
params["enabled"] = json_enabled
|
||||
|
||||
json_search: None | str | Unset
|
||||
if isinstance(search, Unset):
|
||||
json_search = UNSET
|
||||
else:
|
||||
json_search = search
|
||||
params["search"] = json_search
|
||||
|
||||
json_pack_ref: None | str | Unset
|
||||
if isinstance(pack_ref, Unset):
|
||||
json_pack_ref = UNSET
|
||||
else:
|
||||
json_pack_ref = pack_ref
|
||||
params["pack_ref"] = json_pack_ref
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v1/workflows",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PaginatedResponseWorkflowSummary | None:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedResponseWorkflowSummary.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: AuthenticatedClient | Client, response: httpx.Response) -> Response[PaginatedResponseWorkflowSummary]:
|
||||
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: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
tags: None | str | Unset = UNSET,
|
||||
enabled: bool | None | Unset = UNSET,
|
||||
search: None | str | Unset = UNSET,
|
||||
pack_ref: None | str | Unset = UNSET,
|
||||
|
||||
) -> Response[PaginatedResponseWorkflowSummary]:
|
||||
""" List all workflows with pagination and filtering
|
||||
|
||||
Args:
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
tags (None | str | Unset):
|
||||
enabled (bool | None | Unset):
|
||||
search (None | str | Unset):
|
||||
pack_ref (None | str | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedResponseWorkflowSummary]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
tags=tags,
|
||||
enabled=enabled,
|
||||
search=search,
|
||||
pack_ref=pack_ref,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
tags: None | str | Unset = UNSET,
|
||||
enabled: bool | None | Unset = UNSET,
|
||||
search: None | str | Unset = UNSET,
|
||||
pack_ref: None | str | Unset = UNSET,
|
||||
|
||||
) -> PaginatedResponseWorkflowSummary | None:
|
||||
""" List all workflows with pagination and filtering
|
||||
|
||||
Args:
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
tags (None | str | Unset):
|
||||
enabled (bool | None | Unset):
|
||||
search (None | str | Unset):
|
||||
pack_ref (None | str | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedResponseWorkflowSummary
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
tags=tags,
|
||||
enabled=enabled,
|
||||
search=search,
|
||||
pack_ref=pack_ref,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
tags: None | str | Unset = UNSET,
|
||||
enabled: bool | None | Unset = UNSET,
|
||||
search: None | str | Unset = UNSET,
|
||||
pack_ref: None | str | Unset = UNSET,
|
||||
|
||||
) -> Response[PaginatedResponseWorkflowSummary]:
|
||||
""" List all workflows with pagination and filtering
|
||||
|
||||
Args:
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
tags (None | str | Unset):
|
||||
enabled (bool | None | Unset):
|
||||
search (None | str | Unset):
|
||||
pack_ref (None | str | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedResponseWorkflowSummary]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
tags=tags,
|
||||
enabled=enabled,
|
||||
search=search,
|
||||
pack_ref=pack_ref,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
tags: None | str | Unset = UNSET,
|
||||
enabled: bool | None | Unset = UNSET,
|
||||
search: None | str | Unset = UNSET,
|
||||
pack_ref: None | str | Unset = UNSET,
|
||||
|
||||
) -> PaginatedResponseWorkflowSummary | None:
|
||||
""" List all workflows with pagination and filtering
|
||||
|
||||
Args:
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
tags (None | str | Unset):
|
||||
enabled (bool | None | Unset):
|
||||
search (None | str | Unset):
|
||||
pack_ref (None | str | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedResponseWorkflowSummary
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
client=client,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
tags=tags,
|
||||
enabled=enabled,
|
||||
search=search,
|
||||
pack_ref=pack_ref,
|
||||
|
||||
)).parsed
|
||||
212
tests/generated_client/api/workflows/list_workflows_by_pack.py
Normal file
212
tests/generated_client/api/workflows/list_workflows_by_pack.py
Normal file
@@ -0,0 +1,212 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.paginated_response_workflow_summary import PaginatedResponseWorkflowSummary
|
||||
from ...types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
pack_ref: str,
|
||||
*,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
|
||||
|
||||
|
||||
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["page"] = page
|
||||
|
||||
params["page_size"] = page_size
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v1/packs/{pack_ref}/workflows".format(pack_ref=quote(str(pack_ref), safe=""),),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | PaginatedResponseWorkflowSummary | None:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedResponseWorkflowSummary.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
|
||||
if response.status_code == 404:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | PaginatedResponseWorkflowSummary]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
pack_ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
|
||||
) -> Response[Any | PaginatedResponseWorkflowSummary]:
|
||||
""" List workflows by pack reference
|
||||
|
||||
Args:
|
||||
pack_ref (str):
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | PaginatedResponseWorkflowSummary]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
pack_ref=pack_ref,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
pack_ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
|
||||
) -> Any | PaginatedResponseWorkflowSummary | None:
|
||||
""" List workflows by pack reference
|
||||
|
||||
Args:
|
||||
pack_ref (str):
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | PaginatedResponseWorkflowSummary
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
pack_ref=pack_ref,
|
||||
client=client,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
pack_ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
|
||||
) -> Response[Any | PaginatedResponseWorkflowSummary]:
|
||||
""" List workflows by pack reference
|
||||
|
||||
Args:
|
||||
pack_ref (str):
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | PaginatedResponseWorkflowSummary]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
pack_ref=pack_ref,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
pack_ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
page: int | Unset = UNSET,
|
||||
page_size: int | Unset = UNSET,
|
||||
|
||||
) -> Any | PaginatedResponseWorkflowSummary | None:
|
||||
""" List workflows by pack reference
|
||||
|
||||
Args:
|
||||
pack_ref (str):
|
||||
page (int | Unset):
|
||||
page_size (int | Unset):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | PaginatedResponseWorkflowSummary
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
pack_ref=pack_ref,
|
||||
client=client,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
|
||||
)).parsed
|
||||
200
tests/generated_client/api/workflows/update_workflow.py
Normal file
200
tests/generated_client/api/workflows/update_workflow.py
Normal file
@@ -0,0 +1,200 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, cast
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from ...models.update_workflow_request import UpdateWorkflowRequest
|
||||
from ...models.update_workflow_response_200 import UpdateWorkflowResponse200
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
ref: str,
|
||||
*,
|
||||
body: UpdateWorkflowRequest,
|
||||
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "put",
|
||||
"url": "/api/v1/workflows/{ref}".format(ref=quote(str(ref), safe=""),),
|
||||
}
|
||||
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
|
||||
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | UpdateWorkflowResponse200 | None:
|
||||
if response.status_code == 200:
|
||||
response_200 = UpdateWorkflowResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
|
||||
if response.status_code == 400:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
|
||||
if response.status_code == 404:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | UpdateWorkflowResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: UpdateWorkflowRequest,
|
||||
|
||||
) -> Response[Any | UpdateWorkflowResponse200]:
|
||||
""" Update an existing workflow
|
||||
|
||||
Args:
|
||||
ref (str):
|
||||
body (UpdateWorkflowRequest): Request DTO for updating a workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | UpdateWorkflowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
body=body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: UpdateWorkflowRequest,
|
||||
|
||||
) -> Any | UpdateWorkflowResponse200 | None:
|
||||
""" Update an existing workflow
|
||||
|
||||
Args:
|
||||
ref (str):
|
||||
body (UpdateWorkflowRequest): Request DTO for updating a workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | UpdateWorkflowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
body=body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: UpdateWorkflowRequest,
|
||||
|
||||
) -> Response[Any | UpdateWorkflowResponse200]:
|
||||
""" Update an existing workflow
|
||||
|
||||
Args:
|
||||
ref (str):
|
||||
body (UpdateWorkflowRequest): Request DTO for updating a workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns 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 | UpdateWorkflowResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
ref=ref,
|
||||
body=body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
ref: str,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: UpdateWorkflowRequest,
|
||||
|
||||
) -> Any | UpdateWorkflowResponse200 | None:
|
||||
""" Update an existing workflow
|
||||
|
||||
Args:
|
||||
ref (str):
|
||||
body (UpdateWorkflowRequest): Request DTO for updating a workflow
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Any | UpdateWorkflowResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
ref=ref,
|
||||
client=client,
|
||||
body=body,
|
||||
|
||||
)).parsed
|
||||
Reference in New Issue
Block a user