Skip to content

Commit 0084a4d

Browse files
feat(api): api update
1 parent 6cf8fb3 commit 0084a4d

5 files changed

Lines changed: 46 additions & 166 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1775
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3642238a0fcdc091efbca5515455c92c73e4d66478c4dca432a6109fa97e130f.yml
3-
openapi_spec_hash: 24a2895c05baa9100b3cda54d3ab9e19
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cb6b87f45c66e5a30eb913c34f701a5609b2761a5cc0c6ae3a9dd56632ab4cc.yml
3+
openapi_spec_hash: 805bdec318dc4e872b6bed9e2789a4f0
44
config_hash: 4a37da9893560914a7ac1a75cc01202a

src/cloudflare/types/shared/token_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import Dict, List, Union, Optional
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
@@ -35,5 +35,5 @@ class TokenPolicy(BaseModel):
3535
permission_groups: List[PermissionGroup]
3636
"""A set of permission groups that are specified to the policy."""
3737

38-
resources: Dict[str, object]
38+
resources: Union[Dict[str, str], Dict[str, Dict[str, str]]]
3939
"""A list of resource names that the policy applies to."""

src/cloudflare/types/shared_params/token_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable
5+
from typing import Dict, Union, Iterable
66
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"]
@@ -29,5 +29,5 @@ class TokenPolicy(TypedDict, total=False):
2929
permission_groups: Required[Iterable[PermissionGroup]]
3030
"""A set of permission groups that are specified to the policy."""
3131

32-
resources: Required[Dict[str, object]]
32+
resources: Required[Union[Dict[str, str], Dict[str, Dict[str, str]]]]
3333
"""A list of resource names that the policy applies to."""

tests/api_resources/accounts/test_tokens.py

Lines changed: 22 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ def test_method_create(self, client: Cloudflare) -> None:
3737
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
3838
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
3939
],
40-
"resources": {
41-
"object": "bar",
42-
"string": "bar",
43-
},
40+
"resources": {"foo": "string"},
4441
}
4542
],
4643
)
@@ -71,10 +68,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
7168
},
7269
},
7370
],
74-
"resources": {
75-
"object": "bar",
76-
"string": "bar",
77-
},
71+
"resources": {"foo": "string"},
7872
}
7973
],
8074
condition={
@@ -101,10 +95,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
10195
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
10296
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
10397
],
104-
"resources": {
105-
"object": "bar",
106-
"string": "bar",
107-
},
98+
"resources": {"foo": "string"},
10899
}
109100
],
110101
)
@@ -127,10 +118,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
127118
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
128119
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
129120
],
130-
"resources": {
131-
"object": "bar",
132-
"string": "bar",
133-
},
121+
"resources": {"foo": "string"},
134122
}
135123
],
136124
) as response:
@@ -156,10 +144,7 @@ def test_path_params_create(self, client: Cloudflare) -> None:
156144
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
157145
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
158146
],
159-
"resources": {
160-
"object": "bar",
161-
"string": "bar",
162-
},
147+
"resources": {"foo": "string"},
163148
}
164149
],
165150
)
@@ -178,10 +163,7 @@ def test_method_update(self, client: Cloudflare) -> None:
178163
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
179164
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
180165
],
181-
"resources": {
182-
"object": "bar",
183-
"string": "bar",
184-
},
166+
"resources": {"foo": "string"},
185167
}
186168
],
187169
)
@@ -213,10 +195,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
213195
},
214196
},
215197
],
216-
"resources": {
217-
"object": "bar",
218-
"string": "bar",
219-
},
198+
"resources": {"foo": "string"},
220199
}
221200
],
222201
condition={
@@ -245,10 +224,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
245224
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
246225
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
247226
],
248-
"resources": {
249-
"object": "bar",
250-
"string": "bar",
251-
},
227+
"resources": {"foo": "string"},
252228
}
253229
],
254230
)
@@ -272,10 +248,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
272248
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
273249
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
274250
],
275-
"resources": {
276-
"object": "bar",
277-
"string": "bar",
278-
},
251+
"resources": {"foo": "string"},
279252
}
280253
],
281254
) as response:
@@ -302,10 +275,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
302275
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
303276
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
304277
],
305-
"resources": {
306-
"object": "bar",
307-
"string": "bar",
308-
},
278+
"resources": {"foo": "string"},
309279
}
310280
],
311281
)
@@ -322,10 +292,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
322292
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
323293
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
324294
],
325-
"resources": {
326-
"object": "bar",
327-
"string": "bar",
328-
},
295+
"resources": {"foo": "string"},
329296
}
330297
],
331298
)
@@ -548,10 +515,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
548515
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
549516
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
550517
],
551-
"resources": {
552-
"object": "bar",
553-
"string": "bar",
554-
},
518+
"resources": {"foo": "string"},
555519
}
556520
],
557521
)
@@ -582,10 +546,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
582546
},
583547
},
584548
],
585-
"resources": {
586-
"object": "bar",
587-
"string": "bar",
588-
},
549+
"resources": {"foo": "string"},
589550
}
590551
],
591552
condition={
@@ -612,10 +573,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
612573
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
613574
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
614575
],
615-
"resources": {
616-
"object": "bar",
617-
"string": "bar",
618-
},
576+
"resources": {"foo": "string"},
619577
}
620578
],
621579
)
@@ -638,10 +596,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
638596
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
639597
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
640598
],
641-
"resources": {
642-
"object": "bar",
643-
"string": "bar",
644-
},
599+
"resources": {"foo": "string"},
645600
}
646601
],
647602
) as response:
@@ -667,10 +622,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
667622
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
668623
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
669624
],
670-
"resources": {
671-
"object": "bar",
672-
"string": "bar",
673-
},
625+
"resources": {"foo": "string"},
674626
}
675627
],
676628
)
@@ -689,10 +641,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
689641
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
690642
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
691643
],
692-
"resources": {
693-
"object": "bar",
694-
"string": "bar",
695-
},
644+
"resources": {"foo": "string"},
696645
}
697646
],
698647
)
@@ -724,10 +673,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
724673
},
725674
},
726675
],
727-
"resources": {
728-
"object": "bar",
729-
"string": "bar",
730-
},
676+
"resources": {"foo": "string"},
731677
}
732678
],
733679
condition={
@@ -756,10 +702,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
756702
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
757703
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
758704
],
759-
"resources": {
760-
"object": "bar",
761-
"string": "bar",
762-
},
705+
"resources": {"foo": "string"},
763706
}
764707
],
765708
)
@@ -783,10 +726,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
783726
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
784727
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
785728
],
786-
"resources": {
787-
"object": "bar",
788-
"string": "bar",
789-
},
729+
"resources": {"foo": "string"},
790730
}
791731
],
792732
) as response:
@@ -813,10 +753,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
813753
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
814754
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
815755
],
816-
"resources": {
817-
"object": "bar",
818-
"string": "bar",
819-
},
756+
"resources": {"foo": "string"},
820757
}
821758
],
822759
)
@@ -833,10 +770,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
833770
{"id": "c8fed203ed3043cba015a93ad1616f1f"},
834771
{"id": "82e64a83756745bbbb1c9c2701bf816b"},
835772
],
836-
"resources": {
837-
"object": "bar",
838-
"string": "bar",
839-
},
773+
"resources": {"foo": "string"},
840774
}
841775
],
842776
)

0 commit comments

Comments
 (0)