zscaler-sdk-python 0.3.0__tar.gz → 0.3.1__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 (76) hide show
  1. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/PKG-INFO +3 -2
  2. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/pyproject.toml +4 -3
  3. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/__init__.py +1 -1
  4. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/cache/zscaler_cache.py +1 -1
  5. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/__init__.py +79 -63
  6. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/app_segments.py +2 -1
  7. zscaler_sdk_python-0.3.0/zscaler/zpa/policiesv2.py → zscaler_sdk_python-0.3.1/zscaler/zpa/policies.py +1433 -228
  8. zscaler_sdk_python-0.3.0/zscaler/zpa/policies.py +0 -857
  9. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/LICENSE.md +0 -0
  10. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/README.md +0 -0
  11. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/cache/__init__.py +0 -0
  12. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/cache/cache.py +0 -0
  13. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/cache/no_op_cache.py +0 -0
  14. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/constants.py +0 -0
  15. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/errors/__init__.py +0 -0
  16. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/errors/error.py +0 -0
  17. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/errors/http_error.py +0 -0
  18. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/errors/zscaler_api_error.py +0 -0
  19. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/exceptions/__init__.py +0 -0
  20. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/exceptions/exceptions.py +0 -0
  21. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/logger.py +0 -0
  22. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/ratelimiter/__init__.py +0 -0
  23. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/ratelimiter/ratelimiter.py +0 -0
  24. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/user_agent.py +0 -0
  25. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/utils.py +0 -0
  26. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/__init__.py +0 -0
  27. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/activate.py +0 -0
  28. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/admin_and_role_management.py +0 -0
  29. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/apptotal.py +0 -0
  30. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/audit_logs.py +0 -0
  31. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/authentication_settings.py +0 -0
  32. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/client.py +0 -0
  33. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/cloud_apps.py +0 -0
  34. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/device_management.py +0 -0
  35. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/dlp.py +0 -0
  36. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/errors.py +0 -0
  37. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/firewall.py +0 -0
  38. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/forwarding_control.py +0 -0
  39. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/isolation_profile.py +0 -0
  40. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/labels.py +0 -0
  41. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/locations.py +0 -0
  42. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/sandbox.py +0 -0
  43. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/security.py +0 -0
  44. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/ssl_inspection.py +0 -0
  45. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/traffic.py +0 -0
  46. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/url_categories.py +0 -0
  47. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/url_filtering.py +0 -0
  48. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/users.py +0 -0
  49. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/web_dlp.py +0 -0
  50. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/workload_groups.py +0 -0
  51. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zia/zpa_gateway.py +0 -0
  52. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/README.md +0 -0
  53. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/app_segments_inspection.py +0 -0
  54. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/app_segments_pra.py +0 -0
  55. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/certificates.py +0 -0
  56. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/client.py +0 -0
  57. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/cloud_connector_groups.py +0 -0
  58. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/connectors.py +0 -0
  59. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/emergency_access.py +0 -0
  60. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/errors.py +0 -0
  61. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/idp.py +0 -0
  62. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/inspection.py +0 -0
  63. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/isolation.py +0 -0
  64. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/lss.py +0 -0
  65. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/machine_groups.py +0 -0
  66. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/posture_profiles.py +0 -0
  67. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/privileged_remote_access.py +0 -0
  68. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/provisioning.py +0 -0
  69. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/saml_attributes.py +0 -0
  70. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/scim_attributes.py +0 -0
  71. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/scim_groups.py +0 -0
  72. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/segment_groups.py +0 -0
  73. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/server_groups.py +0 -0
  74. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/servers.py +0 -0
  75. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/zscaler/zpa/service_edges.py +0 -0
  76. {zscaler_sdk_python-0.3.0 → zscaler_sdk_python-0.3.1}/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.3.0
3
+ Version: 0.3.1
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
@@ -23,13 +23,14 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: aenum ; extra == "dev"
25
25
  Requires-Dist: arrow
26
- Requires-Dist: black ; extra == "dev"
26
+ Requires-Dist: black (>=24.3.0) ; extra == "dev"
27
27
  Requires-Dist: certifi
28
28
  Requires-Dist: charset-normalizer
29
29
  Requires-Dist: cryptography (>=3.4,<43.0)
30
30
  Requires-Dist: flake8
31
31
  Requires-Dist: flatdict
32
32
  Requires-Dist: idna
33
+ Requires-Dist: okta (>=2.9.7)
33
34
  Requires-Dist: pycryptodomex
34
35
  Requires-Dist: pydash ; extra == "dev"
35
36
  Requires-Dist: python-box (>=7.1.1,<8.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "zscaler-sdk-python"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "Official Python SDK for the Zscaler Products (Beta)"
5
5
  authors = ["Zscaler, Inc. <devrel@zscaler.com>"]
6
6
  license = "MIT"
@@ -48,11 +48,12 @@ aenum = "*"
48
48
  pydash = "*"
49
49
  flake8 = "*"
50
50
  pytz = "*"
51
- black = "*"
51
+ black = ">=24.3.0"
52
52
  cryptography = ">=3.4,<43.0"
53
+ okta = ">=2.9.7"
53
54
 
54
55
  [tool.poetry.dev-dependencies]
55
- black = "24.3.0"
56
+ black = ">=24.3.0"
56
57
  pytest = "^8.2.1"
57
58
  pytest-asyncio = ">=0.23.7"
58
59
  pytest-mock = "*"
@@ -29,7 +29,7 @@ __license__ = "MIT"
29
29
  __contributors__ = [
30
30
  "William Guilherme",
31
31
  ]
32
- __version__ = "0.3.0"
32
+ __version__ = "0.3.1"
33
33
 
34
34
  from zscaler.zia import ZIAClientHelper # noqa
35
35
  from zscaler.zpa import ZPAClientHelper # noqa
@@ -115,8 +115,8 @@ class ZscalerCache(Cache):
115
115
  """
116
116
  Clear the cache.
117
117
  """
118
+ logger.info("Clearing the entire cache.")
118
119
  self._store.clear()
119
- logger.info("Cleared the cache.")
120
120
 
121
121
  def _clean_cache(self):
122
122
  """
@@ -40,7 +40,6 @@ from zscaler.zpa.isolation import IsolationAPI
40
40
  from zscaler.zpa.lss import LSSConfigControllerAPI
41
41
  from zscaler.zpa.machine_groups import MachineGroupsAPI
42
42
  from zscaler.zpa.policies import PolicySetsAPI
43
- from zscaler.zpa.policiesv2 import PolicySetsV2API
44
43
  from zscaler.zpa.posture_profiles import PostureProfilesAPI
45
44
  from zscaler.zpa.privileged_remote_access import PrivilegedRemoteAccessAPI
46
45
  from zscaler.zpa.provisioning import ProvisioningKeyAPI
@@ -118,6 +117,7 @@ class ZPAClientHelper(ZPAClient):
118
117
  self.v2_lss_url = f"{self.baseurl}/mgmtconfig/v2/admin/lssConfig/customers/{customer_id}"
119
118
  self.cbi_url = f"{self.baseurl}/cbiconfig/cbi/api/customers/{customer_id}"
120
119
  self.fail_safe = fail_safe
120
+
121
121
  # Cache setup
122
122
  cache_enabled = os.environ.get("ZSCALER_CLIENT_CACHE_ENABLED", "true").lower() == "true"
123
123
  if cache is None:
@@ -133,25 +133,26 @@ class ZPAClientHelper(ZPAClient):
133
133
  # Initialize user-agent
134
134
  ua = UserAgent()
135
135
  self.user_agent = ua.get_user_agent_string()
136
+ self.access_token = None
137
+ self.headers = {}
136
138
  self.refreshToken()
137
139
 
138
140
  def refreshToken(self):
139
- # login
140
- response = self.login()
141
- if response is None or response.status_code > 299 or not response.json():
142
- logger.error("Failed to login using provided credentials, response: %s", response)
143
- raise Exception("Failed to login using provided credentials.")
144
- self.access_token = response.json().get("access_token")
145
- self.headers = {
146
- "Content-Type": "application/json",
147
- "Accept": "application/json",
148
- "Authorization": f"Bearer {self.access_token}",
149
- "User-Agent": self.user_agent,
150
- }
141
+ if not self.access_token or is_token_expired(self.access_token):
142
+ response = self.login()
143
+ if response is None or response.status_code > 299 or not response.json():
144
+ logger.error("Failed to login using provided credentials, response: %s", response)
145
+ raise Exception("Failed to login using provided credentials.")
146
+ self.access_token = response.json().get("access_token")
147
+ self.headers = {
148
+ "Content-Type": "application/json",
149
+ "Accept": "application/json",
150
+ "Authorization": f"Bearer {self.access_token}",
151
+ "User-Agent": self.user_agent,
152
+ }
151
153
 
152
154
  @retry_with_backoff(retries=5)
153
155
  def login(self):
154
- """Log in to the ZPA API and set the access token for subsequent requests."""
155
156
  params = {"client_id": self.client_id, "client_secret": self.client_secret}
156
157
  headers = {
157
158
  "Content-Type": "application/x-www-form-urlencoded",
@@ -164,7 +165,6 @@ class ZPAClientHelper(ZPAClient):
164
165
  url = DEV_AUTH_URL + "?grant_type=CLIENT_CREDENTIALS"
165
166
  data = urllib.parse.urlencode(params)
166
167
  resp = requests.post(url, data=data, headers=headers, timeout=self.timeout)
167
- # Avoid logging all data from the response, focus on the status and a summary instead
168
168
  logger.info("Login attempt with status: %d", resp.status_code)
169
169
  return resp
170
170
  except Exception as e:
@@ -172,16 +172,6 @@ class ZPAClientHelper(ZPAClient):
172
172
  return None
173
173
 
174
174
  def send(self, method, path, json=None, params=None, api_version: str = None):
175
- """
176
- Send a request to the ZPA API.
177
-
178
- Parameters:
179
- - method (str): The HTTP method.
180
- - path (str): API endpoint path.
181
- - json (dict, optional): Request payload. Defaults to None.
182
- Returns:
183
- - Response: Response object from the request.
184
- """
185
175
  api = self.url
186
176
  if api_version is None:
187
177
  api = self.url
@@ -196,13 +186,10 @@ class ZPAClientHelper(ZPAClient):
196
186
 
197
187
  url = f"{api}/{path.lstrip('/')}"
198
188
  start_time = time.time()
199
- # Update headers to include the user agent
200
189
  headers_with_user_agent = self.headers.copy()
201
190
  headers_with_user_agent["User-Agent"] = self.user_agent
202
- # Generate a unique UUID for this request
203
191
  request_uuid = uuid.uuid4()
204
192
  dump_request(logger, url, method, json, params, headers_with_user_agent, request_uuid)
205
- # Check cache before sending request
206
193
  cache_key = self.cache.create_key(url, params)
207
194
  if method == "GET" and self.cache.contains(cache_key):
208
195
  resp = self.cache.get(cache_key)
@@ -219,12 +206,13 @@ class ZPAClientHelper(ZPAClient):
219
206
  return resp
220
207
 
221
208
  attempts = 0
222
- while attempts < 5: # Trying a maximum of 5 times
209
+ while attempts < 5:
223
210
  try:
224
- # If the token is None or expired, fetch a new token
225
- if is_token_expired(self.access_token):
226
- logger.warning("The provided or fetched token was already expired. Refreshing...")
227
- self.refreshToken()
211
+ self.refreshToken()
212
+ should_wait, delay = self.rate_limiter.wait(method)
213
+ if should_wait:
214
+ logger.warning(f"Rate limit exceeded. Retrying in {delay} seconds.")
215
+ time.sleep(delay)
228
216
  resp = requests.request(
229
217
  method,
230
218
  url,
@@ -241,37 +229,39 @@ class ZPAClientHelper(ZPAClient):
241
229
  request_uuid=request_uuid,
242
230
  start_time=start_time,
243
231
  )
244
- if resp.status_code == 429: # HTTP Status code 429 indicates "Too Many Requests"
245
- sleep_time = int(
246
- resp.headers.get("Retry-After", 2)
247
- ) # Default to 60 seconds if 'Retry-After' header is missing
248
- logger.warning(f"Rate limit exceeded. Retrying in {sleep_time} seconds.")
249
- sleep(sleep_time)
232
+ if resp.status_code == 429:
233
+ retry_after = resp.headers.get("Retry-After")
234
+ if retry_after:
235
+ try:
236
+ sleep_time = int(retry_after)
237
+ except ValueError:
238
+ sleep_time = int(retry_after[:-1])
239
+ logger.warning(f"Rate limit exceeded. Retrying in {sleep_time} seconds.")
240
+ time.sleep(sleep_time)
241
+ else:
242
+ time.sleep(60)
250
243
  attempts += 1
251
244
  continue
252
245
  else:
253
246
  break
254
247
  except requests.RequestException as e:
255
- if attempts == 4: # If it's the last attempt, raise the exception
248
+ if attempts == 4:
256
249
  logger.error(f"Failed to send {method} request to {url} after 5 attempts. Error: {str(e)}")
257
250
  raise e
258
251
  else:
259
252
  logger.warning(f"Failed to send {method} request to {url}. Retrying... Error: {str(e)}")
260
253
  attempts += 1
261
- sleep(5) # Sleep for 5 seconds before retrying
254
+ time.sleep(5)
262
255
 
263
- # If Non-GET call, clear the
264
256
  if method != "GET":
265
- self.cache.delete(cache_key)
257
+ logger.info(f"Clearing cache for non-GET request: {method} {url}")
258
+ self.cache.clear()
266
259
 
267
- # Detailed logging for request and response
268
260
  try:
269
261
  response_data = resp.json()
270
- except ValueError: # Using ValueError for JSON decoding errors
262
+ except ValueError:
271
263
  response_data = resp.text
272
- # check if call was succesful
273
264
  if 200 > resp.status_code or resp.status_code > 299:
274
- # create errors
275
265
  try:
276
266
  error = ZscalerAPIError(url, resp, response_data)
277
267
  if self.fail_safe:
@@ -284,7 +274,6 @@ class ZPAClientHelper(ZPAClient):
284
274
  logger.error(response_data)
285
275
  raise HTTPException(response_data)
286
276
  logger.error(error)
287
- # Cache the response if it's a successful GET request
288
277
  if method == "GET" and resp.status_code == 200:
289
278
  self.cache.add(cache_key, resp)
290
279
  return resp
@@ -294,23 +283,34 @@ class ZPAClientHelper(ZPAClient):
294
283
  Send a GET request to the ZPA API.
295
284
 
296
285
  Parameters:
297
- - path (str): API endpoint path.
298
- - data (dict, optional): Request payload. Defaults to None.
286
+ path (str): API endpoint path.
287
+ json (dict, optional): Request payload. Defaults to None.
288
+ params (dict, optional): Query parameters. Defaults to None.
289
+ api_version (str, optional): API version to use. Defaults to None.
290
+
299
291
  Returns:
300
- - Response: Response object from the request.
292
+ dict: Formatted JSON response from the API.
301
293
  """
302
-
303
- # Use rate limiter before making a request
304
294
  should_wait, delay = self.rate_limiter.wait("GET")
305
295
  if should_wait:
306
296
  time.sleep(delay)
307
-
308
- # Now proceed with sending the request
309
297
  resp = self.send("GET", path, json, params, api_version=api_version)
310
298
  formatted_resp = format_json_response(resp, box_attrs=dict())
311
299
  return formatted_resp
312
300
 
313
301
  def put(self, path, json=None, params=None, api_version: str = None):
302
+ """
303
+ Send a PUT request to the ZPA API.
304
+
305
+ Parameters:
306
+ path (str): API endpoint path.
307
+ json (dict, optional): Request payload. Defaults to None.
308
+ params (dict, optional): Query parameters. Defaults to None.
309
+ api_version (str, optional): API version to use. Defaults to None.
310
+
311
+ Returns:
312
+ dict: Formatted JSON response from the API.
313
+ """
314
314
  should_wait, delay = self.rate_limiter.wait("PUT")
315
315
  if should_wait:
316
316
  time.sleep(delay)
@@ -319,6 +319,18 @@ class ZPAClientHelper(ZPAClient):
319
319
  return formatted_resp
320
320
 
321
321
  def post(self, path, json=None, params=None, api_version: str = None):
322
+ """
323
+ Send a POST request to the ZPA API.
324
+
325
+ Parameters:
326
+ path (str): API endpoint path.
327
+ json (dict, optional): Request payload. Defaults to None.
328
+ params (dict, optional): Query parameters. Defaults to None.
329
+ api_version (str, optional): API version to use. Defaults to None.
330
+
331
+ Returns:
332
+ dict: Formatted JSON response from the API.
333
+ """
322
334
  should_wait, delay = self.rate_limiter.wait("POST")
323
335
  if should_wait:
324
336
  time.sleep(delay)
@@ -327,6 +339,18 @@ class ZPAClientHelper(ZPAClient):
327
339
  return formatted_resp
328
340
 
329
341
  def delete(self, path, json=None, params=None, api_version: str = None):
342
+ """
343
+ Send a DELETE request to the ZPA API.
344
+
345
+ Parameters:
346
+ path (str): API endpoint path.
347
+ json (dict, optional): Request payload. Defaults to None.
348
+ params (dict, optional): Query parameters. Defaults to None.
349
+ api_version (str, optional): API version to use. Defaults to None.
350
+
351
+ Returns:
352
+ Response: Response object from the DELETE request.
353
+ """
330
354
  should_wait, delay = self.rate_limiter.wait("DELETE")
331
355
  if should_wait:
332
356
  time.sleep(delay)
@@ -575,14 +599,6 @@ class ZPAClientHelper(ZPAClient):
575
599
  """
576
600
  return PolicySetsAPI(self)
577
601
 
578
- @property
579
- def policiesv2(self):
580
- """
581
- The interface object for the :ref:`ZPA Policy Sets V2 interface <zpa-policiesv2>`.
582
-
583
- """
584
- return PolicySetsV2API(self)
585
-
586
602
  @property
587
603
  def posture_profiles(self):
588
604
  """
@@ -96,7 +96,8 @@ class ApplicationSegmentAPI:
96
96
  Retrieve all configured application segments of a specified type, optionally expanding all related data.
97
97
 
98
98
  Args:
99
- application_type (str): Type of application segment to retrieve. Must be one of "BROWSER_ACCESS", "INSPECT", "SECURE_REMOTE_ACCESS".
99
+ application_type (str): Type of application segment to retrieve.
100
+ Must be one of "BROWSER_ACCESS", "INSPECT", "SECURE_REMOTE_ACCESS".
100
101
  expand_all (bool, optional): Whether to expand all related data. Defaults to False.
101
102
 
102
103
  Keyword Args: