Skip to content

Commit 24c1400

Browse files
feat: update via SDK Studio (#11)
1 parent cc845ba commit 24c1400

File tree

12 files changed

+288
-320
lines changed

12 files changed

+288
-320
lines changed

tests/api_resources/alerting/v3s/test_policies.py

+52-28
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,9 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
9090
"zones": ["string", "string", "string"],
9191
},
9292
mechanisms={
93-
"foo": [
94-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
95-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
96-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
97-
]
93+
"email": [{"id": "[email protected]"}],
94+
"pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}],
95+
"webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}],
9896
},
9997
name="SSL Notification Event Policy",
10098
)
@@ -254,7 +252,11 @@ def test_method_notification_policies_create_a_notification_policy(self, client:
254252
"023e105f4ecef8ad9ca31a8372d0c353",
255253
alert_type="universal_ssl_event_type",
256254
enabled=True,
257-
mechanisms={"foo": [{}, {}, {}]},
255+
mechanisms={
256+
"email": [{}],
257+
"pagerduty": [{}],
258+
"webhooks": [{}],
259+
},
258260
name="SSL Notification Event Policy",
259261
)
260262
assert_matches_type(PolicyNotificationPoliciesCreateANotificationPolicyResponse, policy, path=["response"])
@@ -269,11 +271,9 @@ def test_method_notification_policies_create_a_notification_policy_with_all_para
269271
alert_type="universal_ssl_event_type",
270272
enabled=True,
271273
mechanisms={
272-
"foo": [
273-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
274-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
275-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
276-
]
274+
"email": [{"id": "[email protected]"}],
275+
"pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}],
276+
"webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}],
277277
},
278278
name="SSL Notification Event Policy",
279279
description="Something describing the policy.",
@@ -329,7 +329,11 @@ def test_raw_response_notification_policies_create_a_notification_policy(self, c
329329
"023e105f4ecef8ad9ca31a8372d0c353",
330330
alert_type="universal_ssl_event_type",
331331
enabled=True,
332-
mechanisms={"foo": [{}, {}, {}]},
332+
mechanisms={
333+
"email": [{}],
334+
"pagerduty": [{}],
335+
"webhooks": [{}],
336+
},
333337
name="SSL Notification Event Policy",
334338
)
335339

@@ -345,7 +349,11 @@ def test_streaming_response_notification_policies_create_a_notification_policy(s
345349
"023e105f4ecef8ad9ca31a8372d0c353",
346350
alert_type="universal_ssl_event_type",
347351
enabled=True,
348-
mechanisms={"foo": [{}, {}, {}]},
352+
mechanisms={
353+
"email": [{}],
354+
"pagerduty": [{}],
355+
"webhooks": [{}],
356+
},
349357
name="SSL Notification Event Policy",
350358
) as response:
351359
assert not response.is_closed
@@ -364,7 +372,11 @@ def test_path_params_notification_policies_create_a_notification_policy(self, cl
364372
"",
365373
alert_type="universal_ssl_event_type",
366374
enabled=True,
367-
mechanisms={"foo": [{}, {}, {}]},
375+
mechanisms={
376+
"email": [{}],
377+
"pagerduty": [{}],
378+
"webhooks": [{}],
379+
},
368380
name="SSL Notification Event Policy",
369381
)
370382

@@ -481,11 +493,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
481493
"zones": ["string", "string", "string"],
482494
},
483495
mechanisms={
484-
"foo": [
485-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
486-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
487-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
488-
]
496+
"email": [{"id": "[email protected]"}],
497+
"pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}],
498+
"webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}],
489499
},
490500
name="SSL Notification Event Policy",
491501
)
@@ -647,7 +657,11 @@ async def test_method_notification_policies_create_a_notification_policy(
647657
"023e105f4ecef8ad9ca31a8372d0c353",
648658
alert_type="universal_ssl_event_type",
649659
enabled=True,
650-
mechanisms={"foo": [{}, {}, {}]},
660+
mechanisms={
661+
"email": [{}],
662+
"pagerduty": [{}],
663+
"webhooks": [{}],
664+
},
651665
name="SSL Notification Event Policy",
652666
)
653667
assert_matches_type(PolicyNotificationPoliciesCreateANotificationPolicyResponse, policy, path=["response"])
@@ -662,11 +676,9 @@ async def test_method_notification_policies_create_a_notification_policy_with_al
662676
alert_type="universal_ssl_event_type",
663677
enabled=True,
664678
mechanisms={
665-
"foo": [
666-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
667-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
668-
{"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"},
669-
]
679+
"email": [{"id": "[email protected]"}],
680+
"pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}],
681+
"webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}],
670682
},
671683
name="SSL Notification Event Policy",
672684
description="Something describing the policy.",
@@ -724,7 +736,11 @@ async def test_raw_response_notification_policies_create_a_notification_policy(
724736
"023e105f4ecef8ad9ca31a8372d0c353",
725737
alert_type="universal_ssl_event_type",
726738
enabled=True,
727-
mechanisms={"foo": [{}, {}, {}]},
739+
mechanisms={
740+
"email": [{}],
741+
"pagerduty": [{}],
742+
"webhooks": [{}],
743+
},
728744
name="SSL Notification Event Policy",
729745
)
730746

@@ -742,7 +758,11 @@ async def test_streaming_response_notification_policies_create_a_notification_po
742758
"023e105f4ecef8ad9ca31a8372d0c353",
743759
alert_type="universal_ssl_event_type",
744760
enabled=True,
745-
mechanisms={"foo": [{}, {}, {}]},
761+
mechanisms={
762+
"email": [{}],
763+
"pagerduty": [{}],
764+
"webhooks": [{}],
765+
},
746766
name="SSL Notification Event Policy",
747767
) as response:
748768
assert not response.is_closed
@@ -764,7 +784,11 @@ async def test_path_params_notification_policies_create_a_notification_policy(
764784
"",
765785
alert_type="universal_ssl_event_type",
766786
enabled=True,
767-
mechanisms={"foo": [{}, {}, {}]},
787+
mechanisms={
788+
"email": [{}],
789+
"pagerduty": [{}],
790+
"webhooks": [{}],
791+
},
768792
name="SSL Notification Event Policy",
769793
)
770794
)

tests/api_resources/devices/test_postures.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
5252
expiration="1h",
5353
input={
5454
"exists": True,
55-
"operating_system": "mac",
55+
"operating_system": "linux",
5656
"path": "/bin/cat",
5757
"sha256": "https://api.us-2.crowdstrike.com",
5858
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e",
@@ -174,7 +174,7 @@ def test_method_device_posture_rules_create_device_posture_rule_with_all_params(
174174
expiration="1h",
175175
input={
176176
"exists": True,
177-
"operating_system": "mac",
177+
"operating_system": "linux",
178178
"path": "/bin/cat",
179179
"sha256": "https://api.us-2.crowdstrike.com",
180180
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e",
@@ -333,7 +333,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
333333
expiration="1h",
334334
input={
335335
"exists": True,
336-
"operating_system": "mac",
336+
"operating_system": "linux",
337337
"path": "/bin/cat",
338338
"sha256": "https://api.us-2.crowdstrike.com",
339339
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e",
@@ -457,7 +457,7 @@ async def test_method_device_posture_rules_create_device_posture_rule_with_all_p
457457
expiration="1h",
458458
input={
459459
"exists": True,
460-
"operating_system": "mac",
460+
"operating_system": "linux",
461461
"path": "/bin/cat",
462462
"sha256": "https://api.us-2.crowdstrike.com",
463463
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e",

tests/api_resources/dex/test_http_tests.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def test_method_get(self, client: Cloudflare) -> None:
2929
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
3030
account_id="01a7362d577a6c3019a474fd6f485823",
3131
interval="minute",
32-
time_end="1689606812000",
33-
time_start="1689520412000",
32+
time_end="string",
33+
time_start="string",
3434
)
3535
assert_matches_type(HTTPTestGetResponse, http_test, path=["response"])
3636

@@ -41,8 +41,8 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
4141
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
4242
account_id="01a7362d577a6c3019a474fd6f485823",
4343
interval="minute",
44-
time_end="1689606812000",
45-
time_start="1689520412000",
44+
time_end="string",
45+
time_start="string",
4646
colo="string",
4747
device_id=["string", "string", "string"],
4848
)
@@ -55,8 +55,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
5555
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
5656
account_id="01a7362d577a6c3019a474fd6f485823",
5757
interval="minute",
58-
time_end="1689606812000",
59-
time_start="1689520412000",
58+
time_end="string",
59+
time_start="string",
6060
)
6161

6262
assert response.is_closed is True
@@ -71,8 +71,8 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
7171
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
7272
account_id="01a7362d577a6c3019a474fd6f485823",
7373
interval="minute",
74-
time_end="1689606812000",
75-
time_start="1689520412000",
74+
time_end="string",
75+
time_start="string",
7676
) as response:
7777
assert not response.is_closed
7878
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -90,17 +90,17 @@ def test_path_params_get(self, client: Cloudflare) -> None:
9090
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
9191
account_id="",
9292
interval="minute",
93-
time_end="1689606812000",
94-
time_start="1689520412000",
93+
time_end="string",
94+
time_start="string",
9595
)
9696

9797
with pytest.raises(ValueError, match=r"Expected a non-empty value for `test_id` but received ''"):
9898
client.dex.http_tests.with_raw_response.get(
9999
"",
100100
account_id="01a7362d577a6c3019a474fd6f485823",
101101
interval="minute",
102-
time_end="1689606812000",
103-
time_start="1689520412000",
102+
time_end="string",
103+
time_start="string",
104104
)
105105

106106

@@ -114,8 +114,8 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
114114
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
115115
account_id="01a7362d577a6c3019a474fd6f485823",
116116
interval="minute",
117-
time_end="1689606812000",
118-
time_start="1689520412000",
117+
time_end="string",
118+
time_start="string",
119119
)
120120
assert_matches_type(HTTPTestGetResponse, http_test, path=["response"])
121121

@@ -126,8 +126,8 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
126126
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
127127
account_id="01a7362d577a6c3019a474fd6f485823",
128128
interval="minute",
129-
time_end="1689606812000",
130-
time_start="1689520412000",
129+
time_end="string",
130+
time_start="string",
131131
colo="string",
132132
device_id=["string", "string", "string"],
133133
)
@@ -140,8 +140,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
140140
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
141141
account_id="01a7362d577a6c3019a474fd6f485823",
142142
interval="minute",
143-
time_end="1689606812000",
144-
time_start="1689520412000",
143+
time_end="string",
144+
time_start="string",
145145
)
146146

147147
assert response.is_closed is True
@@ -156,8 +156,8 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
156156
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
157157
account_id="01a7362d577a6c3019a474fd6f485823",
158158
interval="minute",
159-
time_end="1689606812000",
160-
time_start="1689520412000",
159+
time_end="string",
160+
time_start="string",
161161
) as response:
162162
assert not response.is_closed
163163
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -175,15 +175,15 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
175175
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
176176
account_id="",
177177
interval="minute",
178-
time_end="1689606812000",
179-
time_start="1689520412000",
178+
time_end="string",
179+
time_start="string",
180180
)
181181

182182
with pytest.raises(ValueError, match=r"Expected a non-empty value for `test_id` but received ''"):
183183
await async_client.dex.http_tests.with_raw_response.get(
184184
"",
185185
account_id="01a7362d577a6c3019a474fd6f485823",
186186
interval="minute",
187-
time_end="1689606812000",
188-
time_start="1689520412000",
187+
time_end="string",
188+
time_start="string",
189189
)

0 commit comments

Comments
 (0)