zscaler-sdk-python 0.10.0__tar.gz → 0.10.2__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 (100) hide show
  1. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/PKG-INFO +5 -5
  2. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/pyproject.toml +6 -6
  3. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/__init__.py +1 -1
  4. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/__init__.py +163 -17
  5. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/pac_files.py +4 -14
  6. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/users.py +1 -1
  7. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/policies.py +8 -2
  8. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/LICENSE.md +0 -0
  9. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/README.md +0 -0
  10. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/cache/__init__.py +0 -0
  11. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/cache/cache.py +0 -0
  12. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/cache/no_op_cache.py +0 -0
  13. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/cache/zscaler_cache.py +0 -0
  14. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/constants.py +0 -0
  15. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/errors/__init__.py +0 -0
  16. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/errors/error.py +0 -0
  17. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/errors/http_error.py +0 -0
  18. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/errors/zscaler_api_error.py +0 -0
  19. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/exceptions/__init__.py +0 -0
  20. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/exceptions/exceptions.py +0 -0
  21. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/logger.py +0 -0
  22. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/ratelimiter/__init__.py +0 -0
  23. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/ratelimiter/ratelimiter.py +0 -0
  24. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/user_agent.py +0 -0
  25. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/utils.py +0 -0
  26. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcc/__init__.py +0 -0
  27. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcc/client.py +0 -0
  28. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcc/devices.py +0 -0
  29. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcc/secrets.py +0 -0
  30. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/__init__.py +0 -0
  31. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/activation.py +0 -0
  32. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/admin_and_role_management.py +0 -0
  33. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/client.py +0 -0
  34. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/ecgroups.py +0 -0
  35. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/locations.py +0 -0
  36. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zcon/provisioning.py +0 -0
  37. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/__init__.py +0 -0
  38. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/admin.py +0 -0
  39. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/alerts.py +0 -0
  40. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/apps.py +0 -0
  41. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/devices.py +0 -0
  42. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/filters.py +0 -0
  43. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/inventory.py +0 -0
  44. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/troubleshooting.py +0 -0
  45. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/users.py +0 -0
  46. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zdx/zdx_client.py +0 -0
  47. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/activate.py +0 -0
  48. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/admin_and_role_management.py +0 -0
  49. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/apptotal.py +0 -0
  50. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/audit_logs.py +0 -0
  51. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/authentication_settings.py +0 -0
  52. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/client.py +0 -0
  53. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/cloud_apps.py +0 -0
  54. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/cloudappcontrol.py +0 -0
  55. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/device_management.py +0 -0
  56. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/dlp.py +0 -0
  57. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/errors.py +0 -0
  58. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/firewall.py +0 -0
  59. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/forwarding_control.py +0 -0
  60. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/isolation_profile.py +0 -0
  61. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/labels.py +0 -0
  62. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/locations.py +0 -0
  63. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/sandbox.py +0 -0
  64. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/security.py +0 -0
  65. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/ssl_inspection.py +0 -0
  66. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/traffic.py +0 -0
  67. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/url_categories.py +0 -0
  68. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/url_filtering.py +0 -0
  69. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/web_dlp.py +0 -0
  70. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/workload_groups.py +0 -0
  71. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zia/zpa_gateway.py +0 -0
  72. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/README.md +0 -0
  73. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/__init__.py +0 -0
  74. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments.py +0 -0
  75. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments_inspection.py +0 -0
  76. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments_pra.py +0 -0
  77. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/authdomains.py +0 -0
  78. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/certificates.py +0 -0
  79. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/client.py +0 -0
  80. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/cloud_connector_groups.py +0 -0
  81. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/connectors.py +0 -0
  82. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/emergency_access.py +0 -0
  83. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/errors.py +0 -0
  84. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/idp.py +0 -0
  85. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/inspection.py +0 -0
  86. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/isolation.py +0 -0
  87. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/lss.py +0 -0
  88. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/machine_groups.py +0 -0
  89. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/microtenants.py +0 -0
  90. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/posture_profiles.py +0 -0
  91. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/privileged_remote_access.py +0 -0
  92. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/provisioning.py +0 -0
  93. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/saml_attributes.py +0 -0
  94. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/scim_attributes.py +0 -0
  95. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/scim_groups.py +0 -0
  96. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/segment_groups.py +0 -0
  97. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/server_groups.py +0 -0
  98. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/servers.py +0 -0
  99. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/service_edges.py +0 -0
  100. {zscaler_sdk_python-0.10.0 → zscaler_sdk_python-0.10.2}/zscaler/zpa/trusted_networks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zscaler-sdk-python
3
- Version: 0.10.0
3
+ Version: 0.10.2
4
4
  Summary: Official Python SDK for the Zscaler Products (Beta)
5
5
  Home-page: https://github.com/zscaler/zscaler-sdk-python
6
6
  License: MIT
@@ -22,7 +22,7 @@ Classifier: Topic :: Security
22
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: aenum ; extra == "dev"
25
- Requires-Dist: aiohttp (>=3.10.2)
25
+ Requires-Dist: aiohttp (>=3.11.11)
26
26
  Requires-Dist: arrow
27
27
  Requires-Dist: black (>=24.3.0) ; extra == "dev"
28
28
  Requires-Dist: certifi (>=2024.2.2)
@@ -34,16 +34,16 @@ Requires-Dist: idna (>=3.10)
34
34
  Requires-Dist: okta (>=2.9.7)
35
35
  Requires-Dist: pycryptodomex (>=3.20.0)
36
36
  Requires-Dist: pydash (>=8.0.3) ; extra == "dev"
37
- Requires-Dist: python-box (>=7.2.0)
37
+ Requires-Dist: python-box (>=7.3.0)
38
38
  Requires-Dist: python-dateutil
39
39
  Requires-Dist: pytz (>=2024.2)
40
40
  Requires-Dist: pyyaml
41
41
  Requires-Dist: requests (>=2.32.3)
42
42
  Requires-Dist: responses (>=0.25.3)
43
43
  Requires-Dist: restfly (>=1.5.0)
44
- Requires-Dist: six
44
+ Requires-Dist: six (>=1.17.0)
45
45
  Requires-Dist: xmltodict (>=0.14.2)
46
- Requires-Dist: yarl (>=1.14.0)
46
+ Requires-Dist: yarl (>=1.17.0)
47
47
  Project-URL: Bug Tracker, https://github.com/zscaler/zscaler-sdk-python/issues
48
48
  Project-URL: Documentation, https://zscaler-sdk-python.readthedocs.io
49
49
  Project-URL: Repository, https://github.com/zscaler/zscaler-sdk-python
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "zscaler-sdk-python"
3
- version = "0.10.0"
3
+ version = "0.10.2"
4
4
  description = "Official Python SDK for the Zscaler Products (Beta)"
5
5
  authors = ["Zscaler, Inc. <devrel@zscaler.com>"]
6
6
  license = "MIT"
@@ -33,16 +33,16 @@ arrow = "*"
33
33
  certifi = ">=2024.2.2"
34
34
  charset-normalizer = "*"
35
35
  idna = ">=3.10"
36
- python-box = ">=7.2.0"
36
+ python-box = ">=7.3.0"
37
37
  python-dateutil = "*"
38
38
  requests = ">=2.32.3"
39
39
  responses = ">=0.25.3"
40
40
  restfly = ">=1.5.0"
41
- six = "*"
41
+ six = ">=1.17.0"
42
42
  flatdict = "*"
43
43
  pyyaml = "*"
44
44
  xmltodict = ">=0.14.2"
45
- yarl = ">=1.14.0"
45
+ yarl = ">=1.17.0"
46
46
  pycryptodomex = ">=3.20.0"
47
47
  aenum = "*"
48
48
  pydash = ">=8.0.3"
@@ -51,7 +51,7 @@ pytz = ">=2024.2"
51
51
  black = ">=24.3.0"
52
52
  cryptography = ">=43.0.0"
53
53
  okta = ">=2.9.7"
54
- aiohttp = ">=3.10.2"
54
+ aiohttp = ">=3.11.11"
55
55
 
56
56
  [tool.poetry.dev-dependencies]
57
57
  black = ">=24.3.0"
@@ -62,7 +62,7 @@ pytest-recording = "^0.13.2"
62
62
  pytest-cov = "*"
63
63
  pyfakefs = ">=5.6.0"
64
64
  isort = "*"
65
- wheel = "*"
65
+ wheel = ">=0.45.1"
66
66
  sphinx = "^7.4.7"
67
67
  sphinx-autobuild = "*"
68
68
  sphinx_rtd_theme = "*"
@@ -29,7 +29,7 @@ __license__ = "MIT"
29
29
  __contributors__ = [
30
30
  "William Guilherme",
31
31
  ]
32
- __version__ = "0.10.0"
32
+ __version__ = "0.10.2"
33
33
 
34
34
  from zscaler.zdx import ZDXClientHelper # noqa
35
35
  from zscaler.zia import ZIAClientHelper # noqa
@@ -407,7 +407,6 @@ class ZIAClientHelper(ZIAClient):
407
407
  page=None,
408
408
  pagesize=None,
409
409
  search=None,
410
- max_page_size=1000, # Default to 1000, can be adjusted based on endpoint constraints
411
410
  max_items=None, # Maximum number of items to retrieve across pages
412
411
  max_pages=None, # Maximum number of pages to retrieve
413
412
  type=None, # Specify type of VPN credentials (CN, IP, UFQDN, XAUTH)
@@ -423,7 +422,7 @@ class ZIAClientHelper(ZIAClient):
423
422
  path (str): The API endpoint path to send requests to.
424
423
  expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
425
424
  page (int): Specific page number to fetch. Defaults to 1 if not provided.
426
- pagesize (int): Number of items per page, default is 100, with a maximum of 1000.
425
+ pagesize (int): Number of items per page, default is 100, with a maximum of 10000.
427
426
  search (str): Search query to filter the results.
428
427
  max_items (int): Maximum number of items to retrieve.
429
428
  max_pages (int): Maximum number of pages to fetch.
@@ -431,7 +430,7 @@ class ZIAClientHelper(ZIAClient):
431
430
  include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
432
431
  location_id (int, optional): Retrieve VPN credentials for the specified location ID.
433
432
  managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
434
- prefix (int, optional): Retrieve VPN credentials managed by the specified partner.
433
+ prefix (int, optional): Retrieve VPN credentials managed by a given partner.
435
434
 
436
435
  Returns:
437
436
  tuple: A tuple containing:
@@ -445,10 +444,10 @@ class ZIAClientHelper(ZIAClient):
445
444
  "EMPTY_RESULTS": "No results found for page {page}.",
446
445
  }
447
446
 
448
- # Initialize pagination parameters
447
+ # Initialize parameters
449
448
  params = {
450
449
  "page": page if page is not None else 1, # Start at page 1 if not specified
451
- "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
450
+ "pageSize": pagesize if pagesize is not None else 100, # Allow any user-defined pagesize
452
451
  }
453
452
 
454
453
  # Add optional filters to the params if provided
@@ -465,12 +464,30 @@ class ZIAClientHelper(ZIAClient):
465
464
  if prefix:
466
465
  params["prefix"] = prefix
467
466
 
467
+ # If the user specifies a page, fetch only that page
468
+ if page is not None:
469
+ response = self.send("GET", path=path, params=params)
470
+ if response.status_code != expected_status_code:
471
+ error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
472
+ status_code=response.status_code, page=params["page"]
473
+ )
474
+ logger.error(error_msg)
475
+ return BoxList([]), error_msg
476
+
477
+ response_data = response.json()
478
+ if not isinstance(response_data, list):
479
+ error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
480
+ logger.warn(error_msg)
481
+ return BoxList([]), error_msg
482
+
483
+ data = convert_keys_to_snake(response_data)
484
+ return BoxList(data), None
485
+
486
+ # If no page is specified, iterate through pages to fetch all items
468
487
  ret_data = []
469
488
  total_collected = 0
470
-
471
489
  try:
472
490
  while True:
473
- # Apply rate-limiting if necessary
474
491
  should_wait, delay = self.rate_limiter.wait("GET")
475
492
  if should_wait:
476
493
  time.sleep(delay)
@@ -495,13 +512,6 @@ class ZIAClientHelper(ZIAClient):
495
512
 
496
513
  data = convert_keys_to_snake(response_data)
497
514
 
498
- # If searching for a specific item, stop if we find a match
499
- if search:
500
- for item in data:
501
- if item.get("name") == search:
502
- ret_data.append(item)
503
- return BoxList(ret_data), None
504
-
505
515
  # Limit data collection based on max_items
506
516
  if max_items is not None:
507
517
  data = data[: max_items - total_collected] # Limit items on the current page
@@ -514,8 +524,8 @@ class ZIAClientHelper(ZIAClient):
514
524
  ):
515
525
  break
516
526
 
517
- # Stop if we've processed all available pages (i.e., less than requested page size)
518
- if len(data) < params["pagesize"]:
527
+ # Stop if fewer items than pageSize are returned
528
+ if len(data) < params["pageSize"]:
519
529
  break
520
530
 
521
531
  # Move to the next page
@@ -531,6 +541,142 @@ class ZIAClientHelper(ZIAClient):
531
541
 
532
542
  return BoxList(ret_data), None
533
543
 
544
+
545
+ # def get_paginated_data(
546
+ # self,
547
+ # path=None,
548
+ # expected_status_code=200,
549
+ # page=None,
550
+ # pagesize=None,
551
+ # search=None,
552
+ # max_items=None, # Maximum number of items to retrieve across pages
553
+ # max_pages=None, # Maximum number of pages to retrieve
554
+ # type=None, # Specify type of VPN credentials (CN, IP, UFQDN, XAUTH)
555
+ # include_only_without_location=None, # Include only VPN credentials not associated with any location
556
+ # location_id=None, # VPN credentials for a specific location ID
557
+ # managed_by=None, # VPN credentials managed by a given partner
558
+ # prefix=None, # VPN credentials managed by a given partner
559
+ # ):
560
+ # """
561
+ # Fetches paginated data from the API based on specified parameters and handles pagination.
562
+
563
+ # Args:
564
+ # path (str): The API endpoint path to send requests to.
565
+ # expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
566
+ # page (int): Specific page number to fetch. Defaults to 1 if not provided.
567
+ # pagesize (int): Number of items per page, default is 100, with a maximum of 1000.
568
+ # search (str): Search query to filter the results.
569
+ # max_items (int): Maximum number of items to retrieve.
570
+ # max_pages (int): Maximum number of pages to fetch.
571
+ # type (str, optional): Type of VPN credentials (e.g., CN, IP, UFQDN, XAUTH).
572
+ # include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
573
+ # location_id (int, optional): Retrieve VPN credentials for the specified location ID.
574
+ # managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
575
+ # prefix (int, optional): Retrieve VPN credentials managed by the specified partner.
576
+
577
+ # Returns:
578
+ # tuple: A tuple containing:
579
+ # - BoxList: A list of fetched items wrapped in a BoxList for easy access.
580
+ # - str: An error message if any occurred during the data fetching process.
581
+ # """
582
+ # logger = logging.getLogger(__name__)
583
+
584
+ # ERROR_MESSAGES = {
585
+ # "UNEXPECTED_STATUS": "Unexpected status code {status_code} received for page {page}.",
586
+ # "EMPTY_RESULTS": "No results found for page {page}.",
587
+ # }
588
+
589
+ # # Initialize pagination parameters
590
+ # # params = {
591
+ # # "page": page if page is not None else 1, # Start at page 1 if not specified
592
+ # # "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
593
+ # # }
594
+
595
+ # params = {
596
+ # "page": page if page is not None else 1, # Start at page 1 if not specified
597
+ # "pagesize": max(100, min(pagesize or 100, 10000)), # Ensure pagesize is within API limits
598
+ # }
599
+
600
+ # # Add optional filters to the params if provided
601
+ # if search:
602
+ # params["search"] = search
603
+ # if type:
604
+ # params["type"] = type
605
+ # if include_only_without_location is not None:
606
+ # params["includeOnlyWithoutLocation"] = include_only_without_location
607
+ # if location_id:
608
+ # params["locationId"] = location_id
609
+ # if managed_by:
610
+ # params["managedBy"] = managed_by
611
+ # if prefix:
612
+ # params["prefix"] = prefix
613
+
614
+ # ret_data = []
615
+ # total_collected = 0
616
+
617
+ # try:
618
+ # while True:
619
+ # # Apply rate-limiting if necessary
620
+ # should_wait, delay = self.rate_limiter.wait("GET")
621
+ # if should_wait:
622
+ # time.sleep(delay)
623
+
624
+ # # Send the request to the API
625
+ # response = self.send("GET", path=path, params=params)
626
+
627
+ # # Check for unexpected status code
628
+ # if response.status_code != expected_status_code:
629
+ # error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
630
+ # status_code=response.status_code, page=params["page"]
631
+ # )
632
+ # logger.error(error_msg)
633
+ # return BoxList([]), error_msg
634
+
635
+ # # Parse the response as a flat list of items
636
+ # response_data = response.json()
637
+ # if not isinstance(response_data, list):
638
+ # error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
639
+ # logger.warn(error_msg)
640
+ # return BoxList([]), error_msg
641
+
642
+ # data = convert_keys_to_snake(response_data)
643
+
644
+ # # If searching for a specific item, stop if we find a match
645
+ # if search:
646
+ # for item in data:
647
+ # if item.get("name") == search:
648
+ # ret_data.append(item)
649
+ # return BoxList(ret_data), None
650
+
651
+ # # Limit data collection based on max_items
652
+ # if max_items is not None:
653
+ # data = data[: max_items - total_collected] # Limit items on the current page
654
+ # ret_data.extend(data)
655
+ # total_collected += len(data)
656
+
657
+ # # Check if we've reached max_items or max_pages limits
658
+ # if (max_items is not None and total_collected >= max_items) or (
659
+ # max_pages is not None and params["page"] >= max_pages
660
+ # ):
661
+ # break
662
+
663
+ # # Stop if we've processed all available pages (i.e., less than requested page size)
664
+ # if len(data) < params["pagesize"]:
665
+ # break
666
+
667
+ # # Move to the next page
668
+ # params["page"] += 1
669
+
670
+ # finally:
671
+ # time.sleep(2) # Ensure a delay between requests regardless of outcome
672
+
673
+ # if not ret_data:
674
+ # error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
675
+ # logger.warn(error_msg)
676
+ # return BoxList([]), error_msg
677
+
678
+ # return BoxList(ret_data), None
679
+
534
680
  @property
535
681
  def admin_and_role_management(self):
536
682
  """
@@ -619,7 +765,7 @@ class ZIAClientHelper(ZIAClient):
619
765
 
620
766
  """
621
767
  return CloudSandboxAPI(self)
622
-
768
+
623
769
  @property
624
770
  def security(self):
625
771
  """
@@ -39,23 +39,13 @@ class PacFilesAPI:
39
39
  Specifies the page size. The default size is 100, but the maximum size is 1000.
40
40
 
41
41
  Returns:
42
- :obj:`BoxList`: The list of Rule Labels configured in ZIA.
42
+ :obj:`BoxList`: The list of PAC Files configured in ZIA.
43
43
 
44
44
  Examples:
45
- List Rule Labels using default settings:
45
+ List PAC Files using default settings:
46
46
 
47
- >>> for label in zia.labels.list_labels():
48
- ... print(label)
49
-
50
- List labels, limiting to a maximum of 10 items:
51
-
52
- >>> for label in zia.labels.list_labels(max_items=10):
53
- ... print(label)
54
-
55
- List labels, returning 200 items per page for a maximum of 2 pages:
56
-
57
- >>> for label in zia.labels.list_labels(page_size=200, max_pages=2):
58
- ... print(label)
47
+ >>> for pac_files in zia.pac_files.list_pac_files():
48
+ ... print(pac_files)
59
49
 
60
50
  """
61
51
  list, _ = self.rest.get_paginated_data(path="/pacFiles", **kwargs)
@@ -170,7 +170,7 @@ class UserManagementAPI:
170
170
  **name (str, optional):
171
171
  Filters by user name. This is a `partial` match.
172
172
  **page_size (int, optional):
173
- Specifies the page size. The default size is 100, but the maximum size is 1000.
173
+ Specifies the page size. The default size is 100, but the maximum size is 10000.
174
174
  **sort_by (str):
175
175
  The field name to sort by, supported values: id, name, creationTime or modifiedTime (default to name)
176
176
  **sort_order (str):
@@ -15,8 +15,6 @@
15
15
  # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
16
 
17
17
 
18
- import functools
19
-
20
18
  from box import Box, BoxList
21
19
  from requests import Response
22
20
 
@@ -61,6 +59,7 @@ class PolicySetsAPI:
61
59
  """
62
60
  template = []
63
61
  app_and_app_group_operands = []
62
+ scim_and_scim_group_operands = []
64
63
  object_types_to_operands = {
65
64
  "CONSOLE": [],
66
65
  "MACHINE_GRP": [],
@@ -100,6 +99,8 @@ class PolicySetsAPI:
100
99
 
101
100
  if object_type in ["APP", "APP_GROUP"]:
102
101
  app_and_app_group_operands.append(operand)
102
+ elif object_type in ["SCIM","SCIM_GROUP"]:
103
+ scim_and_scim_group_operands.append(operand)
103
104
  elif object_type in object_types_to_operands:
104
105
  object_types_to_operands[object_type].append(operand)
105
106
 
@@ -131,6 +132,11 @@ class PolicySetsAPI:
131
132
  app_group_operator = operators_for_types.get("APP", "OR")
132
133
  template.append({"operator": app_group_operator, "operands": app_and_app_group_operands})
133
134
 
135
+ # Combine SCIM and SCIM_GROUP operands with their specific operator
136
+ if scim_and_scim_group_operands:
137
+ scim_group_operator = operators_for_types.get("SCIM_GROUP", "OR")
138
+ template.append({"operator": scim_group_operator, "operands": scim_and_scim_group_operands})
139
+
134
140
  # Combine other object types into their blocks with their respective operator
135
141
  for object_type, operands in object_types_to_operands.items():
136
142
  if operands: