zscaler-sdk-python 0.10.1__tar.gz → 0.10.3__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.1 → zscaler_sdk_python-0.10.3}/PKG-INFO +1 -1
  2. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/pyproject.toml +1 -1
  3. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/__init__.py +1 -1
  4. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/__init__.py +172 -21
  5. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/LICENSE.md +0 -0
  6. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/README.md +0 -0
  7. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/cache/__init__.py +0 -0
  8. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/cache/cache.py +0 -0
  9. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/cache/no_op_cache.py +0 -0
  10. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/cache/zscaler_cache.py +0 -0
  11. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/constants.py +0 -0
  12. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/errors/__init__.py +0 -0
  13. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/errors/error.py +0 -0
  14. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/errors/http_error.py +0 -0
  15. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/errors/zscaler_api_error.py +0 -0
  16. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/exceptions/__init__.py +0 -0
  17. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/exceptions/exceptions.py +0 -0
  18. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/logger.py +0 -0
  19. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/ratelimiter/__init__.py +0 -0
  20. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/ratelimiter/ratelimiter.py +0 -0
  21. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/user_agent.py +0 -0
  22. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/utils.py +0 -0
  23. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcc/__init__.py +0 -0
  24. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcc/client.py +0 -0
  25. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcc/devices.py +0 -0
  26. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcc/secrets.py +0 -0
  27. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/__init__.py +0 -0
  28. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/activation.py +0 -0
  29. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/admin_and_role_management.py +0 -0
  30. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/client.py +0 -0
  31. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/ecgroups.py +0 -0
  32. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/locations.py +0 -0
  33. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zcon/provisioning.py +0 -0
  34. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/__init__.py +0 -0
  35. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/admin.py +0 -0
  36. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/alerts.py +0 -0
  37. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/apps.py +0 -0
  38. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/devices.py +0 -0
  39. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/filters.py +0 -0
  40. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/inventory.py +0 -0
  41. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/troubleshooting.py +0 -0
  42. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/users.py +0 -0
  43. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zdx/zdx_client.py +0 -0
  44. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/activate.py +0 -0
  45. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/admin_and_role_management.py +0 -0
  46. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/apptotal.py +0 -0
  47. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/audit_logs.py +0 -0
  48. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/authentication_settings.py +0 -0
  49. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/client.py +0 -0
  50. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/cloud_apps.py +0 -0
  51. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/cloudappcontrol.py +0 -0
  52. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/device_management.py +0 -0
  53. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/dlp.py +0 -0
  54. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/errors.py +0 -0
  55. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/firewall.py +0 -0
  56. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/forwarding_control.py +0 -0
  57. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/isolation_profile.py +0 -0
  58. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/labels.py +0 -0
  59. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/locations.py +0 -0
  60. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/pac_files.py +0 -0
  61. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/sandbox.py +0 -0
  62. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/security.py +0 -0
  63. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/ssl_inspection.py +0 -0
  64. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/traffic.py +0 -0
  65. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/url_categories.py +0 -0
  66. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/url_filtering.py +0 -0
  67. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/users.py +0 -0
  68. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/web_dlp.py +0 -0
  69. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/workload_groups.py +0 -0
  70. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zia/zpa_gateway.py +0 -0
  71. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/README.md +0 -0
  72. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/__init__.py +0 -0
  73. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/app_segments.py +0 -0
  74. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/app_segments_inspection.py +0 -0
  75. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/app_segments_pra.py +0 -0
  76. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/authdomains.py +0 -0
  77. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/certificates.py +0 -0
  78. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/client.py +0 -0
  79. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/cloud_connector_groups.py +0 -0
  80. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/connectors.py +0 -0
  81. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/emergency_access.py +0 -0
  82. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/errors.py +0 -0
  83. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/idp.py +0 -0
  84. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/inspection.py +0 -0
  85. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/isolation.py +0 -0
  86. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/lss.py +0 -0
  87. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/machine_groups.py +0 -0
  88. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/microtenants.py +0 -0
  89. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/policies.py +0 -0
  90. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/posture_profiles.py +0 -0
  91. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/privileged_remote_access.py +0 -0
  92. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/provisioning.py +0 -0
  93. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/saml_attributes.py +0 -0
  94. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/scim_attributes.py +0 -0
  95. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/scim_groups.py +0 -0
  96. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/segment_groups.py +0 -0
  97. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/server_groups.py +0 -0
  98. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/servers.py +0 -0
  99. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/zscaler/zpa/service_edges.py +0 -0
  100. {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.3}/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.1
3
+ Version: 0.10.3
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "zscaler-sdk-python"
3
- version = "0.10.1"
3
+ version = "0.10.3"
4
4
  description = "Official Python SDK for the Zscaler Products (Beta)"
5
5
  authors = ["Zscaler, Inc. <devrel@zscaler.com>"]
6
6
  license = "MIT"
@@ -29,7 +29,7 @@ __license__ = "MIT"
29
29
  __contributors__ = [
30
30
  "William Guilherme",
31
31
  ]
32
- __version__ = "0.10.1"
32
+ __version__ = "0.10.3"
33
33
 
34
34
  from zscaler.zdx import ZDXClientHelper # noqa
35
35
  from zscaler.zia import ZIAClientHelper # noqa
@@ -32,6 +32,7 @@ from zscaler.zia.admin_and_role_management import AdminAndRoleManagementAPI
32
32
  from zscaler.zia.apptotal import AppTotalAPI
33
33
  from zscaler.zia.audit_logs import AuditLogsAPI
34
34
  from zscaler.zia.authentication_settings import AuthenticationSettingsAPI
35
+ from zscaler.zia.cloud_apps import CloudAppsAPI
35
36
  from zscaler.zia.device_management import DeviceManagementAPI
36
37
  from zscaler.zia.dlp import DLPAPI
37
38
  from zscaler.zia.firewall import FirewallPolicyAPI
@@ -422,7 +423,7 @@ class ZIAClientHelper(ZIAClient):
422
423
  path (str): The API endpoint path to send requests to.
423
424
  expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
424
425
  page (int): Specific page number to fetch. Defaults to 1 if not provided.
425
- pagesize (int): Number of items per page, default is 100, with a maximum of 1000.
426
+ pagesize (int): Number of items per page, default is 100, with a maximum of 10000.
426
427
  search (str): Search query to filter the results.
427
428
  max_items (int): Maximum number of items to retrieve.
428
429
  max_pages (int): Maximum number of pages to fetch.
@@ -430,7 +431,7 @@ class ZIAClientHelper(ZIAClient):
430
431
  include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
431
432
  location_id (int, optional): Retrieve VPN credentials for the specified location ID.
432
433
  managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
433
- prefix (int, optional): Retrieve VPN credentials managed by the specified partner.
434
+ prefix (int, optional): Retrieve VPN credentials managed by a given partner.
434
435
 
435
436
  Returns:
436
437
  tuple: A tuple containing:
@@ -444,17 +445,12 @@ class ZIAClientHelper(ZIAClient):
444
445
  "EMPTY_RESULTS": "No results found for page {page}.",
445
446
  }
446
447
 
447
- # Initialize pagination parameters
448
- # params = {
449
- # "page": page if page is not None else 1, # Start at page 1 if not specified
450
- # "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
451
- # }
452
-
448
+ # Initialize parameters
453
449
  params = {
454
450
  "page": page if page is not None else 1, # Start at page 1 if not specified
455
- "pagesize": max(100, min(pagesize or 100, 10000)), # Ensure pagesize is within API limits
451
+ "pageSize": pagesize if pagesize is not None else 100, # Allow any user-defined pagesize
456
452
  }
457
-
453
+
458
454
  # Add optional filters to the params if provided
459
455
  if search:
460
456
  params["search"] = search
@@ -469,12 +465,30 @@ class ZIAClientHelper(ZIAClient):
469
465
  if prefix:
470
466
  params["prefix"] = prefix
471
467
 
468
+ # If the user specifies a page, fetch only that page
469
+ if page is not None:
470
+ response = self.send("GET", path=path, params=params)
471
+ if response.status_code != expected_status_code:
472
+ error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
473
+ status_code=response.status_code, page=params["page"]
474
+ )
475
+ logger.error(error_msg)
476
+ return BoxList([]), error_msg
477
+
478
+ response_data = response.json()
479
+ if not isinstance(response_data, list):
480
+ error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
481
+ logger.warn(error_msg)
482
+ return BoxList([]), error_msg
483
+
484
+ data = convert_keys_to_snake(response_data)
485
+ return BoxList(data), None
486
+
487
+ # If no page is specified, iterate through pages to fetch all items
472
488
  ret_data = []
473
489
  total_collected = 0
474
-
475
490
  try:
476
491
  while True:
477
- # Apply rate-limiting if necessary
478
492
  should_wait, delay = self.rate_limiter.wait("GET")
479
493
  if should_wait:
480
494
  time.sleep(delay)
@@ -499,13 +513,6 @@ class ZIAClientHelper(ZIAClient):
499
513
 
500
514
  data = convert_keys_to_snake(response_data)
501
515
 
502
- # If searching for a specific item, stop if we find a match
503
- if search:
504
- for item in data:
505
- if item.get("name") == search:
506
- ret_data.append(item)
507
- return BoxList(ret_data), None
508
-
509
516
  # Limit data collection based on max_items
510
517
  if max_items is not None:
511
518
  data = data[: max_items - total_collected] # Limit items on the current page
@@ -518,8 +525,8 @@ class ZIAClientHelper(ZIAClient):
518
525
  ):
519
526
  break
520
527
 
521
- # Stop if we've processed all available pages (i.e., less than requested page size)
522
- if len(data) < params["pagesize"]:
528
+ # Stop if fewer items than pageSize are returned
529
+ if len(data) < params["pageSize"]:
523
530
  break
524
531
 
525
532
  # Move to the next page
@@ -535,6 +542,142 @@ class ZIAClientHelper(ZIAClient):
535
542
 
536
543
  return BoxList(ret_data), None
537
544
 
545
+
546
+ # def get_paginated_data(
547
+ # self,
548
+ # path=None,
549
+ # expected_status_code=200,
550
+ # page=None,
551
+ # pagesize=None,
552
+ # search=None,
553
+ # max_items=None, # Maximum number of items to retrieve across pages
554
+ # max_pages=None, # Maximum number of pages to retrieve
555
+ # type=None, # Specify type of VPN credentials (CN, IP, UFQDN, XAUTH)
556
+ # include_only_without_location=None, # Include only VPN credentials not associated with any location
557
+ # location_id=None, # VPN credentials for a specific location ID
558
+ # managed_by=None, # VPN credentials managed by a given partner
559
+ # prefix=None, # VPN credentials managed by a given partner
560
+ # ):
561
+ # """
562
+ # Fetches paginated data from the API based on specified parameters and handles pagination.
563
+
564
+ # Args:
565
+ # path (str): The API endpoint path to send requests to.
566
+ # expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
567
+ # page (int): Specific page number to fetch. Defaults to 1 if not provided.
568
+ # pagesize (int): Number of items per page, default is 100, with a maximum of 1000.
569
+ # search (str): Search query to filter the results.
570
+ # max_items (int): Maximum number of items to retrieve.
571
+ # max_pages (int): Maximum number of pages to fetch.
572
+ # type (str, optional): Type of VPN credentials (e.g., CN, IP, UFQDN, XAUTH).
573
+ # include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
574
+ # location_id (int, optional): Retrieve VPN credentials for the specified location ID.
575
+ # managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
576
+ # prefix (int, optional): Retrieve VPN credentials managed by the specified partner.
577
+
578
+ # Returns:
579
+ # tuple: A tuple containing:
580
+ # - BoxList: A list of fetched items wrapped in a BoxList for easy access.
581
+ # - str: An error message if any occurred during the data fetching process.
582
+ # """
583
+ # logger = logging.getLogger(__name__)
584
+
585
+ # ERROR_MESSAGES = {
586
+ # "UNEXPECTED_STATUS": "Unexpected status code {status_code} received for page {page}.",
587
+ # "EMPTY_RESULTS": "No results found for page {page}.",
588
+ # }
589
+
590
+ # # Initialize pagination parameters
591
+ # # params = {
592
+ # # "page": page if page is not None else 1, # Start at page 1 if not specified
593
+ # # "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
594
+ # # }
595
+
596
+ # params = {
597
+ # "page": page if page is not None else 1, # Start at page 1 if not specified
598
+ # "pagesize": max(100, min(pagesize or 100, 10000)), # Ensure pagesize is within API limits
599
+ # }
600
+
601
+ # # Add optional filters to the params if provided
602
+ # if search:
603
+ # params["search"] = search
604
+ # if type:
605
+ # params["type"] = type
606
+ # if include_only_without_location is not None:
607
+ # params["includeOnlyWithoutLocation"] = include_only_without_location
608
+ # if location_id:
609
+ # params["locationId"] = location_id
610
+ # if managed_by:
611
+ # params["managedBy"] = managed_by
612
+ # if prefix:
613
+ # params["prefix"] = prefix
614
+
615
+ # ret_data = []
616
+ # total_collected = 0
617
+
618
+ # try:
619
+ # while True:
620
+ # # Apply rate-limiting if necessary
621
+ # should_wait, delay = self.rate_limiter.wait("GET")
622
+ # if should_wait:
623
+ # time.sleep(delay)
624
+
625
+ # # Send the request to the API
626
+ # response = self.send("GET", path=path, params=params)
627
+
628
+ # # Check for unexpected status code
629
+ # if response.status_code != expected_status_code:
630
+ # error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
631
+ # status_code=response.status_code, page=params["page"]
632
+ # )
633
+ # logger.error(error_msg)
634
+ # return BoxList([]), error_msg
635
+
636
+ # # Parse the response as a flat list of items
637
+ # response_data = response.json()
638
+ # if not isinstance(response_data, list):
639
+ # error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
640
+ # logger.warn(error_msg)
641
+ # return BoxList([]), error_msg
642
+
643
+ # data = convert_keys_to_snake(response_data)
644
+
645
+ # # If searching for a specific item, stop if we find a match
646
+ # if search:
647
+ # for item in data:
648
+ # if item.get("name") == search:
649
+ # ret_data.append(item)
650
+ # return BoxList(ret_data), None
651
+
652
+ # # Limit data collection based on max_items
653
+ # if max_items is not None:
654
+ # data = data[: max_items - total_collected] # Limit items on the current page
655
+ # ret_data.extend(data)
656
+ # total_collected += len(data)
657
+
658
+ # # Check if we've reached max_items or max_pages limits
659
+ # if (max_items is not None and total_collected >= max_items) or (
660
+ # max_pages is not None and params["page"] >= max_pages
661
+ # ):
662
+ # break
663
+
664
+ # # Stop if we've processed all available pages (i.e., less than requested page size)
665
+ # if len(data) < params["pagesize"]:
666
+ # break
667
+
668
+ # # Move to the next page
669
+ # params["page"] += 1
670
+
671
+ # finally:
672
+ # time.sleep(2) # Ensure a delay between requests regardless of outcome
673
+
674
+ # if not ret_data:
675
+ # error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
676
+ # logger.warn(error_msg)
677
+ # return BoxList([]), error_msg
678
+
679
+ # return BoxList(ret_data), None
680
+
538
681
  @property
539
682
  def admin_and_role_management(self):
540
683
  """
@@ -567,6 +710,14 @@ class ZIAClientHelper(ZIAClient):
567
710
  """
568
711
  return ActivationAPI(self)
569
712
 
713
+ @property
714
+ def cloud_apps(self):
715
+ """
716
+ The interface object for the :ref:`ZIA Cloud Applications interface <zia-cloud_apps>`.
717
+
718
+ """
719
+ return CloudAppsAPI(self)
720
+
570
721
  @property
571
722
  def dlp(self):
572
723
  """