Skip to content

Commit b017a63

Browse files
Merge pull request #51 from biosimulations/add-copasi
Add copasi
2 parents e9ae1bb + 45d663d commit b017a63

39 files changed

Lines changed: 3038 additions & 145 deletions
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
from http import HTTPStatus
2+
from typing import Any, Optional, Union, cast
3+
4+
import httpx
5+
6+
from ...client import AuthenticatedClient, Client
7+
from ...types import Response, UNSET
8+
from ... import errors
9+
10+
from ...models.bi_graph_process import BiGraphProcess
11+
from typing import cast
12+
13+
14+
def _get_kwargs() -> dict[str, Any]:
15+
_kwargs: dict[str, Any] = {
16+
"method": "get",
17+
"url": "/core/processes/list",
18+
}
19+
20+
return _kwargs
21+
22+
23+
def _parse_response(
24+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
25+
) -> Optional[list["BiGraphProcess"]]:
26+
if response.status_code == 200:
27+
response_200 = []
28+
_response_200 = response.json()
29+
for response_200_item_data in _response_200:
30+
response_200_item = BiGraphProcess.from_dict(response_200_item_data)
31+
32+
response_200.append(response_200_item)
33+
34+
return response_200
35+
if client.raise_on_unexpected_status:
36+
raise errors.UnexpectedStatus(response.status_code, response.content)
37+
else:
38+
return None
39+
40+
41+
def _build_response(
42+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
43+
) -> Response[list["BiGraphProcess"]]:
44+
return Response(
45+
status_code=HTTPStatus(response.status_code),
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(client=client, response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
*,
54+
client: Union[AuthenticatedClient, Client],
55+
) -> Response[list["BiGraphProcess"]]:
56+
"""Get the list of processes
57+
58+
Raises:
59+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60+
httpx.TimeoutException: If the request takes longer than Client.timeout.
61+
62+
Returns:
63+
Response[list['BiGraphProcess']]
64+
"""
65+
66+
kwargs = _get_kwargs()
67+
68+
response = client.get_httpx_client().request(
69+
**kwargs,
70+
)
71+
72+
return _build_response(client=client, response=response)
73+
74+
75+
def sync(
76+
*,
77+
client: Union[AuthenticatedClient, Client],
78+
) -> Optional[list["BiGraphProcess"]]:
79+
"""Get the list of processes
80+
81+
Raises:
82+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83+
httpx.TimeoutException: If the request takes longer than Client.timeout.
84+
85+
Returns:
86+
list['BiGraphProcess']
87+
"""
88+
89+
return sync_detailed(
90+
client=client,
91+
).parsed
92+
93+
94+
async def asyncio_detailed(
95+
*,
96+
client: Union[AuthenticatedClient, Client],
97+
) -> Response[list["BiGraphProcess"]]:
98+
"""Get the list of processes
99+
100+
Raises:
101+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102+
httpx.TimeoutException: If the request takes longer than Client.timeout.
103+
104+
Returns:
105+
Response[list['BiGraphProcess']]
106+
"""
107+
108+
kwargs = _get_kwargs()
109+
110+
response = await client.get_async_httpx_client().request(**kwargs)
111+
112+
return _build_response(client=client, response=response)
113+
114+
115+
async def asyncio(
116+
*,
117+
client: Union[AuthenticatedClient, Client],
118+
) -> Optional[list["BiGraphProcess"]]:
119+
"""Get the list of processes
120+
121+
Raises:
122+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123+
httpx.TimeoutException: If the request takes longer than Client.timeout.
124+
125+
Returns:
126+
list['BiGraphProcess']
127+
"""
128+
129+
return (
130+
await asyncio_detailed(
131+
client=client,
132+
)
133+
).parsed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
from http import HTTPStatus
2+
from typing import Any, Optional, Union, cast
3+
4+
import httpx
5+
6+
from ...client import AuthenticatedClient, Client
7+
from ...types import Response, UNSET
8+
from ... import errors
9+
10+
from ...models.bi_graph_step import BiGraphStep
11+
from typing import cast
12+
13+
14+
def _get_kwargs() -> dict[str, Any]:
15+
_kwargs: dict[str, Any] = {
16+
"method": "get",
17+
"url": "/core/steps/list",
18+
}
19+
20+
return _kwargs
21+
22+
23+
def _parse_response(
24+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
25+
) -> Optional[list["BiGraphStep"]]:
26+
if response.status_code == 200:
27+
response_200 = []
28+
_response_200 = response.json()
29+
for response_200_item_data in _response_200:
30+
response_200_item = BiGraphStep.from_dict(response_200_item_data)
31+
32+
response_200.append(response_200_item)
33+
34+
return response_200
35+
if client.raise_on_unexpected_status:
36+
raise errors.UnexpectedStatus(response.status_code, response.content)
37+
else:
38+
return None
39+
40+
41+
def _build_response(
42+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
43+
) -> Response[list["BiGraphStep"]]:
44+
return Response(
45+
status_code=HTTPStatus(response.status_code),
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(client=client, response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
*,
54+
client: Union[AuthenticatedClient, Client],
55+
) -> Response[list["BiGraphStep"]]:
56+
"""Get the list of processes
57+
58+
Raises:
59+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60+
httpx.TimeoutException: If the request takes longer than Client.timeout.
61+
62+
Returns:
63+
Response[list['BiGraphStep']]
64+
"""
65+
66+
kwargs = _get_kwargs()
67+
68+
response = client.get_httpx_client().request(
69+
**kwargs,
70+
)
71+
72+
return _build_response(client=client, response=response)
73+
74+
75+
def sync(
76+
*,
77+
client: Union[AuthenticatedClient, Client],
78+
) -> Optional[list["BiGraphStep"]]:
79+
"""Get the list of processes
80+
81+
Raises:
82+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83+
httpx.TimeoutException: If the request takes longer than Client.timeout.
84+
85+
Returns:
86+
list['BiGraphStep']
87+
"""
88+
89+
return sync_detailed(
90+
client=client,
91+
).parsed
92+
93+
94+
async def asyncio_detailed(
95+
*,
96+
client: Union[AuthenticatedClient, Client],
97+
) -> Response[list["BiGraphStep"]]:
98+
"""Get the list of processes
99+
100+
Raises:
101+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102+
httpx.TimeoutException: If the request takes longer than Client.timeout.
103+
104+
Returns:
105+
Response[list['BiGraphStep']]
106+
"""
107+
108+
kwargs = _get_kwargs()
109+
110+
response = await client.get_async_httpx_client().request(**kwargs)
111+
112+
return _build_response(client=client, response=response)
113+
114+
115+
async def asyncio(
116+
*,
117+
client: Union[AuthenticatedClient, Client],
118+
) -> Optional[list["BiGraphStep"]]:
119+
"""Get the list of processes
120+
121+
Raises:
122+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123+
httpx.TimeoutException: If the request takes longer than Client.timeout.
124+
125+
Returns:
126+
list['BiGraphStep']
127+
"""
128+
129+
return (
130+
await asyncio_detailed(
131+
client=client,
132+
)
133+
).parsed

0 commit comments

Comments
 (0)