ul-data-logger-api-sdk 3.3.3__tar.gz → 3.3.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ul-data-logger-api-sdk
3
- Version: 3.3.3
3
+ Version: 3.3.4
4
4
  Summary: Data logger API sdk
5
5
  Author: Unic-lab
6
6
  License-Expression: MIT
@@ -25,6 +25,7 @@ from data_logger_api_sdk.types.api_base_stations import (
25
25
  ApiBaseStationSystemLogResponse,
26
26
  ApiBaseStationSystemLogsListResult,
27
27
  )
28
+ from data_logger_api_sdk.types.api_bs_device_links import ApiBsDeviceLinkResponse, ApiBsDeviceLinksListResult
28
29
  from data_logger_api_sdk.types.api_bs_traffic_stats import ApiBsTrafficStatsResponse, ApiDeviceTrafficStatsQuery
29
30
  from data_logger_api_sdk.types.api_uplink_signal import (
30
31
  ApiDeviceUplinkSignalLatestResponse,
@@ -218,6 +219,29 @@ class DataLoggerApiSdk:
218
219
  )
219
220
  return ApiDeviceUplinkSignalsListResult(items=items, total_count=total_count)
220
221
 
222
+ def get_bs_device_links(
223
+ self,
224
+ start_at: datetime,
225
+ end_at: datetime | None = None,
226
+ limit: int = 500,
227
+ offset: int = 0,
228
+ ) -> ApiBsDeviceLinksListResult:
229
+ """GET /bs-device-links — связи «мак ↔ БС» за период («когда-либо» при start_at из далёкого прошлого).
230
+
231
+ Один запрос по журналу device_log (дистинкт по паре мак+БС) вместо
232
+ обхода всех БС; для ночного синка слоя «Объекты и устройства».
233
+ """
234
+ query: Dict[str, Any] = {"start_at": start_at.isoformat(), "limit": limit, "offset": offset}
235
+ if end_at is not None:
236
+ query["end_at"] = end_at.isoformat()
237
+ items, total_count = self._request_list_payload_once(
238
+ ApiMethod.GET,
239
+ "/bs-device-links",
240
+ List[ApiBsDeviceLinkResponse], # type: ignore
241
+ query,
242
+ )
243
+ return ApiBsDeviceLinksListResult(items=items, total_count=total_count)
244
+
221
245
  def get_base_station(
222
246
  self,
223
247
  base_station_id: UUID,
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ul-data-logger-api-sdk"
7
- version = "3.3.3"
7
+ version = "3.3.4"
8
8
  description = "Data logger API sdk"
9
9
  license = "MIT"
10
10
  requires-python = ">=3.14"
@@ -0,0 +1,25 @@
1
+ from typing import List, NamedTuple
2
+
3
+ from pydantic import UUID4
4
+ from ul_api_utils.api_resource.api_response import JsonApiResponsePayload
5
+
6
+
7
+ class ApiBsDeviceLinkResponse(JsonApiResponsePayload):
8
+ """Связь «мак ↔ БС» за период: элемент ответа GET /bs-device-links.
9
+
10
+ Пара существует, если БС когда-либо получала пакет устройства в
11
+ запрошенном окне (дистинкт по журналу device_log). bs_id — идентификатор
12
+ БС Data Logger (у потребителя unified API это external_bs_id);
13
+ bs_identifier — её серийный номер.
14
+ """
15
+
16
+ device_network_mac: int
17
+ bs_id: UUID4
18
+ bs_identifier: str
19
+
20
+
21
+ class ApiBsDeviceLinksListResult(NamedTuple):
22
+ """Результат спискового вызова: страница элементов и total_count."""
23
+
24
+ items: List[ApiBsDeviceLinkResponse]
25
+ total_count: int