gcore 0.8.0__py3-none-any.whl → 0.10.0__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.

Potentially problematic release.


This version of gcore might be problematic. Click here for more details.

Files changed (164) hide show
  1. gcore/_base_client.py +4 -1
  2. gcore/_client.py +9 -0
  3. gcore/_files.py +4 -4
  4. gcore/_version.py +1 -1
  5. gcore/resources/__init__.py +14 -0
  6. gcore/resources/cloud/cost_reports.py +24 -0
  7. gcore/resources/cloud/load_balancers/pools/health_monitors.py +8 -4
  8. gcore/resources/cloud/load_balancers/pools/members.py +2 -2
  9. gcore/resources/cloud/quotas/requests.py +7 -15
  10. gcore/resources/fastedge/binaries.py +81 -1
  11. gcore/resources/security/__init__.py +75 -0
  12. gcore/resources/security/bgp_announces.py +308 -0
  13. gcore/resources/security/events.py +234 -0
  14. gcore/resources/security/profile_templates.py +143 -0
  15. gcore/resources/security/profiles.py +661 -0
  16. gcore/resources/security/security.py +198 -0
  17. gcore/resources/waap/__init__.py +14 -0
  18. gcore/resources/waap/custom_page_sets.py +40 -34
  19. gcore/resources/waap/domains/__init__.py +14 -28
  20. gcore/resources/waap/domains/advanced_rules.py +5 -8
  21. gcore/resources/waap/domains/{api_discovery/api_discovery.py → api_discovery.py} +292 -59
  22. gcore/resources/waap/domains/api_path_groups.py +5 -5
  23. gcore/resources/waap/domains/api_paths.py +15 -17
  24. gcore/resources/waap/domains/custom_rules.py +5 -8
  25. gcore/resources/waap/domains/domains.py +120 -64
  26. gcore/resources/waap/domains/firewall_rules.py +3 -5
  27. gcore/resources/waap/domains/insight_silences.py +28 -5
  28. gcore/resources/waap/domains/insights.py +36 -10
  29. gcore/resources/waap/domains/{analytics/analytics.py → statistics.py} +514 -213
  30. gcore/resources/waap/insights.py +233 -0
  31. gcore/resources/waap/ip_info/__init__.py +33 -0
  32. gcore/resources/waap/{ip_info.py → ip_info/ip_info.py} +149 -235
  33. gcore/resources/waap/ip_info/metrics.py +203 -0
  34. gcore/resources/waap/waap.py +40 -8
  35. gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +3 -0
  36. gcore/types/cloud/cost_report_get_aggregated_params.py +3 -0
  37. gcore/types/cloud/cost_report_get_detailed_params.py +3 -0
  38. gcore/types/cloud/gpu_baremetal_flavor.py +16 -0
  39. gcore/types/cloud/health_monitor.py +6 -0
  40. gcore/types/cloud/load_balancer_create_params.py +8 -3
  41. gcore/types/cloud/load_balancers/pool_create_params.py +8 -3
  42. gcore/types/cloud/load_balancers/pool_update_params.py +8 -3
  43. gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +7 -2
  44. gcore/types/cloud/load_balancers/pools/member_add_params.py +1 -1
  45. gcore/types/cloud/quotas/request_list_params.py +2 -2
  46. gcore/types/cloud/region.py +6 -6
  47. gcore/types/fastedge/__init__.py +1 -0
  48. gcore/types/fastedge/binary_create_params.py +11 -0
  49. gcore/types/security/__init__.py +18 -0
  50. gcore/types/security/bgp_announce_list_params.py +18 -0
  51. gcore/types/security/bgp_announce_list_response.py +10 -0
  52. gcore/types/security/bgp_announce_toggle_params.py +16 -0
  53. gcore/types/security/client_announce.py +15 -0
  54. gcore/types/security/client_profile.py +56 -0
  55. gcore/types/security/client_profile_template.py +43 -0
  56. gcore/types/security/client_view.py +29 -0
  57. gcore/types/security/event_list_params.py +38 -0
  58. gcore/types/security/profile_create_params.py +24 -0
  59. gcore/types/security/profile_list_params.py +17 -0
  60. gcore/types/security/profile_list_response.py +10 -0
  61. gcore/types/security/profile_recreate_params.py +24 -0
  62. gcore/types/security/profile_replace_params.py +24 -0
  63. gcore/types/security/profile_template_list_response.py +10 -0
  64. gcore/types/waap/__init__.py +6 -54
  65. gcore/types/waap/custom_page_set_create_params.py +121 -14
  66. gcore/types/waap/custom_page_set_preview_params.py +11 -4
  67. gcore/types/waap/custom_page_set_update_params.py +122 -15
  68. gcore/types/waap/domain_list_params.py +1 -3
  69. gcore/types/waap/domains/__init__.py +28 -18
  70. gcore/types/waap/domains/advanced_rule_list_params.py +1 -3
  71. gcore/types/waap/domains/{api_discovery/scan_result_list_params.py → api_discovery_list_scan_results_params.py} +2 -2
  72. gcore/types/waap/domains/{api_path_group_list_response.py → api_path_group_list.py} +2 -2
  73. gcore/types/waap/domains/custom_rule_list_params.py +1 -3
  74. gcore/types/waap/domains/insight_list_params.py +16 -6
  75. gcore/types/waap/domains/insight_replace_params.py +2 -4
  76. gcore/types/waap/domains/insight_silence_list_params.py +13 -4
  77. gcore/types/waap/domains/{analytics_list_ddos_attacks_params.py → statistic_get_ddos_attacks_params.py} +2 -2
  78. gcore/types/waap/domains/{analytics_list_ddos_info_params.py → statistic_get_ddos_info_params.py} +2 -2
  79. gcore/types/waap/domains/{analytics_get_event_statistics_params.py → statistic_get_events_aggregated_params.py} +2 -2
  80. gcore/types/waap/domains/{analytics/request_list_params.py → statistic_get_requests_series_params.py} +27 -5
  81. gcore/types/waap/domains/{analytics_list_event_traffic_params.py → statistic_get_traffic_series_params.py} +4 -5
  82. gcore/types/waap/domains/statistic_get_traffic_series_response.py +10 -0
  83. gcore/types/waap/{waap_advanced_rule.py → domains/waap_advanced_rule.py} +1 -1
  84. gcore/types/waap/domains/{api_discovery_get_settings_response.py → waap_api_discovery_settings.py} +2 -2
  85. gcore/types/waap/domains/{api_path_get_response.py → waap_api_path.py} +2 -2
  86. gcore/types/waap/domains/{api_discovery/scan_result_get_response.py → waap_api_scan_result.py} +3 -3
  87. gcore/types/waap/{waap_blocked_statistics.py → domains/waap_blocked_statistics.py} +1 -1
  88. gcore/types/waap/{waap_count_statistics.py → domains/waap_count_statistics.py} +1 -1
  89. gcore/types/waap/{waap_custom_rule.py → domains/waap_custom_rule.py} +1 -1
  90. gcore/types/waap/{waap_ddos_attack.py → domains/waap_ddos_attack.py} +1 -1
  91. gcore/types/waap/{waap_ddos_info.py → domains/waap_ddos_info.py} +1 -1
  92. gcore/types/waap/{waap_event_statistics.py → domains/waap_event_statistics.py} +1 -1
  93. gcore/types/waap/{waap_firewall_rule.py → domains/waap_firewall_rule.py} +1 -1
  94. gcore/types/waap/{waap_insight.py → domains/waap_insight.py} +3 -3
  95. gcore/types/waap/{waap_insight_silence.py → domains/waap_insight_silence.py} +1 -1
  96. gcore/types/waap/domains/waap_request_details.py +185 -0
  97. gcore/types/waap/{waap_request_summary.py → domains/waap_request_summary.py} +1 -1
  98. gcore/types/waap/domains/{api_discovery_scan_openapi_response.py → waap_task_id.py} +2 -2
  99. gcore/types/waap/{waap_traffic_metrics.py → domains/waap_traffic_metrics.py} +1 -1
  100. gcore/types/waap/insight_list_types_params.py +28 -0
  101. gcore/types/waap/ip_info/__init__.py +6 -0
  102. gcore/types/waap/{ip_info_get_counts_params.py → ip_info/metric_list_params.py} +2 -2
  103. gcore/types/waap/{waap_ip_info_counts.py → ip_info/waap_ip_info_counts.py} +1 -1
  104. gcore/types/waap/{ip_info_get_params.py → ip_info_get_ip_info_params.py} +2 -2
  105. gcore/types/waap/{waap_ip_info.py → ip_info_get_ip_info_response.py} +2 -2
  106. gcore/types/waap/ip_info_get_top_urls_response.py +12 -3
  107. gcore/types/waap/{ip_info_get_top_sessions_params.py → ip_info_get_top_user_sessions_params.py} +2 -2
  108. gcore/types/waap/{ip_info_get_top_sessions_response.py → ip_info_get_top_user_sessions_response.py} +2 -2
  109. gcore/types/waap/waap_custom_page_set.py +113 -13
  110. gcore/types/waap/waap_detailed_domain.py +2 -2
  111. gcore/types/waap/waap_insight_type.py +33 -0
  112. gcore/types/waap/waap_rule_set.py +26 -3
  113. gcore/types/waap/waap_summary_domain.py +2 -2
  114. {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/METADATA +1 -1
  115. {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/RECORD +117 -134
  116. gcore/resources/waap/domains/analytics/__init__.py +0 -33
  117. gcore/resources/waap/domains/analytics/requests.py +0 -378
  118. gcore/resources/waap/domains/api_discovery/__init__.py +0 -33
  119. gcore/resources/waap/domains/api_discovery/scan_results.py +0 -352
  120. gcore/resources/waap/domains/policies.py +0 -173
  121. gcore/types/waap/domains/analytics/__init__.py +0 -5
  122. gcore/types/waap/domains/analytics_list_event_traffic_response.py +0 -10
  123. gcore/types/waap/domains/api_discovery/__init__.py +0 -7
  124. gcore/types/waap/domains/api_discovery/scan_result_list_response.py +0 -29
  125. gcore/types/waap/domains/api_discovery_update_settings_response.py +0 -36
  126. gcore/types/waap/domains/api_discovery_upload_openapi_response.py +0 -10
  127. gcore/types/waap/domains/api_path_create_response.py +0 -50
  128. gcore/types/waap/domains/api_path_list_response.py +0 -50
  129. gcore/types/waap/waap_block_csrf_page_data.py +0 -28
  130. gcore/types/waap/waap_block_csrf_page_data_param.py +0 -28
  131. gcore/types/waap/waap_block_page_data.py +0 -28
  132. gcore/types/waap/waap_block_page_data_param.py +0 -28
  133. gcore/types/waap/waap_captcha_page_data.py +0 -31
  134. gcore/types/waap/waap_captcha_page_data_param.py +0 -31
  135. gcore/types/waap/waap_common_tag.py +0 -16
  136. gcore/types/waap/waap_cookie_disabled_page_data.py +0 -18
  137. gcore/types/waap/waap_cookie_disabled_page_data_param.py +0 -18
  138. gcore/types/waap/waap_customer_rule_state.py +0 -7
  139. gcore/types/waap/waap_domain_policy.py +0 -29
  140. gcore/types/waap/waap_domain_status.py +0 -7
  141. gcore/types/waap/waap_handshake_page_data.py +0 -25
  142. gcore/types/waap/waap_handshake_page_data_param.py +0 -25
  143. gcore/types/waap/waap_insight_silence_sort_by.py +0 -9
  144. gcore/types/waap/waap_insight_sort_by.py +0 -20
  145. gcore/types/waap/waap_insight_status.py +0 -7
  146. gcore/types/waap/waap_javascript_disabled_page_data.py +0 -18
  147. gcore/types/waap/waap_javascript_disabled_page_data_param.py +0 -18
  148. gcore/types/waap/waap_network_details.py +0 -17
  149. gcore/types/waap/waap_page_type.py +0 -9
  150. gcore/types/waap/waap_paginated_custom_page_set.py +0 -22
  151. gcore/types/waap/waap_paginated_ddos_attack.py +0 -22
  152. gcore/types/waap/waap_paginated_ddos_info.py +0 -22
  153. gcore/types/waap/waap_paginated_request_summary.py +0 -22
  154. gcore/types/waap/waap_pattern_matched_tag.py +0 -37
  155. gcore/types/waap/waap_policy_action.py +0 -7
  156. gcore/types/waap/waap_request_details.py +0 -92
  157. gcore/types/waap/waap_request_organization.py +0 -13
  158. gcore/types/waap/waap_resolution.py +0 -7
  159. gcore/types/waap/waap_rule_action_type.py +0 -7
  160. gcore/types/waap/waap_top_url.py +0 -13
  161. gcore/types/waap/waap_traffic_type.py +0 -28
  162. gcore/types/waap/waap_user_agent_details.py +0 -40
  163. {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/WHEEL +0 -0
  164. {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/licenses/LICENSE +0 -0
@@ -20,9 +20,7 @@ from ...._response import (
20
20
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
21
21
  from ...._base_client import AsyncPaginator, make_request_options
22
22
  from ....types.waap.domains import api_path_list_params, api_path_create_params, api_path_update_params
23
- from ....types.waap.domains.api_path_get_response import APIPathGetResponse
24
- from ....types.waap.domains.api_path_list_response import APIPathListResponse
25
- from ....types.waap.domains.api_path_create_response import APIPathCreateResponse
23
+ from ....types.waap.domains.waap_api_path import WaapAPIPath
26
24
 
27
25
  __all__ = ["APIPathsResource", "AsyncAPIPathsResource"]
28
26
 
@@ -63,7 +61,7 @@ class APIPathsResource(SyncAPIResource):
63
61
  extra_query: Query | None = None,
64
62
  extra_body: Body | None = None,
65
63
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
66
- ) -> APIPathCreateResponse:
64
+ ) -> WaapAPIPath:
67
65
  """
68
66
  Create an API path for a domain
69
67
 
@@ -107,7 +105,7 @@ class APIPathsResource(SyncAPIResource):
107
105
  options=make_request_options(
108
106
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
109
107
  ),
110
- cast_to=APIPathCreateResponse,
108
+ cast_to=WaapAPIPath,
111
109
  )
112
110
 
113
111
  def update(
@@ -214,7 +212,7 @@ class APIPathsResource(SyncAPIResource):
214
212
  extra_query: Query | None = None,
215
213
  extra_body: Body | None = None,
216
214
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
217
- ) -> SyncOffsetPage[APIPathListResponse]:
215
+ ) -> SyncOffsetPage[WaapAPIPath]:
218
216
  """
219
217
  Retrieve a list of API paths for a specific domain
220
218
 
@@ -253,7 +251,7 @@ class APIPathsResource(SyncAPIResource):
253
251
  """
254
252
  return self._get_api_list(
255
253
  f"/waap/v1/domains/{domain_id}/api-paths",
256
- page=SyncOffsetPage[APIPathListResponse],
254
+ page=SyncOffsetPage[WaapAPIPath],
257
255
  options=make_request_options(
258
256
  extra_headers=extra_headers,
259
257
  extra_query=extra_query,
@@ -276,7 +274,7 @@ class APIPathsResource(SyncAPIResource):
276
274
  api_path_list_params.APIPathListParams,
277
275
  ),
278
276
  ),
279
- model=APIPathListResponse,
277
+ model=WaapAPIPath,
280
278
  )
281
279
 
282
280
  def delete(
@@ -329,7 +327,7 @@ class APIPathsResource(SyncAPIResource):
329
327
  extra_query: Query | None = None,
330
328
  extra_body: Body | None = None,
331
329
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
332
- ) -> APIPathGetResponse:
330
+ ) -> WaapAPIPath:
333
331
  """
334
332
  Retrieve a specific API path for a domain
335
333
 
@@ -353,7 +351,7 @@ class APIPathsResource(SyncAPIResource):
353
351
  options=make_request_options(
354
352
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
355
353
  ),
356
- cast_to=APIPathGetResponse,
354
+ cast_to=WaapAPIPath,
357
355
  )
358
356
 
359
357
 
@@ -393,7 +391,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
393
391
  extra_query: Query | None = None,
394
392
  extra_body: Body | None = None,
395
393
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
396
- ) -> APIPathCreateResponse:
394
+ ) -> WaapAPIPath:
397
395
  """
398
396
  Create an API path for a domain
399
397
 
@@ -437,7 +435,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
437
435
  options=make_request_options(
438
436
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
439
437
  ),
440
- cast_to=APIPathCreateResponse,
438
+ cast_to=WaapAPIPath,
441
439
  )
442
440
 
443
441
  async def update(
@@ -544,7 +542,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
544
542
  extra_query: Query | None = None,
545
543
  extra_body: Body | None = None,
546
544
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
547
- ) -> AsyncPaginator[APIPathListResponse, AsyncOffsetPage[APIPathListResponse]]:
545
+ ) -> AsyncPaginator[WaapAPIPath, AsyncOffsetPage[WaapAPIPath]]:
548
546
  """
549
547
  Retrieve a list of API paths for a specific domain
550
548
 
@@ -583,7 +581,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
583
581
  """
584
582
  return self._get_api_list(
585
583
  f"/waap/v1/domains/{domain_id}/api-paths",
586
- page=AsyncOffsetPage[APIPathListResponse],
584
+ page=AsyncOffsetPage[WaapAPIPath],
587
585
  options=make_request_options(
588
586
  extra_headers=extra_headers,
589
587
  extra_query=extra_query,
@@ -606,7 +604,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
606
604
  api_path_list_params.APIPathListParams,
607
605
  ),
608
606
  ),
609
- model=APIPathListResponse,
607
+ model=WaapAPIPath,
610
608
  )
611
609
 
612
610
  async def delete(
@@ -659,7 +657,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
659
657
  extra_query: Query | None = None,
660
658
  extra_body: Body | None = None,
661
659
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
662
- ) -> APIPathGetResponse:
660
+ ) -> WaapAPIPath:
663
661
  """
664
662
  Retrieve a specific API path for a domain
665
663
 
@@ -683,7 +681,7 @@ class AsyncAPIPathsResource(AsyncAPIResource):
683
681
  options=make_request_options(
684
682
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
685
683
  ),
686
- cast_to=APIPathGetResponse,
684
+ cast_to=WaapAPIPath,
687
685
  )
688
686
 
689
687
 
@@ -18,7 +18,6 @@ from ...._response import (
18
18
  async_to_streamed_response_wrapper,
19
19
  )
20
20
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
21
- from ....types.waap import WaapRuleActionType, WaapCustomerRuleState
22
21
  from ...._base_client import AsyncPaginator, make_request_options
23
22
  from ....types.waap.domains import (
24
23
  custom_rule_list_params,
@@ -26,9 +25,7 @@ from ....types.waap.domains import (
26
25
  custom_rule_update_params,
27
26
  custom_rule_delete_multiple_params,
28
27
  )
29
- from ....types.waap.waap_custom_rule import WaapCustomRule
30
- from ....types.waap.waap_rule_action_type import WaapRuleActionType
31
- from ....types.waap.waap_customer_rule_state import WaapCustomerRuleState
28
+ from ....types.waap.domains.waap_custom_rule import WaapCustomRule
32
29
 
33
30
  __all__ = ["CustomRulesResource", "AsyncCustomRulesResource"]
34
31
 
@@ -179,7 +176,7 @@ class CustomRulesResource(SyncAPIResource):
179
176
  self,
180
177
  domain_id: int,
181
178
  *,
182
- action: WaapRuleActionType | NotGiven = NOT_GIVEN,
179
+ action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] | NotGiven = NOT_GIVEN,
183
180
  description: str | NotGiven = NOT_GIVEN,
184
181
  enabled: bool | NotGiven = NOT_GIVEN,
185
182
  limit: int | NotGiven = NOT_GIVEN,
@@ -366,7 +363,7 @@ class CustomRulesResource(SyncAPIResource):
366
363
 
367
364
  def toggle(
368
365
  self,
369
- action: WaapCustomerRuleState,
366
+ action: Literal["enable", "disable"],
370
367
  *,
371
368
  domain_id: int,
372
369
  rule_id: int,
@@ -553,7 +550,7 @@ class AsyncCustomRulesResource(AsyncAPIResource):
553
550
  self,
554
551
  domain_id: int,
555
552
  *,
556
- action: WaapRuleActionType | NotGiven = NOT_GIVEN,
553
+ action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] | NotGiven = NOT_GIVEN,
557
554
  description: str | NotGiven = NOT_GIVEN,
558
555
  enabled: bool | NotGiven = NOT_GIVEN,
559
556
  limit: int | NotGiven = NOT_GIVEN,
@@ -740,7 +737,7 @@ class AsyncCustomRulesResource(AsyncAPIResource):
740
737
 
741
738
  async def toggle(
742
739
  self,
743
- action: WaapCustomerRuleState,
740
+ action: Literal["enable", "disable"],
744
741
  *,
745
742
  domain_id: int,
746
743
  rule_id: int,
@@ -15,14 +15,6 @@ from .insights import (
15
15
  InsightsResourceWithStreamingResponse,
16
16
  AsyncInsightsResourceWithStreamingResponse,
17
17
  )
18
- from .policies import (
19
- PoliciesResource,
20
- AsyncPoliciesResource,
21
- PoliciesResourceWithRawResponse,
22
- AsyncPoliciesResourceWithRawResponse,
23
- PoliciesResourceWithStreamingResponse,
24
- AsyncPoliciesResourceWithStreamingResponse,
25
- )
26
18
  from .settings import (
27
19
  SettingsResource,
28
20
  AsyncSettingsResource,
@@ -42,6 +34,14 @@ from .api_paths import (
42
34
  AsyncAPIPathsResourceWithStreamingResponse,
43
35
  )
44
36
  from ...._compat import cached_property
37
+ from .statistics import (
38
+ StatisticsResource,
39
+ AsyncStatisticsResource,
40
+ StatisticsResourceWithRawResponse,
41
+ AsyncStatisticsResourceWithRawResponse,
42
+ StatisticsResourceWithStreamingResponse,
43
+ AsyncStatisticsResourceWithStreamingResponse,
44
+ )
45
45
  from ...._resource import SyncAPIResource, AsyncAPIResource
46
46
  from ...._response import (
47
47
  to_raw_response_wrapper,
@@ -58,7 +58,15 @@ from .custom_rules import (
58
58
  AsyncCustomRulesResourceWithStreamingResponse,
59
59
  )
60
60
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
61
- from ....types.waap import WaapDomainStatus, domain_list_params, domain_update_params
61
+ from ....types.waap import domain_list_params, domain_update_params
62
+ from .api_discovery import (
63
+ APIDiscoveryResource,
64
+ AsyncAPIDiscoveryResource,
65
+ APIDiscoveryResourceWithRawResponse,
66
+ AsyncAPIDiscoveryResourceWithRawResponse,
67
+ APIDiscoveryResourceWithStreamingResponse,
68
+ AsyncAPIDiscoveryResourceWithStreamingResponse,
69
+ )
62
70
  from .advanced_rules import (
63
71
  AdvancedRulesResource,
64
72
  AsyncAdvancedRulesResource,
@@ -92,23 +100,7 @@ from .insight_silences import (
92
100
  InsightSilencesResourceWithStreamingResponse,
93
101
  AsyncInsightSilencesResourceWithStreamingResponse,
94
102
  )
95
- from .analytics.analytics import (
96
- AnalyticsResource,
97
- AsyncAnalyticsResource,
98
- AnalyticsResourceWithRawResponse,
99
- AsyncAnalyticsResourceWithRawResponse,
100
- AnalyticsResourceWithStreamingResponse,
101
- AsyncAnalyticsResourceWithStreamingResponse,
102
- )
103
- from .api_discovery.api_discovery import (
104
- APIDiscoveryResource,
105
- AsyncAPIDiscoveryResource,
106
- APIDiscoveryResourceWithRawResponse,
107
- AsyncAPIDiscoveryResourceWithRawResponse,
108
- APIDiscoveryResourceWithStreamingResponse,
109
- AsyncAPIDiscoveryResourceWithStreamingResponse,
110
- )
111
- from ....types.waap.waap_domain_status import WaapDomainStatus
103
+ from ....types.waap.waap_policy_mode import WaapPolicyMode
112
104
  from ....types.waap.waap_summary_domain import WaapSummaryDomain
113
105
  from ....types.waap.waap_detailed_domain import WaapDetailedDomain
114
106
  from ....types.waap.domain_list_rule_sets_response import DomainListRuleSetsResponse
@@ -142,12 +134,8 @@ class DomainsResource(SyncAPIResource):
142
134
  return InsightSilencesResource(self._client)
143
135
 
144
136
  @cached_property
145
- def policies(self) -> PoliciesResource:
146
- return PoliciesResource(self._client)
147
-
148
- @cached_property
149
- def analytics(self) -> AnalyticsResource:
150
- return AnalyticsResource(self._client)
137
+ def statistics(self) -> StatisticsResource:
138
+ return StatisticsResource(self._client)
151
139
 
152
140
  @cached_property
153
141
  def custom_rules(self) -> CustomRulesResource:
@@ -227,7 +215,7 @@ class DomainsResource(SyncAPIResource):
227
215
  offset: int | NotGiven = NOT_GIVEN,
228
216
  ordering: Literal["id", "name", "status", "created_at", "-id", "-name", "-status", "-created_at"]
229
217
  | NotGiven = NOT_GIVEN,
230
- status: WaapDomainStatus | NotGiven = NOT_GIVEN,
218
+ status: Literal["active", "bypass", "monitor", "locked"] | NotGiven = NOT_GIVEN,
231
219
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
232
220
  # The extra values given here take precedence over values defined on the client or passed to this method.
233
221
  extra_headers: Headers | None = None,
@@ -384,6 +372,44 @@ class DomainsResource(SyncAPIResource):
384
372
  cast_to=DomainListRuleSetsResponse,
385
373
  )
386
374
 
375
+ def toggle_policy(
376
+ self,
377
+ policy_id: str,
378
+ *,
379
+ domain_id: int,
380
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
381
+ # The extra values given here take precedence over values defined on the client or passed to this method.
382
+ extra_headers: Headers | None = None,
383
+ extra_query: Query | None = None,
384
+ extra_body: Body | None = None,
385
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
386
+ ) -> WaapPolicyMode:
387
+ """
388
+ Modify the activation state of a policy associated with a domain
389
+
390
+ Args:
391
+ domain_id: The domain ID
392
+
393
+ policy_id: The ID of the policy to toggle
394
+
395
+ extra_headers: Send extra headers
396
+
397
+ extra_query: Add additional query parameters to the request
398
+
399
+ extra_body: Add additional JSON properties to the request
400
+
401
+ timeout: Override the client-level default timeout for this request, in seconds
402
+ """
403
+ if not policy_id:
404
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
405
+ return self._patch(
406
+ f"/waap/v1/domains/{domain_id}/policies/{policy_id}/toggle",
407
+ options=make_request_options(
408
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
409
+ ),
410
+ cast_to=WaapPolicyMode,
411
+ )
412
+
387
413
 
388
414
  class AsyncDomainsResource(AsyncAPIResource):
389
415
  @cached_property
@@ -411,12 +437,8 @@ class AsyncDomainsResource(AsyncAPIResource):
411
437
  return AsyncInsightSilencesResource(self._client)
412
438
 
413
439
  @cached_property
414
- def policies(self) -> AsyncPoliciesResource:
415
- return AsyncPoliciesResource(self._client)
416
-
417
- @cached_property
418
- def analytics(self) -> AsyncAnalyticsResource:
419
- return AsyncAnalyticsResource(self._client)
440
+ def statistics(self) -> AsyncStatisticsResource:
441
+ return AsyncStatisticsResource(self._client)
420
442
 
421
443
  @cached_property
422
444
  def custom_rules(self) -> AsyncCustomRulesResource:
@@ -496,7 +518,7 @@ class AsyncDomainsResource(AsyncAPIResource):
496
518
  offset: int | NotGiven = NOT_GIVEN,
497
519
  ordering: Literal["id", "name", "status", "created_at", "-id", "-name", "-status", "-created_at"]
498
520
  | NotGiven = NOT_GIVEN,
499
- status: WaapDomainStatus | NotGiven = NOT_GIVEN,
521
+ status: Literal["active", "bypass", "monitor", "locked"] | NotGiven = NOT_GIVEN,
500
522
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
501
523
  # The extra values given here take precedence over values defined on the client or passed to this method.
502
524
  extra_headers: Headers | None = None,
@@ -653,6 +675,44 @@ class AsyncDomainsResource(AsyncAPIResource):
653
675
  cast_to=DomainListRuleSetsResponse,
654
676
  )
655
677
 
678
+ async def toggle_policy(
679
+ self,
680
+ policy_id: str,
681
+ *,
682
+ domain_id: int,
683
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
684
+ # The extra values given here take precedence over values defined on the client or passed to this method.
685
+ extra_headers: Headers | None = None,
686
+ extra_query: Query | None = None,
687
+ extra_body: Body | None = None,
688
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
689
+ ) -> WaapPolicyMode:
690
+ """
691
+ Modify the activation state of a policy associated with a domain
692
+
693
+ Args:
694
+ domain_id: The domain ID
695
+
696
+ policy_id: The ID of the policy to toggle
697
+
698
+ extra_headers: Send extra headers
699
+
700
+ extra_query: Add additional query parameters to the request
701
+
702
+ extra_body: Add additional JSON properties to the request
703
+
704
+ timeout: Override the client-level default timeout for this request, in seconds
705
+ """
706
+ if not policy_id:
707
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
708
+ return await self._patch(
709
+ f"/waap/v1/domains/{domain_id}/policies/{policy_id}/toggle",
710
+ options=make_request_options(
711
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
712
+ ),
713
+ cast_to=WaapPolicyMode,
714
+ )
715
+
656
716
 
657
717
  class DomainsResourceWithRawResponse:
658
718
  def __init__(self, domains: DomainsResource) -> None:
@@ -673,6 +733,9 @@ class DomainsResourceWithRawResponse:
673
733
  self.list_rule_sets = to_raw_response_wrapper(
674
734
  domains.list_rule_sets,
675
735
  )
736
+ self.toggle_policy = to_raw_response_wrapper(
737
+ domains.toggle_policy,
738
+ )
676
739
 
677
740
  @cached_property
678
741
  def settings(self) -> SettingsResourceWithRawResponse:
@@ -699,12 +762,8 @@ class DomainsResourceWithRawResponse:
699
762
  return InsightSilencesResourceWithRawResponse(self._domains.insight_silences)
700
763
 
701
764
  @cached_property
702
- def policies(self) -> PoliciesResourceWithRawResponse:
703
- return PoliciesResourceWithRawResponse(self._domains.policies)
704
-
705
- @cached_property
706
- def analytics(self) -> AnalyticsResourceWithRawResponse:
707
- return AnalyticsResourceWithRawResponse(self._domains.analytics)
765
+ def statistics(self) -> StatisticsResourceWithRawResponse:
766
+ return StatisticsResourceWithRawResponse(self._domains.statistics)
708
767
 
709
768
  @cached_property
710
769
  def custom_rules(self) -> CustomRulesResourceWithRawResponse:
@@ -738,6 +797,9 @@ class AsyncDomainsResourceWithRawResponse:
738
797
  self.list_rule_sets = async_to_raw_response_wrapper(
739
798
  domains.list_rule_sets,
740
799
  )
800
+ self.toggle_policy = async_to_raw_response_wrapper(
801
+ domains.toggle_policy,
802
+ )
741
803
 
742
804
  @cached_property
743
805
  def settings(self) -> AsyncSettingsResourceWithRawResponse:
@@ -764,12 +826,8 @@ class AsyncDomainsResourceWithRawResponse:
764
826
  return AsyncInsightSilencesResourceWithRawResponse(self._domains.insight_silences)
765
827
 
766
828
  @cached_property
767
- def policies(self) -> AsyncPoliciesResourceWithRawResponse:
768
- return AsyncPoliciesResourceWithRawResponse(self._domains.policies)
769
-
770
- @cached_property
771
- def analytics(self) -> AsyncAnalyticsResourceWithRawResponse:
772
- return AsyncAnalyticsResourceWithRawResponse(self._domains.analytics)
829
+ def statistics(self) -> AsyncStatisticsResourceWithRawResponse:
830
+ return AsyncStatisticsResourceWithRawResponse(self._domains.statistics)
773
831
 
774
832
  @cached_property
775
833
  def custom_rules(self) -> AsyncCustomRulesResourceWithRawResponse:
@@ -803,6 +861,9 @@ class DomainsResourceWithStreamingResponse:
803
861
  self.list_rule_sets = to_streamed_response_wrapper(
804
862
  domains.list_rule_sets,
805
863
  )
864
+ self.toggle_policy = to_streamed_response_wrapper(
865
+ domains.toggle_policy,
866
+ )
806
867
 
807
868
  @cached_property
808
869
  def settings(self) -> SettingsResourceWithStreamingResponse:
@@ -829,12 +890,8 @@ class DomainsResourceWithStreamingResponse:
829
890
  return InsightSilencesResourceWithStreamingResponse(self._domains.insight_silences)
830
891
 
831
892
  @cached_property
832
- def policies(self) -> PoliciesResourceWithStreamingResponse:
833
- return PoliciesResourceWithStreamingResponse(self._domains.policies)
834
-
835
- @cached_property
836
- def analytics(self) -> AnalyticsResourceWithStreamingResponse:
837
- return AnalyticsResourceWithStreamingResponse(self._domains.analytics)
893
+ def statistics(self) -> StatisticsResourceWithStreamingResponse:
894
+ return StatisticsResourceWithStreamingResponse(self._domains.statistics)
838
895
 
839
896
  @cached_property
840
897
  def custom_rules(self) -> CustomRulesResourceWithStreamingResponse:
@@ -868,6 +925,9 @@ class AsyncDomainsResourceWithStreamingResponse:
868
925
  self.list_rule_sets = async_to_streamed_response_wrapper(
869
926
  domains.list_rule_sets,
870
927
  )
928
+ self.toggle_policy = async_to_streamed_response_wrapper(
929
+ domains.toggle_policy,
930
+ )
871
931
 
872
932
  @cached_property
873
933
  def settings(self) -> AsyncSettingsResourceWithStreamingResponse:
@@ -894,12 +954,8 @@ class AsyncDomainsResourceWithStreamingResponse:
894
954
  return AsyncInsightSilencesResourceWithStreamingResponse(self._domains.insight_silences)
895
955
 
896
956
  @cached_property
897
- def policies(self) -> AsyncPoliciesResourceWithStreamingResponse:
898
- return AsyncPoliciesResourceWithStreamingResponse(self._domains.policies)
899
-
900
- @cached_property
901
- def analytics(self) -> AsyncAnalyticsResourceWithStreamingResponse:
902
- return AsyncAnalyticsResourceWithStreamingResponse(self._domains.analytics)
957
+ def statistics(self) -> AsyncStatisticsResourceWithStreamingResponse:
958
+ return AsyncStatisticsResourceWithStreamingResponse(self._domains.statistics)
903
959
 
904
960
  @cached_property
905
961
  def custom_rules(self) -> AsyncCustomRulesResourceWithStreamingResponse:
@@ -18,7 +18,6 @@ from ...._response import (
18
18
  async_to_streamed_response_wrapper,
19
19
  )
20
20
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
21
- from ....types.waap import WaapCustomerRuleState
22
21
  from ...._base_client import AsyncPaginator, make_request_options
23
22
  from ....types.waap.domains import (
24
23
  firewall_rule_list_params,
@@ -26,8 +25,7 @@ from ....types.waap.domains import (
26
25
  firewall_rule_update_params,
27
26
  firewall_rule_delete_multiple_params,
28
27
  )
29
- from ....types.waap.waap_firewall_rule import WaapFirewallRule
30
- from ....types.waap.waap_customer_rule_state import WaapCustomerRuleState
28
+ from ....types.waap.domains.waap_firewall_rule import WaapFirewallRule
31
29
 
32
30
  __all__ = ["FirewallRulesResource", "AsyncFirewallRulesResource"]
33
31
 
@@ -363,7 +361,7 @@ class FirewallRulesResource(SyncAPIResource):
363
361
 
364
362
  def toggle(
365
363
  self,
366
- action: WaapCustomerRuleState,
364
+ action: Literal["enable", "disable"],
367
365
  *,
368
366
  domain_id: int,
369
367
  rule_id: int,
@@ -735,7 +733,7 @@ class AsyncFirewallRulesResource(AsyncAPIResource):
735
733
 
736
734
  async def toggle(
737
735
  self,
738
- action: WaapCustomerRuleState,
736
+ action: Literal["enable", "disable"],
739
737
  *,
740
738
  domain_id: int,
741
739
  rule_id: int,
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from typing import Dict, List, Union, Optional
6
6
  from datetime import datetime
7
+ from typing_extensions import Literal
7
8
 
8
9
  import httpx
9
10
 
@@ -18,15 +19,13 @@ from ...._response import (
18
19
  async_to_streamed_response_wrapper,
19
20
  )
20
21
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
21
- from ....types.waap import WaapInsightSilenceSortBy
22
22
  from ...._base_client import AsyncPaginator, make_request_options
23
23
  from ....types.waap.domains import (
24
24
  insight_silence_list_params,
25
25
  insight_silence_create_params,
26
26
  insight_silence_update_params,
27
27
  )
28
- from ....types.waap.waap_insight_silence import WaapInsightSilence
29
- from ....types.waap.waap_insight_silence_sort_by import WaapInsightSilenceSortBy
28
+ from ....types.waap.domains.waap_insight_silence import WaapInsightSilence
30
29
 
31
30
  __all__ = ["InsightSilencesResource", "AsyncInsightSilencesResource"]
32
31
 
@@ -180,7 +179,19 @@ class InsightSilencesResource(SyncAPIResource):
180
179
  insight_type: Optional[List[str]] | NotGiven = NOT_GIVEN,
181
180
  limit: int | NotGiven = NOT_GIVEN,
182
181
  offset: int | NotGiven = NOT_GIVEN,
183
- ordering: WaapInsightSilenceSortBy | NotGiven = NOT_GIVEN,
182
+ ordering: Literal[
183
+ "id",
184
+ "-id",
185
+ "insight_type",
186
+ "-insight_type",
187
+ "comment",
188
+ "-comment",
189
+ "author",
190
+ "-author",
191
+ "expire_at",
192
+ "-expire_at",
193
+ ]
194
+ | NotGiven = NOT_GIVEN,
184
195
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
185
196
  # The extra values given here take precedence over values defined on the client or passed to this method.
186
197
  extra_headers: Headers | None = None,
@@ -467,7 +478,19 @@ class AsyncInsightSilencesResource(AsyncAPIResource):
467
478
  insight_type: Optional[List[str]] | NotGiven = NOT_GIVEN,
468
479
  limit: int | NotGiven = NOT_GIVEN,
469
480
  offset: int | NotGiven = NOT_GIVEN,
470
- ordering: WaapInsightSilenceSortBy | NotGiven = NOT_GIVEN,
481
+ ordering: Literal[
482
+ "id",
483
+ "-id",
484
+ "insight_type",
485
+ "-insight_type",
486
+ "comment",
487
+ "-comment",
488
+ "author",
489
+ "-author",
490
+ "expire_at",
491
+ "-expire_at",
492
+ ]
493
+ | NotGiven = NOT_GIVEN,
471
494
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
472
495
  # The extra values given here take precedence over values defined on the client or passed to this method.
473
496
  extra_headers: Headers | None = None,
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import List, Optional
6
+ from typing_extensions import Literal
6
7
 
7
8
  import httpx
8
9
 
@@ -17,12 +18,9 @@ from ...._response import (
17
18
  async_to_streamed_response_wrapper,
18
19
  )
19
20
  from ....pagination import SyncOffsetPage, AsyncOffsetPage
20
- from ....types.waap import WaapInsightSortBy, WaapInsightStatus
21
21
  from ...._base_client import AsyncPaginator, make_request_options
22
22
  from ....types.waap.domains import insight_list_params, insight_replace_params
23
- from ....types.waap.waap_insight import WaapInsight
24
- from ....types.waap.waap_insight_status import WaapInsightStatus
25
- from ....types.waap.waap_insight_sort_by import WaapInsightSortBy
23
+ from ....types.waap.domains.waap_insight import WaapInsight
26
24
 
27
25
  __all__ = ["InsightsResource", "AsyncInsightsResource"]
28
26
 
@@ -56,8 +54,22 @@ class InsightsResource(SyncAPIResource):
56
54
  insight_type: Optional[List[str]] | NotGiven = NOT_GIVEN,
57
55
  limit: int | NotGiven = NOT_GIVEN,
58
56
  offset: int | NotGiven = NOT_GIVEN,
59
- ordering: WaapInsightSortBy | NotGiven = NOT_GIVEN,
60
- status: Optional[List[WaapInsightStatus]] | NotGiven = NOT_GIVEN,
57
+ ordering: Literal[
58
+ "id",
59
+ "-id",
60
+ "insight_type",
61
+ "-insight_type",
62
+ "first_seen",
63
+ "-first_seen",
64
+ "last_seen",
65
+ "-last_seen",
66
+ "last_status_change",
67
+ "-last_status_change",
68
+ "status",
69
+ "-status",
70
+ ]
71
+ | NotGiven = NOT_GIVEN,
72
+ status: Optional[List[Literal["OPEN", "ACKED", "CLOSED"]]] | NotGiven = NOT_GIVEN,
61
73
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
74
  # The extra values given here take precedence over values defined on the client or passed to this method.
63
75
  extra_headers: Headers | None = None,
@@ -158,7 +170,7 @@ class InsightsResource(SyncAPIResource):
158
170
  insight_id: str,
159
171
  *,
160
172
  domain_id: int,
161
- status: WaapInsightStatus,
173
+ status: Literal["OPEN", "ACKED", "CLOSED"],
162
174
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163
175
  # The extra values given here take precedence over values defined on the client or passed to this method.
164
176
  extra_headers: Headers | None = None,
@@ -225,8 +237,22 @@ class AsyncInsightsResource(AsyncAPIResource):
225
237
  insight_type: Optional[List[str]] | NotGiven = NOT_GIVEN,
226
238
  limit: int | NotGiven = NOT_GIVEN,
227
239
  offset: int | NotGiven = NOT_GIVEN,
228
- ordering: WaapInsightSortBy | NotGiven = NOT_GIVEN,
229
- status: Optional[List[WaapInsightStatus]] | NotGiven = NOT_GIVEN,
240
+ ordering: Literal[
241
+ "id",
242
+ "-id",
243
+ "insight_type",
244
+ "-insight_type",
245
+ "first_seen",
246
+ "-first_seen",
247
+ "last_seen",
248
+ "-last_seen",
249
+ "last_status_change",
250
+ "-last_status_change",
251
+ "status",
252
+ "-status",
253
+ ]
254
+ | NotGiven = NOT_GIVEN,
255
+ status: Optional[List[Literal["OPEN", "ACKED", "CLOSED"]]] | NotGiven = NOT_GIVEN,
230
256
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
231
257
  # The extra values given here take precedence over values defined on the client or passed to this method.
232
258
  extra_headers: Headers | None = None,
@@ -327,7 +353,7 @@ class AsyncInsightsResource(AsyncAPIResource):
327
353
  insight_id: str,
328
354
  *,
329
355
  domain_id: int,
330
- status: WaapInsightStatus,
356
+ status: Literal["OPEN", "ACKED", "CLOSED"],
331
357
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
332
358
  # The extra values given here take precedence over values defined on the client or passed to this method.
333
359
  extra_headers: Headers | None = None,