Skip to content

Commit

Permalink
v0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoussiau committed Apr 5, 2024
1 parent bbbaf78 commit b21f97c
Show file tree
Hide file tree
Showing 125 changed files with 7,197 additions and 5,752 deletions.
3 changes: 1 addition & 2 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tuneinsight
Version: 0.9.0
Version: 0.9.2
Summary: Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0.
License: Apache-2.0
Author: Tune Insight SA
Expand All @@ -15,7 +15,6 @@ Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: attrs (>=21.3.0)
Requires-Dist: black (==24.2.0)
Requires-Dist: certifi (>=2023.7.22,<2024.0.0)
Requires-Dist: handsdown (>=2.1.0,<3.0.0)
Requires-Dist: httpx (>=0.15.4,<0.24.0)
Requires-Dist: matplotlib (>=3.5.0,<4.0.0)
Requires-Dist: notebook (>=6.4.11,<7.0.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tuneinsight"
version = "0.9.0"
version = "0.9.2"
description = "Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0."
authors = ["Tune Insight SA"]
license = "Apache-2.0"
Expand Down Expand Up @@ -28,14 +28,14 @@ httpx = ">=0.15.4,<0.24.0"
attrs = ">=21.3.0"
certifi = "^2023.7.22"
black = "24.2.0"
handsdown = "^2.1.0"

[tool.poetry.group.dev.dependencies]
selenium = "^4.9.1"
wheel = "^0.38.1"
docker = "^6.0.1"
pylint = "^2.13.2"
pyvcf3 = "^1.0.3" # For GWAS .vcf file parsing
pytest = "^8.1.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion src/tuneinsight/api/api-checksum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b71c951f2eb600cc2a1f073151c9a0c003bd48f1210262ab7df58c9d06e05aba
1543c5968e0e568095cb5eeb44a3c7ab3179d6491f270932e268ab579c8d5948
154 changes: 154 additions & 0 deletions src/tuneinsight/api/sdk/api/api_admin/get_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union

import httpx

from ... import errors
from ...client import Client
from ...models.error import Error
from ...models.settings import Settings
from ...types import Response


def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/settings".format(client.base_url)

headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()

return {
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}


def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Error, Settings]]:
if response.status_code == HTTPStatus.OK:
response_200 = Settings.from_dict(response.json())

return response_200
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = Error.from_dict(response.json())

return response_400
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = Error.from_dict(response.json())

return response_401
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = Error.from_dict(response.json())

return response_403
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = Error.from_dict(response.json())

return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None


def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Settings]]:
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: Client,
) -> Response[Union[Error, Settings]]:
"""retrieve the instance settings
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[Union[Error, Settings]]
"""

kwargs = _get_kwargs(
client=client,
)

response = httpx.request(
verify=client.verify_ssl,
**kwargs,
)

return _build_response(client=client, response=response)


def sync(
*,
client: Client,
) -> Optional[Union[Error, Settings]]:
"""retrieve the instance settings
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[Union[Error, Settings]]
"""

return sync_detailed(
client=client,
).parsed


async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Error, Settings]]:
"""retrieve the instance settings
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[Union[Error, Settings]]
"""

kwargs = _get_kwargs(
client=client,
)

async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.request(**kwargs)

return _build_response(client=client, response=response)


async def asyncio(
*,
client: Client,
) -> Optional[Union[Error, Settings]]:
"""retrieve the instance settings
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[Union[Error, Settings]]
"""

return (
await asyncio_detailed(
client=client,
)
).parsed
182 changes: 182 additions & 0 deletions src/tuneinsight/api/sdk/api/api_admin/patch_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union

import httpx

from ... import errors
from ...client import Client
from ...models.error import Error
from ...models.settings import Settings
from ...types import Response


def _get_kwargs(
*,
client: Client,
json_body: Settings,
) -> Dict[str, Any]:
url = "{}/settings".format(client.base_url)

headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()

json_json_body = json_body.to_dict()

return {
"method": "patch",
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"json": json_json_body,
}


def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Error, Settings]]:
if response.status_code == HTTPStatus.OK:
response_200 = Settings.from_dict(response.json())

return response_200
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = Error.from_dict(response.json())

return response_400
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = Error.from_dict(response.json())

return response_401
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = Error.from_dict(response.json())

return response_403
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
response_422 = Error.from_dict(response.json())

return response_422
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = Error.from_dict(response.json())

return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None


def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Settings]]:
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: Client,
json_body: Settings,
) -> Response[Union[Error, Settings]]:
"""modify the settings
Args:
json_body (Settings): instance settings that is configurable by the administrator.
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[Union[Error, Settings]]
"""

kwargs = _get_kwargs(
client=client,
json_body=json_body,
)

response = httpx.request(
verify=client.verify_ssl,
**kwargs,
)

return _build_response(client=client, response=response)


def sync(
*,
client: Client,
json_body: Settings,
) -> Optional[Union[Error, Settings]]:
"""modify the settings
Args:
json_body (Settings): instance settings that is configurable by the administrator.
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[Union[Error, Settings]]
"""

return sync_detailed(
client=client,
json_body=json_body,
).parsed


async def asyncio_detailed(
*,
client: Client,
json_body: Settings,
) -> Response[Union[Error, Settings]]:
"""modify the settings
Args:
json_body (Settings): instance settings that is configurable by the administrator.
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[Union[Error, Settings]]
"""

kwargs = _get_kwargs(
client=client,
json_body=json_body,
)

async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.request(**kwargs)

return _build_response(client=client, response=response)


async def asyncio(
*,
client: Client,
json_body: Settings,
) -> Optional[Union[Error, Settings]]:
"""modify the settings
Args:
json_body (Settings): instance settings that is configurable by the administrator.
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[Union[Error, Settings]]
"""

return (
await asyncio_detailed(
client=client,
json_body=json_body,
)
).parsed
Loading

0 comments on commit b21f97c

Please sign in to comment.