phisaver-client 1.0.4__py3-none-any.whl

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 (122) hide show
  1. phisaver_client/.gitignore +23 -0
  2. phisaver_client/README.md +124 -0
  3. phisaver_client/__init__.py +8 -0
  4. phisaver_client/api/__init__.py +1 -0
  5. phisaver_client/api/devices/__init__.py +1 -0
  6. phisaver_client/api/devices/devices_create.py +168 -0
  7. phisaver_client/api/devices/devices_destroy.py +95 -0
  8. phisaver_client/api/devices/devices_list.py +124 -0
  9. phisaver_client/api/devices/devices_partial_update.py +188 -0
  10. phisaver_client/api/devices/devices_retrieve.py +146 -0
  11. phisaver_client/api/devices/devices_update.py +184 -0
  12. phisaver_client/api/fleets/__init__.py +1 -0
  13. phisaver_client/api/fleets/fleets_colours_retrieve.py +158 -0
  14. phisaver_client/api/fleets/fleets_create.py +188 -0
  15. phisaver_client/api/fleets/fleets_destroy.py +105 -0
  16. phisaver_client/api/fleets/fleets_list.py +144 -0
  17. phisaver_client/api/fleets/fleets_partial_update.py +208 -0
  18. phisaver_client/api/fleets/fleets_retrieve.py +166 -0
  19. phisaver_client/api/fleets/fleets_update.py +204 -0
  20. phisaver_client/api/login/__init__.py +1 -0
  21. phisaver_client/api/login/login_create.py +197 -0
  22. phisaver_client/api/logout/__init__.py +1 -0
  23. phisaver_client/api/logout/logout_create.py +135 -0
  24. phisaver_client/api/password/__init__.py +1 -0
  25. phisaver_client/api/password/password_change_create.py +185 -0
  26. phisaver_client/api/password/password_reset_confirm_create.py +193 -0
  27. phisaver_client/api/password/password_reset_create.py +185 -0
  28. phisaver_client/api/token/__init__.py +1 -0
  29. phisaver_client/api/token/token_create.py +168 -0
  30. phisaver_client/api/ts/__init__.py +1 -0
  31. phisaver_client/api/ts/ts_heatmap_retrieve.py +407 -0
  32. phisaver_client/api/ts/ts_metrics_retrieve.py +411 -0
  33. phisaver_client/api/ts/ts_series_retrieve.py +442 -0
  34. phisaver_client/api/ts/ts_table_retrieve.py +431 -0
  35. phisaver_client/api/user/__init__.py +1 -0
  36. phisaver_client/api/user/user_partial_update.py +204 -0
  37. phisaver_client/api/user/user_retrieve.py +151 -0
  38. phisaver_client/api/user/user_update.py +203 -0
  39. phisaver_client/api/users/__init__.py +1 -0
  40. phisaver_client/api/users/users_claim_partial_update.py +218 -0
  41. phisaver_client/api/users/users_create.py +168 -0
  42. phisaver_client/api/users/users_current_retrieve.py +119 -0
  43. phisaver_client/api/users/users_destroy.py +95 -0
  44. phisaver_client/api/users/users_list.py +124 -0
  45. phisaver_client/api/users/users_partial_update.py +188 -0
  46. phisaver_client/api/users/users_retrieve.py +146 -0
  47. phisaver_client/api/users/users_update.py +184 -0
  48. phisaver_client/api/vpnclients/__init__.py +1 -0
  49. phisaver_client/api/vpnclients/vpnclients_create.py +168 -0
  50. phisaver_client/api/vpnclients/vpnclients_destroy.py +95 -0
  51. phisaver_client/api/vpnclients/vpnclients_list.py +124 -0
  52. phisaver_client/api/vpnclients/vpnclients_partial_update.py +188 -0
  53. phisaver_client/api/vpnclients/vpnclients_retrieve.py +146 -0
  54. phisaver_client/api/vpnclients/vpnclients_update.py +184 -0
  55. phisaver_client/client.py +268 -0
  56. phisaver_client/errors.py +16 -0
  57. phisaver_client/helpers.py +86 -0
  58. phisaver_client/models/__init__.py +119 -0
  59. phisaver_client/models/auth_token.py +93 -0
  60. phisaver_client/models/colour_palette.py +106 -0
  61. phisaver_client/models/device.py +357 -0
  62. phisaver_client/models/device_video.py +147 -0
  63. phisaver_client/models/fleet.py +144 -0
  64. phisaver_client/models/fleet_devices_details.py +46 -0
  65. phisaver_client/models/login.py +98 -0
  66. phisaver_client/models/metric_label.py +89 -0
  67. phisaver_client/models/password_change.py +83 -0
  68. phisaver_client/models/password_reset.py +74 -0
  69. phisaver_client/models/password_reset_confirm.py +104 -0
  70. phisaver_client/models/patched_device.py +401 -0
  71. phisaver_client/models/patched_fleet.py +167 -0
  72. phisaver_client/models/patched_fleet_devices_details.py +46 -0
  73. phisaver_client/models/patched_user.py +162 -0
  74. phisaver_client/models/patched_user_details.py +86 -0
  75. phisaver_client/models/patched_vpn_client.py +101 -0
  76. phisaver_client/models/rates.py +93 -0
  77. phisaver_client/models/rest_auth_detail.py +61 -0
  78. phisaver_client/models/token.py +62 -0
  79. phisaver_client/models/ts_heatmap_retrieve_attribute.py +18 -0
  80. phisaver_client/models/ts_heatmap_retrieve_engine.py +14 -0
  81. phisaver_client/models/ts_heatmap_retrieve_format.py +14 -0
  82. phisaver_client/models/ts_heatmap_retrieve_metcat.py +18 -0
  83. phisaver_client/models/ts_heatmap_retrieve_response_200.py +46 -0
  84. phisaver_client/models/ts_heatmap_retrieve_source.py +16 -0
  85. phisaver_client/models/ts_heatmap_retrieve_timeformat.py +15 -0
  86. phisaver_client/models/ts_heatmap_retrieve_units.py +13 -0
  87. phisaver_client/models/ts_metrics_retrieve_attribute.py +18 -0
  88. phisaver_client/models/ts_metrics_retrieve_engine.py +14 -0
  89. phisaver_client/models/ts_metrics_retrieve_format.py +14 -0
  90. phisaver_client/models/ts_metrics_retrieve_metcat.py +18 -0
  91. phisaver_client/models/ts_metrics_retrieve_response_200.py +46 -0
  92. phisaver_client/models/ts_metrics_retrieve_source.py +16 -0
  93. phisaver_client/models/ts_metrics_retrieve_timeformat.py +15 -0
  94. phisaver_client/models/ts_metrics_retrieve_units.py +16 -0
  95. phisaver_client/models/ts_series_retrieve_attribute.py +18 -0
  96. phisaver_client/models/ts_series_retrieve_engine.py +14 -0
  97. phisaver_client/models/ts_series_retrieve_format.py +14 -0
  98. phisaver_client/models/ts_series_retrieve_function.py +13 -0
  99. phisaver_client/models/ts_series_retrieve_metcat.py +18 -0
  100. phisaver_client/models/ts_series_retrieve_response_200.py +46 -0
  101. phisaver_client/models/ts_series_retrieve_source.py +16 -0
  102. phisaver_client/models/ts_series_retrieve_timeformat.py +15 -0
  103. phisaver_client/models/ts_series_retrieve_units.py +16 -0
  104. phisaver_client/models/ts_table_retrieve_attribute.py +18 -0
  105. phisaver_client/models/ts_table_retrieve_engine.py +14 -0
  106. phisaver_client/models/ts_table_retrieve_format.py +14 -0
  107. phisaver_client/models/ts_table_retrieve_function.py +13 -0
  108. phisaver_client/models/ts_table_retrieve_metcat.py +18 -0
  109. phisaver_client/models/ts_table_retrieve_response_200.py +46 -0
  110. phisaver_client/models/ts_table_retrieve_source.py +16 -0
  111. phisaver_client/models/ts_table_retrieve_timeformat.py +15 -0
  112. phisaver_client/models/ts_table_retrieve_units.py +16 -0
  113. phisaver_client/models/user.py +157 -0
  114. phisaver_client/models/user_details.py +84 -0
  115. phisaver_client/models/vpn_client.py +95 -0
  116. phisaver_client/py.typed +1 -0
  117. phisaver_client/pyproject.toml +27 -0
  118. phisaver_client/types.py +54 -0
  119. phisaver_client-1.0.4.dist-info/METADATA +56 -0
  120. phisaver_client-1.0.4.dist-info/RECORD +122 -0
  121. phisaver_client-1.0.4.dist-info/WHEEL +4 -0
  122. phisaver_client-1.0.4.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,23 @@
1
+ __pycache__/
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ .pytest_cache/
6
+
7
+ # pyenv
8
+ .python-version
9
+
10
+ # Environments
11
+ .env
12
+ .venv
13
+
14
+ # mypy
15
+ .mypy_cache/
16
+ .dmypy.json
17
+ dmypy.json
18
+
19
+ # JetBrains
20
+ .idea/
21
+
22
+ /coverage.xml
23
+ /.coverage
@@ -0,0 +1,124 @@
1
+ # phisaver_client
2
+ A client library for accessing Phisaver API
3
+
4
+ ## Usage
5
+ First, create a client:
6
+
7
+ ```python
8
+ from phisaver_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 phisaver_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 phisaver_client.models import MyDataModel
25
+ from phisaver_client.api.my_tag import get_my_data_model
26
+ from phisaver_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 phisaver_client.models import MyDataModel
38
+ from phisaver_client.api.my_tag import get_my_data_model
39
+ from phisaver_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 `phisaver_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 phisaver_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 phisaver_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,8 @@
1
+ """A client library for accessing Phisaver API"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,168 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.device import Device
9
+ from ...types import UNSET, Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: Device | Device | Device | Unset = UNSET,
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "post",
20
+ "url": "/api/v1/devices/",
21
+ }
22
+
23
+ if isinstance(body, Device):
24
+ _kwargs["json"] = body.to_dict()
25
+
26
+ headers["Content-Type"] = "application/json"
27
+ if isinstance(body, Device):
28
+ _kwargs["data"] = body.to_dict()
29
+
30
+ headers["Content-Type"] = "application/x-www-form-urlencoded"
31
+ if isinstance(body, Device):
32
+ _kwargs["files"] = body.to_multipart()
33
+
34
+ headers["Content-Type"] = "multipart/form-data"
35
+
36
+ _kwargs["headers"] = headers
37
+ return _kwargs
38
+
39
+
40
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Device | None:
41
+ if response.status_code == 201:
42
+ response_201 = Device.from_dict(response.json())
43
+
44
+ return response_201
45
+
46
+ if client.raise_on_unexpected_status:
47
+ raise errors.UnexpectedStatus(response.status_code, response.content)
48
+ else:
49
+ return None
50
+
51
+
52
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Device]:
53
+ return Response(
54
+ status_code=HTTPStatus(response.status_code),
55
+ content=response.content,
56
+ headers=response.headers,
57
+ parsed=_parse_response(client=client, response=response),
58
+ )
59
+
60
+
61
+ def sync_detailed(
62
+ *,
63
+ client: AuthenticatedClient,
64
+ body: Device | Device | Device | Unset = UNSET,
65
+ ) -> Response[Device]:
66
+ """
67
+ Args:
68
+ body (Device):
69
+ body (Device):
70
+ body (Device):
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
+ Response[Device]
78
+ """
79
+
80
+ kwargs = _get_kwargs(
81
+ body=body,
82
+ )
83
+
84
+ response = client.get_httpx_client().request(
85
+ **kwargs,
86
+ )
87
+
88
+ return _build_response(client=client, response=response)
89
+
90
+
91
+ def sync(
92
+ *,
93
+ client: AuthenticatedClient,
94
+ body: Device | Device | Device | Unset = UNSET,
95
+ ) -> Device | None:
96
+ """
97
+ Args:
98
+ body (Device):
99
+ body (Device):
100
+ body (Device):
101
+
102
+ Raises:
103
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
104
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
105
+
106
+ Returns:
107
+ Device
108
+ """
109
+
110
+ return sync_detailed(
111
+ client=client,
112
+ body=body,
113
+ ).parsed
114
+
115
+
116
+ async def asyncio_detailed(
117
+ *,
118
+ client: AuthenticatedClient,
119
+ body: Device | Device | Device | Unset = UNSET,
120
+ ) -> Response[Device]:
121
+ """
122
+ Args:
123
+ body (Device):
124
+ body (Device):
125
+ body (Device):
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ Response[Device]
133
+ """
134
+
135
+ kwargs = _get_kwargs(
136
+ body=body,
137
+ )
138
+
139
+ response = await client.get_async_httpx_client().request(**kwargs)
140
+
141
+ return _build_response(client=client, response=response)
142
+
143
+
144
+ async def asyncio(
145
+ *,
146
+ client: AuthenticatedClient,
147
+ body: Device | Device | Device | Unset = UNSET,
148
+ ) -> Device | None:
149
+ """
150
+ Args:
151
+ body (Device):
152
+ body (Device):
153
+ body (Device):
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Device
161
+ """
162
+
163
+ return (
164
+ await asyncio_detailed(
165
+ client=client,
166
+ body=body,
167
+ )
168
+ ).parsed
@@ -0,0 +1,95 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ ref: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": "/api/v1/devices/{ref}/".format(
18
+ ref=quote(str(ref), safe=""),
19
+ ),
20
+ }
21
+
22
+ return _kwargs
23
+
24
+
25
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None:
26
+ if response.status_code == 204:
27
+ return None
28
+
29
+ if client.raise_on_unexpected_status:
30
+ raise errors.UnexpectedStatus(response.status_code, response.content)
31
+ else:
32
+ return None
33
+
34
+
35
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]:
36
+ return Response(
37
+ status_code=HTTPStatus(response.status_code),
38
+ content=response.content,
39
+ headers=response.headers,
40
+ parsed=_parse_response(client=client, response=response),
41
+ )
42
+
43
+
44
+ def sync_detailed(
45
+ ref: str,
46
+ *,
47
+ client: AuthenticatedClient,
48
+ ) -> Response[Any]:
49
+ """
50
+ Args:
51
+ ref (str):
52
+
53
+ Raises:
54
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
55
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
56
+
57
+ Returns:
58
+ Response[Any]
59
+ """
60
+
61
+ kwargs = _get_kwargs(
62
+ ref=ref,
63
+ )
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ async def asyncio_detailed(
73
+ ref: str,
74
+ *,
75
+ client: AuthenticatedClient,
76
+ ) -> Response[Any]:
77
+ """
78
+ Args:
79
+ ref (str):
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[Any]
87
+ """
88
+
89
+ kwargs = _get_kwargs(
90
+ ref=ref,
91
+ )
92
+
93
+ response = await client.get_async_httpx_client().request(**kwargs)
94
+
95
+ return _build_response(client=client, response=response)
@@ -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 AuthenticatedClient, Client
8
+ from ...models.device import Device
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "get",
15
+ "url": "/api/v1/devices/",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[Device] | None:
22
+ if response.status_code == 200:
23
+ response_200 = []
24
+ _response_200 = response.json()
25
+ for response_200_item_data in _response_200:
26
+ response_200_item = Device.from_dict(response_200_item_data)
27
+
28
+ response_200.append(response_200_item)
29
+
30
+ return response_200
31
+
32
+ if client.raise_on_unexpected_status:
33
+ raise errors.UnexpectedStatus(response.status_code, response.content)
34
+ else:
35
+ return None
36
+
37
+
38
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[Device]]:
39
+ return Response(
40
+ status_code=HTTPStatus(response.status_code),
41
+ content=response.content,
42
+ headers=response.headers,
43
+ parsed=_parse_response(client=client, response=response),
44
+ )
45
+
46
+
47
+ def sync_detailed(
48
+ *,
49
+ client: AuthenticatedClient,
50
+ ) -> Response[list[Device]]:
51
+ """
52
+ Raises:
53
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
54
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
55
+
56
+ Returns:
57
+ Response[list[Device]]
58
+ """
59
+
60
+ kwargs = _get_kwargs()
61
+
62
+ response = client.get_httpx_client().request(
63
+ **kwargs,
64
+ )
65
+
66
+ return _build_response(client=client, response=response)
67
+
68
+
69
+ def sync(
70
+ *,
71
+ client: AuthenticatedClient,
72
+ ) -> list[Device] | None:
73
+ """
74
+ Raises:
75
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
76
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
77
+
78
+ Returns:
79
+ list[Device]
80
+ """
81
+
82
+ return sync_detailed(
83
+ client=client,
84
+ ).parsed
85
+
86
+
87
+ async def asyncio_detailed(
88
+ *,
89
+ client: AuthenticatedClient,
90
+ ) -> Response[list[Device]]:
91
+ """
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Response[list[Device]]
98
+ """
99
+
100
+ kwargs = _get_kwargs()
101
+
102
+ response = await client.get_async_httpx_client().request(**kwargs)
103
+
104
+ return _build_response(client=client, response=response)
105
+
106
+
107
+ async def asyncio(
108
+ *,
109
+ client: AuthenticatedClient,
110
+ ) -> list[Device] | None:
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
+ list[Device]
118
+ """
119
+
120
+ return (
121
+ await asyncio_detailed(
122
+ client=client,
123
+ )
124
+ ).parsed