Skip to content

Commit e1bec47

Browse files
committed
Python SDK release v0.10.2
1 parent 66a2403 commit e1bec47

File tree

215 files changed

+8296
-5581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+8296
-5581
lines changed

PKG-INFO

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Metadata-Version: 2.1
22
Name: tuneinsight
3-
Version: 0.9.2
4-
Summary: Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0.
3+
Version: 0.10.2
4+
Summary: Diapason is the official Python SDK for the Tune Insight API. The current version is compatible with the same version of the API.
55
License: Apache-2.0
66
Author: Tune Insight SA
77
Requires-Python: >=3.8,<3.12

pyproject.toml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "tuneinsight"
3-
version = "0.9.2"
4-
description = "Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0."
3+
version = "0.10.2"
4+
description = "Diapason is the official Python SDK for the Tune Insight API. The current version is compatible with the same version of the API."
55
authors = ["Tune Insight SA"]
66
license = "Apache-2.0"
77
include = [
@@ -12,6 +12,12 @@ include = [
1212
]
1313
readme = "src/tuneinsight/README.md"
1414

15+
[tool.poetry-dynamic-versioning]
16+
enable = false
17+
style = "pep440"
18+
pattern = "^v(?P<base>\\d+\\.\\d+\\.\\d+)"
19+
format = "{base}"
20+
1521
[tool.poetry.dependencies]
1622
python = ">= 3.8,<3.12"
1723
python-keycloak = "^3.9.0"
@@ -38,8 +44,8 @@ pyvcf3 = "^1.0.3" # For GWAS .vcf file parsing
3844
pytest = "^8.1.1"
3945

4046
[build-system]
41-
requires = ["poetry-core>=1.0.0"]
42-
build-backend = "poetry.core.masonry.api"
47+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
48+
build-backend = "poetry_dynamic_versioning.backend"
4349

4450
[tool.black]
4551
include = '\.pyi?$'

src/tuneinsight/api/api-checksum

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1543c5968e0e568095cb5eeb44a3c7ab3179d6491f270932e268ab579c8d5948
1+
dcb50c2cb9eac6743b41006a2e73a209bea8c9697c526f31a608a0aa602ec4de
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import Client
8+
from ...models.error import Error
9+
from ...models.instance_configuration import InstanceConfiguration
10+
from ...types import Response
11+
12+
13+
def _get_kwargs(
14+
*,
15+
client: Client,
16+
) -> Dict[str, Any]:
17+
url = "{}/config".format(client.base_url)
18+
19+
headers: Dict[str, str] = client.get_headers()
20+
cookies: Dict[str, Any] = client.get_cookies()
21+
22+
# Set the proxies if the client has proxies set.
23+
proxies = None
24+
if hasattr(client, "proxies") and client.proxies is not None:
25+
https_proxy = client.proxies.get("https")
26+
if https_proxy:
27+
proxies = https_proxy
28+
else:
29+
http_proxy = client.proxies.get("http")
30+
if http_proxy:
31+
proxies = http_proxy
32+
33+
return {
34+
"method": "get",
35+
"url": url,
36+
"headers": headers,
37+
"cookies": cookies,
38+
"timeout": client.get_timeout(),
39+
"proxies": proxies,
40+
}
41+
42+
43+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Error, InstanceConfiguration]]:
44+
if response.status_code == HTTPStatus.OK:
45+
response_200 = InstanceConfiguration.from_dict(response.json())
46+
47+
return response_200
48+
if response.status_code == HTTPStatus.UNAUTHORIZED:
49+
response_401 = Error.from_dict(response.json())
50+
51+
return response_401
52+
if response.status_code == HTTPStatus.FORBIDDEN:
53+
response_403 = Error.from_dict(response.json())
54+
55+
return response_403
56+
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
57+
response_500 = Error.from_dict(response.json())
58+
59+
return response_500
60+
if client.raise_on_unexpected_status:
61+
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
62+
else:
63+
return None
64+
65+
66+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, InstanceConfiguration]]:
67+
return Response(
68+
status_code=HTTPStatus(response.status_code),
69+
content=response.content,
70+
headers=response.headers,
71+
parsed=_parse_response(client=client, response=response),
72+
)
73+
74+
75+
def sync_detailed(
76+
*,
77+
client: Client,
78+
) -> Response[Union[Error, InstanceConfiguration]]:
79+
"""get information about the instance's configuration (requires administrative privileges)
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+
Response[Union[Error, InstanceConfiguration]]
87+
"""
88+
89+
kwargs = _get_kwargs(
90+
client=client,
91+
)
92+
93+
response = httpx.request(
94+
verify=client.verify_ssl,
95+
**kwargs,
96+
)
97+
98+
return _build_response(client=client, response=response)
99+
100+
101+
def sync(
102+
*,
103+
client: Client,
104+
) -> Optional[Union[Error, InstanceConfiguration]]:
105+
"""get information about the instance's configuration (requires administrative privileges)
106+
107+
Raises:
108+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
109+
httpx.TimeoutException: If the request takes longer than Client.timeout.
110+
111+
Returns:
112+
Response[Union[Error, InstanceConfiguration]]
113+
"""
114+
115+
return sync_detailed(
116+
client=client,
117+
).parsed
118+
119+
120+
async def asyncio_detailed(
121+
*,
122+
client: Client,
123+
) -> Response[Union[Error, InstanceConfiguration]]:
124+
"""get information about the instance's configuration (requires administrative privileges)
125+
126+
Raises:
127+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128+
httpx.TimeoutException: If the request takes longer than Client.timeout.
129+
130+
Returns:
131+
Response[Union[Error, InstanceConfiguration]]
132+
"""
133+
134+
kwargs = _get_kwargs(
135+
client=client,
136+
)
137+
138+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
139+
response = await _client.request(**kwargs)
140+
141+
return _build_response(client=client, response=response)
142+
143+
144+
async def asyncio(
145+
*,
146+
client: Client,
147+
) -> Optional[Union[Error, InstanceConfiguration]]:
148+
"""get information about the instance's configuration (requires administrative privileges)
149+
150+
Raises:
151+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
152+
httpx.TimeoutException: If the request takes longer than Client.timeout.
153+
154+
Returns:
155+
Response[Union[Error, InstanceConfiguration]]
156+
"""
157+
158+
return (
159+
await asyncio_detailed(
160+
client=client,
161+
)
162+
).parsed

src/tuneinsight/api/sdk/api/api_admin/get_settings.py

+12
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,24 @@ def _get_kwargs(
1919
headers: Dict[str, str] = client.get_headers()
2020
cookies: Dict[str, Any] = client.get_cookies()
2121

22+
# Set the proxies if the client has proxies set.
23+
proxies = None
24+
if hasattr(client, "proxies") and client.proxies is not None:
25+
https_proxy = client.proxies.get("https")
26+
if https_proxy:
27+
proxies = https_proxy
28+
else:
29+
http_proxy = client.proxies.get("http")
30+
if http_proxy:
31+
proxies = http_proxy
32+
2233
return {
2334
"method": "get",
2435
"url": url,
2536
"headers": headers,
2637
"cookies": cookies,
2738
"timeout": client.get_timeout(),
39+
"proxies": proxies,
2840
}
2941

3042

src/tuneinsight/api/sdk/api/api_admin/patch_settings.py

+12
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,24 @@ def _get_kwargs(
2222

2323
json_json_body = json_body.to_dict()
2424

25+
# Set the proxies if the client has proxies set.
26+
proxies = None
27+
if hasattr(client, "proxies") and client.proxies is not None:
28+
https_proxy = client.proxies.get("https")
29+
if https_proxy:
30+
proxies = https_proxy
31+
else:
32+
http_proxy = client.proxies.get("http")
33+
if http_proxy:
34+
proxies = http_proxy
35+
2536
return {
2637
"method": "patch",
2738
"url": url,
2839
"headers": headers,
2940
"cookies": cookies,
3041
"timeout": client.get_timeout(),
42+
"proxies": proxies,
3143
"json": json_json_body,
3244
}
3345

src/tuneinsight/api/sdk/api/api_admin/post_storage.py

+12
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,24 @@ def _get_kwargs(
2222

2323
json_json_body = json_body.to_dict()
2424

25+
# Set the proxies if the client has proxies set.
26+
proxies = None
27+
if hasattr(client, "proxies") and client.proxies is not None:
28+
https_proxy = client.proxies.get("https")
29+
if https_proxy:
30+
proxies = https_proxy
31+
else:
32+
http_proxy = client.proxies.get("http")
33+
if http_proxy:
34+
proxies = http_proxy
35+
2536
return {
2637
"method": "post",
2738
"url": url,
2839
"headers": headers,
2940
"cookies": cookies,
3041
"timeout": client.get_timeout(),
42+
"proxies": proxies,
3143
"json": json_json_body,
3244
}
3345

src/tuneinsight/api/sdk/api/api_computations/compute.py

+12
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,24 @@ def _get_kwargs(
143143
else:
144144
json_json_body = json_body.to_dict()
145145

146+
# Set the proxies if the client has proxies set.
147+
proxies = None
148+
if hasattr(client, "proxies") and client.proxies is not None:
149+
https_proxy = client.proxies.get("https")
150+
if https_proxy:
151+
proxies = https_proxy
152+
else:
153+
http_proxy = client.proxies.get("http")
154+
if http_proxy:
155+
proxies = http_proxy
156+
146157
return {
147158
"method": "post",
148159
"url": url,
149160
"headers": headers,
150161
"cookies": cookies,
151162
"timeout": client.get_timeout(),
163+
"proxies": proxies,
152164
"json": json_json_body,
153165
}
154166

src/tuneinsight/api/sdk/api/api_computations/delete_comp_bookmark.py

+12
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ def _get_kwargs(
1818
headers: Dict[str, str] = client.get_headers()
1919
cookies: Dict[str, Any] = client.get_cookies()
2020

21+
# Set the proxies if the client has proxies set.
22+
proxies = None
23+
if hasattr(client, "proxies") and client.proxies is not None:
24+
https_proxy = client.proxies.get("https")
25+
if https_proxy:
26+
proxies = https_proxy
27+
else:
28+
http_proxy = client.proxies.get("http")
29+
if http_proxy:
30+
proxies = http_proxy
31+
2132
return {
2233
"method": "delete",
2334
"url": url,
2435
"headers": headers,
2536
"cookies": cookies,
2637
"timeout": client.get_timeout(),
38+
"proxies": proxies,
2739
}
2840

2941

src/tuneinsight/api/sdk/api/api_computations/delete_computation.py

+12
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,24 @@ def _get_kwargs(
1919
headers: Dict[str, str] = client.get_headers()
2020
cookies: Dict[str, Any] = client.get_cookies()
2121

22+
# Set the proxies if the client has proxies set.
23+
proxies = None
24+
if hasattr(client, "proxies") and client.proxies is not None:
25+
https_proxy = client.proxies.get("https")
26+
if https_proxy:
27+
proxies = https_proxy
28+
else:
29+
http_proxy = client.proxies.get("http")
30+
if http_proxy:
31+
proxies = http_proxy
32+
2233
return {
2334
"method": "delete",
2435
"url": url,
2536
"headers": headers,
2637
"cookies": cookies,
2738
"timeout": client.get_timeout(),
39+
"proxies": proxies,
2840
}
2941

3042

src/tuneinsight/api/sdk/api/api_computations/delete_computations.py

+12
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ def _get_kwargs(
1818
headers: Dict[str, str] = client.get_headers()
1919
cookies: Dict[str, Any] = client.get_cookies()
2020

21+
# Set the proxies if the client has proxies set.
22+
proxies = None
23+
if hasattr(client, "proxies") and client.proxies is not None:
24+
https_proxy = client.proxies.get("https")
25+
if https_proxy:
26+
proxies = https_proxy
27+
else:
28+
http_proxy = client.proxies.get("http")
29+
if http_proxy:
30+
proxies = http_proxy
31+
2132
return {
2233
"method": "delete",
2334
"url": url,
2435
"headers": headers,
2536
"cookies": cookies,
2637
"timeout": client.get_timeout(),
38+
"proxies": proxies,
2739
}
2840

2941

0 commit comments

Comments
 (0)