binctl-client 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. binctl_client-1.0.0/PKG-INFO +141 -0
  2. binctl_client-1.0.0/README.md +124 -0
  3. binctl_client-1.0.0/binctl_client/__init__.py +5 -0
  4. binctl_client-1.0.0/binctl_client/api/__init__.py +1 -0
  5. binctl_client-1.0.0/binctl_client/api/auth/__init__.py +1 -0
  6. binctl_client-1.0.0/binctl_client/api/auth/login.py +160 -0
  7. binctl_client-1.0.0/binctl_client/api/auth/logout.py +81 -0
  8. binctl_client-1.0.0/binctl_client/api/config/__init__.py +1 -0
  9. binctl_client-1.0.0/binctl_client/api/config/get_config.py +124 -0
  10. binctl_client-1.0.0/binctl_client/api/nodes/__init__.py +1 -0
  11. binctl_client-1.0.0/binctl_client/api/nodes/delete_node_endpoint.py +155 -0
  12. binctl_client-1.0.0/binctl_client/api/nodes/get_node_detail.py +155 -0
  13. binctl_client-1.0.0/binctl_client/api/nodes/get_nodes_list.py +171 -0
  14. binctl_client-1.0.0/binctl_client/api/nodes/patch_node_update.py +176 -0
  15. binctl_client-1.0.0/binctl_client/api/nodes/post_node_create.py +156 -0
  16. binctl_client-1.0.0/binctl_client/api/tags/__init__.py +1 -0
  17. binctl_client-1.0.0/binctl_client/api/tags/delete_tag_endpoint.py +155 -0
  18. binctl_client-1.0.0/binctl_client/api/tags/get_tag_detail.py +155 -0
  19. binctl_client-1.0.0/binctl_client/api/tags/get_tags_list.py +171 -0
  20. binctl_client-1.0.0/binctl_client/api/tags/patch_tag_update.py +176 -0
  21. binctl_client-1.0.0/binctl_client/api/tags/post_tag_create.py +156 -0
  22. binctl_client-1.0.0/binctl_client/client.py +164 -0
  23. binctl_client-1.0.0/binctl_client/errors.py +16 -0
  24. binctl_client-1.0.0/binctl_client/models/__init__.py +37 -0
  25. binctl_client-1.0.0/binctl_client/models/delete_node_endpoint_response_200.py +67 -0
  26. binctl_client-1.0.0/binctl_client/models/delete_node_endpoint_response_200_deleted.py +85 -0
  27. binctl_client-1.0.0/binctl_client/models/delete_tag_endpoint_response_200.py +67 -0
  28. binctl_client-1.0.0/binctl_client/models/delete_tag_endpoint_response_200_deleted.py +69 -0
  29. binctl_client-1.0.0/binctl_client/models/login_request.py +69 -0
  30. binctl_client-1.0.0/binctl_client/models/login_response.py +61 -0
  31. binctl_client-1.0.0/binctl_client/models/node.py +187 -0
  32. binctl_client-1.0.0/binctl_client/models/node_child.py +137 -0
  33. binctl_client-1.0.0/binctl_client/models/node_create.py +123 -0
  34. binctl_client-1.0.0/binctl_client/models/node_page.py +99 -0
  35. binctl_client-1.0.0/binctl_client/models/node_update.py +121 -0
  36. binctl_client-1.0.0/binctl_client/models/server_config.py +68 -0
  37. binctl_client-1.0.0/binctl_client/models/tag.py +87 -0
  38. binctl_client-1.0.0/binctl_client/models/tag_create.py +61 -0
  39. binctl_client-1.0.0/binctl_client/models/tag_page.py +99 -0
  40. binctl_client-1.0.0/binctl_client/models/tag_update.py +61 -0
  41. binctl_client-1.0.0/binctl_client/py.typed +1 -0
  42. binctl_client-1.0.0/binctl_client/types.py +54 -0
  43. binctl_client-1.0.0/pyproject.toml +26 -0
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: binctl-client
3
+ Version: 1.0.0
4
+ Summary: A client library for accessing binctl
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Requires-Dist: attrs (>=22.2.0)
13
+ Requires-Dist: httpx (>=0.23.0,<0.29.0)
14
+ Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
15
+ Description-Content-Type: text/markdown
16
+
17
+ # binctl-client
18
+ A client library for accessing binctl
19
+
20
+ ## Usage
21
+ First, create a client:
22
+
23
+ ```python
24
+ from binctl_client import Client
25
+
26
+ client = Client(base_url="https://api.example.com")
27
+ ```
28
+
29
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
30
+
31
+ ```python
32
+ from binctl_client import AuthenticatedClient
33
+
34
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
35
+ ```
36
+
37
+ Now call your endpoint and use your models:
38
+
39
+ ```python
40
+ from binctl_client.models import MyDataModel
41
+ from binctl_client.api.my_tag import get_my_data_model
42
+ from binctl_client.types import Response
43
+
44
+ with client as client:
45
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
46
+ # or if you need more info (e.g. status_code)
47
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
48
+ ```
49
+
50
+ Or do the same thing with an async version:
51
+
52
+ ```python
53
+ from binctl_client.models import MyDataModel
54
+ from binctl_client.api.my_tag import get_my_data_model
55
+ from binctl_client.types import Response
56
+
57
+ async with client as client:
58
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
59
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
60
+ ```
61
+
62
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
63
+
64
+ ```python
65
+ client = AuthenticatedClient(
66
+ base_url="https://internal_api.example.com",
67
+ token="SuperSecretToken",
68
+ verify_ssl="/path/to/certificate_bundle.pem",
69
+ )
70
+ ```
71
+
72
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
73
+
74
+ ```python
75
+ client = AuthenticatedClient(
76
+ base_url="https://internal_api.example.com",
77
+ token="SuperSecretToken",
78
+ verify_ssl=False
79
+ )
80
+ ```
81
+
82
+ Things to know:
83
+ 1. Every path/method combo becomes a Python module with four functions:
84
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
85
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
86
+ 1. `asyncio`: Like `sync` but async instead of blocking
87
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
88
+
89
+ 1. All path/query params, and bodies become method arguments.
90
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
91
+ 1. Any endpoint which did not have a tag will be in `binctl_client.api.default`
92
+
93
+ ## Advanced customizations
94
+
95
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
96
+
97
+ ```python
98
+ from binctl_client import Client
99
+
100
+ def log_request(request):
101
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
102
+
103
+ def log_response(response):
104
+ request = response.request
105
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
106
+
107
+ client = Client(
108
+ base_url="https://api.example.com",
109
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
110
+ )
111
+
112
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
113
+ ```
114
+
115
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
116
+
117
+ ```python
118
+ import httpx
119
+ from binctl_client import Client
120
+
121
+ client = Client(
122
+ base_url="https://api.example.com",
123
+ )
124
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
125
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
126
+ ```
127
+
128
+ ## Building / publishing this package
129
+ This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
130
+ 1. Update the metadata in pyproject.toml (e.g. authors, version)
131
+ 1. If you're using a private repository, configure it with Poetry
132
+ 1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
133
+ 1. `poetry config http-basic.<your-repository-name> <username> <password>`
134
+ 1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
135
+
136
+ If you want to install this client into another project without publishing it (e.g. for development) then:
137
+ 1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
138
+ 1. If that project is not using Poetry:
139
+ 1. Build a wheel with `poetry build -f wheel`
140
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`
141
+
@@ -0,0 +1,124 @@
1
+ # binctl-client
2
+ A client library for accessing binctl
3
+
4
+ ## Usage
5
+ First, create a client:
6
+
7
+ ```python
8
+ from binctl_client import Client
9
+
10
+ client = Client(base_url="https://api.example.com")
11
+ ```
12
+
13
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
14
+
15
+ ```python
16
+ from binctl_client import AuthenticatedClient
17
+
18
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
19
+ ```
20
+
21
+ Now call your endpoint and use your models:
22
+
23
+ ```python
24
+ from binctl_client.models import MyDataModel
25
+ from binctl_client.api.my_tag import get_my_data_model
26
+ from binctl_client.types import Response
27
+
28
+ with client as client:
29
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
30
+ # or if you need more info (e.g. status_code)
31
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
32
+ ```
33
+
34
+ Or do the same thing with an async version:
35
+
36
+ ```python
37
+ from binctl_client.models import MyDataModel
38
+ from binctl_client.api.my_tag import get_my_data_model
39
+ from binctl_client.types import Response
40
+
41
+ async with client as client:
42
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
43
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
44
+ ```
45
+
46
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
47
+
48
+ ```python
49
+ client = AuthenticatedClient(
50
+ base_url="https://internal_api.example.com",
51
+ token="SuperSecretToken",
52
+ verify_ssl="/path/to/certificate_bundle.pem",
53
+ )
54
+ ```
55
+
56
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
57
+
58
+ ```python
59
+ client = AuthenticatedClient(
60
+ base_url="https://internal_api.example.com",
61
+ token="SuperSecretToken",
62
+ verify_ssl=False
63
+ )
64
+ ```
65
+
66
+ Things to know:
67
+ 1. Every path/method combo becomes a Python module with four functions:
68
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
69
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
70
+ 1. `asyncio`: Like `sync` but async instead of blocking
71
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
72
+
73
+ 1. All path/query params, and bodies become method arguments.
74
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
75
+ 1. Any endpoint which did not have a tag will be in `binctl_client.api.default`
76
+
77
+ ## Advanced customizations
78
+
79
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
80
+
81
+ ```python
82
+ from binctl_client import Client
83
+
84
+ def log_request(request):
85
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
86
+
87
+ def log_response(response):
88
+ request = response.request
89
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
90
+
91
+ client = Client(
92
+ base_url="https://api.example.com",
93
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
94
+ )
95
+
96
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
97
+ ```
98
+
99
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
100
+
101
+ ```python
102
+ import httpx
103
+ from binctl_client import Client
104
+
105
+ client = Client(
106
+ base_url="https://api.example.com",
107
+ )
108
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
109
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
110
+ ```
111
+
112
+ ## Building / publishing this package
113
+ This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
114
+ 1. Update the metadata in pyproject.toml (e.g. authors, version)
115
+ 1. If you're using a private repository, configure it with Poetry
116
+ 1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
117
+ 1. `poetry config http-basic.<your-repository-name> <username> <password>`
118
+ 1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
119
+
120
+ If you want to install this client into another project without publishing it (e.g. for development) then:
121
+ 1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
122
+ 1. If that project is not using Poetry:
123
+ 1. Build a wheel with `poetry build -f wheel`
124
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`
@@ -0,0 +1,5 @@
1
+ """A client library for accessing binctl"""
2
+
3
+ from .client import Client
4
+
5
+ __all__ = ("Client",)
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,160 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.login_request import LoginRequest
9
+ from ...models.login_response import LoginResponse
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ body: LoginRequest,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "post",
21
+ "url": "/v1/auth/login",
22
+ }
23
+
24
+ _kwargs["json"] = body.to_dict()
25
+
26
+ headers["Content-Type"] = "application/json"
27
+
28
+ _kwargs["headers"] = headers
29
+ return _kwargs
30
+
31
+
32
+ def _parse_response(*, client: Client, response: httpx.Response) -> Any | LoginResponse | None:
33
+ if response.status_code == 200:
34
+ response_200 = LoginResponse.from_dict(response.json())
35
+
36
+ return response_200
37
+
38
+ if response.status_code == 401:
39
+ response_401 = cast(Any, None)
40
+ return response_401
41
+
42
+ if client.raise_on_unexpected_status:
43
+ raise errors.UnexpectedStatus(response.status_code, response.content)
44
+ else:
45
+ return None
46
+
47
+
48
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[Any | LoginResponse]:
49
+ return Response(
50
+ status_code=HTTPStatus(response.status_code),
51
+ content=response.content,
52
+ headers=response.headers,
53
+ parsed=_parse_response(client=client, response=response),
54
+ )
55
+
56
+
57
+ def sync_detailed(
58
+ *,
59
+ client: Client,
60
+ body: LoginRequest,
61
+ ) -> Response[Any | LoginResponse]:
62
+ """Obtain a bearer token
63
+
64
+ Args:
65
+ body (LoginRequest):
66
+
67
+ Raises:
68
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
69
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
70
+
71
+ Returns:
72
+ Response[Any | LoginResponse]
73
+ """
74
+
75
+ kwargs = _get_kwargs(
76
+ body=body,
77
+ )
78
+
79
+ response = client.get_httpx_client().request(
80
+ **kwargs,
81
+ )
82
+
83
+ return _build_response(client=client, response=response)
84
+
85
+
86
+ def sync(
87
+ *,
88
+ client: Client,
89
+ body: LoginRequest,
90
+ ) -> Any | LoginResponse | None:
91
+ """Obtain a bearer token
92
+
93
+ Args:
94
+ body (LoginRequest):
95
+
96
+ Raises:
97
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
99
+
100
+ Returns:
101
+ Any | LoginResponse
102
+ """
103
+
104
+ return sync_detailed(
105
+ client=client,
106
+ body=body,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ *,
112
+ client: Client,
113
+ body: LoginRequest,
114
+ ) -> Response[Any | LoginResponse]:
115
+ """Obtain a bearer token
116
+
117
+ Args:
118
+ body (LoginRequest):
119
+
120
+ Raises:
121
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
122
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
123
+
124
+ Returns:
125
+ Response[Any | LoginResponse]
126
+ """
127
+
128
+ kwargs = _get_kwargs(
129
+ body=body,
130
+ )
131
+
132
+ response = await client.get_async_httpx_client().request(**kwargs)
133
+
134
+ return _build_response(client=client, response=response)
135
+
136
+
137
+ async def asyncio(
138
+ *,
139
+ client: Client,
140
+ body: LoginRequest,
141
+ ) -> Any | LoginResponse | None:
142
+ """Obtain a bearer token
143
+
144
+ Args:
145
+ body (LoginRequest):
146
+
147
+ Raises:
148
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
149
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
150
+
151
+ Returns:
152
+ Any | LoginResponse
153
+ """
154
+
155
+ return (
156
+ await asyncio_detailed(
157
+ client=client,
158
+ body=body,
159
+ )
160
+ ).parsed
@@ -0,0 +1,81 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs() -> dict[str, Any]:
12
+
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "post",
15
+ "url": "/v1/auth/logout",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(*, client: Client, response: httpx.Response) -> Any | None:
22
+ if response.status_code == 204:
23
+ return None
24
+
25
+ if client.raise_on_unexpected_status:
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+ else:
28
+ return None
29
+
30
+
31
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
32
+ return Response(
33
+ status_code=HTTPStatus(response.status_code),
34
+ content=response.content,
35
+ headers=response.headers,
36
+ parsed=_parse_response(client=client, response=response),
37
+ )
38
+
39
+
40
+ def sync_detailed(
41
+ *,
42
+ client: Client,
43
+ ) -> Response[Any]:
44
+ """Revoke the current bearer token
45
+
46
+ Raises:
47
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
48
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
49
+
50
+ Returns:
51
+ Response[Any]
52
+ """
53
+
54
+ kwargs = _get_kwargs()
55
+
56
+ response = client.get_httpx_client().request(
57
+ **kwargs,
58
+ )
59
+
60
+ return _build_response(client=client, response=response)
61
+
62
+
63
+ async def asyncio_detailed(
64
+ *,
65
+ client: Client,
66
+ ) -> Response[Any]:
67
+ """Revoke the current bearer token
68
+
69
+ Raises:
70
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
71
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
72
+
73
+ Returns:
74
+ Response[Any]
75
+ """
76
+
77
+ kwargs = _get_kwargs()
78
+
79
+ response = await client.get_async_httpx_client().request(**kwargs)
80
+
81
+ return _build_response(client=client, response=response)
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,124 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.server_config import ServerConfig
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": "/v1/config",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(*, client: Client, response: httpx.Response) -> ServerConfig | None:
23
+ if response.status_code == 200:
24
+ response_200 = ServerConfig.from_dict(response.json())
25
+
26
+ return response_200
27
+
28
+ if client.raise_on_unexpected_status:
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+ else:
31
+ return None
32
+
33
+
34
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[ServerConfig]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ *,
45
+ client: Client,
46
+ ) -> Response[ServerConfig]:
47
+ """Get server configuration
48
+
49
+ Raises:
50
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
51
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
52
+
53
+ Returns:
54
+ Response[ServerConfig]
55
+ """
56
+
57
+ kwargs = _get_kwargs()
58
+
59
+ response = client.get_httpx_client().request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(client=client, response=response)
64
+
65
+
66
+ def sync(
67
+ *,
68
+ client: Client,
69
+ ) -> ServerConfig | None:
70
+ """Get server configuration
71
+
72
+ Raises:
73
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
74
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
75
+
76
+ Returns:
77
+ ServerConfig
78
+ """
79
+
80
+ return sync_detailed(
81
+ client=client,
82
+ ).parsed
83
+
84
+
85
+ async def asyncio_detailed(
86
+ *,
87
+ client: Client,
88
+ ) -> Response[ServerConfig]:
89
+ """Get server configuration
90
+
91
+ Raises:
92
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
94
+
95
+ Returns:
96
+ Response[ServerConfig]
97
+ """
98
+
99
+ kwargs = _get_kwargs()
100
+
101
+ response = await client.get_async_httpx_client().request(**kwargs)
102
+
103
+ return _build_response(client=client, response=response)
104
+
105
+
106
+ async def asyncio(
107
+ *,
108
+ client: Client,
109
+ ) -> ServerConfig | None:
110
+ """Get server configuration
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ ServerConfig
118
+ """
119
+
120
+ return (
121
+ await asyncio_detailed(
122
+ client=client,
123
+ )
124
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""