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
gcore/_base_client.py CHANGED
@@ -532,7 +532,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
532
532
  is_body_allowed = options.method.lower() != "get"
533
533
 
534
534
  if is_body_allowed:
535
- kwargs["json"] = json_data if is_given(json_data) else None
535
+ if isinstance(json_data, bytes):
536
+ kwargs["content"] = json_data
537
+ else:
538
+ kwargs["json"] = json_data if is_given(json_data) else None
536
539
  kwargs["files"] = files
537
540
  else:
538
541
  headers.pop("Content-Type", None)
gcore/_client.py CHANGED
@@ -32,6 +32,7 @@ from .resources.iam import iam
32
32
  from .resources.waap import waap
33
33
  from .resources.cloud import cloud
34
34
  from .resources.fastedge import fastedge
35
+ from .resources.security import security
35
36
  from .resources.streaming import streaming
36
37
 
37
38
  __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gcore", "AsyncGcore", "Client", "AsyncClient"]
@@ -43,6 +44,7 @@ class Gcore(SyncAPIClient):
43
44
  iam: iam.IamResource
44
45
  fastedge: fastedge.FastedgeResource
45
46
  streaming: streaming.StreamingResource
47
+ security: security.SecurityResource
46
48
  with_raw_response: GcoreWithRawResponse
47
49
  with_streaming_response: GcoreWithStreamedResponse
48
50
 
@@ -126,6 +128,7 @@ class Gcore(SyncAPIClient):
126
128
  self.iam = iam.IamResource(self)
127
129
  self.fastedge = fastedge.FastedgeResource(self)
128
130
  self.streaming = streaming.StreamingResource(self)
131
+ self.security = security.SecurityResource(self)
129
132
  self.with_raw_response = GcoreWithRawResponse(self)
130
133
  self.with_streaming_response = GcoreWithStreamedResponse(self)
131
134
 
@@ -264,6 +267,7 @@ class AsyncGcore(AsyncAPIClient):
264
267
  iam: iam.AsyncIamResource
265
268
  fastedge: fastedge.AsyncFastedgeResource
266
269
  streaming: streaming.AsyncStreamingResource
270
+ security: security.AsyncSecurityResource
267
271
  with_raw_response: AsyncGcoreWithRawResponse
268
272
  with_streaming_response: AsyncGcoreWithStreamedResponse
269
273
 
@@ -347,6 +351,7 @@ class AsyncGcore(AsyncAPIClient):
347
351
  self.iam = iam.AsyncIamResource(self)
348
352
  self.fastedge = fastedge.AsyncFastedgeResource(self)
349
353
  self.streaming = streaming.AsyncStreamingResource(self)
354
+ self.security = security.AsyncSecurityResource(self)
350
355
  self.with_raw_response = AsyncGcoreWithRawResponse(self)
351
356
  self.with_streaming_response = AsyncGcoreWithStreamedResponse(self)
352
357
 
@@ -486,6 +491,7 @@ class GcoreWithRawResponse:
486
491
  self.iam = iam.IamResourceWithRawResponse(client.iam)
487
492
  self.fastedge = fastedge.FastedgeResourceWithRawResponse(client.fastedge)
488
493
  self.streaming = streaming.StreamingResourceWithRawResponse(client.streaming)
494
+ self.security = security.SecurityResourceWithRawResponse(client.security)
489
495
 
490
496
 
491
497
  class AsyncGcoreWithRawResponse:
@@ -495,6 +501,7 @@ class AsyncGcoreWithRawResponse:
495
501
  self.iam = iam.AsyncIamResourceWithRawResponse(client.iam)
496
502
  self.fastedge = fastedge.AsyncFastedgeResourceWithRawResponse(client.fastedge)
497
503
  self.streaming = streaming.AsyncStreamingResourceWithRawResponse(client.streaming)
504
+ self.security = security.AsyncSecurityResourceWithRawResponse(client.security)
498
505
 
499
506
 
500
507
  class GcoreWithStreamedResponse:
@@ -504,6 +511,7 @@ class GcoreWithStreamedResponse:
504
511
  self.iam = iam.IamResourceWithStreamingResponse(client.iam)
505
512
  self.fastedge = fastedge.FastedgeResourceWithStreamingResponse(client.fastedge)
506
513
  self.streaming = streaming.StreamingResourceWithStreamingResponse(client.streaming)
514
+ self.security = security.SecurityResourceWithStreamingResponse(client.security)
507
515
 
508
516
 
509
517
  class AsyncGcoreWithStreamedResponse:
@@ -513,6 +521,7 @@ class AsyncGcoreWithStreamedResponse:
513
521
  self.iam = iam.AsyncIamResourceWithStreamingResponse(client.iam)
514
522
  self.fastedge = fastedge.AsyncFastedgeResourceWithStreamingResponse(client.fastedge)
515
523
  self.streaming = streaming.AsyncStreamingResourceWithStreamingResponse(client.streaming)
524
+ self.security = security.AsyncSecurityResourceWithStreamingResponse(client.security)
516
525
 
517
526
 
518
527
  Client = Gcore
gcore/_files.py CHANGED
@@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
69
69
  return file
70
70
 
71
71
  if is_tuple_t(file):
72
- return (file[0], _read_file_content(file[1]), *file[2:])
72
+ return (file[0], read_file_content(file[1]), *file[2:])
73
73
 
74
74
  raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
75
75
 
76
76
 
77
- def _read_file_content(file: FileContent) -> HttpxFileContent:
77
+ def read_file_content(file: FileContent) -> HttpxFileContent:
78
78
  if isinstance(file, os.PathLike):
79
79
  return pathlib.Path(file).read_bytes()
80
80
  return file
@@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
111
111
  return file
112
112
 
113
113
  if is_tuple_t(file):
114
- return (file[0], await _async_read_file_content(file[1]), *file[2:])
114
+ return (file[0], await async_read_file_content(file[1]), *file[2:])
115
115
 
116
116
  raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
117
117
 
118
118
 
119
- async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
119
+ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
120
120
  if isinstance(file, os.PathLike):
121
121
  return await anyio.Path(file).read_bytes()
122
122
 
gcore/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "gcore"
4
- __version__ = "0.8.0" # x-release-please-version
4
+ __version__ = "0.10.0" # x-release-please-version
@@ -32,6 +32,14 @@ from .fastedge import (
32
32
  FastedgeResourceWithStreamingResponse,
33
33
  AsyncFastedgeResourceWithStreamingResponse,
34
34
  )
35
+ from .security import (
36
+ SecurityResource,
37
+ AsyncSecurityResource,
38
+ SecurityResourceWithRawResponse,
39
+ AsyncSecurityResourceWithRawResponse,
40
+ SecurityResourceWithStreamingResponse,
41
+ AsyncSecurityResourceWithStreamingResponse,
42
+ )
35
43
  from .streaming import (
36
44
  StreamingResource,
37
45
  AsyncStreamingResource,
@@ -72,4 +80,10 @@ __all__ = [
72
80
  "AsyncStreamingResourceWithRawResponse",
73
81
  "StreamingResourceWithStreamingResponse",
74
82
  "AsyncStreamingResourceWithStreamingResponse",
83
+ "SecurityResource",
84
+ "AsyncSecurityResource",
85
+ "SecurityResourceWithRawResponse",
86
+ "AsyncSecurityResourceWithRawResponse",
87
+ "SecurityResourceWithStreamingResponse",
88
+ "AsyncSecurityResourceWithStreamingResponse",
75
89
  ]
@@ -60,6 +60,7 @@ class CostReportsResource(SyncAPIResource):
60
60
  projects: Iterable[int] | NotGiven = NOT_GIVEN,
61
61
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
62
62
  response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
63
+ rounding: bool | NotGiven = NOT_GIVEN,
63
64
  schema_filter: cost_report_get_aggregated_params.SchemaFilter | NotGiven = NOT_GIVEN,
64
65
  tags: cost_report_get_aggregated_params.Tags | NotGiven = NOT_GIVEN,
65
66
  types: List[
@@ -128,6 +129,8 @@ class CostReportsResource(SyncAPIResource):
128
129
 
129
130
  response_format: Format of the response (csv or json).
130
131
 
132
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
133
+
131
134
  schema_filter: Extended filter for field filtering.
132
135
 
133
136
  tags: Filter by tags
@@ -152,6 +155,7 @@ class CostReportsResource(SyncAPIResource):
152
155
  "projects": projects,
153
156
  "regions": regions,
154
157
  "response_format": response_format,
158
+ "rounding": rounding,
155
159
  "schema_filter": schema_filter,
156
160
  "tags": tags,
157
161
  "types": types,
@@ -171,6 +175,7 @@ class CostReportsResource(SyncAPIResource):
171
175
  time_to: Union[str, datetime],
172
176
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
173
177
  response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
178
+ rounding: bool | NotGiven = NOT_GIVEN,
174
179
  schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
175
180
  tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
176
181
  types: List[
@@ -230,6 +235,8 @@ class CostReportsResource(SyncAPIResource):
230
235
 
231
236
  response_format: Format of the response (`csv_totals` or json).
232
237
 
238
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
239
+
233
240
  schema_filter: Extended filter for field filtering.
234
241
 
235
242
  tags: Filter by tags
@@ -252,6 +259,7 @@ class CostReportsResource(SyncAPIResource):
252
259
  "time_to": time_to,
253
260
  "regions": regions,
254
261
  "response_format": response_format,
262
+ "rounding": rounding,
255
263
  "schema_filter": schema_filter,
256
264
  "tags": tags,
257
265
  "types": types,
@@ -275,6 +283,7 @@ class CostReportsResource(SyncAPIResource):
275
283
  projects: Iterable[int] | NotGiven = NOT_GIVEN,
276
284
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
277
285
  response_format: Literal["csv_records", "json"] | NotGiven = NOT_GIVEN,
286
+ rounding: bool | NotGiven = NOT_GIVEN,
278
287
  schema_filter: cost_report_get_detailed_params.SchemaFilter | NotGiven = NOT_GIVEN,
279
288
  sorting: Iterable[cost_report_get_detailed_params.Sorting] | NotGiven = NOT_GIVEN,
280
289
  tags: cost_report_get_detailed_params.Tags | NotGiven = NOT_GIVEN,
@@ -349,6 +358,8 @@ class CostReportsResource(SyncAPIResource):
349
358
 
350
359
  response_format: Format of the response (csv or json).
351
360
 
361
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
362
+
352
363
  schema_filter: Extended filter for field filtering.
353
364
 
354
365
  sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
@@ -377,6 +388,7 @@ class CostReportsResource(SyncAPIResource):
377
388
  "projects": projects,
378
389
  "regions": regions,
379
390
  "response_format": response_format,
391
+ "rounding": rounding,
380
392
  "schema_filter": schema_filter,
381
393
  "sorting": sorting,
382
394
  "tags": tags,
@@ -420,6 +432,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
420
432
  projects: Iterable[int] | NotGiven = NOT_GIVEN,
421
433
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
422
434
  response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
435
+ rounding: bool | NotGiven = NOT_GIVEN,
423
436
  schema_filter: cost_report_get_aggregated_params.SchemaFilter | NotGiven = NOT_GIVEN,
424
437
  tags: cost_report_get_aggregated_params.Tags | NotGiven = NOT_GIVEN,
425
438
  types: List[
@@ -488,6 +501,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
488
501
 
489
502
  response_format: Format of the response (csv or json).
490
503
 
504
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
505
+
491
506
  schema_filter: Extended filter for field filtering.
492
507
 
493
508
  tags: Filter by tags
@@ -512,6 +527,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
512
527
  "projects": projects,
513
528
  "regions": regions,
514
529
  "response_format": response_format,
530
+ "rounding": rounding,
515
531
  "schema_filter": schema_filter,
516
532
  "tags": tags,
517
533
  "types": types,
@@ -531,6 +547,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
531
547
  time_to: Union[str, datetime],
532
548
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
533
549
  response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
550
+ rounding: bool | NotGiven = NOT_GIVEN,
534
551
  schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
535
552
  tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
536
553
  types: List[
@@ -590,6 +607,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
590
607
 
591
608
  response_format: Format of the response (`csv_totals` or json).
592
609
 
610
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
611
+
593
612
  schema_filter: Extended filter for field filtering.
594
613
 
595
614
  tags: Filter by tags
@@ -612,6 +631,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
612
631
  "time_to": time_to,
613
632
  "regions": regions,
614
633
  "response_format": response_format,
634
+ "rounding": rounding,
615
635
  "schema_filter": schema_filter,
616
636
  "tags": tags,
617
637
  "types": types,
@@ -635,6 +655,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
635
655
  projects: Iterable[int] | NotGiven = NOT_GIVEN,
636
656
  regions: Iterable[int] | NotGiven = NOT_GIVEN,
637
657
  response_format: Literal["csv_records", "json"] | NotGiven = NOT_GIVEN,
658
+ rounding: bool | NotGiven = NOT_GIVEN,
638
659
  schema_filter: cost_report_get_detailed_params.SchemaFilter | NotGiven = NOT_GIVEN,
639
660
  sorting: Iterable[cost_report_get_detailed_params.Sorting] | NotGiven = NOT_GIVEN,
640
661
  tags: cost_report_get_detailed_params.Tags | NotGiven = NOT_GIVEN,
@@ -709,6 +730,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
709
730
 
710
731
  response_format: Format of the response (csv or json).
711
732
 
733
+ rounding: Round cost values to 5 decimal places. When false, returns full precision.
734
+
712
735
  schema_filter: Extended filter for field filtering.
713
736
 
714
737
  sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
@@ -737,6 +760,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
737
760
  "projects": projects,
738
761
  "regions": regions,
739
762
  "response_format": response_format,
763
+ "rounding": rounding,
740
764
  "schema_filter": schema_filter,
741
765
  "sorting": sorting,
742
766
  "tags": tags,
@@ -58,7 +58,7 @@ class HealthMonitorsResource(SyncAPIResource):
58
58
  type: LbHealthMonitorType,
59
59
  expected_codes: Optional[str] | NotGiven = NOT_GIVEN,
60
60
  http_method: Optional[HTTPMethod] | NotGiven = NOT_GIVEN,
61
- max_retries_down: Optional[int] | NotGiven = NOT_GIVEN,
61
+ max_retries_down: int | NotGiven = NOT_GIVEN,
62
62
  url_path: Optional[str] | NotGiven = NOT_GIVEN,
63
63
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
64
64
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -85,7 +85,9 @@ class HealthMonitorsResource(SyncAPIResource):
85
85
 
86
86
  type: Health monitor type. Once health monitor is created, cannot be changed.
87
87
 
88
- expected_codes: Can only be used together with `HTTP` or `HTTPS` health monitor type.
88
+ expected_codes: Expected HTTP response codes. Can be a single code or a range of codes. Can only
89
+ be used together with `HTTP` or `HTTPS` health monitor type. For example,
90
+ 200,202,300-302,401,403,404,500-504. If not specified, the default is 200.
89
91
 
90
92
  http_method: HTTP method. Can only be used together with `HTTP` or `HTTPS` health monitor
91
93
  type.
@@ -209,7 +211,7 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
209
211
  type: LbHealthMonitorType,
210
212
  expected_codes: Optional[str] | NotGiven = NOT_GIVEN,
211
213
  http_method: Optional[HTTPMethod] | NotGiven = NOT_GIVEN,
212
- max_retries_down: Optional[int] | NotGiven = NOT_GIVEN,
214
+ max_retries_down: int | NotGiven = NOT_GIVEN,
213
215
  url_path: Optional[str] | NotGiven = NOT_GIVEN,
214
216
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215
217
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -236,7 +238,9 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
236
238
 
237
239
  type: Health monitor type. Once health monitor is created, cannot be changed.
238
240
 
239
- expected_codes: Can only be used together with `HTTP` or `HTTPS` health monitor type.
241
+ expected_codes: Expected HTTP response codes. Can be a single code or a range of codes. Can only
242
+ be used together with `HTTP` or `HTTPS` health monitor type. For example,
243
+ 200,202,300-302,401,403,404,500-504. If not specified, the default is 200.
240
244
 
241
245
  http_method: HTTP method. Can only be used together with `HTTP` or `HTTPS` health monitor
242
246
  type.
@@ -57,7 +57,7 @@ class MembersResource(SyncAPIResource):
57
57
  monitor_address: Optional[str] | NotGiven = NOT_GIVEN,
58
58
  monitor_port: Optional[int] | NotGiven = NOT_GIVEN,
59
59
  subnet_id: Optional[str] | NotGiven = NOT_GIVEN,
60
- weight: Optional[int] | NotGiven = NOT_GIVEN,
60
+ weight: int | NotGiven = NOT_GIVEN,
61
61
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
62
  # The extra values given here take precedence over values defined on the client or passed to this method.
63
63
  extra_headers: Headers | None = None,
@@ -222,7 +222,7 @@ class AsyncMembersResource(AsyncAPIResource):
222
222
  monitor_address: Optional[str] | NotGiven = NOT_GIVEN,
223
223
  monitor_port: Optional[int] | NotGiven = NOT_GIVEN,
224
224
  subnet_id: Optional[str] | NotGiven = NOT_GIVEN,
225
- weight: Optional[int] | NotGiven = NOT_GIVEN,
225
+ weight: int | NotGiven = NOT_GIVEN,
226
226
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
227
227
  # The extra values given here take precedence over values defined on the client or passed to this method.
228
228
  extra_headers: Headers | None = None,
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import List
6
6
  from typing_extensions import Literal
7
7
 
8
8
  import httpx
@@ -99,7 +99,7 @@ class RequestsResource(SyncAPIResource):
99
99
  *,
100
100
  limit: int | NotGiven = NOT_GIVEN,
101
101
  offset: int | NotGiven = NOT_GIVEN,
102
- status: Optional[List[Literal["done", "in progress", "rejected"]]] | NotGiven = NOT_GIVEN,
102
+ status: List[Literal["done", "in progress", "rejected"]] | NotGiven = NOT_GIVEN,
103
103
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
104
104
  # The extra values given here take precedence over values defined on the client or passed to this method.
105
105
  extra_headers: Headers | None = None,
@@ -148,7 +148,7 @@ class RequestsResource(SyncAPIResource):
148
148
 
149
149
  def delete(
150
150
  self,
151
- request_id: str,
151
+ request_id: int,
152
152
  *,
153
153
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
154
154
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -171,8 +171,6 @@ class RequestsResource(SyncAPIResource):
171
171
 
172
172
  timeout: Override the client-level default timeout for this request, in seconds
173
173
  """
174
- if not request_id:
175
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
176
174
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
177
175
  return self._delete(
178
176
  f"/cloud/v2/limits_request/{request_id}",
@@ -184,7 +182,7 @@ class RequestsResource(SyncAPIResource):
184
182
 
185
183
  def get(
186
184
  self,
187
- request_id: str,
185
+ request_id: int,
188
186
  *,
189
187
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
190
188
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -207,8 +205,6 @@ class RequestsResource(SyncAPIResource):
207
205
 
208
206
  timeout: Override the client-level default timeout for this request, in seconds
209
207
  """
210
- if not request_id:
211
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
212
208
  return self._get(
213
209
  f"/cloud/v2/limits_request/{request_id}",
214
210
  options=make_request_options(
@@ -291,7 +287,7 @@ class AsyncRequestsResource(AsyncAPIResource):
291
287
  *,
292
288
  limit: int | NotGiven = NOT_GIVEN,
293
289
  offset: int | NotGiven = NOT_GIVEN,
294
- status: Optional[List[Literal["done", "in progress", "rejected"]]] | NotGiven = NOT_GIVEN,
290
+ status: List[Literal["done", "in progress", "rejected"]] | NotGiven = NOT_GIVEN,
295
291
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
296
292
  # The extra values given here take precedence over values defined on the client or passed to this method.
297
293
  extra_headers: Headers | None = None,
@@ -340,7 +336,7 @@ class AsyncRequestsResource(AsyncAPIResource):
340
336
 
341
337
  async def delete(
342
338
  self,
343
- request_id: str,
339
+ request_id: int,
344
340
  *,
345
341
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
346
342
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -363,8 +359,6 @@ class AsyncRequestsResource(AsyncAPIResource):
363
359
 
364
360
  timeout: Override the client-level default timeout for this request, in seconds
365
361
  """
366
- if not request_id:
367
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
368
362
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
369
363
  return await self._delete(
370
364
  f"/cloud/v2/limits_request/{request_id}",
@@ -376,7 +370,7 @@ class AsyncRequestsResource(AsyncAPIResource):
376
370
 
377
371
  async def get(
378
372
  self,
379
- request_id: str,
373
+ request_id: int,
380
374
  *,
381
375
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
382
376
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -399,8 +393,6 @@ class AsyncRequestsResource(AsyncAPIResource):
399
393
 
400
394
  timeout: Override the client-level default timeout for this request, in seconds
401
395
  """
402
- if not request_id:
403
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
404
396
  return await self._get(
405
397
  f"/cloud/v2/limits_request/{request_id}",
406
398
  options=make_request_options(
@@ -4,7 +4,8 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
7
+ from ..._files import read_file_content, async_read_file_content
8
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileContent
8
9
  from ..._compat import cached_property
9
10
  from ..._resource import SyncAPIResource, AsyncAPIResource
10
11
  from ..._response import (
@@ -15,6 +16,7 @@ from ..._response import (
15
16
  )
16
17
  from ..._base_client import make_request_options
17
18
  from ...types.fastedge.binary import Binary
19
+ from ...types.fastedge.binary_short import BinaryShort
18
20
  from ...types.fastedge.binary_list_response import BinaryListResponse
19
21
 
20
22
  __all__ = ["BinariesResource", "AsyncBinariesResource"]
@@ -40,6 +42,39 @@ class BinariesResource(SyncAPIResource):
40
42
  """
41
43
  return BinariesResourceWithStreamingResponse(self)
42
44
 
45
+ def create(
46
+ self,
47
+ body: FileContent,
48
+ *,
49
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50
+ # The extra values given here take precedence over values defined on the client or passed to this method.
51
+ extra_headers: Headers | None = None,
52
+ extra_query: Query | None = None,
53
+ extra_body: Body | None = None,
54
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
55
+ ) -> BinaryShort:
56
+ """
57
+ Store compiled WASM binary
58
+
59
+ Args:
60
+ extra_headers: Send extra headers
61
+
62
+ extra_query: Add additional query parameters to the request
63
+
64
+ extra_body: Add additional JSON properties to the request
65
+
66
+ timeout: Override the client-level default timeout for this request, in seconds
67
+ """
68
+ extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})}
69
+ return self._post(
70
+ "/fastedge/v1/binaries/raw",
71
+ body=read_file_content(body),
72
+ options=make_request_options(
73
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
74
+ ),
75
+ cast_to=BinaryShort,
76
+ )
77
+
43
78
  def list(
44
79
  self,
45
80
  *,
@@ -143,6 +178,39 @@ class AsyncBinariesResource(AsyncAPIResource):
143
178
  """
144
179
  return AsyncBinariesResourceWithStreamingResponse(self)
145
180
 
181
+ async def create(
182
+ self,
183
+ body: FileContent,
184
+ *,
185
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
186
+ # The extra values given here take precedence over values defined on the client or passed to this method.
187
+ extra_headers: Headers | None = None,
188
+ extra_query: Query | None = None,
189
+ extra_body: Body | None = None,
190
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
191
+ ) -> BinaryShort:
192
+ """
193
+ Store compiled WASM binary
194
+
195
+ Args:
196
+ extra_headers: Send extra headers
197
+
198
+ extra_query: Add additional query parameters to the request
199
+
200
+ extra_body: Add additional JSON properties to the request
201
+
202
+ timeout: Override the client-level default timeout for this request, in seconds
203
+ """
204
+ extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})}
205
+ return await self._post(
206
+ "/fastedge/v1/binaries/raw",
207
+ body=await async_read_file_content(body),
208
+ options=make_request_options(
209
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
210
+ ),
211
+ cast_to=BinaryShort,
212
+ )
213
+
146
214
  async def list(
147
215
  self,
148
216
  *,
@@ -230,6 +298,9 @@ class BinariesResourceWithRawResponse:
230
298
  def __init__(self, binaries: BinariesResource) -> None:
231
299
  self._binaries = binaries
232
300
 
301
+ self.create = to_raw_response_wrapper(
302
+ binaries.create,
303
+ )
233
304
  self.list = to_raw_response_wrapper(
234
305
  binaries.list,
235
306
  )
@@ -245,6 +316,9 @@ class AsyncBinariesResourceWithRawResponse:
245
316
  def __init__(self, binaries: AsyncBinariesResource) -> None:
246
317
  self._binaries = binaries
247
318
 
319
+ self.create = async_to_raw_response_wrapper(
320
+ binaries.create,
321
+ )
248
322
  self.list = async_to_raw_response_wrapper(
249
323
  binaries.list,
250
324
  )
@@ -260,6 +334,9 @@ class BinariesResourceWithStreamingResponse:
260
334
  def __init__(self, binaries: BinariesResource) -> None:
261
335
  self._binaries = binaries
262
336
 
337
+ self.create = to_streamed_response_wrapper(
338
+ binaries.create,
339
+ )
263
340
  self.list = to_streamed_response_wrapper(
264
341
  binaries.list,
265
342
  )
@@ -275,6 +352,9 @@ class AsyncBinariesResourceWithStreamingResponse:
275
352
  def __init__(self, binaries: AsyncBinariesResource) -> None:
276
353
  self._binaries = binaries
277
354
 
355
+ self.create = async_to_streamed_response_wrapper(
356
+ binaries.create,
357
+ )
278
358
  self.list = async_to_streamed_response_wrapper(
279
359
  binaries.list,
280
360
  )
@@ -0,0 +1,75 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .events import (
4
+ EventsResource,
5
+ AsyncEventsResource,
6
+ EventsResourceWithRawResponse,
7
+ AsyncEventsResourceWithRawResponse,
8
+ EventsResourceWithStreamingResponse,
9
+ AsyncEventsResourceWithStreamingResponse,
10
+ )
11
+ from .profiles import (
12
+ ProfilesResource,
13
+ AsyncProfilesResource,
14
+ ProfilesResourceWithRawResponse,
15
+ AsyncProfilesResourceWithRawResponse,
16
+ ProfilesResourceWithStreamingResponse,
17
+ AsyncProfilesResourceWithStreamingResponse,
18
+ )
19
+ from .security import (
20
+ SecurityResource,
21
+ AsyncSecurityResource,
22
+ SecurityResourceWithRawResponse,
23
+ AsyncSecurityResourceWithRawResponse,
24
+ SecurityResourceWithStreamingResponse,
25
+ AsyncSecurityResourceWithStreamingResponse,
26
+ )
27
+ from .bgp_announces import (
28
+ BgpAnnouncesResource,
29
+ AsyncBgpAnnouncesResource,
30
+ BgpAnnouncesResourceWithRawResponse,
31
+ AsyncBgpAnnouncesResourceWithRawResponse,
32
+ BgpAnnouncesResourceWithStreamingResponse,
33
+ AsyncBgpAnnouncesResourceWithStreamingResponse,
34
+ )
35
+ from .profile_templates import (
36
+ ProfileTemplatesResource,
37
+ AsyncProfileTemplatesResource,
38
+ ProfileTemplatesResourceWithRawResponse,
39
+ AsyncProfileTemplatesResourceWithRawResponse,
40
+ ProfileTemplatesResourceWithStreamingResponse,
41
+ AsyncProfileTemplatesResourceWithStreamingResponse,
42
+ )
43
+
44
+ __all__ = [
45
+ "EventsResource",
46
+ "AsyncEventsResource",
47
+ "EventsResourceWithRawResponse",
48
+ "AsyncEventsResourceWithRawResponse",
49
+ "EventsResourceWithStreamingResponse",
50
+ "AsyncEventsResourceWithStreamingResponse",
51
+ "BgpAnnouncesResource",
52
+ "AsyncBgpAnnouncesResource",
53
+ "BgpAnnouncesResourceWithRawResponse",
54
+ "AsyncBgpAnnouncesResourceWithRawResponse",
55
+ "BgpAnnouncesResourceWithStreamingResponse",
56
+ "AsyncBgpAnnouncesResourceWithStreamingResponse",
57
+ "ProfileTemplatesResource",
58
+ "AsyncProfileTemplatesResource",
59
+ "ProfileTemplatesResourceWithRawResponse",
60
+ "AsyncProfileTemplatesResourceWithRawResponse",
61
+ "ProfileTemplatesResourceWithStreamingResponse",
62
+ "AsyncProfileTemplatesResourceWithStreamingResponse",
63
+ "ProfilesResource",
64
+ "AsyncProfilesResource",
65
+ "ProfilesResourceWithRawResponse",
66
+ "AsyncProfilesResourceWithRawResponse",
67
+ "ProfilesResourceWithStreamingResponse",
68
+ "AsyncProfilesResourceWithStreamingResponse",
69
+ "SecurityResource",
70
+ "AsyncSecurityResource",
71
+ "SecurityResourceWithRawResponse",
72
+ "AsyncSecurityResourceWithRawResponse",
73
+ "SecurityResourceWithStreamingResponse",
74
+ "AsyncSecurityResourceWithStreamingResponse",
75
+ ]