3
3
from __future__ import annotations
4
4
5
5
import os
6
- from typing import Any , cast
6
+ from typing import Any , Optional , cast
7
7
8
8
import pytest
9
9
@@ -23,7 +23,7 @@ def test_method_edit(self, client: Cloudflare) -> None:
23
23
dns_setting = client .zones .dns_settings .edit (
24
24
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
25
25
)
26
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
26
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
27
27
28
28
@pytest .mark .skip ()
29
29
@parametrize
@@ -35,7 +35,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
35
35
nameservers = {"type" : "cloudflare.standard" },
36
36
secondary_overrides = False ,
37
37
)
38
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
38
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
39
39
40
40
@pytest .mark .skip ()
41
41
@parametrize
@@ -47,7 +47,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
47
47
assert response .is_closed is True
48
48
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
49
49
dns_setting = response .parse ()
50
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
50
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
51
51
52
52
@pytest .mark .skip ()
53
53
@parametrize
@@ -59,7 +59,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
59
59
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
60
60
61
61
dns_setting = response .parse ()
62
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
62
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
63
63
64
64
assert cast (Any , response .is_closed ) is True
65
65
@@ -77,7 +77,7 @@ def test_method_get(self, client: Cloudflare) -> None:
77
77
dns_setting = client .zones .dns_settings .get (
78
78
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
79
79
)
80
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
80
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
81
81
82
82
@pytest .mark .skip ()
83
83
@parametrize
@@ -89,7 +89,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
89
89
assert response .is_closed is True
90
90
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
91
91
dns_setting = response .parse ()
92
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
92
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
93
93
94
94
@pytest .mark .skip ()
95
95
@parametrize
@@ -101,7 +101,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
101
101
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
102
102
103
103
dns_setting = response .parse ()
104
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
104
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
105
105
106
106
assert cast (Any , response .is_closed ) is True
107
107
@@ -123,7 +123,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
123
123
dns_setting = await async_client .zones .dns_settings .edit (
124
124
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
125
125
)
126
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
126
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
127
127
128
128
@pytest .mark .skip ()
129
129
@parametrize
@@ -135,7 +135,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
135
135
nameservers = {"type" : "cloudflare.standard" },
136
136
secondary_overrides = False ,
137
137
)
138
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
138
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
139
139
140
140
@pytest .mark .skip ()
141
141
@parametrize
@@ -147,7 +147,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
147
147
assert response .is_closed is True
148
148
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
149
149
dns_setting = await response .parse ()
150
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
150
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
151
151
152
152
@pytest .mark .skip ()
153
153
@parametrize
@@ -159,7 +159,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
159
159
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
160
160
161
161
dns_setting = await response .parse ()
162
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
162
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
163
163
164
164
assert cast (Any , response .is_closed ) is True
165
165
@@ -177,7 +177,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
177
177
dns_setting = await async_client .zones .dns_settings .get (
178
178
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
179
179
)
180
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
180
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
181
181
182
182
@pytest .mark .skip ()
183
183
@parametrize
@@ -189,7 +189,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
189
189
assert response .is_closed is True
190
190
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
191
191
dns_setting = await response .parse ()
192
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
192
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
193
193
194
194
@pytest .mark .skip ()
195
195
@parametrize
@@ -201,7 +201,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
201
201
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
202
202
203
203
dns_setting = await response .parse ()
204
- assert_matches_type (DNSSetting , dns_setting , path = ["response" ])
204
+ assert_matches_type (Optional [ DNSSetting ] , dns_setting , path = ["response" ])
205
205
206
206
assert cast (Any , response .is_closed ) is True
207
207
0 commit comments