konecty-sdk-python 2.0.4__tar.gz → 2.0.5__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 (34) hide show
  1. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/client.py +29 -0
  2. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/PKG-INFO +1 -1
  3. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/pyproject.toml +1 -1
  4. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/.gitignore +0 -0
  5. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/__init__.py +0 -0
  6. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/cli/__init__.py +0 -0
  7. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/cli/apply.py +0 -0
  8. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/cli/backup.py +0 -0
  9. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/cli/pull.py +0 -0
  10. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/__init__.py +0 -0
  11. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/exceptions.py +0 -0
  12. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/feature_types/__init__.py +0 -0
  13. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/feature_types/cross_module_query.py +0 -0
  14. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/feature_types/kpi.py +0 -0
  15. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/feature_types/query_json.py +0 -0
  16. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/file_manager.py +0 -0
  17. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/filters.py +0 -0
  18. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/http.py +0 -0
  19. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/model.py +0 -0
  20. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/serialization.py +0 -0
  21. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/__init__.py +0 -0
  22. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/aggregation.py +0 -0
  23. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/base.py +0 -0
  24. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/change_user.py +0 -0
  25. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/comments.py +0 -0
  26. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/export.py +0 -0
  27. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/files.py +0 -0
  28. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/notifications.py +0 -0
  29. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/query.py +0 -0
  30. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/stream.py +0 -0
  31. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/services/subscriptions.py +0 -0
  32. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/settings.py +0 -0
  33. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/KonectySdkPython/lib/types.py +0 -0
  34. {konecty_sdk_python-2.0.4 → konecty_sdk_python-2.0.5}/README.md +0 -0
@@ -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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "konecty_sdk_python"
3
- version = "2.0.4"
3
+ version = "2.0.5"
4
4
  description = "Konecty SDK Python"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"