konecty-sdk-python 2.0.4__py3-none-any.whl → 2.0.5__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.
@@ -463,6 +463,35 @@ class KonectyClient:
463
463
  raise KonectyAPIError(errors)
464
464
  data = result.get("data", [])
465
465
  return cast(List[KonectyDict], data)
466
+
467
+ async def lookup(self, module: str, lookup_field: str, options: KonectyFindParams, search: str = "") -> List[KonectyDict]:
468
+ params: Dict[str, str] = {}
469
+ for key, value in options.model_dump(exclude_none=True).items():
470
+ params[key] = (
471
+ json.dumps(value, default=json_serial)
472
+ if key != "fields"
473
+ else ",".join(value)
474
+ )
475
+ if search:
476
+ params["search"] = search
477
+
478
+ print(f"params: {params}")
479
+ async with (
480
+ aiohttp.ClientSession() as session,
481
+ session.get(
482
+ f"{self.base_url}/rest/data/{module}/lookup/{lookup_field}",
483
+ params=params,
484
+ headers={"Authorization": self.headers["Authorization"]},
485
+ ) as response,
486
+ ):
487
+ response.raise_for_status()
488
+ result = await response.json()
489
+ if not result.get("success", False):
490
+ errors = result.get("errors", [])
491
+ logger.error(errors)
492
+ raise KonectyAPIError(errors)
493
+ data = result.get("data", [])
494
+ return cast(List[KonectyDict], data)
466
495
 
467
496
  def find_sync(self, module: str, options: KonectyFindParams) -> List[KonectyDict]:
468
497
  """Versão síncrona de find."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: konecty_sdk_python
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Konecty SDK Python
5
5
  Author-email: Leonardo Leal <leonardo.leal@konecty.com>, Derotino Silveira <derotino.silveira@konecty.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ KonectySdkPython/cli/apply.py,sha256=LyPoNcsU3oz9P_eTAi4BdtJHWkbp-sNK_SP9W8Xua04
4
4
  KonectySdkPython/cli/backup.py,sha256=rcla3EWfPsy-vWgmDK844EaM5u3h7JF-u7-b2HUBMgA,4785
5
5
  KonectySdkPython/cli/pull.py,sha256=n4gIkKtuEpPKULb3zcYu5tZlBLbt_4oNQDeu2l6tHxU,9529
6
6
  KonectySdkPython/lib/__init__.py,sha256=Du8jLNfFG1bQuHX5u7pAhbyV9TjC7Ie9K1Xo1KSUqqc,995
7
- KonectySdkPython/lib/client.py,sha256=tOA-IsBe1gA_4hn69lrkXK8LD-8iDRQ3rpuvUwVBsLY,30781
7
+ KonectySdkPython/lib/client.py,sha256=jX1_ayUYF_vMQuCj0Kuk1Fhw3SYie-RJ8Ekna9uUWSo,31954
8
8
  KonectySdkPython/lib/exceptions.py,sha256=HR48cd-cptFPoObr37NcvDrdkb-RtxKRteQoG-tuPkk,529
9
9
  KonectySdkPython/lib/file_manager.py,sha256=CLpOJWdA1tb2iq0qOIeRyEEIuACRq9tIo7Rls1YT2ig,9986
10
10
  KonectySdkPython/lib/filters.py,sha256=PsFaUFCEyKgxgzD566LdTLvuMJevoF_i9U1WnpJZzPQ,4482
@@ -28,7 +28,7 @@ KonectySdkPython/lib/services/notifications.py,sha256=7AtCBbBl-YAz_RBIW6bzoKvuws
28
28
  KonectySdkPython/lib/services/query.py,sha256=vCqbf0QdV8Blh8Hfsvq6Ne1-YFuC5siw1gVa7ZBGs_k,6605
29
29
  KonectySdkPython/lib/services/stream.py,sha256=1DMVxcg9Ymk2NgX0Qfvpjrr6vZJo5iFovPFT1NA3_CY,4737
30
30
  KonectySdkPython/lib/services/subscriptions.py,sha256=_Jq8jW7YkL_hwLNte1bWgrr4D2EMZUUSOXUgnRoGGK4,1022
31
- konecty_sdk_python-2.0.4.dist-info/METADATA,sha256=DLB0V_BAvLX0DEBULTk0K8vvIfV-Hsby_OVdzTiQAS8,1622
32
- konecty_sdk_python-2.0.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
33
- konecty_sdk_python-2.0.4.dist-info/entry_points.txt,sha256=awf962DamFgy791G3PsJ354edBMLJg16Dqi-2Y1tb9s,58
34
- konecty_sdk_python-2.0.4.dist-info/RECORD,,
31
+ konecty_sdk_python-2.0.5.dist-info/METADATA,sha256=GNN5r6m-JKJaOiwghqtS-IscpxYTmQB-Or5JMgI3PeA,1622
32
+ konecty_sdk_python-2.0.5.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
33
+ konecty_sdk_python-2.0.5.dist-info/entry_points.txt,sha256=awf962DamFgy791G3PsJ354edBMLJg16Dqi-2Y1tb9s,58
34
+ konecty_sdk_python-2.0.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.29.0
2
+ Generator: hatchling 1.30.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any