mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-17 07:10:37 +00:00
Compare commits
4403 commits
generated-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac1ae1cb4f | ||
|
|
1a32133afb | ||
|
|
8917497520 | ||
|
|
c8ae1c4a73 | ||
|
|
8b3ce06fc7 | ||
|
|
d6670b63bd | ||
|
|
7926da91e6 | ||
|
|
320184d824 | ||
|
|
4ebf402430 | ||
|
|
d7212f1a49 | ||
|
|
07a2a5f767 | ||
|
|
a7c1bd0a1e | ||
|
|
056581dc85 | ||
|
|
a102a1bef3 | ||
|
|
c34ffc9b4c | ||
|
|
0ffbbc908d | ||
|
|
eed581b908 | ||
|
|
4c166b5177 | ||
|
|
0291352a03 | ||
|
|
07bbf757e7 | ||
|
|
09930a5ad4 | ||
|
|
3bcfa29698 | ||
|
|
35c6110e79 | ||
|
|
9da70d6b74 | ||
|
|
d4795c5d22 | ||
|
|
fceaf952e4 | ||
|
|
c96a4a2945 | ||
|
|
504317bcf0 | ||
|
|
98fee4a292 | ||
|
|
348095e34f | ||
|
|
0e3aa91845 | ||
|
|
41338e3dd5 | ||
|
|
2d18032c67 | ||
|
|
d1e83c5d09 | ||
|
|
cc4533e355 | ||
|
|
8db9c20ccb | ||
|
|
6121b3ba11 | ||
|
|
df432e7609 | ||
|
|
9c8559d70a | ||
|
|
c9cbf7e211 | ||
|
|
5de1381d4d | ||
|
|
30ed065576 | ||
|
|
993fdb40b7 | ||
|
|
f21d1cd0bd | ||
|
|
fa43851595 | ||
|
|
6130ecc4dc | ||
|
|
cdba5080f6 | ||
|
|
75784282c4 | ||
|
|
43f3f5e8c9 | ||
|
|
8dad1e946d | ||
|
|
281c1cb68a | ||
|
|
5f179bd1ee | ||
|
|
30e933cbe5 | ||
|
|
247e55ddab | ||
|
|
5b9ca588f5 | ||
|
|
332065cd40 | ||
|
|
25eef72907 | ||
|
|
ae14989860 | ||
|
|
490c4a7cf1 | ||
|
|
2b5c16bd01 | ||
|
|
5824050255 | ||
|
|
b70af3b52d | ||
|
|
e5208e5870 | ||
|
|
ada93e7971 | ||
|
|
fbf6b19996 | ||
|
|
ab85801ef2 | ||
|
|
666946a5de | ||
|
|
5a1cebf4fb | ||
|
|
bde7bba347 | ||
|
|
638a408467 | ||
|
|
e78504b2c6 | ||
|
|
e8a25d6857 | ||
|
|
681873a149 | ||
|
|
7aea492684 | ||
|
|
daade1056c | ||
|
|
e25254e09a | ||
|
|
a44e5e2abc | ||
|
|
f77967cc93 | ||
|
|
7ed5dbaf85 | ||
|
|
07360b2995 | ||
|
|
9b7fd43d70 | ||
|
|
9329e893d3 | ||
|
|
5777e787d6 | ||
|
|
b7c8c9bf70 | ||
|
|
c23b742aae | ||
|
|
e7ee4790ca | ||
|
|
12f91c834a | ||
|
|
c6a8e46d6a | ||
|
|
a99409b2c4 | ||
|
|
59e8394259 | ||
|
|
6bface0539 | ||
|
|
ac82fc9c4b | ||
|
|
ee2b098c13 | ||
|
|
ac32dfd9b4 | ||
|
|
804d2090b0 | ||
|
|
63b2c62191 | ||
|
|
dd486ca988 | ||
|
|
8b2358aebd | ||
|
|
ccdf2978e5 | ||
|
|
dcfb0036e6 | ||
|
|
cb5769e139 | ||
|
|
5d271a4267 | ||
|
|
3fa3634276 | ||
|
|
67c2f9016f | ||
|
|
956c552db2 | ||
|
|
6844e77d68 | ||
|
|
b232e391f5 | ||
|
|
7fce06647a | ||
|
|
187690c42c | ||
|
|
d6e8de6c5e | ||
|
|
a1f094d6b2 | ||
|
|
41069fe111 | ||
|
|
0328fccbd5 | ||
|
|
2604f3e0f9 | ||
|
|
aa144bed24 | ||
|
|
05ab171a9d | ||
|
|
114cda31cc | ||
|
|
531510b8f3 | ||
|
|
ee716a27c4 | ||
|
|
c81d4cefa7 | ||
|
|
a5f7dc7757 | ||
|
|
8aca85028a | ||
|
|
ad5aa879fd | ||
|
|
01b04a5c33 | ||
|
|
ddf1d63e1a | ||
|
|
a23ce796f4 | ||
|
|
f2635a8db1 | ||
|
|
0dc99df1b5 | ||
|
|
ecb14f81db | ||
|
|
bbd2ec14f8 | ||
|
|
5bb2e3a54f | ||
|
|
09f900c702 | ||
|
|
1895824b4c | ||
|
|
feef780db5 | ||
|
|
256931e6ee | ||
|
|
f0bc6f2c1c | ||
|
|
064a80caf7 | ||
|
|
8285a2a510 | ||
|
|
ff06097767 | ||
|
|
03902e72f4 | ||
|
|
48a269c950 | ||
|
|
226447b1bb | ||
|
|
3166598cf9 | ||
|
|
107eec12be | ||
|
|
bd76d627d7 | ||
|
|
79d4fc9c93 | ||
|
|
a08321665b | ||
|
|
2e22aa3d15 | ||
|
|
f288008c4c | ||
|
|
ad389fb2d9 | ||
|
|
3cd208b548 | ||
|
|
42e4d7b3e5 | ||
|
|
843e74b394 | ||
|
|
e209fe93a2 | ||
|
|
694e7bdd19 | ||
|
|
fc4f23e1bf | ||
|
|
a763b1181d | ||
|
|
fc2d801cd3 | ||
|
|
63e9021ee7 | ||
|
|
c232d9c43d | ||
|
|
64fe2fc930 | ||
|
|
9cbf3ba16e | ||
|
|
99801fefe8 | ||
|
|
784cbd8a41 | ||
|
|
4ec79187ba | ||
|
|
d18d161e2c | ||
|
|
c90dc29462 | ||
|
|
412746b62c | ||
|
|
756dc87dde | ||
|
|
420b061e23 | ||
|
|
230ab49f3c | ||
|
|
683d427b63 | ||
|
|
daa38c323b | ||
|
|
a563edc852 | ||
|
|
6d09569da5 | ||
|
|
eda71210a3 | ||
|
|
c174702c79 | ||
|
|
526e8208d3 | ||
|
|
dd17de0e55 | ||
|
|
8156cfcf29 | ||
|
|
1b314dccb5 | ||
|
|
26b49cf554 | ||
|
|
ef1e121d6f | ||
|
|
a9e83cbe9c | ||
|
|
9358ffc1a3 | ||
|
|
31b5859708 | ||
|
|
1fe1799406 | ||
|
|
991e0fc1e1 | ||
|
|
0ebcb1d9d7 | ||
|
|
c73f7da0b9 | ||
|
|
1cc4487501 | ||
|
|
1239774eae | ||
|
|
de3c3670bc | ||
|
|
70c6acb46d | ||
|
|
f430026e5b | ||
|
|
21f6032e38 | ||
|
|
88ec221710 | ||
|
|
80e2782269 | ||
|
|
69d5705493 | ||
|
|
9376e78a79 | ||
|
|
a2d07437f9 | ||
|
|
0e54f805e6 | ||
|
|
e3b60cb7b5 | ||
|
|
adae794692 | ||
|
|
c24c53d46d | ||
|
|
7543822b83 | ||
|
|
82c33e17a5 | ||
|
|
07f3fd366e | ||
|
|
315f0b0ffb | ||
|
|
8781542734 | ||
|
|
b1b3e6706a | ||
|
|
1231168273 | ||
|
|
953ea469bc | ||
|
|
1a1599f9eb | ||
|
|
fd86d0565f | ||
|
|
d688d8cae0 | ||
|
|
b33f26b293 | ||
|
|
60adcfe666 | ||
|
|
2d0e1b2650 | ||
|
|
3ce565b426 | ||
|
|
c3cbead8bf | ||
|
|
ef0e95365d | ||
|
|
0e03991763 | ||
|
|
deef46a631 | ||
|
|
cc777e3735 | ||
|
|
ef47630032 | ||
|
|
202c8af03e | ||
|
|
4be105433a | ||
|
|
dfc2734221 | ||
|
|
c57d2f0df9 | ||
|
|
fa4d155e34 | ||
|
|
0efabf029d | ||
|
|
583b2c0e67 | ||
|
|
ccc6796fb7 | ||
|
|
7626a4ad33 | ||
|
|
f46bda50c6 | ||
|
|
06432e9cb6 | ||
|
|
104f49313b | ||
|
|
d3ecf74d52 | ||
|
|
677bc09c92 | ||
|
|
0562d99243 | ||
|
|
a2b0366e00 | ||
|
|
24bc11cf22 | ||
|
|
929b9cc9f2 | ||
|
|
12ce5aeec1 | ||
|
|
d40bf552be | ||
|
|
1e52865c88 | ||
|
|
6dc8518be6 | ||
|
|
ba9e07e4ea | ||
|
|
5a9d7b1949 | ||
|
|
1c06a6b21e | ||
|
|
2cf223a2f5 | ||
|
|
2253c4f71c | ||
|
|
e176282397 | ||
|
|
f177f81f52 | ||
|
|
e7d96a210e | ||
|
|
311500a7ac | ||
|
|
e934bc7192 | ||
|
|
c6f66707fe | ||
|
|
3396ea19fd | ||
|
|
ad75922803 | ||
|
|
3bd3de86dc | ||
|
|
56b5d17251 | ||
|
|
cc53052ce0 | ||
|
|
6fa8c01474 | ||
|
|
a62ea1f4e0 | ||
|
|
498e0aaeda | ||
|
|
c91c959452 | ||
|
|
cd1fa23f46 | ||
|
|
04408711c3 | ||
|
|
5d6c45bf10 | ||
|
|
8e3a146193 | ||
|
|
a774fae24d | ||
|
|
947a0f6bc1 | ||
|
|
3d9fc8ead6 | ||
|
|
850feb65f0 | ||
|
|
9423ba35e4 | ||
|
|
05dbc9b5d5 | ||
|
|
e8497e451c | ||
|
|
95584868de | ||
|
|
06a669a653 | ||
|
|
dc416deb22 | ||
|
|
1f908ce175 | ||
|
|
e78bbede6d | ||
|
|
e0fa8ba5d6 | ||
|
|
32626187b1 | ||
|
|
fac321f4a3 | ||
|
|
b2b853973c | ||
|
|
3ad25b0e41 | ||
|
|
7b05258d1b | ||
|
|
52f048d71c | ||
|
|
3116eff364 | ||
|
|
67747514e2 | ||
|
|
9e0f67e129 | ||
|
|
538f06cf66 | ||
|
|
43c314341d | ||
|
|
8bbdb09158 | ||
|
|
eb55e4138e | ||
|
|
5fdf1d676b | ||
|
|
543bc5b80e | ||
|
|
9fa89b53c5 | ||
|
|
fd0cac5130 | ||
|
|
7ec9f75255 | ||
|
|
eb4baecf1b | ||
|
|
eb08f599d6 | ||
|
|
748c4e824a | ||
|
|
2ef0d84f11 | ||
|
|
24c4cbbcfb | ||
|
|
cb3b0407e8 | ||
|
|
ff73ba2a19 | ||
|
|
4876ef7892 | ||
|
|
1950fab970 | ||
|
|
7404be07cb | ||
|
|
a53617dc69 | ||
|
|
84682dd063 | ||
|
|
c9fb679f92 | ||
|
|
32c371551f | ||
|
|
de2b2d002a | ||
|
|
730a028452 | ||
|
|
5b6e8e6693 | ||
|
|
8f9b7f968a | ||
|
|
a3e6097150 | ||
|
|
9c7bd6a869 | ||
|
|
7dbd84c034 | ||
|
|
c07a179cab | ||
|
|
8c98391fca | ||
|
|
3eebc2869e | ||
|
|
a80d32c6c1 | ||
|
|
546caeef89 | ||
|
|
138a7497bd | ||
|
|
0706852017 | ||
|
|
7a3837abea | ||
|
|
a4ea37c362 | ||
|
|
95e8cb98fe | ||
|
|
6d18f33ed7 | ||
|
|
89cf966cf7 | ||
|
|
19c43b9f32 | ||
|
|
c33634ece6 | ||
|
|
f051fda39c | ||
|
|
4e36104852 | ||
|
|
d8d12f0b21 | ||
|
|
594d40d72b | ||
|
|
6234f43d5d | ||
|
|
1b5bb1c805 | ||
|
|
5154be1187 | ||
|
|
4f8670399f | ||
|
|
385a5e4732 | ||
|
|
c2f7a6e3ec | ||
|
|
257bcc824b | ||
|
|
78d01a77cb | ||
|
|
bea25385a0 | ||
|
|
fbbc7a55ba | ||
|
|
2c8a8d3f0b | ||
|
|
8f35fe123b | ||
|
|
2c876743c0 | ||
|
|
9c340b31db | ||
|
|
0c32e14eba | ||
|
|
9c36dabe91 | ||
|
|
a4e3a9393c | ||
|
|
304403d83c | ||
|
|
e6f9fe168c | ||
|
|
2e842fe5c7 | ||
|
|
3b58f153b4 | ||
|
|
c667ae580c | ||
|
|
0d3f55f34a | ||
|
|
9c64ad74c9 | ||
|
|
7340bf1f3f | ||
|
|
118bc56a88 | ||
|
|
297c0a5ee1 | ||
|
|
e920acd059 | ||
|
|
53fa55d9ed | ||
|
|
b5d205a6c4 | ||
|
|
0eba680cab | ||
|
|
f487fd1b7f | ||
|
|
475b534aad | ||
|
|
4b96b39a68 | ||
|
|
b1a034bb4a | ||
|
|
8e191f1932 | ||
|
|
157a4e665b | ||
|
|
41537ba9ec | ||
|
|
71b91898dd | ||
|
|
8d12317a18 | ||
|
|
a94f532064 | ||
|
|
3aa3fa29e6 | ||
|
|
05d0d852b0 | ||
|
|
e5821fa94b | ||
|
|
417b029521 | ||
|
|
136a09be1f | ||
|
|
72f73f9208 | ||
|
|
064f77360a | ||
|
|
607deba07a | ||
|
|
3a38efda7b | ||
|
|
ad29ea4521 | ||
|
|
8b82e7aa63 | ||
|
|
b7fb4fa2d4 | ||
|
|
64e4fd55ba | ||
|
|
36e746a308 | ||
|
|
8b2eda8d72 | ||
|
|
e84a1cca20 | ||
|
|
c6034b66bb | ||
|
|
199ab374bf | ||
|
|
00af2c6602 | ||
|
|
19c0409fbe | ||
|
|
4101e4058f | ||
|
|
cd1ce1deda | ||
|
|
3632e3d656 | ||
|
|
540aeadb84 | ||
|
|
e02eaae02e | ||
|
|
16877d69d3 | ||
|
|
2ed75a500e | ||
|
|
22da63a72c | ||
|
|
6438215080 | ||
|
|
219ed43eb1 | ||
|
|
4ed10d9425 | ||
|
|
334a510cd9 | ||
|
|
5b30d442ae | ||
|
|
bc1ab4a91a | ||
|
|
54ae33bdaf | ||
|
|
cce8aa1254 | ||
|
|
36caebc37f | ||
|
|
542b143d19 | ||
|
|
a2f9775b95 | ||
|
|
718d9c8e68 | ||
|
|
c18a098640 | ||
|
|
ad23dc6f54 | ||
|
|
7487db21a9 | ||
|
|
14f8fbaa08 | ||
|
|
d5269dd27f | ||
|
|
26e271148b | ||
|
|
1a0f354a27 | ||
|
|
dd64495bc4 | ||
|
|
fd0de51424 | ||
|
|
ddd19ae299 | ||
|
|
8925395310 | ||
|
|
242c3141dc | ||
|
|
31d7a86232 | ||
|
|
90bc46cdd7 | ||
|
|
0ae9745c22 | ||
|
|
6e07ae1be3 | ||
|
|
0e13a9b098 | ||
|
|
f97b094bf0 | ||
|
|
91316eea8a | ||
|
|
de6f1d0f6c | ||
|
|
d7201d232c | ||
|
|
bc7133dd7f | ||
|
|
7d694e1836 | ||
|
|
e725155771 | ||
|
|
a92fc6233f | ||
|
|
bcca7546e5 | ||
|
|
ee0f955a3b | ||
|
|
70376269a7 | ||
|
|
b29892e925 | ||
|
|
62c78b4da4 | ||
|
|
67a7cb1fda | ||
|
|
a40a8998d8 | ||
|
|
d1ff3b01c5 | ||
|
|
3afa589549 | ||
|
|
1a92d199bb | ||
|
|
a9bc47fb44 | ||
|
|
b5e03a6d83 | ||
|
|
6fa22edc2e | ||
|
|
e4d4ff5267 | ||
|
|
db8e9307e4 | ||
|
|
0c6081a5f6 | ||
|
|
c8af26d72d | ||
|
|
6e80064515 | ||
|
|
3b99726040 | ||
|
|
cb7a1ca974 | ||
|
|
a8b57a5e46 | ||
|
|
253d1ad723 | ||
|
|
591f73d0cb | ||
|
|
4ed5e61825 | ||
|
|
381bce72b4 | ||
|
|
1739dc82a5 | ||
|
|
e424320e50 | ||
|
|
5366c80121 | ||
|
|
900a341b92 | ||
|
|
1685ab7e4e | ||
|
|
e75c6eb917 | ||
|
|
644a41917a | ||
|
|
bb4bd218a1 | ||
|
|
b79fd2fdef | ||
|
|
29147073fa | ||
|
|
88f8c8a04a | ||
|
|
1062bfb456 | ||
|
|
1675067fb1 | ||
|
|
977d5c7201 | ||
|
|
7e4626961b | ||
|
|
7b734a186d | ||
|
|
b1fdd1187e | ||
|
|
703aae6518 | ||
|
|
0cdd87f49a | ||
|
|
6b721a6807 | ||
|
|
bf8e983290 | ||
|
|
1e88f505eb | ||
|
|
15854a9bac | ||
|
|
ad8c04deff | ||
|
|
649d2039b2 | ||
|
|
5fe7ea9b5b | ||
|
|
bfc0dd8d66 | ||
|
|
03e79c10da | ||
|
|
7b3a51bc15 | ||
|
|
1daf1c28c6 | ||
|
|
edfddf31cf | ||
|
|
b895d1478d | ||
|
|
8c5439cb8d | ||
|
|
c8a0db8796 | ||
|
|
be32215fc9 | ||
|
|
84b83b541b | ||
|
|
b234613b5f | ||
|
|
6c7acdcbcf | ||
|
|
59019001da | ||
|
|
577f8f63ab | ||
|
|
2d00c506e8 | ||
|
|
ba166b3698 | ||
|
|
552d99deb7 | ||
|
|
d0e8d73cf4 | ||
|
|
d487232e26 | ||
|
|
17cb705744 | ||
|
|
92d1bed8e1 | ||
|
|
d1de8e655f | ||
|
|
1cdbf1c5e0 | ||
|
|
194e957232 | ||
|
|
5fa9150dd8 | ||
|
|
c0baa5fb1d | ||
|
|
701819b09f | ||
|
|
4beeff9c87 | ||
|
|
c5794681c7 | ||
|
|
f6dbb4a1c5 | ||
|
|
649cb244d8 | ||
|
|
1bb92c8521 | ||
|
|
461dac60ff | ||
|
|
752ed983a7 | ||
|
|
5ad6267fc2 | ||
|
|
c3cf9ac6ad | ||
|
|
c4a4eb79f5 | ||
|
|
a6249b7c10 | ||
|
|
84758cf903 | ||
|
|
ad34b4d852 | ||
|
|
f5d07b9dc1 | ||
|
|
720a4f09c0 | ||
|
|
2828953dd2 | ||
|
|
380250fe78 | ||
|
|
fd54a7bb9a | ||
|
|
a5ddb11d12 | ||
|
|
a132738127 | ||
|
|
3d7b02f8ae | ||
|
|
11b7bbb7d4 | ||
|
|
179f185205 | ||
|
|
d094bebf65 | ||
|
|
a72fb0adc2 | ||
|
|
c29e981e2f | ||
|
|
3dc14a1316 | ||
|
|
597c59eb8e | ||
|
|
4476835630 | ||
|
|
07ab04d997 | ||
|
|
ef764d481e | ||
|
|
f381a9801f | ||
|
|
ce7c6e970b | ||
|
|
39426ec6a4 | ||
|
|
3f15a22269 | ||
|
|
ef1b563ebf | ||
|
|
e09e0ee0e0 | ||
|
|
c189b32b1e | ||
|
|
ecac54cf17 | ||
|
|
a45728adfa | ||
|
|
d900af34c1 | ||
|
|
2248053e09 | ||
|
|
a13c51da77 | ||
|
|
4f2fe11cd2 | ||
|
|
b403b70201 | ||
|
|
e9cab7ecc8 | ||
|
|
fdf68a82b0 | ||
|
|
7fdb3acba4 | ||
|
|
5c405cef86 | ||
|
|
1788a7256c | ||
|
|
c2b6ce133d | ||
|
|
0c0e90cd32 | ||
|
|
b2d2377811 | ||
|
|
c6ce7806c7 | ||
|
|
1e0b357bb6 | ||
|
|
fceef0cd04 | ||
|
|
dd52a57ceb | ||
|
|
7e458e7669 | ||
|
|
6aa431d66b | ||
|
|
afabde3c77 | ||
|
|
7701fc5b27 | ||
|
|
8f5755fb5f | ||
|
|
d18dee35a6 | ||
|
|
19aec0a498 | ||
|
|
71032c2a95 | ||
|
|
58eae895be | ||
|
|
11d079b31b | ||
|
|
7c07fb27ec | ||
|
|
5667406657 | ||
|
|
07074f1588 | ||
|
|
04834e7b5f | ||
|
|
faafd4e1ed | ||
|
|
d2d1c246d0 | ||
|
|
95796251b5 | ||
|
|
a7f790a0c8 | ||
|
|
1a4aa1bc2b | ||
|
|
f49710ab9f | ||
|
|
c364ea9a4e | ||
|
|
94d09b839e | ||
|
|
14837411e9 | ||
|
|
c05d148535 | ||
|
|
ed77a9c883 | ||
|
|
75e914b4b4 | ||
|
|
19019e26ec | ||
|
|
ecc0b17e46 | ||
|
|
1a5e6ff2cc | ||
|
|
ea379f5c19 | ||
|
|
fcfe4febd0 | ||
|
|
8cac6ad3cd | ||
|
|
9fe503be8d | ||
|
|
6750cf364f | ||
|
|
fdc3e4182e | ||
|
|
17f7fc563d | ||
|
|
ee8f1e3bcf | ||
|
|
220dd057c9 | ||
|
|
a989c2bb34 | ||
|
|
d36269376d | ||
|
|
0b00d971c8 | ||
|
|
40f0ef1365 | ||
|
|
4d3b7b7c1b | ||
|
|
039e41c2c5 | ||
|
|
bd2ff86ff4 | ||
|
|
ad8b7f2098 | ||
|
|
82c29874a8 | ||
|
|
d7b7407130 | ||
|
|
33327c7a0c | ||
|
|
d546ce8923 | ||
|
|
03e9458b14 | ||
|
|
0e950d65a7 | ||
|
|
ff1a1776e7 | ||
|
|
d1f26b4740 | ||
|
|
ff60f913cf | ||
|
|
305bc1d5fe | ||
|
|
86f69ea8ab | ||
|
|
db99f314d4 | ||
|
|
e4c01bc132 | ||
|
|
2b51c9c2c6 | ||
|
|
23d7f1ca8f | ||
|
|
0c6f4a1c25 | ||
|
|
a2ddb17158 | ||
|
|
a99b147a33 | ||
|
|
1fbd77ba3a | ||
|
|
0306df1d4d | ||
|
|
3a3462dcb5 | ||
|
|
20295df888 | ||
|
|
bf6d4b9fbf | ||
|
|
f8baa7506f | ||
|
|
1a5cf12542 | ||
|
|
8812e3c3a4 | ||
|
|
62394cbd35 | ||
|
|
6c59fd59d2 | ||
|
|
37c83d5820 | ||
|
|
31192943ef | ||
|
|
9edf66cb3c | ||
|
|
ba2b47ac12 | ||
|
|
d04eeca866 | ||
|
|
775028af14 | ||
|
|
0732d2b286 | ||
|
|
0d61d2a953 | ||
|
|
97ed9b24d0 | ||
|
|
676ac089f6 | ||
|
|
3f6045dffd | ||
|
|
9ca549e242 | ||
|
|
d078d8290e | ||
|
|
71efbfaf56 | ||
|
|
3697eacbd3 | ||
|
|
d391777ce6 | ||
|
|
af68ef6ac4 | ||
|
|
e749879ab0 | ||
|
|
66684b6c5a | ||
|
|
4f4710ea85 | ||
|
|
e3ba5c153d | ||
|
|
8b3c388f9d | ||
|
|
d2136c38fb | ||
|
|
4a847fe1b5 | ||
|
|
b2cfa5d064 | ||
|
|
e2276987c7 | ||
|
|
d045812f3a | ||
|
|
37004e6049 | ||
|
|
d61b25a7e2 | ||
|
|
5cbdb5e773 | ||
|
|
1c2fb5a49f | ||
|
|
a40f4376af | ||
|
|
e761fc9c05 | ||
|
|
1fe10e72b8 | ||
|
|
8fea9cb064 | ||
|
|
47a7356a3c | ||
|
|
67ee23a7ac | ||
|
|
004208ba4e | ||
|
|
02d39ccd1a | ||
|
|
41ecfcc5d5 | ||
|
|
8ca04ea4ae | ||
|
|
f6b85e011f | ||
|
|
9344bc8a4b | ||
|
|
563ea64e06 | ||
|
|
b7696e2a48 | ||
|
|
cd5d257652 | ||
|
|
a4f55b62b2 | ||
|
|
be4674648e | ||
|
|
6834a83123 | ||
|
|
f331b9cd75 | ||
|
|
4f76ce8034 | ||
|
|
06145e2f14 | ||
|
|
e9809cfbae | ||
|
|
d450f544d6 | ||
|
|
012add4d67 | ||
|
|
baedf673e4 | ||
|
|
fff82c307f | ||
|
|
128fbe63aa | ||
|
|
7b274325e2 | ||
|
|
885373e610 | ||
|
|
af978d0298 | ||
|
|
b38f0ace9a | ||
|
|
7d76f9d101 | ||
|
|
695b9045e9 | ||
|
|
c01bbd3e6c | ||
|
|
cf53e28855 | ||
|
|
7f1372ea2a | ||
|
|
0f6dce048b | ||
|
|
199a88be63 | ||
|
|
2c61aa3ac9 | ||
|
|
f86f76f379 | ||
|
|
4aa7131b3c | ||
|
|
2afcb5ca3c | ||
|
|
f6204c6b2f | ||
|
|
db33638b9f | ||
|
|
8ab8c4eb4b | ||
|
|
778f78115d | ||
|
|
d87ddb6242 | ||
|
|
4798d43f42 | ||
|
|
204b88ab27 | ||
|
|
da9bafdbe1 | ||
|
|
8aef5949b2 | ||
|
|
26dd72372e | ||
|
|
989c450d67 | ||
|
|
66d9ea12ae | ||
|
|
0c71dd55bf | ||
|
|
7e24b935de | ||
|
|
f0e33192d4 | ||
|
|
5ef54c7e5e | ||
|
|
6a8f351e0d | ||
|
|
dff3ef1ca2 | ||
|
|
4b3192ce5c | ||
|
|
4c327b919a | ||
|
|
4a3e172e60 | ||
|
|
e7719ca1b9 | ||
|
|
37cf1c632b | ||
|
|
3c7d7cf028 | ||
|
|
dfa191a224 | ||
|
|
d9e5c67d57 | ||
|
|
8b27e754bf | ||
|
|
a280770a67 | ||
|
|
e84e11bd29 | ||
|
|
f87b664fee | ||
|
|
786e044ffd | ||
|
|
b8fca2df54 | ||
|
|
9fa1796063 | ||
|
|
8cefbce049 | ||
|
|
30c1a25280 | ||
|
|
4151b24379 | ||
|
|
d1a800bd62 | ||
|
|
ebd43ba06f | ||
|
|
408a32105a | ||
|
|
d6da944485 | ||
|
|
ef3241155b | ||
|
|
1f8dd7cf49 | ||
|
|
8495fc472b | ||
|
|
911baa9178 | ||
|
|
5f108a7da1 | ||
|
|
8a59c82a62 | ||
|
|
d944593979 | ||
|
|
6b4fb7364f | ||
|
|
6c2e97608d | ||
|
|
a7b06ba519 | ||
|
|
a759138802 | ||
|
|
d3b07f1989 | ||
|
|
04febc51d5 | ||
|
|
3c85796579 | ||
|
|
18a53df5be | ||
|
|
13751bd24b | ||
|
|
3e0c3d21b2 | ||
|
|
c8156f66af | ||
|
|
e2c3f0e925 | ||
|
|
913a2f17d3 | ||
|
|
8caed87d4c | ||
|
|
f95f44872f | ||
|
|
608d92209e | ||
|
|
51535d72cf | ||
|
|
3faea45157 | ||
|
|
2d18890966 | ||
|
|
a0bdfecf96 | ||
|
|
60555df79a | ||
|
|
4b5aa76925 | ||
|
|
875b226008 | ||
|
|
55bdd142fe | ||
|
|
f79941a810 | ||
|
|
3f093ce43d | ||
|
|
669e3a2cd5 | ||
|
|
3563caf13e | ||
|
|
4f16970993 | ||
|
|
0cd03dc03b | ||
|
|
95b38c1055 | ||
|
|
4cd628c6a8 | ||
|
|
3496867059 | ||
|
|
619680a821 | ||
|
|
1721bdeee5 | ||
|
|
31d8cdb16a | ||
|
|
18c412a620 | ||
|
|
b1ca732ef2 | ||
|
|
f2a2601eb9 | ||
|
|
31d114adba | ||
|
|
a41dac604c | ||
|
|
d55225fdc6 | ||
|
|
cc95551376 | ||
|
|
e6289234b0 | ||
|
|
38d255e3fa | ||
|
|
fdd636ea04 | ||
|
|
49799344bd | ||
|
|
2791ca0f13 | ||
|
|
39eee8115c | ||
|
|
6298c3d18f | ||
|
|
fbcee1293c | ||
|
|
7acc8ad35c | ||
|
|
4986e298df | ||
|
|
f6fc8fd816 | ||
|
|
777a87352e | ||
|
|
1049a59c57 | ||
|
|
daad33b1d3 | ||
|
|
13bb1b5659 | ||
|
|
bef97cb4c5 | ||
|
|
94013898de | ||
|
|
8c680ab101 | ||
|
|
a19067b84f | ||
|
|
b3bb180dc1 | ||
|
|
e87711d7aa | ||
|
|
f9ac4bd1d9 | ||
|
|
5c84e05ec1 | ||
|
|
5517a90563 | ||
|
|
2c537a459e | ||
|
|
007f4495f0 | ||
|
|
60e0273652 | ||
|
|
0cad077c08 | ||
|
|
d3bede256c | ||
|
|
6586194d66 | ||
|
|
95e70afa30 | ||
|
|
d11c055b98 | ||
|
|
60f39ca17a | ||
|
|
6cd14e4015 | ||
|
|
dd3c2d99bd | ||
|
|
d70cd0843d | ||
|
|
40fb5d7837 | ||
|
|
05ca0d93a1 | ||
|
|
ad8669ffa6 | ||
|
|
d4c2a27e26 | ||
|
|
67998d3696 | ||
|
|
fb41d15660 | ||
|
|
fa6eeff3b3 | ||
|
|
25f146de21 | ||
|
|
b8a08463e9 | ||
|
|
1dbea20306 | ||
|
|
4f27679963 | ||
|
|
e571768cba | ||
|
|
95872a7bf1 | ||
|
|
da737397d0 | ||
|
|
7d7101f719 | ||
|
|
25e996e0fb | ||
|
|
a9ebbad8a7 | ||
|
|
6c59419247 | ||
|
|
bdfd4fe2be | ||
|
|
10458c5825 | ||
|
|
8bd8510dbb | ||
|
|
e36630197c | ||
|
|
025f13868f | ||
|
|
ba19d769d4 | ||
|
|
5ed9984510 | ||
|
|
31433acb6d | ||
|
|
7bf12be43b | ||
|
|
ce8fca0994 | ||
|
|
21ab1948e1 | ||
|
|
b505cf8790 | ||
|
|
f440cc49b9 | ||
|
|
78544abb45 | ||
|
|
e7647c513f | ||
|
|
2ec01e7d9f | ||
|
|
e2f1a8599c | ||
|
|
150839634b | ||
|
|
6208f98f38 | ||
|
|
18d68d5de8 | ||
|
|
b04dbcbc44 | ||
|
|
8fb0d0a04a | ||
|
|
196e7c8070 | ||
|
|
68b2dc1035 | ||
|
|
5e11322262 | ||
|
|
09474a8ed1 | ||
|
|
b3ce118460 | ||
|
|
238ace4aca | ||
|
|
6b4a8e8b37 | ||
|
|
a5e134820e | ||
|
|
f2c4d96e7e | ||
|
|
f14db9739f | ||
|
|
f6250be985 | ||
|
|
9f45e61aab | ||
|
|
f2dd4a5132 | ||
|
|
b9998d5486 | ||
|
|
e164792a10 | ||
|
|
8ff1336a34 | ||
|
|
8491d361b4 | ||
|
|
d432614878 | ||
|
|
29aa5a8491 | ||
|
|
7967c6c588 | ||
|
|
4c495dac37 | ||
|
|
c11b076181 | ||
|
|
33d67a0e69 | ||
|
|
d4d0167904 | ||
|
|
c187e84f8b | ||
|
|
2d660921c5 | ||
|
|
8ccfe59ed6 | ||
|
|
c37ac489db | ||
|
|
f9d1c46e0f | ||
|
|
27baeff185 | ||
|
|
3a09c7fbbc | ||
|
|
6127428d50 | ||
|
|
d00b7835c9 | ||
|
|
b9b7ea4b24 | ||
|
|
994cb78b50 | ||
|
|
4447ff8a80 | ||
|
|
7b4b1f264d | ||
|
|
949ca4b447 | ||
|
|
ece1cc5e41 | ||
|
|
094f951a4c | ||
|
|
12d767c56f | ||
|
|
c96ed6b2f4 | ||
|
|
415fba0d29 | ||
|
|
4b25f86286 | ||
|
|
f896e3749c | ||
|
|
76884cf76f | ||
|
|
ac5db5500d | ||
|
|
2af0e793b5 | ||
|
|
5cfd1de78a | ||
|
|
e528d4e590 | ||
|
|
dbeeeaeef2 | ||
|
|
3e4f4ff174 | ||
|
|
433d1972aa | ||
|
|
585bf448fe | ||
|
|
ab1db5e59c | ||
|
|
5461b1d035 | ||
|
|
7fd1bf0b2a | ||
|
|
2cc8169d33 | ||
|
|
654ad5f918 | ||
|
|
3c436a602e | ||
|
|
0416008cc8 | ||
|
|
43b9565f7c | ||
|
|
a216e2e393 | ||
|
|
35bc4e4614 | ||
|
|
f44ffd9b08 | ||
|
|
db1107990a | ||
|
|
af19200849 | ||
|
|
411faf6186 | ||
|
|
c7af07746f | ||
|
|
c4fedb40aa | ||
|
|
8929f20e32 | ||
|
|
354e89899d | ||
|
|
b598a2d52b | ||
|
|
a6e3752180 | ||
|
|
b1ede14fbb | ||
|
|
11606b1ce6 | ||
|
|
b3ad8c87dd | ||
|
|
f5fd3eeba8 | ||
|
|
3e61aa9fa6 | ||
|
|
c05f73f7fc | ||
|
|
23145fe154 | ||
|
|
055eae7ca4 | ||
|
|
a2acfb6807 | ||
|
|
1795d55be5 | ||
|
|
742363c7d3 | ||
|
|
1cf5bcb02c | ||
|
|
83147080d6 | ||
|
|
814f5754e8 | ||
|
|
ef5a192896 | ||
|
|
5932cbc74b | ||
|
|
86e9e212df | ||
|
|
44fe568511 | ||
|
|
60dc1ec346 | ||
|
|
c985ddfc81 | ||
|
|
91b72b8b9e | ||
|
|
180b188ff9 | ||
|
|
c629d56f59 | ||
|
|
253874c013 | ||
|
|
6701e97ab2 | ||
|
|
c40823ba0a | ||
|
|
74d13c94e4 | ||
|
|
a121f9a2ac | ||
|
|
b43303f584 | ||
|
|
5b41492a8c | ||
|
|
0159f11dcb | ||
|
|
afe204f40a | ||
|
|
04417d8f23 | ||
|
|
6f839afb01 | ||
|
|
ab747d82df | ||
|
|
bcb83e357f | ||
|
|
27f772bee0 | ||
|
|
42efe02349 | ||
|
|
21c6ef39c6 | ||
|
|
1001e96374 | ||
|
|
03e3f91177 | ||
|
|
cf867b7790 | ||
|
|
df245c4a87 | ||
|
|
d8661881cb | ||
|
|
a59bc16830 | ||
|
|
64f8ca0ba3 | ||
|
|
99f49b325e | ||
|
|
609b52f322 | ||
|
|
8e6118e372 | ||
|
|
b95be3ff81 | ||
|
|
58686d5db3 | ||
|
|
4f3866dd4b | ||
|
|
b782db35ac | ||
|
|
7be518154d | ||
|
|
f6271e2284 | ||
|
|
54e678404e | ||
|
|
626161dd60 | ||
|
|
c7c289519b | ||
|
|
78360a9ae8 | ||
|
|
6fb80358b5 | ||
|
|
c3faef0269 | ||
|
|
b186635e92 | ||
|
|
9352fd5310 | ||
|
|
dbf2f37fe0 | ||
|
|
8ff6bb1c60 | ||
|
|
7f9df1b21a | ||
|
|
e9cbc25505 | ||
|
|
4036cff56c | ||
|
|
b3c931a64f | ||
|
|
7fa28cf107 | ||
|
|
becca312b5 | ||
|
|
ada4a631c3 | ||
|
|
d46e34be64 | ||
|
|
304f14a58f | ||
|
|
3ef495cd50 | ||
|
|
5b9e1c758e | ||
|
|
022663bdb5 | ||
|
|
9f8837cd1d | ||
|
|
3cf421e88f | ||
|
|
a67683b322 | ||
|
|
485c247e29 | ||
|
|
ec865ede2c | ||
|
|
42d2df5610 | ||
|
|
a2994e7fd1 | ||
|
|
245fb2df46 | ||
|
|
20fbd5f5da | ||
|
|
400a6ac947 | ||
|
|
1ec860d303 | ||
|
|
e674ca7a1b | ||
|
|
3ef38c2b0e | ||
|
|
190383e9f0 | ||
|
|
842b4537ab | ||
|
|
350f61f22b | ||
|
|
0b34c1021d | ||
|
|
8b29e45b9c | ||
|
|
3a71098303 | ||
|
|
d2eea96da3 | ||
|
|
ea00c6998e | ||
|
|
399460f6dc | ||
|
|
2d7663792a | ||
|
|
486de51ad4 | ||
|
|
8c21019635 | ||
|
|
9558fe5f9f | ||
|
|
b0a068e65c | ||
|
|
721e2180df | ||
|
|
dd21a12a55 | ||
|
|
8ea03586f5 | ||
|
|
781c40868e | ||
|
|
d0356ff31b | ||
|
|
3d36c878e2 | ||
|
|
a314ecf65c | ||
|
|
234fac4a2f | ||
|
|
3d86ae977f | ||
|
|
41fea370c9 | ||
|
|
efa747ffac | ||
|
|
a9aff7089b | ||
|
|
4dc6a2d1cd | ||
|
|
3726a69d68 | ||
|
|
c8adb81768 | ||
|
|
29bf562d93 | ||
|
|
91e8d7dca3 | ||
|
|
6b4ad0e8ea | ||
|
|
33b0654aef | ||
|
|
9b164a5bdc | ||
|
|
e24ab7a0fe | ||
|
|
c7fc4a487e | ||
|
|
bac91d09f1 | ||
|
|
775153ae5e | ||
|
|
76761da087 | ||
|
|
f8c5a14404 | ||
|
|
50b526cb59 | ||
|
|
1dcc72812a | ||
|
|
696bf55405 | ||
|
|
b5291ff398 | ||
|
|
b9e8e83157 | ||
|
|
725b74610b | ||
|
|
84a30d75eb | ||
|
|
5ee7ad1b48 | ||
|
|
ab879fc241 | ||
|
|
f27a611160 | ||
|
|
db9441e9d6 | ||
|
|
0f82140267 | ||
|
|
ae86458bcc | ||
|
|
396ca15298 | ||
|
|
9838d9baf9 | ||
|
|
8d92a4da2d | ||
|
|
6452b4fc1c | ||
|
|
7be27ccd6a | ||
|
|
1eed34f82f | ||
|
|
e5bc8e40a2 | ||
|
|
79e06acb25 | ||
|
|
e7e279ce7f | ||
|
|
cbe322c5ce | ||
|
|
4b85e7c422 | ||
|
|
13cb87db4e | ||
|
|
82bd59aabd | ||
|
|
678a4cc7c1 | ||
|
|
b9d21e2cce | ||
|
|
b03d706b2c | ||
|
|
02785f0357 | ||
|
|
318370f356 | ||
|
|
fb70863481 | ||
|
|
d467b552d4 | ||
|
|
22d6f6a545 | ||
|
|
d61d6514aa | ||
|
|
3cbd92cc79 | ||
|
|
a589f62594 | ||
|
|
1daa8521ad | ||
|
|
a80f4380c0 | ||
|
|
997e76c44e | ||
|
|
fb256d6d78 | ||
|
|
7c57e7fe25 | ||
|
|
8993161c30 | ||
|
|
99b897e941 | ||
|
|
f91d0a66a1 | ||
|
|
45a632b6bb | ||
|
|
8020023d93 | ||
|
|
1c512517ad | ||
|
|
ea8eba541f | ||
|
|
f15782abf3 | ||
|
|
eceb0bb926 | ||
|
|
5ac1547cdc | ||
|
|
59c11df0c5 | ||
|
|
9714af9f1f | ||
|
|
e19a0bc2df | ||
|
|
fd88938090 | ||
|
|
85781c7aa9 | ||
|
|
5c98d68ca6 | ||
|
|
35ad0da1a1 | ||
|
|
382b222c69 | ||
|
|
83f3046e8f | ||
|
|
22ed9e7cd2 | ||
|
|
691e88c0f1 | ||
|
|
63065ff249 | ||
|
|
28ad38e7d6 | ||
|
|
9d7e34aa7f | ||
|
|
8d68b06e42 | ||
|
|
6fed285b03 | ||
|
|
c4a30f58e9 | ||
|
|
b087493e54 | ||
|
|
ad83253dd2 | ||
|
|
365f8b8392 | ||
|
|
4f8ffed1bb | ||
|
|
d38e78473b | ||
|
|
bb5ce84ef4 | ||
|
|
c8b5873b69 | ||
|
|
0fcc0eb8be | ||
|
|
e0f23f6c98 | ||
|
|
2b920bce7a | ||
|
|
4c89890bf6 | ||
|
|
fb046c9ac4 | ||
|
|
63fe23724f | ||
|
|
0c1a3cde17 | ||
|
|
cc218d0186 | ||
|
|
23bc225bf9 | ||
|
|
8b817066d4 | ||
|
|
6dc8b43cba | ||
|
|
5feb309c32 | ||
|
|
f14a36c084 | ||
|
|
9be116edb5 | ||
|
|
e6469e548f | ||
|
|
d3faaf203e | ||
|
|
09eee108cf | ||
|
|
b3b4976eee | ||
|
|
3b1e3ac4c4 | ||
|
|
6377c9625b | ||
|
|
ea4af79fd7 | ||
|
|
897cb5d9fc | ||
|
|
9c74c35288 | ||
|
|
38f39f5a2d | ||
|
|
6dd613eceb | ||
|
|
bb5d651470 | ||
|
|
0749c30ad3 | ||
|
|
b31b885bdc | ||
|
|
9f2b44a424 | ||
|
|
c8c233135c | ||
|
|
4a7cce2366 | ||
|
|
a32f7f4efd | ||
|
|
671d6f13da | ||
|
|
a06b786bd0 | ||
|
|
1a00b4942c | ||
|
|
43cc685c2e | ||
|
|
2a72515dcd | ||
|
|
eed2102b4a | ||
|
|
171d27895a | ||
|
|
79599563c7 | ||
|
|
0a539cac43 | ||
|
|
06dc8d6337 | ||
|
|
db63a891f6 | ||
|
|
fce9f77df7 | ||
|
|
373e33095f | ||
|
|
db75221789 | ||
|
|
c3a6b8b8ce | ||
|
|
ee0b98803c | ||
|
|
8628ff138e | ||
|
|
e082e70472 | ||
|
|
5376e01a03 | ||
|
|
9f5db76d67 | ||
|
|
7b4b6ba0ac | ||
|
|
2c18c7b56b | ||
|
|
18e260729b | ||
|
|
434c9bcfdc | ||
|
|
8a6a86ec96 | ||
|
|
12d8b2aa53 | ||
|
|
129ad31e34 | ||
|
|
f89618e1f5 | ||
|
|
1b62d3e0b0 | ||
|
|
9014a25047 | ||
|
|
06805500de | ||
|
|
44c1559839 | ||
|
|
0a0e94ba98 | ||
|
|
2ec6012630 | ||
|
|
d4b4d44fa4 | ||
|
|
4f2901796c | ||
|
|
f0210024ca | ||
|
|
60524682ae | ||
|
|
1ad9c65df2 | ||
|
|
cfadb1f3dd | ||
|
|
f9a17c08cc | ||
|
|
bffab4392b | ||
|
|
f4cb436a7b | ||
|
|
2f0c13d341 | ||
|
|
7faa67e868 | ||
|
|
132c1cce10 | ||
|
|
2e3260adc4 | ||
|
|
0aa2a75cb7 | ||
|
|
3d1c382c88 | ||
|
|
4f672b2779 | ||
|
|
ec87056a22 | ||
|
|
77c1f63438 | ||
|
|
70a36e8bc2 | ||
|
|
3eb852c848 | ||
|
|
8fa7fa3146 | ||
|
|
dfa3e75c85 | ||
|
|
7d2e41ce6a | ||
|
|
10130aa6d0 | ||
|
|
72b7ad595a | ||
|
|
739729c033 | ||
|
|
37a6922752 | ||
|
|
638463e09f | ||
|
|
a047042584 | ||
|
|
115692aa41 | ||
|
|
a6fcd6b0fc | ||
|
|
5903758eef | ||
|
|
d2589efc19 | ||
|
|
d378fb7df9 | ||
|
|
81bb51bfaa | ||
|
|
e5de4c9695 | ||
|
|
0727f282b3 | ||
|
|
3740dee443 | ||
|
|
faa2c10317 | ||
|
|
65ba2373e8 | ||
|
|
fc6ca90779 | ||
|
|
8dacecc0d6 | ||
|
|
80d050507b | ||
|
|
5bae07901d | ||
|
|
bf9d860451 | ||
|
|
02d7cbbe9c | ||
|
|
1dedfa998d | ||
|
|
7f83adf153 | ||
|
|
b241f5b4f5 | ||
|
|
8ce1bcb3a7 | ||
|
|
85fd5868a8 | ||
|
|
370836be94 | ||
|
|
a1e865f027 | ||
|
|
878ae25e6b | ||
|
|
62ae0252e5 | ||
|
|
f3508f4cec | ||
|
|
302b156f74 | ||
|
|
61a852b624 | ||
|
|
1d668f96ed | ||
|
|
8225a83398 | ||
|
|
7fce6348d5 | ||
|
|
9228d480c3 | ||
|
|
520a260515 | ||
|
|
4423d8f45b | ||
|
|
8072d1e30f | ||
|
|
1bd37b9d64 | ||
|
|
2a3b8c5c95 | ||
|
|
11683b6141 | ||
|
|
e6ff06cb56 | ||
|
|
645adba800 | ||
|
|
0dfba03ee6 | ||
|
|
e0e0068535 | ||
|
|
5a0030a63d | ||
|
|
7af6c0025b | ||
|
|
2b17e06de2 | ||
|
|
df1729282f | ||
|
|
6074a04a11 | ||
|
|
68720aacb7 | ||
|
|
0a952c0532 | ||
|
|
349d7af568 | ||
|
|
41a215873a | ||
|
|
10e2b1241c | ||
|
|
799c954083 | ||
|
|
ff79b8b6b1 | ||
|
|
7e80cb872d | ||
|
|
2a2e1991f7 | ||
|
|
da91e219ed | ||
|
|
cc90fdc422 | ||
|
|
e6a1bfad0b | ||
|
|
f6b6e83986 | ||
|
|
bdb21a52db | ||
|
|
dce94373dc | ||
|
|
9229d539d1 | ||
|
|
c6cf3dc770 | ||
|
|
a271105854 | ||
|
|
09f456c084 | ||
|
|
f411df9d1f | ||
|
|
a7aacf00c9 | ||
|
|
b04ba760dc | ||
|
|
8f975358c9 | ||
|
|
6c97352fd4 | ||
|
|
f7ca287ebc | ||
|
|
20fbd7d260 | ||
|
|
a1ef1be8af | ||
|
|
fd6395586b | ||
|
|
5dfdcbd6e1 | ||
|
|
8edd6d6cbd | ||
|
|
4493d6c280 | ||
|
|
c10d3b7485 | ||
|
|
b9a842b5a8 | ||
|
|
df84d3a366 | ||
|
|
91253c2a7c | ||
|
|
73ec2ba285 | ||
|
|
429c4ee023 | ||
|
|
2085a9ea03 | ||
|
|
5b6c2365c4 | ||
|
|
5d21b01729 | ||
|
|
124d934f1f | ||
|
|
1d4bea4918 | ||
|
|
1230240fb7 | ||
|
|
e7936f6b3d | ||
|
|
a3043d4a8c | ||
|
|
17db44d1b1 | ||
|
|
f2cdcdc4d6 | ||
|
|
5408013619 | ||
|
|
17a3ce1057 | ||
|
|
db7684993c | ||
|
|
9cb1e41da9 | ||
|
|
52ec8391c9 | ||
|
|
ce7f87207e | ||
|
|
efa8fcb924 | ||
|
|
9cae1f099f | ||
|
|
b1b4b24f24 | ||
|
|
982f95ad5f | ||
|
|
6b98f7a14e | ||
|
|
712c994276 | ||
|
|
54e1a34f48 | ||
|
|
0991241905 | ||
|
|
e5c69df85f | ||
|
|
674c2cec27 | ||
|
|
d77a47e7ec | ||
|
|
5c57d32bf1 | ||
|
|
352b69df43 | ||
|
|
fcf96f7318 | ||
|
|
2fe9a7082b | ||
|
|
cf4cf84ef5 | ||
|
|
0c5439a1d0 | ||
|
|
f3b2007357 | ||
|
|
9e517da586 | ||
|
|
642d2d3b6a | ||
|
|
c59b644abf | ||
|
|
f78a05510f | ||
|
|
d723b3769b | ||
|
|
582142f123 | ||
|
|
90d0608e7a | ||
|
|
f21869ffa9 | ||
|
|
165bc8c274 | ||
|
|
e738082ba7 | ||
|
|
da884ff78b | ||
|
|
f68f721a33 | ||
|
|
72e5f89f7d | ||
|
|
ebd0a3af40 | ||
|
|
b2587fcbe1 | ||
|
|
792e093841 | ||
|
|
a320820466 | ||
|
|
acbdc24863 | ||
|
|
72b7defac7 | ||
|
|
c7dffd760e | ||
|
|
332f48d846 | ||
|
|
560801e982 | ||
|
|
d2f86b69e9 | ||
|
|
7f6dfe242b | ||
|
|
041b12d7d0 | ||
|
|
9e6edc9be5 | ||
|
|
db72d31b7c | ||
|
|
f3206a6abb | ||
|
|
6b30a5b716 | ||
|
|
f70b142bfe | ||
|
|
39bd39c544 | ||
|
|
89e9982bc2 | ||
|
|
3f9fd35d89 | ||
|
|
ff3807c964 | ||
|
|
cb658ad623 | ||
|
|
5bd4192470 | ||
|
|
8b5316e41c | ||
|
|
240f6c5aa7 | ||
|
|
38a93e7579 | ||
|
|
e2f5e1b186 | ||
|
|
c12dfc071a | ||
|
|
0978d147d0 | ||
|
|
86ca907944 | ||
|
|
571fe0eafb | ||
|
|
4b2bf34d7b | ||
|
|
a824f1b1ea | ||
|
|
375bc8c56e | ||
|
|
4823b68243 | ||
|
|
6a4602abc1 | ||
|
|
cb5fbad852 | ||
|
|
2284798235 | ||
|
|
84bc37c6ca | ||
|
|
adc6f6bc43 | ||
|
|
a0f4c07c9e | ||
|
|
34e5a2986d | ||
|
|
c3cd782dea | ||
|
|
40cb3e10a7 | ||
|
|
7d503e6c36 | ||
|
|
4f5d9ef977 | ||
|
|
00f4d23458 | ||
|
|
13247e74f7 | ||
|
|
3823729022 | ||
|
|
1156419c4d | ||
|
|
076177e470 | ||
|
|
2b35234067 | ||
|
|
a3698135b8 | ||
|
|
ace3716898 | ||
|
|
70659321d9 | ||
|
|
c04d762fc0 | ||
|
|
2cad4a00e9 | ||
|
|
2e9734b0e7 | ||
|
|
ee088e9f99 | ||
|
|
0f018249fc | ||
|
|
2c1492df86 | ||
|
|
5b79c504ff | ||
|
|
8eac90a40d | ||
|
|
aa8b4a611d | ||
|
|
5570f239b1 | ||
|
|
c9849147c3 | ||
|
|
de07ba24fc | ||
|
|
88819fcc48 | ||
|
|
55b8cff543 | ||
|
|
09de961772 | ||
|
|
272e71cf39 | ||
|
|
ce08157eef | ||
|
|
515e68c5bd | ||
|
|
5bf1ef5e81 | ||
|
|
19d7551f79 | ||
|
|
b6cc8324bd | ||
|
|
4786ac7470 | ||
|
|
eb4ca16704 | ||
|
|
51a00052d1 | ||
|
|
458a4a57c8 | ||
|
|
2d037ba7fb | ||
|
|
9218b3b48b | ||
|
|
1c448f1846 | ||
|
|
d40b09962f | ||
|
|
546cb1c67c | ||
|
|
291389c5d2 | ||
|
|
f43f3928ec | ||
|
|
1c97b11edd | ||
|
|
ace26df932 | ||
|
|
dc752c1096 | ||
|
|
5be5fe6c91 | ||
|
|
2d5cecb752 | ||
|
|
1cad8304d0 | ||
|
|
8fb8e8b2ab | ||
|
|
8ed5f71bba | ||
|
|
2de0fb0b3f | ||
|
|
9949651a06 | ||
|
|
d4deaed06b | ||
|
|
f1b6c86ef5 | ||
|
|
b48096544b | ||
|
|
8fa356e6de | ||
|
|
4b5919334b | ||
|
|
93cfe2870a | ||
|
|
09acf0aba6 | ||
|
|
d55a879055 | ||
|
|
4e1d81a164 | ||
|
|
eeb6d8eeb3 | ||
|
|
e727768f54 | ||
|
|
073898dc9f | ||
|
|
efe358fa87 | ||
|
|
b461bd659b | ||
|
|
838f684bb7 | ||
|
|
cda5a42a9e | ||
|
|
660adfde85 | ||
|
|
f3c2bb42b3 | ||
|
|
90be13db56 | ||
|
|
d39c7b5190 | ||
|
|
bd94126a86 | ||
|
|
3fd5de24f3 | ||
|
|
c810755564 | ||
|
|
d22a2debd3 | ||
|
|
dbebda3f46 | ||
|
|
9e7ca11b0d | ||
|
|
abbdc97e68 | ||
|
|
64c23aa719 | ||
|
|
6cce63201c | ||
|
|
5f7165bf44 | ||
|
|
08ad8b2383 | ||
|
|
f704605381 | ||
|
|
bfd27f86e1 | ||
|
|
94403aa020 | ||
|
|
86eff892d6 | ||
|
|
44c9de7f4e | ||
|
|
cd21ed6a93 | ||
|
|
99783851c3 | ||
|
|
877e8c2484 | ||
|
|
2b267cec1b | ||
|
|
3f20b98dee | ||
|
|
c2770eec42 | ||
|
|
5244425b52 | ||
|
|
6f7623fef2 | ||
|
|
441bcecde6 | ||
|
|
bc2b5c431a | ||
|
|
1629b7f549 | ||
|
|
f92d492937 | ||
|
|
8c246c1361 | ||
|
|
9abf6d52c2 | ||
|
|
503ab54a5a | ||
|
|
354f6d28d0 | ||
|
|
66d6d48e74 | ||
|
|
0ac8d45b16 | ||
|
|
99d91330f7 | ||
|
|
b6ca4bd513 | ||
|
|
178ca7e20f | ||
|
|
abbd9f710f | ||
|
|
c1e8143d4f | ||
|
|
6473ee69bc | ||
|
|
6e79a67fbf | ||
|
|
f61777abb5 | ||
|
|
2f10d9cc4c | ||
|
|
0b5a5d0f0b | ||
|
|
d44d69e2c3 | ||
|
|
68582c42d9 | ||
|
|
24412bf446 | ||
|
|
1914be19fb | ||
|
|
385c77263a | ||
|
|
a88b77db25 | ||
|
|
74f433a9e0 | ||
|
|
e323e62645 | ||
|
|
b132a0d47f | ||
|
|
504c74e695 | ||
|
|
29e038971e | ||
|
|
fdc0bb6474 | ||
|
|
6fd4293e5d | ||
|
|
22d878bc6d | ||
|
|
f0898d4b37 | ||
|
|
e077e34c22 | ||
|
|
f57867db82 | ||
|
|
ff2f5dc939 | ||
|
|
dae115058b | ||
|
|
eef643fdd9 | ||
|
|
fe787a344a | ||
|
|
0d7e3140f0 | ||
|
|
798b1a044e | ||
|
|
52a6813647 | ||
|
|
e03ce048f9 | ||
|
|
a1f401515c | ||
|
|
4becac84ec | ||
|
|
f75e79798d | ||
|
|
4bdc8b8e80 | ||
|
|
cebdca0fda | ||
|
|
f52ebe6d78 | ||
|
|
cb12f0cd6a | ||
|
|
a099fad7d2 | ||
|
|
9ef8e452f5 | ||
|
|
827c10017e | ||
|
|
7e91d46290 | ||
|
|
da7b5f422b | ||
|
|
4f8e6815ca | ||
|
|
7ed7289ffe | ||
|
|
9240e69336 | ||
|
|
c0fb56ecaa | ||
|
|
68e3460c1d | ||
|
|
57550b48cd | ||
|
|
dc34f9907d | ||
|
|
a741bdf2fa | ||
|
|
2822b778d6 | ||
|
|
5a0bbb54a2 | ||
|
|
16c1dedaf8 | ||
|
|
a5741e37c2 | ||
|
|
9df3ed0184 | ||
|
|
8481e89081 | ||
|
|
c31276aad8 | ||
|
|
43e110c34d | ||
|
|
af11bd2d51 | ||
|
|
97587ec1f3 | ||
|
|
2738b43901 | ||
|
|
4c0208fbb0 | ||
|
|
dba2577ddc | ||
|
|
cff7a71d58 | ||
|
|
784ac5030d | ||
|
|
54252488a6 | ||
|
|
1231213014 | ||
|
|
f2052650d7 | ||
|
|
f0224d993a | ||
|
|
98cbcf0634 | ||
|
|
86aa020531 | ||
|
|
8f86af0bdb | ||
|
|
8d7e74c70f | ||
|
|
e93416a40a | ||
|
|
b208526849 | ||
|
|
c5015bead1 | ||
|
|
7e4dc286a6 | ||
|
|
e834126e45 | ||
|
|
132b928a2c | ||
|
|
ce27740cf0 | ||
|
|
41cf6440ab | ||
|
|
acfefb74fc | ||
|
|
02129537d9 | ||
|
|
2bc2dad099 | ||
|
|
352211e48d | ||
|
|
3ae61fa7b3 | ||
|
|
e20afff450 | ||
|
|
4e9e1946eb | ||
|
|
bb57aa3659 | ||
|
|
a420a8a309 | ||
|
|
ae294348b3 | ||
|
|
39d795030e | ||
|
|
dc78f1fb44 | ||
|
|
ae32a0cb74 | ||
|
|
ca3b4bbae7 | ||
|
|
e62687a18f | ||
|
|
b7c068d8f3 | ||
|
|
86d2ca9596 | ||
|
|
ee7863df06 | ||
|
|
f21bfd7cc1 | ||
|
|
c70c0aab31 | ||
|
|
2fdb36acda | ||
|
|
5224699235 | ||
|
|
60108cff85 | ||
|
|
38cabdb760 | ||
|
|
7884fa9bdb | ||
|
|
028f8121fc | ||
|
|
71f93761ff | ||
|
|
ed673726c5 | ||
|
|
6bba17e417 | ||
|
|
525500af20 | ||
|
|
600cf3611b | ||
|
|
201c3d3a92 | ||
|
|
e3cdcbc551 | ||
|
|
9eef074336 | ||
|
|
ddf63db3dc | ||
|
|
99fa058199 | ||
|
|
f6ccb89f55 | ||
|
|
35b5c2e507 | ||
|
|
6b1c55caed | ||
|
|
d88201e7d1 | ||
|
|
cc4dd91815 | ||
|
|
fe6f102538 | ||
|
|
a42b5410e8 | ||
|
|
adbc2a2bf1 | ||
|
|
ecd339856a | ||
|
|
7d79a27e4d | ||
|
|
82fa3ce708 | ||
|
|
5f6b64ec82 | ||
|
|
f52a8d69e6 | ||
|
|
522ee54868 | ||
|
|
b0a850f383 | ||
|
|
3013e8243c | ||
|
|
78f97fc7ef | ||
|
|
45b1f6c5e0 | ||
|
|
1cf36f9d67 | ||
|
|
839e93f72f | ||
|
|
dac2d0cdd0 | ||
|
|
eafbc7528f | ||
|
|
360515b262 | ||
|
|
3948b37f29 | ||
|
|
f573cb2c58 | ||
|
|
0192a712fb | ||
|
|
122fb95b6b | ||
|
|
516a7dc984 | ||
|
|
7d12c5843f | ||
|
|
0663f4a9a4 | ||
|
|
84d7c24433 | ||
|
|
5836b62d3e | ||
|
|
5bdf8d5379 | ||
|
|
0ad5c7ed72 | ||
|
|
6c589c845b | ||
|
|
02760703b5 | ||
|
|
09278885a8 | ||
|
|
5f3ac2d688 | ||
|
|
5d3f801923 | ||
|
|
dc06ed7a08 | ||
|
|
f21ae8ac28 | ||
|
|
b0faa588ed | ||
|
|
55fdf43298 | ||
|
|
a0e6c34c00 | ||
|
|
e6cd2b2151 | ||
|
|
be92858543 | ||
|
|
5bf3a700f7 | ||
|
|
377fde04c1 | ||
|
|
95dcd8992d | ||
|
|
6747b4d683 | ||
|
|
fd48f20481 | ||
|
|
0d56519468 | ||
|
|
cd52692d66 | ||
|
|
587dc9a4b4 | ||
|
|
9ce46d9ee3 | ||
|
|
1653edd2a1 | ||
|
|
dad85a1be0 | ||
|
|
f73219b363 | ||
|
|
b3f5470113 | ||
|
|
11eed51718 | ||
|
|
8e74daca3b | ||
|
|
5f4d8093b4 | ||
|
|
55cd6e2ad2 | ||
|
|
af83eb111d | ||
|
|
d81d6808f2 | ||
|
|
b9e790e678 | ||
|
|
cb97b73607 | ||
|
|
da5514406a | ||
|
|
fdb082b778 | ||
|
|
70681c6954 | ||
|
|
c367fcd5cf | ||
|
|
cda602969d | ||
|
|
463ff301c7 | ||
|
|
f4b6cdc439 | ||
|
|
1f8177a16f | ||
|
|
2e47bc684f | ||
|
|
b744b198d0 | ||
|
|
4db65cd925 | ||
|
|
887626e672 | ||
|
|
fb884d64e9 | ||
|
|
737555c2b2 | ||
|
|
768df2e5db | ||
|
|
733fbfdc6e | ||
|
|
063476e0d8 | ||
|
|
fcee4e4af9 | ||
|
|
51b2454987 | ||
|
|
d20a91b8fa | ||
|
|
72c6a1b0ec | ||
|
|
be3f81a53b | ||
|
|
4f4084218d | ||
|
|
575f39b880 | ||
|
|
e767541701 | ||
|
|
604bfb8dbd | ||
|
|
8a55f951fa | ||
|
|
c7a3bb8700 | ||
|
|
8f0939c492 | ||
|
|
357be834b3 | ||
|
|
30882fcc27 | ||
|
|
8cbd69ef74 | ||
|
|
e17f67cee1 | ||
|
|
afec0a3941 | ||
|
|
1b90f81e62 | ||
|
|
b97a44eded | ||
|
|
d851221411 | ||
|
|
90398ee41d | ||
|
|
955548fd0a | ||
|
|
20e1b3c969 | ||
|
|
fdc91c3f13 | ||
|
|
6cb01f119b | ||
|
|
49f48d3343 | ||
|
|
fc4ebc4b58 | ||
|
|
dedeb0caea | ||
|
|
ba2eddcaa8 | ||
|
|
2298acd2ab | ||
|
|
7354f249f6 | ||
|
|
61a7c100be | ||
|
|
b610201afb | ||
|
|
9c2f609d6a | ||
|
|
d044e24aa2 | ||
|
|
35a1b0c674 | ||
|
|
c23ee2f8f1 | ||
|
|
feb315a49b | ||
|
|
77605d5586 | ||
|
|
ca57d94199 | ||
|
|
c98a66aba5 | ||
|
|
d971c7a188 | ||
|
|
2749d98bc2 | ||
|
|
a12c2b07e7 | ||
|
|
3161bfd970 | ||
|
|
8b670ec07f | ||
|
|
67795e2d4e | ||
|
|
6515c1f7e6 | ||
|
|
af2698665b | ||
|
|
926131ef26 | ||
|
|
a0a179bff8 | ||
|
|
3ba7782c0d | ||
|
|
07cc74a70c | ||
|
|
1d3c031430 | ||
|
|
508b3c5df9 | ||
|
|
e05db80bd1 | ||
|
|
6f5c10e43b | ||
|
|
8625538d03 | ||
|
|
1c422d13dc | ||
|
|
0881227406 | ||
|
|
e7f416c827 | ||
|
|
3e0af28977 | ||
|
|
f322c2367e | ||
|
|
08b0bbac7b | ||
|
|
1d73ad3c3b | ||
|
|
7707838ab6 | ||
|
|
f3bb3d9093 | ||
|
|
38917f453f | ||
|
|
f14dd44944 | ||
|
|
17e2cebbab | ||
|
|
32e41abc50 | ||
|
|
08301afa95 | ||
|
|
17f84557c7 | ||
|
|
a33f67ab3d | ||
|
|
91f4348111 | ||
|
|
5791bebe8e | ||
|
|
ca2334c921 | ||
|
|
02867e6738 | ||
|
|
3248bf18f9 | ||
|
|
0a31178b3c | ||
|
|
651fb08e9a | ||
|
|
6c5ee74708 | ||
|
|
9c00ffb0aa | ||
|
|
4f663e4ff4 | ||
|
|
d668fe2dcc | ||
|
|
179ed30d55 | ||
|
|
7ca47f95aa | ||
|
|
f2305301d9 | ||
|
|
e4fd95d19f | ||
|
|
040be30c7b | ||
|
|
7b24bf760a | ||
|
|
fb2d8a407c | ||
|
|
f68a394aa8 | ||
|
|
f0b3b32553 | ||
|
|
d61b0a2c42 | ||
|
|
efe3bcd6ae | ||
|
|
d59772990d | ||
|
|
f46cc69703 | ||
|
|
4c45e6d259 | ||
|
|
337acb3995 | ||
|
|
2da9bc1305 | ||
|
|
d604765628 | ||
|
|
e6b382cae9 | ||
|
|
bc3de27750 | ||
|
|
920f5c445c | ||
|
|
d44676ab82 | ||
|
|
b6a385ae30 | ||
|
|
32953f89be | ||
|
|
15a30f7880 | ||
|
|
12f7da96cc | ||
|
|
79b77d0249 | ||
|
|
cb5001fee2 | ||
|
|
b68dd1b040 | ||
|
|
113cddba84 | ||
|
|
27923ae041 | ||
|
|
e49abe5cbb | ||
|
|
f5b0d50279 | ||
|
|
43f24b9619 | ||
|
|
308e9165dc | ||
|
|
e54eed5fc4 | ||
|
|
9e6a43b2c5 | ||
|
|
f8b4c0adc2 | ||
|
|
26e5241cd6 | ||
|
|
c12d35de4d | ||
|
|
158769d1b9 | ||
|
|
a66af28dea | ||
|
|
b96e3bfd17 | ||
|
|
bf512ef1ed | ||
|
|
f3c3f6c15c | ||
|
|
c04ac81bb4 | ||
|
|
da2a556cfb | ||
|
|
e965438798 | ||
|
|
09e42ae957 | ||
|
|
5122ca60c3 | ||
|
|
bf01b235bb | ||
|
|
e2d70ce1d0 | ||
|
|
66ad7f26ef | ||
|
|
6f019529bd | ||
|
|
59274dfecb | ||
|
|
124c3eb439 | ||
|
|
89317b2cba | ||
|
|
af06bf8c28 | ||
|
|
2ea8870bed | ||
|
|
69a2fdc74a | ||
|
|
6bec8485f6 | ||
|
|
42e5562e27 | ||
|
|
df65317b2a | ||
|
|
ff856ea2f1 | ||
|
|
1d381305d4 | ||
|
|
5af278ec54 | ||
|
|
7f7f62b840 | ||
|
|
3d8042b562 | ||
|
|
d91caa609c | ||
|
|
cf99e634d6 | ||
|
|
620ff822e8 | ||
|
|
f67edc4460 | ||
|
|
bd421cacf7 | ||
|
|
f8284cedda | ||
|
|
cf3fd16cda | ||
|
|
71587b0fe1 | ||
|
|
c5437db041 | ||
|
|
4bd1ebe405 | ||
|
|
85c6840873 | ||
|
|
024fdefdcd | ||
|
|
680bc72805 | ||
|
|
1c31155866 | ||
|
|
27d62d62d0 | ||
|
|
36df4c3e22 | ||
|
|
684240a65d | ||
|
|
1bf46bc1d7 | ||
|
|
e25ad90469 | ||
|
|
189ad28243 | ||
|
|
fd3cee59b7 | ||
|
|
dc5fe87bbf | ||
|
|
31866a155b | ||
|
|
83718ab6b3 | ||
|
|
2ed521575f | ||
|
|
b1e405f216 | ||
|
|
d8388f9f44 | ||
|
|
3e3c0e62df | ||
|
|
10ef4d76b9 | ||
|
|
7301d16a7b | ||
|
|
1c514852f4 | ||
|
|
0713606d1f | ||
|
|
fd7f34a6e6 | ||
|
|
182f3510b7 | ||
|
|
63fe1fa094 | ||
|
|
4324fd43e6 | ||
|
|
3087a189b0 | ||
|
|
ec2aedc2f4 | ||
|
|
6235fc5e54 | ||
|
|
2c08205e8c | ||
|
|
0c6ade2778 | ||
|
|
3bdb07a96f | ||
|
|
dee1ce6a27 | ||
|
|
566350e6ca | ||
|
|
1d7b5bfeea | ||
|
|
87d045bb31 | ||
|
|
30ed1b9432 | ||
|
|
d94ecf8790 | ||
|
|
2605f1079f | ||
|
|
e62e32dbdd | ||
|
|
564f06e6b3 | ||
|
|
4a30d420e3 | ||
|
|
f5c8be097b | ||
|
|
a0861494fd | ||
|
|
09b968687d | ||
|
|
e1f639a822 | ||
|
|
6bc9217e23 | ||
|
|
9b4957a0b3 | ||
|
|
9aed7692a4 | ||
|
|
0b17b19d6a | ||
|
|
c0351ab338 | ||
|
|
8f9917b569 | ||
|
|
f2d6d2cc6c | ||
|
|
54f94fc400 | ||
|
|
bd403285b9 | ||
|
|
26542d3bbe | ||
|
|
3a9b85b327 | ||
|
|
2d31cbb63c | ||
|
|
fafe01c685 | ||
|
|
0117f15c86 | ||
|
|
da91378ae2 | ||
|
|
c36423aa16 | ||
|
|
37f6a146f3 | ||
|
|
b8d2685448 | ||
|
|
32efbb8e93 | ||
|
|
128cc59e93 | ||
|
|
2783086ce1 | ||
|
|
ee0e5e37cd | ||
|
|
af4984db16 | ||
|
|
cbd955bdbd | ||
|
|
e68ff4c7b9 | ||
|
|
f0e8b663fb | ||
|
|
7b52097bc9 | ||
|
|
89b0199fc3 | ||
|
|
ed0ebb53df | ||
|
|
edbb212f03 | ||
|
|
3ece97bde5 | ||
|
|
d6b4764022 | ||
|
|
8585227879 | ||
|
|
efdb3ed636 | ||
|
|
2beddaa2c1 | ||
|
|
63a8ad58fa | ||
|
|
40e0317fe5 | ||
|
|
18912c44e6 | ||
|
|
2236e6e0ba | ||
|
|
b7b842d909 | ||
|
|
3ddf540df0 | ||
|
|
df19e80a6c | ||
|
|
0e29466c1b | ||
|
|
f0c88ed45a | ||
|
|
12665a7a60 | ||
|
|
7a4fd205a7 | ||
|
|
945d92a98c | ||
|
|
e0ee5d7dc5 | ||
|
|
846d7cd438 | ||
|
|
9e288bd50d | ||
|
|
10e8196da1 | ||
|
|
55d08f8529 | ||
|
|
132e94801a | ||
|
|
b78f07247f | ||
|
|
74c14c6322 | ||
|
|
7e7ed18b86 | ||
|
|
eb53183341 | ||
|
|
060e7cc27c | ||
|
|
6da2a80baa | ||
|
|
3d75e81e79 | ||
|
|
f7411a2353 | ||
|
|
8bec0fcacc | ||
|
|
e3605059e9 | ||
|
|
596fd93f66 | ||
|
|
990b6be257 | ||
|
|
e74b167692 | ||
|
|
a7cd3e2996 | ||
|
|
d87183b131 | ||
|
|
712df660c8 | ||
|
|
1343dd62a5 | ||
|
|
d005361796 | ||
|
|
3bf112d575 | ||
|
|
8ca485a913 | ||
|
|
e1c706264b | ||
|
|
ae8c66ec7a | ||
|
|
2162287945 | ||
|
|
16731fee7b | ||
|
|
63fabd767a | ||
|
|
f54d5f4892 | ||
|
|
7bca1860d9 | ||
|
|
6bc62401ac | ||
|
|
00a0752683 | ||
|
|
44f5ce7c41 | ||
|
|
13915ea9cb | ||
|
|
93b1b32da0 | ||
|
|
0fd7351c7a | ||
|
|
82bf15dd5a | ||
|
|
9e53e1e869 | ||
|
|
ff9af05399 | ||
|
|
5898952833 | ||
|
|
d7355ee086 | ||
|
|
eb7233a3d5 | ||
|
|
d05f996766 | ||
|
|
535d4e1c0d | ||
|
|
19255459d0 | ||
|
|
a5c75f8d3d | ||
|
|
befb71f27a | ||
|
|
a518108c23 | ||
|
|
df5bae9c88 | ||
|
|
cd0407eaa6 | ||
|
|
a6ee516277 | ||
|
|
18f84dfb17 | ||
|
|
a6b6f55eb1 | ||
|
|
eec6a916f7 | ||
|
|
b7ecba7a7d | ||
|
|
d0ca35f3e3 | ||
|
|
2c74cd2c91 | ||
|
|
1af665551a | ||
|
|
21e69dbaa7 | ||
|
|
7fe9f827bb | ||
|
|
00278b3f16 | ||
|
|
696c14e697 | ||
|
|
11dc1abc3c | ||
|
|
61e545d38a | ||
|
|
8fcde81e68 | ||
|
|
ea0fa5d885 | ||
|
|
6136c47d0e | ||
|
|
a445c74ed0 | ||
|
|
cc107c2986 | ||
|
|
2bf990b175 | ||
|
|
9643d565ff | ||
|
|
5409f5be0f | ||
|
|
164c16ddf5 | ||
|
|
22ee635ba1 | ||
|
|
834bade560 | ||
|
|
bc7de91bc3 | ||
|
|
b79ecf7f9f | ||
|
|
5403ee0e70 | ||
|
|
ad8d6534e0 | ||
|
|
71d99a3c77 | ||
|
|
78b35029ab | ||
|
|
48feccbc16 | ||
|
|
6cc310d122 | ||
|
|
4501163284 | ||
|
|
7c1a5ed7c1 | ||
|
|
15a7e54073 | ||
|
|
4d2bb8eaef | ||
|
|
200c5b7c7f | ||
|
|
26df3b9ab0 | ||
|
|
66cf0f0327 | ||
|
|
10a058379b | ||
|
|
d78dfa504b | ||
|
|
c6001079f9 | ||
|
|
2f4d626937 | ||
|
|
3b1867f301 | ||
|
|
e90ddf4855 | ||
|
|
f5127c6317 | ||
|
|
21a5646787 | ||
|
|
09d340f3af | ||
|
|
42a5fec250 | ||
|
|
57fbd93d5c | ||
|
|
04a59cd139 | ||
|
|
b5986ccada | ||
|
|
012275f154 | ||
|
|
f67db2dea8 | ||
|
|
c09f372a05 | ||
|
|
fca264591f | ||
|
|
645549daa0 | ||
|
|
988cf1aa58 | ||
|
|
8de356bd25 | ||
|
|
7cd848ee1f | ||
|
|
84804f1f9f | ||
|
|
0d09f54a97 | ||
|
|
144fd8c607 | ||
|
|
f3503113e3 | ||
|
|
cb6e4a0b8d | ||
|
|
b2fadccafc | ||
|
|
4e210af411 | ||
|
|
5315883933 | ||
|
|
8f0eeba210 | ||
|
|
1cd9c22051 | ||
|
|
f3ee198768 | ||
|
|
aa9784a662 | ||
|
|
32538ecf40 | ||
|
|
11ad270017 | ||
|
|
f2749c618f | ||
|
|
316f0699d4 | ||
|
|
18e2c60c3c | ||
|
|
d8f80cdeff | ||
|
|
0f5cdcd1d5 | ||
|
|
72863e43ff | ||
|
|
ed752977ab | ||
|
|
5bd1e2a45e | ||
|
|
7deee63cab | ||
|
|
35d53a33f3 | ||
|
|
4938fc5e82 | ||
|
|
5409109218 | ||
|
|
e291ce41c9 | ||
|
|
631481896a | ||
|
|
3da4777e31 | ||
|
|
237151bf1e | ||
|
|
a29935b006 | ||
|
|
eea456f759 | ||
|
|
a41f1d7ec5 | ||
|
|
1f75475467 | ||
|
|
f0e0c7a3af | ||
|
|
ed051e22cd | ||
|
|
a9fb6c29b6 | ||
|
|
643b1064fc | ||
|
|
7e308c5387 | ||
|
|
0d22ba50a4 | ||
|
|
07b4f0ab70 | ||
|
|
d2f89cca59 | ||
|
|
2724ca5045 | ||
|
|
2092f8b0d2 | ||
|
|
eea1dd1d80 | ||
|
|
3961b6f999 | ||
|
|
7f868dca9f | ||
|
|
e5c18a582f | ||
|
|
86cdbef44b | ||
|
|
676f9ed416 | ||
|
|
c7b9f3bce4 | ||
|
|
3bb40401f3 | ||
|
|
c8f5b1e1d6 | ||
|
|
3e1e7c3cfc | ||
|
|
e4e0e4eb1e | ||
|
|
a07c61d1df | ||
|
|
1756f61ee6 | ||
|
|
18110b3b0f | ||
|
|
ec30486d68 | ||
|
|
00414facd7 | ||
|
|
d0a1c32523 | ||
|
|
d6a556e8ee | ||
|
|
ac68fb3b9e | ||
|
|
4b37b1d7f6 | ||
|
|
eb1d3e159b | ||
|
|
131d7ef4fe | ||
|
|
e86bc59d39 | ||
|
|
1918a935fd | ||
|
|
8b1418d43c | ||
|
|
fecff934a0 | ||
|
|
966a980485 | ||
|
|
037e321cdd | ||
|
|
88c63349af | ||
|
|
71745723bd | ||
|
|
42b068cc2b | ||
|
|
e9e5091575 | ||
|
|
f9bbcbe50a | ||
|
|
64a3361de8 | ||
|
|
c875061e41 | ||
|
|
fd15be94e1 | ||
|
|
8377c1621b | ||
|
|
541eb72562 | ||
|
|
7037b73971 | ||
|
|
6ff2b25ea4 | ||
|
|
13c9f19e18 | ||
|
|
39f0f50034 | ||
|
|
5aff93e28d | ||
|
|
0e1aa5ca2d | ||
|
|
9366f1b705 | ||
|
|
61652cb093 | ||
|
|
e5dff64016 | ||
|
|
9553c4d99c | ||
|
|
e64d683628 | ||
|
|
ea5fc158b0 | ||
|
|
0222aa8ce1 | ||
|
|
bcf60b6384 | ||
|
|
d4d63b0f4a | ||
|
|
60ffea28b3 | ||
|
|
dc42e1d1d6 | ||
|
|
6981d08e47 | ||
|
|
adef3bb3ba | ||
|
|
986a6134ac | ||
|
|
39bb276fee | ||
|
|
cb72fdbd50 | ||
|
|
f4885cc03c | ||
|
|
0a42cbf7c9 | ||
|
|
3dfe7e7cca | ||
|
|
2c4b3d4da6 | ||
|
|
da29eaaa33 | ||
|
|
c9453e903e | ||
|
|
f81221cfee | ||
|
|
abf49040b3 | ||
|
|
986a7c2391 | ||
|
|
d22c8413e2 | ||
|
|
37f490d9a8 | ||
|
|
9c3704b26f | ||
|
|
f573f07aca | ||
|
|
bd91aa5d9a | ||
|
|
72ac4c46cb | ||
|
|
d5ac058e3b | ||
|
|
8a0768f764 | ||
|
|
bf4ac25c11 | ||
|
|
99c3d22852 | ||
|
|
c85c399797 | ||
|
|
812efe8195 | ||
|
|
de40845c97 | ||
|
|
48038bb8ac | ||
|
|
8e4eda2a1f | ||
|
|
abd0c1aafb | ||
|
|
f7f249bd3a | ||
|
|
3696f5b537 | ||
|
|
94dd262896 | ||
|
|
72ec617044 | ||
|
|
85c82fa877 | ||
|
|
ad1ac83d59 | ||
|
|
3284a7ae58 | ||
|
|
1d73ab0ba3 | ||
|
|
33f054052e | ||
|
|
1b73f16657 | ||
|
|
e27fcda56b | ||
|
|
3c169ffb4d | ||
|
|
3481070c3a | ||
|
|
1ca6031c28 | ||
|
|
de158135a5 | ||
|
|
bb5d3fd40a | ||
|
|
7f26b320af | ||
|
|
7a2467fe3c | ||
|
|
4415c70bc9 | ||
|
|
79e7d9f1b6 | ||
|
|
e365778a83 | ||
|
|
ac35d2b7db | ||
|
|
437222f98f | ||
|
|
21d936993b | ||
|
|
472f9609f6 | ||
|
|
06899c0ef3 | ||
|
|
cba0eb4a3b | ||
|
|
152ab62bf4 | ||
|
|
6977ebf7c5 | ||
|
|
5e1a8305c5 | ||
|
|
3ecdb08ce6 | ||
|
|
7b25afa68b | ||
|
|
3c655e718e | ||
|
|
5d030af7b4 | ||
|
|
aedc9ebe7d | ||
|
|
daba8016d1 | ||
|
|
8dfbc8d5dd | ||
|
|
5b0b8edbd6 | ||
|
|
0c3bdd564c | ||
|
|
c16a996cc9 | ||
|
|
f666a86cd8 | ||
|
|
f6028d6511 | ||
|
|
83810b4c4c | ||
|
|
09bb1034c4 | ||
|
|
f6f96c46a6 | ||
|
|
7355eb00bf | ||
|
|
32d7f31205 | ||
|
|
9c8fe52c80 | ||
|
|
2e6dbc7515 | ||
|
|
9e4bd9860b | ||
|
|
03a1b717af | ||
|
|
da68063264 | ||
|
|
a3795728e2 | ||
|
|
8ed1a7ed01 | ||
|
|
10b5c686f8 | ||
|
|
befe3e538a | ||
|
|
69b6e03833 | ||
|
|
873e953daa | ||
|
|
1fda6e59ce | ||
|
|
e0a7292303 | ||
|
|
fe53e87071 | ||
|
|
17c1f525e0 | ||
|
|
f428b19976 | ||
|
|
e8da793aed | ||
|
|
f7677442d2 | ||
|
|
ed55050269 | ||
|
|
33e5f16771 | ||
|
|
c604729b8e | ||
|
|
d1d584ad06 | ||
|
|
2e12607da5 | ||
|
|
579e8d13f7 | ||
|
|
bab8ab3925 | ||
|
|
d81881b4fe | ||
|
|
a34fc50a3c | ||
|
|
383a2b66d7 | ||
|
|
5ebc37de1b | ||
|
|
e5ef08127a | ||
|
|
4a2a329e7a | ||
|
|
6347ccece9 | ||
|
|
28939c62e6 | ||
|
|
a45710eda1 | ||
|
|
3f0d347996 | ||
|
|
c0d405da9d | ||
|
|
a4f60f1ce1 | ||
|
|
37c9a1f150 | ||
|
|
7632822acf | ||
|
|
c1839a47a7 | ||
|
|
6ffe53cdf4 | ||
|
|
9a20334411 | ||
|
|
21daba90e6 | ||
|
|
77227eff16 | ||
|
|
fe8cefa44a | ||
|
|
27a83e6f69 | ||
|
|
1d2265bf34 | ||
|
|
ef70662471 | ||
|
|
1447601752 | ||
|
|
876ba1b567 | ||
|
|
8b73016288 | ||
|
|
0889a476df | ||
|
|
fe55728c75 | ||
|
|
5e41e6a04b | ||
|
|
91bc6c54c9 | ||
|
|
f6d1d0a83d | ||
|
|
46b6c639ba | ||
|
|
64a5758ed3 | ||
|
|
3d0dedae63 | ||
|
|
86bc62eccc | ||
|
|
6f7094c87d | ||
|
|
ac59c733e5 | ||
|
|
b0b02edeba | ||
|
|
75cdb71562 | ||
|
|
c1c327f57f | ||
|
|
306564267d | ||
|
|
36dbd1a2bd | ||
|
|
5302f5fde5 | ||
|
|
5ad1c1d8ab | ||
|
|
f307e270ab | ||
|
|
1d4abf772c | ||
|
|
b658428566 | ||
|
|
c59ca4f73f | ||
|
|
1d61d2a1c5 | ||
|
|
afad1d276a | ||
|
|
69e83cff4f | ||
|
|
0f2a24bf47 | ||
|
|
0ba0b43e5e | ||
|
|
2abc12c1d6 | ||
|
|
e87e840bbe | ||
|
|
38968339d8 | ||
|
|
829e5d055b | ||
|
|
e917729302 | ||
|
|
607b8732f9 | ||
|
|
20e7706d9c | ||
|
|
550c57c1be | ||
|
|
b748d9afbd | ||
|
|
5fb0e56c56 | ||
|
|
caf5e9cc6e | ||
|
|
bd7a222aea | ||
|
|
f293073df8 | ||
|
|
1adb76ccef | ||
|
|
e251696251 | ||
|
|
443f35a908 | ||
|
|
cb8ea86ee6 | ||
|
|
35b9d94750 | ||
|
|
95a61e3c9d | ||
|
|
75017c4228 | ||
|
|
efaac5ceb1 | ||
|
|
a77e164c94 | ||
|
|
da6b8297e1 | ||
|
|
59454ae43e | ||
|
|
5479d8e748 | ||
|
|
bd4ec96629 | ||
|
|
a1e35a103f | ||
|
|
0cf3bf55e4 | ||
|
|
1408c84631 | ||
|
|
f3ba112082 | ||
|
|
10290f4a33 | ||
|
|
fb17ef2ab9 | ||
|
|
b5d06aa0f3 | ||
|
|
e631e1b1d4 | ||
|
|
e2494312be | ||
|
|
5ee1c6cf44 | ||
|
|
360bf04fc5 | ||
|
|
e9cedb6dc2 | ||
|
|
1c18315e5f | ||
|
|
3c4a73145f | ||
|
|
01a5956dce | ||
|
|
768bb15884 | ||
|
|
fed0b47a58 | ||
|
|
e8770bba7e | ||
|
|
cf4875d006 | ||
|
|
fb6ea0f253 | ||
|
|
c5bf88c191 | ||
|
|
11c17e9aa2 | ||
|
|
559f17056f | ||
|
|
a7cc755a71 | ||
|
|
e66f547fbb | ||
|
|
91d575ba12 | ||
|
|
42a7ea255f | ||
|
|
dd5c96145f | ||
|
|
8416c8ad6e | ||
|
|
412a67fd78 | ||
|
|
2dec2e9265 | ||
|
|
10e203e080 | ||
|
|
641ab5e6e0 | ||
|
|
128a385b1d | ||
|
|
9843daa803 | ||
|
|
1bc20b3e28 | ||
|
|
9b6ffc4bc7 | ||
|
|
33efb56b36 | ||
|
|
24de3055a0 | ||
|
|
8ecccba852 | ||
|
|
d759faeb68 | ||
|
|
3492b45810 | ||
|
|
6fd2133571 | ||
|
|
8834a44e7c | ||
|
|
874a327e6e | ||
|
|
cf91a6a2cf | ||
|
|
9bcb462f68 | ||
|
|
58c5efe91d | ||
|
|
09056af0d3 | ||
|
|
5608d5fafa | ||
|
|
400181a49f | ||
|
|
cb88f3ce97 | ||
|
|
54d8fd00ba | ||
|
|
16f0ad39e2 | ||
|
|
be9b19e509 | ||
|
|
a8aef3982c | ||
|
|
ebd9fb278c | ||
|
|
d0181235d4 | ||
|
|
fd2923e40f | ||
|
|
8b4cb966e4 | ||
|
|
1d4d5750d2 | ||
|
|
df888577fc | ||
|
|
8f0e09e13c | ||
|
|
51e880c93f | ||
|
|
042da4dd52 | ||
|
|
26bc8fead0 | ||
|
|
f1d008ee61 | ||
|
|
f539080e2e | ||
|
|
7767a7b078 | ||
|
|
8295242ac2 | ||
|
|
00efb4a5cd | ||
|
|
cdfb3836b5 | ||
|
|
d806ffe629 | ||
|
|
868e5e8564 | ||
|
|
bdf1459e4f | ||
|
|
8186f92124 | ||
|
|
b5f96d5de3 | ||
|
|
89617c6f5a | ||
|
|
6825bc670f | ||
|
|
bc9105d905 | ||
|
|
95384040a9 | ||
|
|
00461cb430 | ||
|
|
57745532df | ||
|
|
14b30e331d | ||
|
|
b3dd9b4b88 | ||
|
|
0234c75e30 | ||
|
|
f14aa84528 | ||
|
|
d3f361ec86 | ||
|
|
25ef4244dd | ||
|
|
7174e3f619 | ||
|
|
19c26af35a | ||
|
|
e2d193d46d | ||
|
|
1fc2fceeb9 | ||
|
|
60fd0dca50 | ||
|
|
422583b20b | ||
|
|
9547b981e7 | ||
|
|
2f333f0f7f | ||
|
|
47886e29ad | ||
|
|
a0f029376e | ||
|
|
100937bee2 | ||
|
|
572f167a8d | ||
|
|
6e7ae13193 | ||
|
|
6bcfe27a9f | ||
|
|
4b362089eb | ||
|
|
4d0ce2c5c7 | ||
|
|
8616e80222 | ||
|
|
80e608a8bd | ||
|
|
d3c7c009c7 | ||
|
|
536e9af373 | ||
|
|
896e2f52d1 | ||
|
|
7c6551d349 | ||
|
|
64921d8542 | ||
|
|
5b9d814e0e | ||
|
|
adabd3e86d | ||
|
|
c2ef0bf6f5 | ||
|
|
07e0a8029f | ||
|
|
8fa3d32b09 | ||
|
|
63c6ed1c19 | ||
|
|
768d6609b2 | ||
|
|
9ce78ee085 | ||
|
|
b60664821e | ||
|
|
03170c5e4a | ||
|
|
42897ddb03 | ||
|
|
be392a1850 | ||
|
|
a32f6d1454 | ||
|
|
9898ee6f56 | ||
|
|
28baf77761 | ||
|
|
2ecd71eb1b | ||
|
|
7b9de407d4 | ||
|
|
d74a90876c | ||
|
|
46351b3852 | ||
|
|
8e8fe26cc4 | ||
|
|
d845c28db2 | ||
|
|
0a784707bd | ||
|
|
465e224c99 | ||
|
|
b46de16a36 | ||
|
|
619a5f15e7 | ||
|
|
305b170fc0 | ||
|
|
6f833196e4 | ||
|
|
8b1b62d64d | ||
|
|
22e6630226 | ||
|
|
79a2aad2f3 | ||
|
|
1d5cf20582 | ||
|
|
6cabbcb0da | ||
|
|
01837ad8c1 | ||
|
|
4fd2deb824 | ||
|
|
a9d48f9c87 | ||
|
|
7cb8f6323f | ||
|
|
0d2de71e48 | ||
|
|
0b2d5615bc | ||
|
|
69699116da | ||
|
|
fb18f45817 | ||
|
|
37d045c3fd | ||
|
|
00ed123df0 | ||
|
|
330dccd96a | ||
|
|
4f63906cbb | ||
|
|
04e74cf3b5 | ||
|
|
103c54c774 | ||
|
|
937ed8a0c8 | ||
|
|
4a6ef55b0d | ||
|
|
3aa2bfb9fa | ||
|
|
d612050c57 | ||
|
|
a4185677d8 | ||
|
|
cbfe1fa440 | ||
|
|
2a6c481d9c | ||
|
|
3256d53c9c | ||
|
|
b51c83475d | ||
|
|
171779bbd3 | ||
|
|
e84971f0d1 | ||
|
|
4b1063e402 | ||
|
|
769fc4be09 | ||
|
|
178ec80a6b | ||
|
|
1162e3c1ef | ||
|
|
f0b7887fe4 | ||
|
|
957c4bc628 | ||
|
|
3f1bf9595d | ||
|
|
53db033ae1 | ||
|
|
7e14a7b3b3 | ||
|
|
ed1ad03925 | ||
|
|
24a197352b | ||
|
|
108ed19e9a | ||
|
|
32e6b63273 | ||
|
|
fe7efd8e1a | ||
|
|
227d782e5a | ||
|
|
17d4a0cf58 | ||
|
|
c908a4e0cd | ||
|
|
d9eb295b20 | ||
|
|
722dada9dd | ||
|
|
9ef9edb8c6 | ||
|
|
9b8ae2a2f7 | ||
|
|
61bf520cd2 | ||
|
|
25c0311757 | ||
|
|
0b8e6fd7eb | ||
|
|
441a19da59 | ||
|
|
9ca3132d24 | ||
|
|
7445a0fc56 | ||
|
|
990bbb83e3 | ||
|
|
91e8cafae7 | ||
|
|
00706f958b | ||
|
|
d72621d3f8 | ||
|
|
1aa61a6a23 | ||
|
|
fa9e1c87a4 | ||
|
|
312310fb34 | ||
|
|
176ad37bb8 | ||
|
|
f170e87269 | ||
|
|
eaddc26ac0 | ||
|
|
63dc185be2 | ||
|
|
aa28d7cda9 | ||
|
|
0a1800bc5a | ||
|
|
26547868d2 | ||
|
|
76b09c0c6d | ||
|
|
967ee4d2d5 | ||
|
|
9f30a3bcd2 | ||
|
|
745b6164b8 | ||
|
|
756b655139 | ||
|
|
94a642ce72 | ||
|
|
13a5a1ef6c | ||
|
|
77991efc74 | ||
|
|
cc361e0468 | ||
|
|
aa37c3073d | ||
|
|
b90ff6439e | ||
|
|
f3849df4d6 | ||
|
|
b6d676fbe7 | ||
|
|
e20e92ef45 | ||
|
|
f39926e978 | ||
|
|
9dba2cffe7 | ||
|
|
4efc31df42 | ||
|
|
580e0c729d | ||
|
|
32277cbcdf | ||
|
|
78a05b90cd | ||
|
|
8c470ed84b | ||
|
|
72c73ade6f | ||
|
|
6b620f4cc2 | ||
|
|
d991acf657 | ||
|
|
484971cb29 | ||
|
|
a5c1ec7e27 | ||
|
|
b8efc3a574 | ||
|
|
ebd29ac390 | ||
|
|
3a112d737f | ||
|
|
e3384b92b9 | ||
|
|
5b0fdee7f9 | ||
|
|
bf32fd8603 | ||
|
|
63a86b58a4 | ||
|
|
daa591a981 | ||
|
|
ba6e5ec3ec | ||
|
|
1882042224 | ||
|
|
34b069089f | ||
|
|
eed240ac1d | ||
|
|
09455dec2d | ||
|
|
085aaeec92 | ||
|
|
7edeccfa83 | ||
|
|
0d0744c7c2 | ||
|
|
5fc669a22c | ||
|
|
1f8584fb85 | ||
|
|
1eb8c3ab38 | ||
|
|
5a50b92d8b | ||
|
|
7ea89b90cf | ||
|
|
063355f21e | ||
|
|
0408a36805 | ||
|
|
88cc3fe06b | ||
|
|
5a6176cc5b | ||
|
|
df04478481 | ||
|
|
308afa3dbc | ||
|
|
9c5f7b3f3b | ||
|
|
53cc6266f6 | ||
|
|
55b855644b | ||
|
|
c50692370a | ||
|
|
b8f1f65e4e | ||
|
|
1e5cb1d25a | ||
|
|
c91a548b49 | ||
|
|
4e29da74b3 | ||
|
|
0f925de6c1 | ||
|
|
b5c255a5df | ||
|
|
1d7e02e396 | ||
|
|
0c0041cebb | ||
|
|
44d0768396 | ||
|
|
08124ebfe1 | ||
|
|
d162fcdf14 | ||
|
|
beaf6fb487 | ||
|
|
3892afaa42 | ||
|
|
f2779a3a21 | ||
|
|
b4b592011c | ||
|
|
6f15c28b3a | ||
|
|
81cf8204e0 | ||
|
|
6d2e579a5c | ||
|
|
6db027616a | ||
|
|
5606473de5 | ||
|
|
bd28b6b836 | ||
|
|
098f9e9641 | ||
|
|
1e545d9dd1 | ||
|
|
31e6b609a7 | ||
|
|
62e0a51c71 | ||
|
|
13ecc1166d | ||
|
|
c25c6998b7 | ||
|
|
c9d5f24436 | ||
|
|
00cd7cd5ff | ||
|
|
fdaa56de23 | ||
|
|
81af6f8c29 | ||
|
|
175588b28d | ||
|
|
044eb02fb9 | ||
|
|
41ec621e7d | ||
|
|
c86b73a2b0 | ||
|
|
4ab9050edf | ||
|
|
0ba5d89d38 | ||
|
|
65b57b1f2a | ||
|
|
9f96c39e40 | ||
|
|
7b692e081a | ||
|
|
4373f9831d | ||
|
|
01909ee9e5 | ||
|
|
a27ccb0d20 | ||
|
|
efea96616e | ||
|
|
4774ac4399 | ||
|
|
305a4b1b9b | ||
|
|
0c4aeaff32 | ||
|
|
65654561d1 | ||
|
|
64f3ce59e0 | ||
|
|
ee8d3c0036 | ||
|
|
4ffddd6f0b | ||
|
|
75a0f03d8a | ||
|
|
8afb93b8ee | ||
|
|
42b0db847d | ||
|
|
9360bd2cc1 | ||
|
|
763f1fa5cf | ||
|
|
6773991ed2 | ||
|
|
72d1bdc434 | ||
|
|
7c8964d84b | ||
|
|
cce72c3af8 | ||
|
|
e47a5655c0 | ||
|
|
af818e032b | ||
|
|
a6fa5c4470 | ||
|
|
84d27b0c9c | ||
|
|
49fd162419 | ||
|
|
e19eca741e | ||
|
|
7a77a6c0f2 | ||
|
|
4acf97e1dc | ||
|
|
93c24d1d3e | ||
|
|
22113edbb8 | ||
|
|
42e8888a92 | ||
|
|
15343399cc | ||
|
|
801f50cb6d | ||
|
|
15fd010b48 | ||
|
|
1cc1e116f3 | ||
|
|
efbc650113 | ||
|
|
c2ccf21258 | ||
|
|
02067aeeb3 | ||
|
|
6613eb984e | ||
|
|
bc14629caa | ||
|
|
7f9bc926c7 | ||
|
|
b59f16b04a | ||
|
|
29af51643a | ||
|
|
0f6f115791 | ||
|
|
f3dbbd3b6d | ||
|
|
988205ec4a | ||
|
|
caadb4a756 | ||
|
|
9f9da43d43 | ||
|
|
b38bfd43e4 | ||
|
|
bd24285985 | ||
|
|
ec86436ac6 | ||
|
|
6e92f7a796 | ||
|
|
89ca3ccca0 | ||
|
|
eaccbdd3a0 | ||
|
|
a2656cf9ec | ||
|
|
5a7292953f | ||
|
|
3423386bae | ||
|
|
515c1cf6e1 | ||
|
|
c557efb294 | ||
|
|
79ae91802a | ||
|
|
654d23e819 | ||
|
|
08c7faf002 | ||
|
|
5d5abdd45a | ||
|
|
b2f7440702 | ||
|
|
9ba5fdec80 | ||
|
|
c81886f553 | ||
|
|
c327434840 | ||
|
|
c45de38a8c | ||
|
|
3f550d67fd | ||
|
|
f2c162501e | ||
|
|
d874ffee4c | ||
|
|
09861a9660 | ||
|
|
5619a29f3b | ||
|
|
fa93e23a99 | ||
|
|
534211f744 | ||
|
|
d18501228d | ||
|
|
2ae37b7158 | ||
|
|
8515ef2ecd | ||
|
|
725a0b2de0 | ||
|
|
1dc3e1b538 | ||
|
|
b31824c9f2 | ||
|
|
4f6bd32a2c | ||
|
|
5f66e65b03 | ||
|
|
1285a6e546 | ||
|
|
49545ebea3 | ||
|
|
6574368a5d | ||
|
|
ae7df01f18 | ||
|
|
7ba4751c99 | ||
|
|
e0c8e30bbe | ||
|
|
8ab5376e1f | ||
|
|
7e26907ec3 | ||
|
|
ce7e1cd3af | ||
|
|
a65a823db8 | ||
|
|
40b04cf904 | ||
|
|
d598a2c31a | ||
|
|
cc10d8b23b | ||
|
|
8c2f4021b3 | ||
|
|
577ef5a9ae | ||
|
|
813a523837 | ||
|
|
39073f5460 | ||
|
|
91de8496b8 | ||
|
|
d61c117b26 | ||
|
|
0c28d8c407 | ||
|
|
8d3c033818 | ||
|
|
52c110f2fe | ||
|
|
6d95401b37 | ||
|
|
815cb73cab | ||
|
|
e65324b52c | ||
|
|
f7dbb5c365 | ||
|
|
c307837d8c | ||
|
|
bb11742853 | ||
|
|
d0abdfc840 | ||
|
|
c7dc14cd33 | ||
|
|
23355fa519 | ||
|
|
94dbb218d0 | ||
|
|
304ea4dace | ||
|
|
29ab78978e | ||
|
|
be808ba3aa | ||
|
|
6a35661965 | ||
|
|
f61601df12 | ||
|
|
69957c9f5e | ||
|
|
96827ac737 | ||
|
|
a26cc697ad | ||
|
|
5319204dbe | ||
|
|
2c324b1cd1 | ||
|
|
12fe274b6a | ||
|
|
b801d626d0 | ||
|
|
1d953b907c | ||
|
|
48a8a1e9da | ||
|
|
1ad5a83ad6 | ||
|
|
0c6007639c | ||
|
|
66639c025e | ||
|
|
349ffe9789 | ||
|
|
04daa8080e | ||
|
|
344acef770 | ||
|
|
6245c7d3e9 | ||
|
|
74d1bda35a | ||
|
|
78d055e4e1 | ||
|
|
2a0b3a80b3 | ||
|
|
f4e4549b92 | ||
|
|
de133355c9 | ||
|
|
b261f431f9 | ||
|
|
ea525d5d4d | ||
|
|
a039aad421 | ||
|
|
ac296c0fbb | ||
|
|
1f6fad0f4e | ||
|
|
3b6e001b10 | ||
|
|
bb62a7a146 | ||
|
|
30076c3e3f | ||
|
|
29f4dfbe3b | ||
|
|
0f629eaec7 | ||
|
|
50953578da | ||
|
|
0e38d06c15 | ||
|
|
d914001925 | ||
|
|
4d68dc43e5 | ||
|
|
63f81c51fd | ||
|
|
50bdbd346c | ||
|
|
53a465c55a | ||
|
|
232a9ae5a8 | ||
|
|
9ff0c22385 | ||
|
|
43d8638327 | ||
|
|
308441afbb | ||
|
|
1a8df9dc70 | ||
|
|
9359c74ba9 | ||
|
|
34c8524e8f | ||
|
|
3abbdc2280 | ||
|
|
f90ef670dd | ||
|
|
7f1629f312 | ||
|
|
1853baf66d | ||
|
|
8e50970fde | ||
|
|
46f4cebaed | ||
|
|
fc58f17230 | ||
|
|
bc34d5e6ad | ||
|
|
9e7205092c | ||
|
|
eb64f4e566 | ||
|
|
7e949dd7cf | ||
|
|
3f9113c5ba | ||
|
|
906b95efda | ||
|
|
57e8453852 | ||
|
|
672f36a5ef | ||
|
|
9b0e3ad59c | ||
|
|
e1c817aa3b | ||
|
|
9c979cbb1b | ||
|
|
f15c125b4e | ||
|
|
02d97ddfc6 | ||
|
|
772de19c72 | ||
|
|
2c5f9e36eb | ||
|
|
ef3037a856 | ||
|
|
411292ad16 | ||
|
|
5230acc221 | ||
|
|
3b30a2df5d | ||
|
|
0e1af22a8d | ||
|
|
c39a64fbeb | ||
|
|
2ae2f12e47 | ||
|
|
888333b9db | ||
|
|
58f511b520 | ||
|
|
b38d36214d | ||
|
|
f965b5a57c | ||
|
|
806b593135 | ||
|
|
50628a80d6 | ||
|
|
b2bafcc9c6 | ||
|
|
08fc45f826 | ||
|
|
76e19f2eae | ||
|
|
8c29d288e1 | ||
|
|
30737c6ba2 | ||
|
|
a482199ab1 | ||
|
|
314f37400e | ||
|
|
b3ce3e3959 | ||
|
|
d15264017e | ||
|
|
248fe590b2 | ||
|
|
2737777132 | ||
|
|
7cdf7227a7 | ||
|
|
f51ad38f1a | ||
|
|
3f30c2ad14 | ||
|
|
0e261daa8c | ||
|
|
243c4d3800 | ||
|
|
1b49449f65 | ||
|
|
1948178ce6 | ||
|
|
63e8c5a76d | ||
|
|
25f30d49ae | ||
|
|
0102f5f1de | ||
|
|
8b13d6108e | ||
|
|
258143e224 | ||
|
|
7429a49941 | ||
|
|
a31052caf4 | ||
|
|
4be3410a5c | ||
|
|
e2276ed15e | ||
|
|
26e2a84301 | ||
|
|
c3d0f7ec33 | ||
|
|
78006b606e | ||
|
|
9cd6c6ddae | ||
|
|
51598de333 | ||
|
|
e8a9b8a4a7 | ||
|
|
ef6007a267 | ||
|
|
a38ce02b98 | ||
|
|
e321ec9f9c | ||
|
|
e7b198e263 | ||
|
|
240359871f | ||
|
|
7731d780c9 | ||
|
|
f091d58595 | ||
|
|
470dbabe4d | ||
|
|
49da8b8772 | ||
|
|
90bad041e3 | ||
|
|
56a1c24e80 | ||
|
|
84c76fc1e6 | ||
|
|
c14251c3d6 | ||
|
|
ea2493c77f | ||
|
|
ff8ec44f66 | ||
|
|
36fb267d1a | ||
|
|
f76f67f9db | ||
|
|
ca44266b82 | ||
|
|
f6a35499fb | ||
|
|
862729f8a1 | ||
|
|
a74bd02580 | ||
|
|
d1cde175c5 | ||
|
|
ba734094b0 | ||
|
|
c31e8395fa | ||
|
|
2ccf1ee095 | ||
|
|
ead9e53315 | ||
|
|
c42356d0a8 | ||
|
|
c7858af821 | ||
|
|
3f75cf9b6e | ||
|
|
570fe1be28 | ||
|
|
f8f428369f | ||
|
|
34c9a16b53 | ||
|
|
ee77d82b9a | ||
|
|
c2fd30a09a | ||
|
|
3613da1aca | ||
|
|
4346a42249 | ||
|
|
db8315ae77 | ||
|
|
f4fc9d1760 | ||
|
|
4badfb680d | ||
|
|
7e7debff9b | ||
|
|
5c551e7d04 | ||
|
|
a6ddf17925 | ||
|
|
fa4f1aa80b | ||
|
|
3da7a3d5ad | ||
|
|
863f6bc7a6 | ||
|
|
05f2c2c057 | ||
|
|
786b82dd04 | ||
|
|
768225956d | ||
|
|
2885854868 | ||
|
|
bca4715b07 | ||
|
|
8fd28dc924 | ||
|
|
613baab5ec | ||
|
|
61acfd4945 | ||
|
|
b66e545187 | ||
|
|
09743dd160 | ||
|
|
e4bab4dc1d | ||
|
|
e618a11ba6 | ||
|
|
3f3415bb9e | ||
|
|
2bdc2d56a1 | ||
|
|
6b11f40a84 | ||
|
|
4725169dd6 | ||
|
|
1c1058f925 | ||
|
|
175f454929 | ||
|
|
cadc468870 | ||
|
|
8f6f02353f | ||
|
|
25b477aad5 | ||
|
|
e52216f17b | ||
|
|
db11cb3e6b | ||
|
|
34e39e17fb | ||
|
|
32cda999d6 | ||
|
|
46f6afe464 | ||
|
|
5a0ea03c9e | ||
|
|
d7d24c7f52 | ||
|
|
964de58c03 | ||
|
|
dd58966495 | ||
|
|
311f126e7f | ||
|
|
574f006950 | ||
|
|
64e76f7e7f | ||
|
|
33eaa513c2 | ||
|
|
ed2a8cbdb6 | ||
|
|
d191df0246 | ||
|
|
821c71c97c | ||
|
|
3e37859728 | ||
|
|
6a7158e45a | ||
|
|
60bc704c64 | ||
|
|
faa85bc7ed | ||
|
|
30f83ccd01 | ||
|
|
420edc39cd | ||
|
|
7fe65d4d1e | ||
|
|
ee062b5dfa | ||
|
|
a1b3cc59f3 | ||
|
|
c296ef6acc | ||
|
|
fc17f80c53 | ||
|
|
39d61fa102 | ||
|
|
5f67159d07 | ||
|
|
5663727b1d | ||
|
|
8e3d72b2b3 | ||
|
|
7f22d3d4c5 | ||
|
|
455280d1c7 | ||
|
|
1d707e5709 | ||
|
|
d78b6f4284 | ||
|
|
560e0a5e39 | ||
|
|
06cba2bda4 | ||
|
|
aead7adf7f | ||
|
|
0a61f31f54 | ||
|
|
68efa8bdd2 | ||
|
|
eeaaa86efc | ||
|
|
6c19fa7f09 | ||
|
|
8316bd81ea | ||
|
|
fda1c448f1 | ||
|
|
de723e0ac7 | ||
|
|
6768400d73 | ||
|
|
a9f2a0d0f4 | ||
|
|
70451c5584 | ||
|
|
a2ecd9b20a | ||
|
|
31020e5dec | ||
|
|
0f2f0327d3 | ||
|
|
600a49774f | ||
|
|
c6135c6b81 | ||
|
|
17c9b1885c | ||
|
|
cd759ac57e | ||
|
|
575abbd4d2 | ||
|
|
1e2ffe295e | ||
|
|
6262a0e186 | ||
|
|
7d935bd009 | ||
|
|
3045efc2c7 | ||
|
|
96b943c477 | ||
|
|
cce7ce82e0 | ||
|
|
13c789506a | ||
|
|
af8b53b69f | ||
|
|
2998e58594 | ||
|
|
0471f80056 | ||
|
|
bac68f9bb6 | ||
|
|
9faf13bc0a | ||
|
|
87cfe3f06d | ||
|
|
0a295d2fc0 | ||
|
|
4002758021 | ||
|
|
e1d0d64678 | ||
|
|
50a7777623 | ||
|
|
611750d350 | ||
|
|
9e68bea156 | ||
|
|
8a53a40566 | ||
|
|
d04dfee456 | ||
|
|
736a97783a | ||
|
|
861709a3a1 | ||
|
|
b35caaea7a | ||
|
|
e77994f968 | ||
|
|
0aed308b80 | ||
|
|
ed7624ee26 | ||
|
|
f0c26a0b53 | ||
|
|
7850e2040c | ||
|
|
e91b45b7f3 | ||
|
|
a2433f41c7 | ||
|
|
598836dfda | ||
|
|
512203e858 | ||
|
|
cf3b8d925d | ||
|
|
cf6bd06c4c | ||
|
|
ccaeebb547 | ||
|
|
434690974d | ||
|
|
0bfa95acf6 | ||
|
|
20e4aff929 | ||
|
|
8ea5be246f | ||
|
|
9c895b4f42 | ||
|
|
90c3186760 | ||
|
|
25951eeb48 | ||
|
|
d3e0648ee1 | ||
|
|
28c06a7fd3 | ||
|
|
ca2bde239b | ||
|
|
a2955c5da1 | ||
|
|
c309481bf9 | ||
|
|
fd61b0dd32 | ||
|
|
cf972bbbe2 | ||
|
|
90ce238bfa | ||
|
|
c2e0647baf | ||
|
|
1022f3066b | ||
|
|
84d7b0dc1a | ||
|
|
7ae4e71c47 | ||
|
|
74cd67c1d5 | ||
|
|
bb95823924 | ||
|
|
83cd3fdb83 | ||
|
|
86075bbe47 | ||
|
|
7b4ad6eb4a | ||
|
|
11cfe41b8e | ||
|
|
c3abf890c1 | ||
|
|
1729a2cdd4 | ||
|
|
2516664810 | ||
|
|
8fdc3df35e | ||
|
|
2dce4afe42 | ||
|
|
41a8d2246f | ||
|
|
efafb96456 | ||
|
|
c08fb0db23 | ||
|
|
2fdfcf5572 | ||
|
|
c94a7430a2 | ||
|
|
87d6d49d65 | ||
|
|
7fcc030e0b | ||
|
|
64a4acd3f1 | ||
|
|
86071592be | ||
|
|
e75f49950e | ||
|
|
8e5a9db103 | ||
|
|
53f952b0ca | ||
|
|
9aae738690 | ||
|
|
17f284ac3d | ||
|
|
12381332af | ||
|
|
b80c95a5ac | ||
|
|
1cba5a7c0d | ||
|
|
852b7dc358 | ||
|
|
cf7cc16360 | ||
|
|
009cfadeaa | ||
|
|
cfa44153bb | ||
|
|
c174dc7973 | ||
|
|
89d49a9026 | ||
|
|
f60b1656d2 | ||
|
|
93bdfad87e | ||
|
|
8110894e0b | ||
|
|
74958bdef6 | ||
|
|
fba0e374dc | ||
|
|
23722cc372 | ||
|
|
8236e8bf67 | ||
|
|
5cf1ddeaa0 | ||
|
|
a8cad59293 | ||
|
|
6134898fdd | ||
|
|
d0a6c8a768 | ||
|
|
d1df920f4b | ||
|
|
03f1cd5d23 | ||
|
|
6fa02583cb | ||
|
|
bacd1bf46e | ||
|
|
3ada1c7b2e | ||
|
|
fe70845826 | ||
|
|
040b023072 | ||
|
|
502c98c1a1 | ||
|
|
7e830293c5 | ||
|
|
c5a273734a | ||
|
|
736ef7dfbd | ||
|
|
6a321d34b8 | ||
|
|
2eb03dd982 | ||
|
|
0ce4b26ad0 | ||
|
|
fa526975d0 | ||
|
|
62e392fc33 | ||
|
|
d91fe49512 | ||
|
|
69956609dd | ||
|
|
3a7046c27a | ||
|
|
67e6f18c0d | ||
|
|
04048c52c0 | ||
|
|
e9ed855708 | ||
|
|
befbb9c64a | ||
|
|
2294aabf97 | ||
|
|
eaa8e7251d | ||
|
|
2d1fd82a25 | ||
|
|
b7bf288769 | ||
|
|
46698df804 | ||
|
|
58191cba25 | ||
|
|
e0c241ae0c | ||
|
|
5baa2fc8fd | ||
|
|
7805fde9b3 | ||
|
|
80601e266d | ||
|
|
68138db1b0 | ||
|
|
25ddd22e8e | ||
|
|
2e661f04b7 | ||
|
|
06a3d17164 | ||
|
|
ec24a52f7f | ||
|
|
15aabc46d6 | ||
|
|
c723bde8ca | ||
|
|
d8f38c68ef | ||
|
|
49a344776c | ||
|
|
915c1d761d | ||
|
|
284257253d | ||
|
|
da4b88885a | ||
|
|
cd05b30c88 | ||
|
|
0c67313053 | ||
|
|
2c0ff7dee2 | ||
|
|
61f20128d4 | ||
|
|
a72ac5b5a6 | ||
|
|
f4ca9d1241 | ||
|
|
2bad5b93a9 | ||
|
|
582594017e | ||
|
|
9bc3a4555a | ||
|
|
0575db6f08 | ||
|
|
81164f1641 | ||
|
|
82449b1551 | ||
|
|
d56dc7a474 | ||
|
|
ef6f32cf5d | ||
|
|
e14765ee80 | ||
|
|
b37a4a952c | ||
|
|
b4c773eca5 | ||
|
|
8d53838110 | ||
|
|
bcbde3c48a | ||
|
|
a9193f3efd | ||
|
|
114bb6b322 | ||
|
|
b39b42a37f | ||
|
|
070918f0d2 | ||
|
|
a138322698 | ||
|
|
ed59500543 | ||
|
|
15ad9355e6 | ||
|
|
15ef09d211 | ||
|
|
647cd3ebbc | ||
|
|
65df83ba6d | ||
|
|
bb11a58e22 | ||
|
|
03547804fc | ||
|
|
8116c69364 | ||
|
|
f81ecdddbe | ||
|
|
da7d67586a | ||
|
|
4a1eec886c | ||
|
|
bb2a07e35b | ||
|
|
b8411a9363 | ||
|
|
f4d0dc7138 | ||
|
|
491a77520b | ||
|
|
dced7fcf33 | ||
|
|
6a16a58560 | ||
|
|
e3a3b62080 | ||
|
|
aaa21da321 | ||
|
|
d5bb6f8362 | ||
|
|
9de375beef | ||
|
|
1865527839 | ||
|
|
688c4f0378 | ||
|
|
8176af1d6c | ||
|
|
6e6f0e325b | ||
|
|
b4e9e71ad8 | ||
|
|
bfd6950cfc | ||
|
|
c32f16418b | ||
|
|
ff6a875428 | ||
|
|
8b94b8dd76 | ||
|
|
4f48f34112 | ||
|
|
32a6d2dcd9 | ||
|
|
3339305292 | ||
|
|
e7ece7099a | ||
|
|
f621e070f2 | ||
|
|
c4ec2518e7 | ||
|
|
f3d27bd774 | ||
|
|
398428cde6 | ||
|
|
cf5b13e527 | ||
|
|
9e8d867e3e | ||
|
|
2ebf3aedd9 | ||
|
|
be954f1f8d | ||
|
|
209d91db43 | ||
|
|
0648b00bc8 | ||
|
|
8728546702 | ||
|
|
d086f8e406 | ||
|
|
b4ccd6ae62 | ||
|
|
b3aea3b33e | ||
|
|
22b306f9f3 | ||
|
|
64746987f3 | ||
|
|
2adff4fa8c | ||
|
|
6599b89408 | ||
|
|
ca8df49cac | ||
|
|
811809ea78 | ||
|
|
541710005f | ||
|
|
b8641babb0 | ||
|
|
85ea74c4a3 | ||
|
|
3f6b0175cf | ||
|
|
99bcb73398 | ||
|
|
98d6d681f0 | ||
|
|
878b526a9d | ||
|
|
52fcb9bf69 | ||
|
|
24610ee124 | ||
|
|
1de091bc1b | ||
|
|
a1855ad6ee | ||
|
|
c540a6bc15 | ||
|
|
46fe427595 | ||
|
|
6b898d6f10 | ||
|
|
2a1cb4b5ee | ||
|
|
f44b8d9ac9 | ||
|
|
e8f0de5926 | ||
|
|
bbc84f8a03 | ||
|
|
e54a57e258 | ||
|
|
96735b7282 | ||
|
|
bc04ae8b52 | ||
|
|
1273d3fcc4 | ||
|
|
291e099c3e | ||
|
|
258cab107d | ||
|
|
c4770ee743 | ||
|
|
a511f0e2cb | ||
|
|
af263cad73 | ||
|
|
d2e2b28b98 | ||
|
|
821bb593a9 | ||
|
|
bce89ebcd9 | ||
|
|
e78475a10e | ||
|
|
b6be122497 | ||
|
|
316f72ed25 | ||
|
|
3995ced502 | ||
|
|
2f1d0e0668 | ||
|
|
75500a8252 | ||
|
|
8fb0b193fc | ||
|
|
3dcb89f67e | ||
|
|
6503a1689e | ||
|
|
522bc467eb | ||
|
|
8a429e35b8 | ||
|
|
38feb387f4 | ||
|
|
3c4078f9df | ||
|
|
37b2b79102 | ||
|
|
60f53e5336 | ||
|
|
1282d2095f | ||
|
|
1551969f22 | ||
|
|
a90da01d76 | ||
|
|
17c6455a40 | ||
|
|
f7a6ca119d | ||
|
|
34706fdbe8 | ||
|
|
9094b4e4b2 | ||
|
|
94c88793f6 | ||
|
|
4a0644f309 | ||
|
|
17c2b78eab | ||
|
|
b25c6fc449 | ||
|
|
5584fca47e | ||
|
|
6c8b53a499 | ||
|
|
0dbf0f5382 | ||
|
|
6949c20c1e | ||
|
|
079cba58d1 | ||
|
|
6031ae93d9 | ||
|
|
eba86e853d | ||
|
|
f43166b991 | ||
|
|
ee81fba8a8 | ||
|
|
6f848ba0be | ||
|
|
a897b665cf | ||
|
|
ffc17e958c | ||
|
|
aeaa56cf6f | ||
|
|
32214d9a3c | ||
|
|
64819e531d | ||
|
|
0dff80f614 | ||
|
|
d73518c7b7 | ||
|
|
e71be01b47 | ||
|
|
7706d48f3f | ||
|
|
9ec6e88804 | ||
|
|
8f24c0d538 | ||
|
|
129fdd8333 | ||
|
|
9a14329856 | ||
|
|
6e0e19f4f0 | ||
|
|
21c0d21b76 | ||
|
|
d064f1a0f4 | ||
|
|
d666576e60 | ||
|
|
634a302bfc | ||
|
|
c2878bdb25 | ||
|
|
aa12f3c9b2 | ||
|
|
0559f4076e | ||
|
|
11218de0b1 | ||
|
|
b017f04e5b | ||
|
|
9026ba1317 | ||
|
|
30e1a06a3d | ||
|
|
741afd2941 | ||
|
|
a1b659ca93 | ||
|
|
1c9534a37a | ||
|
|
213c7f0519 | ||
|
|
d265388717 | ||
|
|
8aeb63a650 | ||
|
|
2547a2e132 | ||
|
|
f6f6db3d01 | ||
|
|
598261d7ac | ||
|
|
17ed0ff86a | ||
|
|
de4e348049 | ||
|
|
4fc14538dc | ||
|
|
f02688168e | ||
|
|
c4f5a69ca8 | ||
|
|
ea3c6dc3a3 | ||
|
|
6114ff462e | ||
|
|
0831d037d9 | ||
|
|
fced905393 | ||
|
|
ce967fbd2d | ||
|
|
7dff911912 | ||
|
|
066164cfd1 | ||
|
|
26599d0d1a | ||
|
|
ba4b02d1c9 | ||
|
|
8fdfff3ee1 | ||
|
|
e77f508503 | ||
|
|
1a113b863c | ||
|
|
3d98fba71c | ||
|
|
15a6adfb71 | ||
|
|
42ad95382b | ||
|
|
087dd39091 | ||
|
|
56dca42e17 | ||
|
|
b0b7116db2 | ||
|
|
3b05435cab | ||
|
|
e16b8eec40 | ||
|
|
7299d62c4c | ||
|
|
a997b40032 | ||
|
|
4efa7b1a64 | ||
|
|
dc48e66d51 | ||
|
|
d459a477e6 | ||
|
|
4107247013 | ||
|
|
cc58279d91 | ||
|
|
06c6fbbdfc | ||
|
|
5399fe786f | ||
|
|
0fbad95a26 | ||
|
|
a1f52251ef | ||
|
|
82081277f5 | ||
|
|
d9b6345797 | ||
|
|
5fee6993f6 | ||
|
|
1c8fc9c76e | ||
|
|
3f4305f5e0 | ||
|
|
4d07c9279f | ||
|
|
406cd14643 | ||
|
|
e5f8fab995 | ||
|
|
e088fa35be | ||
|
|
e91b22d78f | ||
|
|
8bc99ae689 | ||
|
|
5d7efed605 | ||
|
|
aa928602e2 | ||
|
|
30991e5f82 | ||
|
|
5ab5180145 | ||
|
|
ecf909a83d | ||
|
|
08aa37f91c | ||
|
|
e53d3c8c80 | ||
|
|
6d80a4114d | ||
|
|
1585de4614 | ||
|
|
913c0585ec | ||
|
|
07a9d1ef9a | ||
|
|
26b8d4d554 | ||
|
|
6df8ac087e | ||
|
|
cf616e1770 | ||
|
|
42bde1c4bc | ||
|
|
a216e21584 | ||
|
|
109b2408c8 | ||
|
|
e13944b577 | ||
|
|
6aa6dd76bd | ||
|
|
0699645b43 | ||
|
|
d5b6b1e041 | ||
|
|
97a4a6ecfb | ||
|
|
1bb16681ac | ||
|
|
bbc5c47f99 | ||
|
|
8333cc9895 | ||
|
|
01a5f6dc3e | ||
|
|
d0f9b652b6 | ||
|
|
a9fb4bd815 | ||
|
|
b02a3a6c0f | ||
|
|
0d97401137 | ||
|
|
f4b9ad590f | ||
|
|
928a6d6137 | ||
|
|
91ca108bd5 | ||
|
|
eb53bcb83a | ||
|
|
939d9df3e3 | ||
|
|
ece3ecc927 | ||
|
|
7932a902ef | ||
|
|
a0a142b795 | ||
|
|
547d81dee6 | ||
|
|
ca74a013a7 | ||
|
|
51c1d82e65 | ||
|
|
69d14b3890 | ||
|
|
dc306973d5 | ||
|
|
cc22cb5b75 | ||
|
|
8703733747 | ||
|
|
1c766243eb | ||
|
|
3c1897a47d | ||
|
|
22c184ebf3 | ||
|
|
82e8ca53c4 | ||
|
|
439a8292e7 | ||
|
|
6ff321dc3d | ||
|
|
28eaa38065 | ||
|
|
fdeb11cf98 | ||
|
|
82bbd71774 | ||
|
|
01a46c5858 | ||
|
|
052747aa5c | ||
|
|
cd6884d6a9 | ||
|
|
e9e3fd85d8 | ||
|
|
74de52fda8 | ||
|
|
81b555abc9 | ||
|
|
ea91ee44cc | ||
|
|
db34d57cbb | ||
|
|
aa12de0617 | ||
|
|
7b85d2262b | ||
|
|
3112e77701 | ||
|
|
9deb2f41db | ||
|
|
f6430b7da0 | ||
|
|
381ebf4a87 | ||
|
|
c996cadc39 | ||
|
|
063addb8c3 | ||
|
|
4a7b51ba9a | ||
|
|
5e4656011a | ||
|
|
cd59b4a3c7 | ||
|
|
ef5e7ee79f | ||
|
|
46c4648beb | ||
|
|
997098f313 | ||
|
|
5acb02c8c4 | ||
|
|
fe5de84b88 | ||
|
|
1a82acfe5e | ||
|
|
498913d0e8 | ||
|
|
b63a076dd8 | ||
|
|
e020fef0b6 | ||
|
|
1f88ee5bde | ||
|
|
b1a45398d3 | ||
|
|
4ea82b2757 | ||
|
|
f6ce7db266 | ||
|
|
e71b38484f | ||
|
|
dadf2717c8 | ||
|
|
55865cfd42 | ||
|
|
500976bfe6 | ||
|
|
71e22e2f9b | ||
|
|
4848bd11c2 | ||
|
|
ed9dd82958 | ||
|
|
7371f0fe9c | ||
|
|
caa36b4448 | ||
|
|
c1ed21d227 | ||
|
|
7d5572aee6 | ||
|
|
8e20edfc52 | ||
|
|
9367d593ce | ||
|
|
038c47e763 | ||
|
|
7bfbdba867 | ||
|
|
b762e85608 | ||
|
|
f9b879a727 | ||
|
|
4e01b1c7a4 | ||
|
|
7bd7ef61cc | ||
|
|
044d8e5454 | ||
|
|
6a74ae12a6 | ||
|
|
edf3d01b2c | ||
|
|
cba721dfb4 | ||
|
|
6b66d162ab | ||
|
|
1451caa51b | ||
|
|
1b3c1867a1 | ||
|
|
ec8a580bb4 | ||
|
|
c3c6156360 | ||
|
|
226559c098 | ||
|
|
f51ca7bcd2 | ||
|
|
2f1ef0fd1c | ||
|
|
c97f907888 | ||
|
|
e0269bba24 | ||
|
|
7e2cd67996 | ||
|
|
f583ec8acf | ||
|
|
04b79faf41 | ||
|
|
3de54540a0 | ||
|
|
349941a0f1 | ||
|
|
9cb5cd7d01 | ||
|
|
05e0b92bd3 | ||
|
|
0d3feacc6e | ||
|
|
cc76cffbc9 | ||
|
|
d8131eaecc | ||
|
|
1be11e847d | ||
|
|
b1e35493ea | ||
|
|
4f82091a8b | ||
|
|
6ee5e162f9 | ||
|
|
c7023433bd | ||
|
|
06307a8204 | ||
|
|
04cd78a2fb | ||
|
|
8543fae03e | ||
|
|
9742593480 | ||
|
|
c57c9060af | ||
|
|
2d44575915 | ||
|
|
816c7b3eaf | ||
|
|
b4a7375244 | ||
|
|
46f1cc127b | ||
|
|
edccbd62ef | ||
|
|
568efe921e | ||
|
|
187d46db1f | ||
|
|
843c4ab7b0 | ||
|
|
9ced3bb626 | ||
|
|
71e97aa998 | ||
|
|
cefb09fd18 | ||
|
|
a4c88dfb7e | ||
|
|
e8189fd351 | ||
|
|
6adbe9ad9f | ||
|
|
66380bd320 | ||
|
|
e51ae76cb5 | ||
|
|
e272f2d2f3 | ||
|
|
390080678b | ||
|
|
f3cd3a0e49 | ||
|
|
9911e8a5ae | ||
|
|
578652c4ac | ||
|
|
da57903288 | ||
|
|
1755024b6f | ||
|
|
3062da9407 | ||
|
|
1a54c89f03 | ||
|
|
1b6e7fb506 | ||
|
|
7db30f1a64 | ||
|
|
39e0aa0787 | ||
|
|
00bf60078f | ||
|
|
78265361b3 | ||
|
|
c90d052713 | ||
|
|
efcc9ebcca | ||
|
|
ba3959a51f | ||
|
|
5ba6aa2fdc | ||
|
|
d621200385 | ||
|
|
72884ce88d | ||
|
|
cb14149194 | ||
|
|
9da9ede896 | ||
|
|
14b0f6621f | ||
|
|
ef6191f69d | ||
|
|
bd703b43af | ||
|
|
e1195acc48 | ||
|
|
b852f702de | ||
|
|
3a93f412ba | ||
|
|
a1af91e7e0 | ||
|
|
02fe287f00 | ||
|
|
a1758adc9d | ||
|
|
912276c1fd | ||
|
|
53842105e1 | ||
|
|
4198b88ddc | ||
|
|
113cb5b269 | ||
|
|
74f90177e7 | ||
|
|
02aeaabae3 | ||
|
|
ff97dd5b0c | ||
|
|
a19a00632f | ||
|
|
980ac6dd9e | ||
|
|
4f81e3a49b | ||
|
|
9c78797434 | ||
|
|
3f3c410cc4 | ||
|
|
8c02be4d02 | ||
|
|
598f17dc09 | ||
|
|
5d522b4a3b | ||
|
|
6dc52de9b0 | ||
|
|
e94d9f7e8a | ||
|
|
64e3e72794 | ||
|
|
7600ef4404 | ||
|
|
03507c5c91 | ||
|
|
92b2ce3b9b | ||
|
|
cef0cea6c4 | ||
|
|
f9ea911f67 | ||
|
|
392e54fb43 | ||
|
|
1716bafada | ||
|
|
637480d143 | ||
|
|
fe3c0e9aaf | ||
|
|
73c1c103a9 | ||
|
|
a1c451e778 | ||
|
|
36f10acb46 | ||
|
|
0c82790057 | ||
|
|
d61c9a1401 | ||
|
|
f7761ebf84 | ||
|
|
ee63e1eabd | ||
|
|
ec1cce1022 | ||
|
|
7067513262 | ||
|
|
547a922d64 | ||
|
|
8140735568 | ||
|
|
b22ba085df | ||
|
|
0330dce9a9 | ||
|
|
6e2115addd | ||
|
|
1158194344 | ||
|
|
77175b0d23 | ||
|
|
21b7830e1b | ||
|
|
561f2c0b64 | ||
|
|
78c7e25e85 | ||
|
|
142d257f44 | ||
|
|
0a5bff5ef8 | ||
|
|
2f8cee56e4 | ||
|
|
be7f95b936 | ||
|
|
a54ba22cbd | ||
|
|
fdbc41b6f8 | ||
|
|
017c740e7c | ||
|
|
306f8a4fa8 | ||
|
|
b0a46c09fe | ||
|
|
8f28f6cafb | ||
|
|
4944d404c5 | ||
|
|
d05b083904 | ||
|
|
fd420dab47 | ||
|
|
7a883a3af3 | ||
|
|
0d5f2a92b0 | ||
|
|
57e73e5f47 | ||
|
|
db82249844 | ||
|
|
50facab4f8 | ||
|
|
09f9f1f6f4 | ||
|
|
4f83a03df2 | ||
|
|
eafefcd348 | ||
|
|
9c81cdaaa7 | ||
|
|
992e3d68e7 | ||
|
|
8c548f7bb0 | ||
|
|
b6421e4f37 | ||
|
|
baf75e216f | ||
|
|
131db3e1b0 | ||
|
|
789689195f | ||
|
|
96236a2dc3 | ||
|
|
0f546f597a | ||
|
|
6048cc2ac1 | ||
|
|
8dca457d34 | ||
|
|
1c71964ca4 | ||
|
|
f48bf6350d | ||
|
|
ce39f6aed0 | ||
|
|
3009046a27 | ||
|
|
9966bb71bc | ||
|
|
15c8441822 | ||
|
|
33ca608d5d | ||
|
|
4d5d4bd261 | ||
|
|
2d7391be05 | ||
|
|
79eab2f865 | ||
|
|
671030ae27 | ||
|
|
943e7bf32d | ||
|
|
7a0162e173 | ||
|
|
287bb9a3b7 | ||
|
|
f520ca581c | ||
|
|
9bc4946f74 | ||
|
|
ed6a712c10 | ||
|
|
2d97be7aa5 | ||
|
|
df5ef97507 | ||
|
|
11bb6dd69f | ||
|
|
7ee6553a4c | ||
|
|
fff2454d95 | ||
|
|
442584f708 | ||
|
|
8668e02b24 | ||
|
|
218645a9ac | ||
|
|
53c19b3eaa | ||
|
|
82a67f8fe5 | ||
|
|
f47e0885d0 | ||
|
|
c3a0ecc86f | ||
|
|
3830cdae38 | ||
|
|
f3749fd6d0 | ||
|
|
f61c978ec9 | ||
|
|
f0c83e009e | ||
|
|
d3c3d58c9b | ||
|
|
0592df8066 | ||
|
|
b3fc97d222 | ||
|
|
f4f82f4990 | ||
|
|
98426f4c32 | ||
|
|
063d1f3067 | ||
|
|
2b107f5ebc | ||
|
|
dd703c4841 | ||
|
|
835829aa93 | ||
|
|
8f5a33d507 | ||
|
|
d2a77f29c7 | ||
|
|
9d23770ed3 | ||
|
|
69b665d94d | ||
|
|
c974ba0ad6 | ||
|
|
565b4a2c1a | ||
|
|
58169cc074 | ||
|
|
442f36f79e | ||
|
|
0bfacd4397 | ||
|
|
4e8e439098 | ||
|
|
784447a897 | ||
|
|
098ce63b75 | ||
|
|
9066b5546d | ||
|
|
4567f4d99e | ||
|
|
ec2e1e3670 | ||
|
|
bfa8b2256a | ||
|
|
d84dbbb74d | ||
|
|
bb3889a105 | ||
|
|
9475e3cbe7 | ||
|
|
cd93b55fba | ||
|
|
45f7884a79 | ||
|
|
9091d7b0ef | ||
|
|
e8ed1f8f7f | ||
|
|
ee85bf180b | ||
|
|
ecf6363a53 | ||
|
|
ffbb106692 | ||
|
|
7f3baa6943 | ||
|
|
547f900a65 | ||
|
|
f30af8597b | ||
|
|
c8dc5e30a1 | ||
|
|
f5ecfb2c0e | ||
|
|
2d617ad494 | ||
|
|
bd08f43b49 | ||
|
|
5ffaecc6e0 | ||
|
|
ae962684f6 | ||
|
|
af6dfae184 | ||
|
|
c8f72ed706 | ||
|
|
be4677a1dd | ||
|
|
129cd128f6 | ||
|
|
3cfe2ab9c3 | ||
|
|
1aca60697f | ||
|
|
16f2024592 | ||
|
|
563d2ccc1d | ||
|
|
fbc645eb9f | ||
|
|
3238c36d41 | ||
|
|
edb1fc53ce | ||
|
|
325e2cc40a | ||
|
|
d722b7b5b3 | ||
|
|
9d24609073 | ||
|
|
9ba0f1bb83 | ||
|
|
69ec751674 | ||
|
|
8600f31343 | ||
|
|
926996cd10 | ||
|
|
509db710e5 | ||
|
|
04ed5f6617 | ||
|
|
2824161b0c | ||
|
|
adfc559082 | ||
|
|
2e9a76c815 | ||
|
|
cdb293551d | ||
|
|
9b0b40de70 | ||
|
|
19b730bd51 | ||
|
|
cb5aa0599c | ||
|
|
c642855551 | ||
|
|
588623e184 | ||
|
|
8b8fd23a03 | ||
|
|
1dffe018ea | ||
|
|
dfa69f4694 | ||
|
|
8353bfe5af | ||
|
|
0a87d13db8 | ||
|
|
a730175143 | ||
|
|
07a5624809 | ||
|
|
947a9e996d | ||
|
|
760506b6bd | ||
|
|
3258d858d7 | ||
|
|
5a27fe15de | ||
|
|
556227a4de | ||
|
|
45c575503a | ||
|
|
5b3d98ddcd | ||
|
|
5c45e6e24f | ||
|
|
1bdd586a53 | ||
|
|
799f40eb7b | ||
|
|
45acdc0763 | ||
|
|
26fd50450a | ||
|
|
4ca97ec63d | ||
|
|
5745d99e61 | ||
|
|
cb61101d98 | ||
|
|
4b98eabcc7 | ||
|
|
6cceaf781a | ||
|
|
014819d5d9 | ||
|
|
e5ba886179 | ||
|
|
0a5e98b7f2 | ||
|
|
359cd8e812 | ||
|
|
457ac8295b | ||
|
|
49c0c0f46f | ||
|
|
dea253d90d | ||
|
|
ddb10a2361 | ||
|
|
03f1c568d0 | ||
|
|
7fb3d7ef1c | ||
|
|
a0eeb87472 | ||
|
|
b511135f1a | ||
|
|
dab20ed880 | ||
|
|
c06792a107 | ||
|
|
f2e1ad06f6 | ||
|
|
23f52bb47d | ||
|
|
24a88ed36b | ||
|
|
9f70033156 | ||
|
|
80bbbeaca6 | ||
|
|
cd62333678 | ||
|
|
9c613081fe | ||
|
|
771a3e2454 | ||
|
|
b037aab980 | ||
|
|
39fddb627d | ||
|
|
2c1659242f | ||
|
|
ba4897066d | ||
|
|
149d9ee9b0 | ||
|
|
bef7fd3b4e | ||
|
|
6d39d7bd16 | ||
|
|
cb7edcdc5d | ||
|
|
2ebd19b792 | ||
|
|
c95540bece | ||
|
|
08203fb732 | ||
|
|
e08ff5c57b | ||
|
|
6ac0d9d9b4 | ||
|
|
7121c4385b | ||
|
|
14ee6c99e2 | ||
|
|
d4bf346823 | ||
|
|
005e405932 | ||
|
|
aa1289f7e3 | ||
|
|
9c53092e24 | ||
|
|
913362958e | ||
|
|
80ef42896b | ||
|
|
624f4e0789 | ||
|
|
db7c75640e | ||
|
|
0e05c40ca0 | ||
|
|
43dea694c1 | ||
|
|
d1480d9ebb | ||
|
|
bd9001e189 | ||
|
|
fd4bc93325 | ||
|
|
98cb7ced13 | ||
|
|
fa43c7259c | ||
|
|
1285395535 | ||
|
|
12a22339c6 | ||
|
|
767d93704e | ||
|
|
1f99285ac4 | ||
|
|
4cf63cd98e | ||
|
|
8ba10d9100 | ||
|
|
ae81ac0f25 | ||
|
|
00f31f92c4 | ||
|
|
bcc840d5bc | ||
|
|
6bbe0d88f0 | ||
|
|
2cebcc3e5a | ||
|
|
588716667b | ||
|
|
c7c44b4ee0 | ||
|
|
dcd2dcb7d5 | ||
|
|
ccf7bfd16d | ||
|
|
1f43934249 | ||
|
|
c7129498b1 | ||
|
|
cedd157d6e | ||
|
|
361ea65744 | ||
|
|
b4a7b95fc1 | ||
|
|
9b140f9c74 | ||
|
|
554952b214 | ||
|
|
a27a054a46 | ||
|
|
cb22c63827 | ||
|
|
4e5920c870 | ||
|
|
a0ab776c16 | ||
|
|
882d30d1f7 | ||
|
|
f853251079 | ||
|
|
30c3d9bdc4 | ||
|
|
105f09369b | ||
|
|
e512306c9e | ||
|
|
281e5905a9 | ||
|
|
a6f2de9912 | ||
|
|
95bced9f30 | ||
|
|
b1be708322 | ||
|
|
dea8849a6d | ||
|
|
6646954d11 | ||
|
|
42f9b3f4e9 | ||
|
|
c9d066bbdd | ||
|
|
0c2dbd8604 | ||
|
|
574da52b34 | ||
|
|
c9807e4dfe | ||
|
|
cbecda37c1 | ||
|
|
50a9dcfd48 | ||
|
|
311c24c1fa | ||
|
|
6ba0d9c66c | ||
|
|
919c5252ed | ||
|
|
3b6a69a9e1 | ||
|
|
78e02752ff | ||
|
|
466aa547e9 | ||
|
|
fabd160a97 | ||
|
|
e50476cd70 | ||
|
|
66f093ff31 | ||
|
|
c444151db6 | ||
|
|
623b17dd79 | ||
|
|
e9385899b3 | ||
|
|
ce0170a05c | ||
|
|
58dc060cb7 | ||
|
|
1f5f9891af | ||
|
|
d7a71cd9b1 | ||
|
|
82073d1bf4 | ||
|
|
0815c66bb8 | ||
|
|
6ac9c96283 | ||
|
|
191305d620 | ||
|
|
284e3282f5 | ||
|
|
7626e85e7b | ||
|
|
f84b5d2dd8 | ||
|
|
95dd9d710b | ||
|
|
3bc49fb7bb | ||
|
|
46f23305ab | ||
|
|
2a60e2d33a | ||
|
|
ed7d9cc57d | ||
|
|
a93e0f4c40 | ||
|
|
18271d286b | ||
|
|
a54717e10c | ||
|
|
54a316c4c5 | ||
|
|
1029c076a8 | ||
|
|
39c7682d9d | ||
|
|
92595595c5 | ||
|
|
f0c7070cb9 | ||
|
|
fae0b85a48 | ||
|
|
58275c6b58 | ||
|
|
e2c61a76fd | ||
|
|
b7f5f304eb | ||
|
|
710e80225e | ||
|
|
552a7fb63c | ||
|
|
8a7795b7f0 | ||
|
|
9b55a93125 | ||
|
|
239fe24b70 | ||
|
|
ad4b172d0e | ||
|
|
722b132222 | ||
|
|
1f9c6213e9 | ||
|
|
29dbf51f93 | ||
|
|
d4794b6584 | ||
|
|
d268aecb0c | ||
|
|
5cc9564b59 | ||
|
|
b7a9f9211d | ||
|
|
cb4ad30959 | ||
|
|
d2862a919e | ||
|
|
a11a93ec9f | ||
|
|
bf7083bf52 | ||
|
|
a5fd661f24 | ||
|
|
d19f8fca18 | ||
|
|
cb1c357b83 | ||
|
|
1f7391e7af | ||
|
|
4859e81914 | ||
|
|
c61e5dd9a2 | ||
|
|
c59b84cfb0 | ||
|
|
df67542643 | ||
|
|
4ca8f6a667 | ||
|
|
7e9a942a8b | ||
|
|
3716bf6e43 | ||
|
|
2cdd861719 | ||
|
|
c5e858b492 | ||
|
|
d0b53fbbc6 | ||
|
|
1f18ceb466 | ||
|
|
f8489eb6d0 | ||
|
|
b4edfaefca | ||
|
|
730d034ce7 | ||
|
|
ab39ea3971 | ||
|
|
0b6f56b17a | ||
|
|
e636b068e7 | ||
|
|
a73e978ca5 | ||
|
|
edfd83972a | ||
|
|
7e086e79b6 | ||
|
|
9410b122f4 | ||
|
|
6c9b54fe6f | ||
|
|
0c946dd44c | ||
|
|
aaba269e90 | ||
|
|
672a3cbeb4 | ||
|
|
93440abad3 | ||
|
|
36b6d70587 | ||
|
|
c7988e0f9d | ||
|
|
58f96214cc | ||
|
|
ae8abbd460 | ||
|
|
aa8eab15fd | ||
|
|
ac8b5b52e9 | ||
|
|
9cd6a9b964 | ||
|
|
4713afb1d2 | ||
|
|
352f1721b2 | ||
|
|
263542437d | ||
|
|
9eac477b52 | ||
|
|
f2ed2d4dd4 | ||
|
|
0faf20d71d | ||
|
|
6337e4591f | ||
|
|
64f7884c78 | ||
|
|
164bac4e0a | ||
|
|
a60a6726b4 | ||
|
|
a46239e37f | ||
|
|
c9404ef717 | ||
|
|
ec01cd0055 | ||
|
|
bc45d38985 | ||
|
|
dcd56bfbef | ||
|
|
ed1fc97394 | ||
|
|
76ec27f34e | ||
|
|
6d84dacd9b | ||
|
|
20eab35662 | ||
|
|
20ca08ad8d | ||
|
|
4bdc331380 | ||
|
|
a93c30bb4f | ||
|
|
caab85ac07 | ||
|
|
2a6e10c1df | ||
|
|
a65350b290 | ||
|
|
c48abbf308 | ||
|
|
44a5674856 | ||
|
|
7407ff3069 | ||
|
|
7aedba0895 | ||
|
|
55ec2a2732 | ||
|
|
39a3341f5b | ||
|
|
6d314fa08d | ||
|
|
fb32986099 | ||
|
|
6ebc422b59 | ||
|
|
48450deaf7 | ||
|
|
b17ea8ad06 | ||
|
|
63fed97d6f | ||
|
|
31e8cd3e99 | ||
|
|
acd3c505a0 | ||
|
|
8f99fa1e30 | ||
|
|
c3990ac7ba | ||
|
|
7ee5b45b27 | ||
|
|
954be3744a | ||
|
|
788a09058c | ||
|
|
bcbeeed326 | ||
|
|
abfdaf8354 | ||
|
|
552a2fbecd | ||
|
|
9e58daf630 | ||
|
|
f241e47239 | ||
|
|
cd98d7591c | ||
|
|
25d7ab4851 | ||
|
|
2499fdfeb1 | ||
|
|
5cb63bc70c | ||
|
|
9418b4dd83 | ||
|
|
72ff19adb0 | ||
|
|
18505d808f | ||
|
|
cbd5196276 | ||
|
|
2dc376ed1e | ||
|
|
ab74d847ef | ||
|
|
52fc220fc3 | ||
|
|
dbf1fc7a0b | ||
|
|
535bdb6351 | ||
|
|
b8e303bc9a | ||
|
|
7fc60d8c25 | ||
|
|
6b8c3c3227 | ||
|
|
37db74ddac | ||
|
|
a6c4b4bc9f | ||
|
|
bce1bf4e6c | ||
|
|
8f7435e210 | ||
|
|
a7900a2a5f | ||
|
|
7892bb7d16 | ||
|
|
2cb4efb26b | ||
|
|
f1ce7a5afb | ||
|
|
16dd159f78 | ||
|
|
32e92cfeec | ||
|
|
89bb6c5f8c | ||
|
|
6f642627eb | ||
|
|
8b0e1686a3 | ||
|
|
cc6768e4ad | ||
|
|
64acf4e7ac | ||
|
|
181cc9b970 | ||
|
|
52e20a3a72 | ||
|
|
3947c44b98 | ||
|
|
7522679d40 | ||
|
|
16afaf2115 | ||
|
|
91c6d1e462 | ||
|
|
38532c0d88 | ||
|
|
99202012bf | ||
|
|
b57695017a | ||
|
|
7dcadc30aa | ||
|
|
b599852c03 | ||
|
|
960003fd58 | ||
|
|
9bc4051ec1 | ||
|
|
4b0f6dea7a | ||
|
|
3f60ca4a3d | ||
|
|
32602b7d45 | ||
|
|
380ae03561 | ||
|
|
c785026eca | ||
|
|
00ce34a8de | ||
|
|
2515c7de55 | ||
|
|
44790ebc0b | ||
|
|
e7fbd5cb87 | ||
|
|
f6889f644d | ||
|
|
4c49e97f61 | ||
|
|
b40922a3ce | ||
|
|
d819bba2ee | ||
|
|
745d0567fd | ||
|
|
36dc82761f | ||
|
|
aeb756c9fc | ||
|
|
82d2f8f1b5 | ||
|
|
b642c0972e | ||
|
|
8d41200c0c | ||
|
|
251ecc83c8 | ||
|
|
d81b910c0a | ||
|
|
e62e98e5d8 | ||
|
|
2817348bd2 | ||
|
|
068cc214ac | ||
|
|
9312532ca4 | ||
|
|
04a6d48206 | ||
|
|
2c56c7a85d | ||
|
|
163b0c6507 | ||
|
|
05735158fa | ||
|
|
bf03c168ec | ||
|
|
cc69543c89 | ||
|
|
0bdab771c6 | ||
|
|
61d3efb5ef | ||
|
|
f4b5236045 | ||
|
|
d7107627d4 | ||
|
|
440ed8c980 | ||
|
|
c63ecd227a | ||
|
|
43518fe42f | ||
|
|
c6b3d39814 | ||
|
|
9d3553ea55 | ||
|
|
4f30fd4c1e | ||
|
|
93768adee0 | ||
|
|
6f512378e9 | ||
|
|
922ae56e0f | ||
|
|
d78d4fd83f | ||
|
|
e491374ef5 | ||
|
|
748f5f68a3 | ||
|
|
4f2b676f34 | ||
|
|
ed813ec70c | ||
|
|
6f6d0eeddb | ||
|
|
4f7262f0a9 | ||
|
|
e9cf58db57 | ||
|
|
d480ff60e1 | ||
|
|
f0d079b8df | ||
|
|
0c45514282 | ||
|
|
4131fb98e9 | ||
|
|
e879c416cc | ||
|
|
95d2093af1 | ||
|
|
bcfd50b187 | ||
|
|
271a315909 | ||
|
|
1b02ff208a | ||
|
|
3791b11de0 | ||
|
|
50890de604 | ||
|
|
1e6baac5a2 | ||
|
|
0d9658b135 | ||
|
|
2b056942ba | ||
|
|
f47b44ddd9 | ||
|
|
4c264e57b0 | ||
|
|
901076d63b | ||
|
|
8c8ac04826 | ||
|
|
62735a6209 | ||
|
|
4462926f06 | ||
|
|
f4bc07dabd | ||
|
|
0f6894ca77 | ||
|
|
667ea295f4 | ||
|
|
450bcb1069 | ||
|
|
14b7e5f00f | ||
|
|
f07a5ed23f | ||
|
|
3e13206872 | ||
|
|
e7b1250320 | ||
|
|
65c9b79e74 | ||
|
|
177554199f | ||
|
|
0497c5ee5a | ||
|
|
9c065ca720 | ||
|
|
bd39128590 | ||
|
|
af84a398bf | ||
|
|
4bb7f7e83e | ||
|
|
655051a20c | ||
|
|
f7c5224a26 | ||
|
|
97e5833200 | ||
|
|
e0af157372 | ||
|
|
8398ecd79f | ||
|
|
bc5184da28 | ||
|
|
6b7d814c1f | ||
|
|
fe916e5269 | ||
|
|
4b5a1d31b0 | ||
|
|
51a8129e83 | ||
|
|
d57260372f | ||
|
|
eef2cda92d | ||
|
|
44279f207f | ||
|
|
885930a969 | ||
|
|
8f6eb78b88 | ||
|
|
ac3eee684d | ||
|
|
2470684861 | ||
|
|
e4ef1c4726 | ||
|
|
25719f7e3d | ||
|
|
0cfa369157 | ||
|
|
172bb17dc2 | ||
|
|
e4c41ad430 | ||
|
|
59c8ceca62 | ||
|
|
3c3b8118c5 | ||
|
|
38dc7a512a | ||
|
|
6e37666028 | ||
|
|
0b228ad2dd | ||
|
|
d0d2889297 | ||
|
|
4543ba6ead | ||
|
|
6bbc586276 | ||
|
|
8faa542034 | ||
|
|
0a32b4fd37 | ||
|
|
05386c7825 | ||
|
|
6cb8b2da52 | ||
|
|
cffed2180f | ||
|
|
4fef9472a4 | ||
|
|
a2b45441a2 | ||
|
|
00e9b599df | ||
|
|
6dd74010be | ||
|
|
cd734312d8 | ||
|
|
229d74593a | ||
|
|
4f75ee0201 | ||
|
|
bf1436f33d | ||
|
|
b394b0184d | ||
|
|
cc359332e8 | ||
|
|
8a7d19342d | ||
|
|
6341f52164 | ||
|
|
3a11bd64e0 | ||
|
|
918d9f0fc1 | ||
|
|
83339e4da8 | ||
|
|
3d43c942f6 | ||
|
|
2ad0155c0b | ||
|
|
e09e8cda58 | ||
|
|
31d1efe389 | ||
|
|
7cc7dcfa98 | ||
|
|
66efab53ca | ||
|
|
a163839359 | ||
|
|
c02c96c28c | ||
|
|
6ec778c7c0 | ||
|
|
fd4601322d | ||
|
|
f384893fcf | ||
|
|
ca9dbf97de | ||
|
|
019304be17 | ||
|
|
ea68c9857c | ||
|
|
5c1ec2725d | ||
|
|
b6c6ac8eb5 | ||
|
|
7ccde2159e | ||
|
|
c02f194997 | ||
|
|
9c5b4473d1 | ||
|
|
447e375b74 | ||
|
|
73811ac57c | ||
|
|
15a99e60dc | ||
|
|
685338d9db | ||
|
|
2557c05358 | ||
|
|
e5f819aa96 | ||
|
|
52cfb742d5 | ||
|
|
d4b12e6968 | ||
|
|
b45318dcb3 | ||
|
|
923ce561c7 | ||
|
|
fd4a5a381c | ||
|
|
698afa9baa | ||
|
|
f43e34e2ff | ||
|
|
d94a497361 | ||
|
|
fdde3912c6 | ||
|
|
7082ba6bdb | ||
|
|
0d00385fe2 | ||
|
|
d0662057bb | ||
|
|
fb3d2ad5a0 | ||
|
|
611e86c9f9 | ||
|
|
fa4fea2a88 | ||
|
|
c670ddd4ba | ||
|
|
c06290bc26 | ||
|
|
f83e66d707 | ||
|
|
b7d569c45d | ||
|
|
8b36d5ebf0 | ||
|
|
5b4c0cb0fb | ||
|
|
1b6129cc4e | ||
|
|
5bba3f7560 | ||
|
|
df2f8def9d | ||
|
|
0749a4c6b2 | ||
|
|
5d40eaab08 | ||
|
|
c357ae74c0 | ||
|
|
f867aea38c | ||
|
|
de77c5e9ca | ||
|
|
f6843c3423 | ||
|
|
ba9352f1b3 | ||
|
|
322f9bdcef | ||
|
|
2d3e9e97e1 | ||
|
|
dca15d5448 | ||
|
|
711c9f6d2c | ||
|
|
d5bbd872ec | ||
|
|
c4497d842d | ||
|
|
6bde8644e0 | ||
|
|
60f303c18e | ||
|
|
9b1547aec7 | ||
|
|
860812409a | ||
|
|
f26e4c3a3a | ||
|
|
68016f0e0e | ||
|
|
153a6cceea | ||
|
|
3b75df031e | ||
|
|
75080aa57d | ||
|
|
a4ccc09402 | ||
|
|
e31ca82c81 | ||
|
|
71a6039890 | ||
|
|
cc6ec6d5f7 | ||
|
|
555aa02094 | ||
|
|
d02fa81905 | ||
|
|
df3ff137c3 | ||
|
|
588e64995f | ||
|
|
5662375c37 | ||
|
|
fc7e79b997 | ||
|
|
052252418b | ||
|
|
58f9b787c9 | ||
|
|
2e80c6db9a | ||
|
|
d22e479cd8 | ||
|
|
90d1fd52d6 | ||
|
|
da8e9ce3ed | ||
|
|
81a8c7db1a | ||
|
|
91cc11b7a6 | ||
|
|
88f9882406 | ||
|
|
193b388634 | ||
|
|
a225578402 | ||
|
|
b53e90f2ac | ||
|
|
4d55acf04e | ||
|
|
debe02e5a1 | ||
|
|
76dc60941b | ||
|
|
5ad2175357 | ||
|
|
a295731acb | ||
|
|
7c214a721f | ||
|
|
9cd06e0834 | ||
|
|
37cec62998 | ||
|
|
e697dc1908 | ||
|
|
d1e9233b88 | ||
|
|
77cd2adc0e | ||
|
|
fb1015130c | ||
|
|
5196fe9ffa | ||
|
|
755d4ed230 | ||
|
|
4628e57a5b | ||
|
|
d50bb7e4fc | ||
|
|
9d156260df | ||
|
|
7d6367aee4 | ||
|
|
a5617ba278 | ||
|
|
87a97dc6cf | ||
|
|
d6f51f3c7c | ||
|
|
1c188e0b2c | ||
|
|
ebcee72230 | ||
|
|
2706c9a0bd | ||
|
|
ac63efe42d | ||
|
|
b9ad754444 | ||
|
|
800c87ee88 | ||
|
|
c0c7d121fb | ||
|
|
6d5bba0bb8 | ||
|
|
4557d767d9 | ||
|
|
1f840b330c | ||
|
|
e4136eb634 | ||
|
|
c053afc0ca | ||
|
|
0ad9db4e88 | ||
|
|
593f166b45 | ||
|
|
a27315b760 | ||
|
|
1c36f2d647 | ||
|
|
f6cec98f4f | ||
|
|
bb2b0b7824 | ||
|
|
ca75916dd0 | ||
|
|
8c97227eb2 | ||
|
|
40e25457fd | ||
|
|
e84ab27feb | ||
|
|
c3a57992c7 | ||
|
|
e3426bd618 | ||
|
|
3abea37ba0 | ||
|
|
1088dacb0d | ||
|
|
5b67169f0f | ||
|
|
f437760db4 | ||
|
|
cb0d967c2c | ||
|
|
ccbc0be905 | ||
|
|
2ee13005b2 | ||
|
|
336f847ee3 | ||
|
|
84580cd97e | ||
|
|
ce464d978a |
5939 changed files with 586262 additions and 258948 deletions
|
|
@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
|
|||
|
||||
USER vscode
|
||||
|
||||
RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
|
||||
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
|
||||
ENV PATH=/home/vscode/.rye/shims:$PATH
|
||||
|
||||
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
|
||||
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {}
|
||||
}
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
|
|
|
|||
60
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
60
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: Bug report
|
||||
description: Report an issue or bug with this library
|
||||
labels: ['bug']
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: non_api
|
||||
attributes:
|
||||
label: Confirm this is a Python library issue and not an underlying Cloudflare API issue.
|
||||
description: Issues with the underlying Cloudflare API should be reported via [Cloudflare Support](https://developers.cloudflare.com/support/contacting-cloudflare-support)
|
||||
options:
|
||||
- label: This is an issue with the Python library
|
||||
required: true
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is, and any additional context.
|
||||
placeholder: Tell us what you see!
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: repro-steps
|
||||
attributes:
|
||||
label: To Reproduce
|
||||
description: Steps to reproduce the behavior.
|
||||
placeholder: |
|
||||
1. Fetch a '...'
|
||||
2. Update the '....'
|
||||
3. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: code-snippets
|
||||
attributes:
|
||||
label: Code snippets
|
||||
description: If applicable, add code snippets to help explain your problem.
|
||||
render: Python
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: OS
|
||||
placeholder: macOS
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: language-version
|
||||
attributes:
|
||||
label: Python version
|
||||
placeholder: 3.9.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: lib-version
|
||||
attributes:
|
||||
label: Library version
|
||||
placeholder: v4.0.0
|
||||
validations:
|
||||
required: true
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,9 +1,5 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: v3.0.0 Beta feedback
|
||||
url: https://github.com/cloudflare/cloudflare-python/discussions/116
|
||||
about: |
|
||||
If you have a feature request or feedback on our new v3 library, please comment in our discussion page.
|
||||
- name: Cloudflare support
|
||||
url: https://developers.cloudflare.com/support/contacting-cloudflare-support
|
||||
about: |
|
||||
|
|
|
|||
111
.github/workflows/ci.yml
vendored
111
.github/workflows/ci.yml
vendored
|
|
@ -1,41 +1,110 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
branches-ignore:
|
||||
- 'generated'
|
||||
- 'codegen/**'
|
||||
- 'integrated/**'
|
||||
- 'stl-preview-head/**'
|
||||
- 'stl-preview-base/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
timeout-minutes: 10
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rye
|
||||
run: |
|
||||
curl -sSf https://rye.astral.sh/get | bash
|
||||
echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
||||
env:
|
||||
RYE_VERSION: '0.44.0'
|
||||
RYE_INSTALL_OPTION: '--yes'
|
||||
|
||||
- name: Install dependencies
|
||||
run: rye sync --all-features
|
||||
|
||||
- name: Run lints
|
||||
run: ./scripts/lint
|
||||
|
||||
upload:
|
||||
if: github.repository == 'stainless-sdks/cloudflare-python'
|
||||
timeout-minutes: 10
|
||||
name: upload
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
runs-on: depot-ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get GitHub OIDC Token
|
||||
id: github-oidc
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: core.setOutput('github_token', await core.getIDToken());
|
||||
|
||||
- name: Upload tarball
|
||||
env:
|
||||
URL: https://pkg.stainless.com/s
|
||||
AUTH: ${{ steps.github-oidc.outputs.github_token }}
|
||||
SHA: ${{ github.sha }}
|
||||
run: ./scripts/utils/upload-artifact.sh
|
||||
|
||||
test:
|
||||
timeout-minutes: 30
|
||||
name: test
|
||||
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rye
|
||||
run: |
|
||||
curl -sSf https://rye.astral.sh/get | bash
|
||||
echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
||||
env:
|
||||
RYE_VERSION: '0.44.0'
|
||||
RYE_INSTALL_OPTION: '--yes'
|
||||
|
||||
- name: Bootstrap
|
||||
run: ./scripts/bootstrap
|
||||
|
||||
- name: Run tests
|
||||
run: ./scripts/test
|
||||
|
||||
examples:
|
||||
timeout-minutes: 10
|
||||
name: examples
|
||||
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
|
||||
if: github.repository == 'cloudflare/cloudflare-python'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rye
|
||||
run: |
|
||||
curl -sSf https://rye-up.com/get | bash
|
||||
curl -sSf https://rye.astral.sh/get | bash
|
||||
echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
||||
env:
|
||||
RYE_VERSION: 0.24.0
|
||||
RYE_INSTALL_OPTION: "--yes"
|
||||
|
||||
RYE_VERSION: '0.44.0'
|
||||
RYE_INSTALL_OPTION: '--yes'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
rye sync --all-features
|
||||
|
||||
- name: Run ruff
|
||||
- env:
|
||||
CLOUDFLARE_ACCOUNT_ID: f037e56e89293a057740de681ac9abbe
|
||||
CLOUDFLARE_EMAIL: terraform-acceptance-test@cfapi.net
|
||||
CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c920711
|
||||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
||||
run: |
|
||||
rye run check:ruff
|
||||
|
||||
- name: Run type checking
|
||||
run: |
|
||||
rye run typecheck
|
||||
|
||||
- name: Ensure importable
|
||||
run: |
|
||||
rye run python -c 'import cloudflare'
|
||||
rye run python ./examples/ai/demo.py
|
||||
rye run python ./examples/dns/record.py
|
||||
|
|
|
|||
8
.github/workflows/publish-pypi.yml
vendored
8
.github/workflows/publish-pypi.yml
vendored
|
|
@ -14,15 +14,15 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rye
|
||||
run: |
|
||||
curl -sSf https://rye-up.com/get | bash
|
||||
curl -sSf https://rye.astral.sh/get | bash
|
||||
echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
||||
env:
|
||||
RYE_VERSION: 0.24.0
|
||||
RYE_INSTALL_OPTION: "--yes"
|
||||
RYE_VERSION: '0.44.0'
|
||||
RYE_INSTALL_OPTION: '--yes'
|
||||
|
||||
- name: Publish to PyPI
|
||||
run: |
|
||||
|
|
|
|||
10
.github/workflows/release-doctor.yml
vendored
10
.github/workflows/release-doctor.yml
vendored
|
|
@ -1,16 +1,24 @@
|
|||
name: Release Doctor
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release_doctor:
|
||||
name: release doctor
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 2
|
||||
if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check release environment
|
||||
run: |
|
||||
|
|
|
|||
19
.github/workflows/semgrep.yml
vendored
Normal file
19
.github/workflows/semgrep.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
on:
|
||||
workflow_dispatch: {}
|
||||
schedule:
|
||||
- cron: '0 4 * * *'
|
||||
name: Semgrep config
|
||||
jobs:
|
||||
semgrep:
|
||||
name: semgrep/ci
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
||||
SEMGREP_URL: https://cloudflare.semgrep.dev
|
||||
SEMGREP_APP_URL: https://cloudflare.semgrep.dev
|
||||
SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version
|
||||
container:
|
||||
image: returntocorp/semgrep
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: semgrep ci
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
.prism.log
|
||||
.vscode
|
||||
_dev
|
||||
|
||||
|
|
@ -12,3 +13,4 @@ dist
|
|||
.env
|
||||
.envrc
|
||||
codegen.log
|
||||
Brewfile.lock.json
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
".": "3.0.0-beta.4"
|
||||
".": "4.3.1"
|
||||
}
|
||||
|
|
@ -1 +1,4 @@
|
|||
configured_endpoints: 1288
|
||||
configured_endpoints: 1752
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b15b44e0efd207de48e7e74e742b0b4b190c74f12a941a1a0ef59a51656a5224.yml
|
||||
openapi_spec_hash: 83243c9ee06f88d0fa91e9b185d8a42e
|
||||
config_hash: 8601d43fd5ccaf9e3d08f26748a5a63a
|
||||
|
|
|
|||
2
Brewfile
Normal file
2
Brewfile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
brew "rye"
|
||||
|
||||
1611
CHANGELOG.md
1611
CHANGELOG.md
File diff suppressed because it is too large
Load diff
|
|
@ -2,9 +2,13 @@
|
|||
|
||||
### With Rye
|
||||
|
||||
We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
|
||||
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
|
||||
|
||||
After installing Rye, you'll just have to run this command:
|
||||
```sh
|
||||
$ ./scripts/bootstrap
|
||||
```
|
||||
|
||||
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
|
||||
|
||||
```sh
|
||||
$ rye sync --all-features
|
||||
|
|
@ -13,8 +17,7 @@ $ rye sync --all-features
|
|||
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
|
||||
|
||||
```sh
|
||||
$ rye shell
|
||||
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
|
||||
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
|
||||
$ source .venv/bin/activate
|
||||
|
||||
# now you can omit the `rye run` prefix
|
||||
|
|
@ -31,25 +34,25 @@ $ pip install -r requirements-dev.lock
|
|||
|
||||
## Modifying/Adding code
|
||||
|
||||
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
|
||||
`src/cloudflare/lib/` and `examples/` directories are exceptions and will never be overridden.
|
||||
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
|
||||
result in merge conflicts between manual patches and changes from the generator. The generator will never
|
||||
modify the contents of the `src/cloudflare/lib/` and `examples/` directories.
|
||||
|
||||
## Adding and running examples
|
||||
|
||||
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
|
||||
added to.
|
||||
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
|
||||
|
||||
```bash
|
||||
```py
|
||||
# add an example to examples/<your-example>.py
|
||||
|
||||
#!/usr/bin/env -S rye run python
|
||||
…
|
||||
```
|
||||
|
||||
```
|
||||
chmod +x examples/<your-example>.py
|
||||
```sh
|
||||
$ chmod +x examples/<your-example>.py
|
||||
# run the example against your api
|
||||
./examples/<your-example>.py
|
||||
$ ./examples/<your-example>.py
|
||||
```
|
||||
|
||||
## Using the repository from source
|
||||
|
|
@ -58,8 +61,8 @@ If you’d like to use the repository from source, you can either install from g
|
|||
|
||||
To install via git:
|
||||
|
||||
```bash
|
||||
pip install git+ssh://git@github.com/cloudflare/cloudflare-python.git
|
||||
```sh
|
||||
$ pip install git+ssh://git@github.com/cloudflare/cloudflare-python.git
|
||||
```
|
||||
|
||||
Alternatively, you can build from source and install the wheel file:
|
||||
|
|
@ -68,29 +71,29 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
|
|||
|
||||
To create a distributable version of the library, all you have to do is run this command:
|
||||
|
||||
```bash
|
||||
rye build
|
||||
```sh
|
||||
$ rye build
|
||||
# or
|
||||
python -m build
|
||||
$ python -m build
|
||||
```
|
||||
|
||||
Then to install:
|
||||
|
||||
```sh
|
||||
pip install ./path-to-wheel-file.whl
|
||||
$ pip install ./path-to-wheel-file.whl
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
# you will need npm installed
|
||||
npx prism mock path/to/your/openapi.yml
|
||||
$ npx prism mock path/to/your/openapi.yml
|
||||
```
|
||||
|
||||
```bash
|
||||
rye run pytest
|
||||
```sh
|
||||
$ ./scripts/test
|
||||
```
|
||||
|
||||
## Linting and formatting
|
||||
|
|
@ -100,14 +103,14 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and
|
|||
|
||||
To lint:
|
||||
|
||||
```bash
|
||||
rye run lint
|
||||
```sh
|
||||
$ ./scripts/lint
|
||||
```
|
||||
|
||||
To format and fix all ruff issues automatically:
|
||||
|
||||
```bash
|
||||
rye run format
|
||||
```sh
|
||||
$ ./scripts/format
|
||||
```
|
||||
|
||||
## Publishing and releases
|
||||
|
|
@ -121,5 +124,5 @@ You can release to package managers by using [the `Publish PyPI` GitHub action](
|
|||
|
||||
### Publish manually
|
||||
|
||||
If you need to manually release a package, you can run the `bin/publish-pypi` script with an `PYPI_TOKEN` set on
|
||||
If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
|
||||
the environment.
|
||||
|
|
|
|||
2
LICENSE
2
LICENSE
|
|
@ -186,7 +186,7 @@
|
|||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2024 Cloudflare
|
||||
Copyright 2025 Cloudflare
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
152
README.md
152
README.md
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[](https://pypi.org/project/cloudflare/)
|
||||
|
||||
The Cloudflare Python library provides convenient access to the Cloudflare REST API from any Python 3.7+
|
||||
The Cloudflare Python library provides convenient access to the Cloudflare REST API from any Python 3.8+
|
||||
application. The library includes type definitions for all request params and response fields,
|
||||
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
||||
|
||||
## Documentation
|
||||
|
||||
The REST API documentation can be found [on developers.cloudflare.com](https://developers.cloudflare.com/api). The full API of this library can be found in [api.md](api.md).
|
||||
The REST API documentation can be found on [developers.cloudflare.com](https://developers.cloudflare.com/api). The full API of this library can be found in [api.md](api.md).
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -26,8 +26,7 @@ import os
|
|||
from cloudflare import Cloudflare
|
||||
|
||||
client = Cloudflare(
|
||||
# This is the default and can be omitted
|
||||
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
|
||||
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
|
||||
)
|
||||
|
||||
zone = client.zones.create(
|
||||
|
|
@ -53,8 +52,7 @@ import asyncio
|
|||
from cloudflare import AsyncCloudflare
|
||||
|
||||
client = AsyncCloudflare(
|
||||
# This is the default and can be omitted
|
||||
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
|
||||
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -74,10 +72,10 @@ Functionality between the synchronous and asynchronous clients is otherwise iden
|
|||
|
||||
## Using types
|
||||
|
||||
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev), which provide helper methods for things like:
|
||||
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
|
||||
|
||||
- Serializing back into JSON, `model.model_dump_json(indent=2, exclude_unset=True)`
|
||||
- Converting to a dictionary, `model.model_dump(exclude_unset=True)`
|
||||
- Serializing back into JSON, `model.to_json()`
|
||||
- Converting to a dictionary, `model.to_dict()`
|
||||
|
||||
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
||||
|
||||
|
|
@ -88,7 +86,7 @@ List methods in the Cloudflare API are paginated.
|
|||
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
||||
|
||||
```python
|
||||
import cloudflare
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
client = Cloudflare()
|
||||
|
||||
|
|
@ -104,7 +102,7 @@ Or, asynchronously:
|
|||
|
||||
```python
|
||||
import asyncio
|
||||
import cloudflare
|
||||
from cloudflare import AsyncCloudflare
|
||||
|
||||
client = AsyncCloudflare()
|
||||
|
||||
|
|
@ -137,11 +135,46 @@ Or just work directly with the returned data:
|
|||
```python
|
||||
first_page = await client.accounts.list()
|
||||
for account in first_page.result:
|
||||
print(account)
|
||||
print(account.id)
|
||||
|
||||
# Remove `await` for non-async usage.
|
||||
```
|
||||
|
||||
## Nested params
|
||||
|
||||
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
||||
|
||||
```python
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
client = Cloudflare()
|
||||
|
||||
zone = client.zones.create(
|
||||
account={},
|
||||
name="example.com",
|
||||
)
|
||||
print(zone.account)
|
||||
```
|
||||
|
||||
## File uploads
|
||||
|
||||
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
||||
|
||||
```python
|
||||
from pathlib import Path
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
client = Cloudflare()
|
||||
|
||||
client.api_gateway.user_schemas.create(
|
||||
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
file=Path("/path/to/file"),
|
||||
kind="openapi_v3",
|
||||
)
|
||||
```
|
||||
|
||||
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
||||
|
||||
## Handling errors
|
||||
|
||||
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cloudflare.APIConnectionError` is raised.
|
||||
|
|
@ -172,7 +205,7 @@ except cloudflare.APIStatusError as e:
|
|||
print(e.response)
|
||||
```
|
||||
|
||||
Error codes are as followed:
|
||||
Error codes are as follows:
|
||||
|
||||
| Status Code | Error Type |
|
||||
| ----------- | -------------------------- |
|
||||
|
|
@ -228,7 +261,7 @@ client = Cloudflare(
|
|||
)
|
||||
|
||||
# Override per-request:
|
||||
client.with_options(timeout=5 * 1000).zones.edit(
|
||||
client.with_options(timeout=5.0).zones.edit(
|
||||
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
```
|
||||
|
|
@ -243,12 +276,14 @@ Note that requests that time out are [retried twice by default](#retries).
|
|||
|
||||
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
|
||||
|
||||
You can enable logging by setting the environment variable `CLOUDFLARE_LOG` to `debug`.
|
||||
You can enable logging by setting the environment variable `CLOUDFLARE_LOG` to `info`.
|
||||
|
||||
```shell
|
||||
$ export CLOUDFLARE_LOG=debug
|
||||
$ export CLOUDFLARE_LOG=info
|
||||
```
|
||||
|
||||
Or to `debug` for more verbose logging.
|
||||
|
||||
### How to tell whether `None` means `null` or missing
|
||||
|
||||
In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
|
||||
|
|
@ -306,44 +341,105 @@ with client.zones.with_streaming_response.create(
|
|||
|
||||
The context manager is required so that the response will reliably be closed.
|
||||
|
||||
### Making custom/undocumented requests
|
||||
|
||||
This library is typed for convenient access to the documented API.
|
||||
|
||||
If you need to access undocumented endpoints, params, or response properties, the library can still be used.
|
||||
|
||||
#### Undocumented endpoints
|
||||
|
||||
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
|
||||
http verbs. Options on the client will be respected (such as retries) when making this request.
|
||||
|
||||
```py
|
||||
import httpx
|
||||
|
||||
response = client.post(
|
||||
"/foo",
|
||||
cast_to=httpx.Response,
|
||||
body={"my_param": True},
|
||||
)
|
||||
|
||||
print(response.headers.get("x-foo"))
|
||||
```
|
||||
|
||||
#### Undocumented request params
|
||||
|
||||
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
|
||||
options.
|
||||
|
||||
#### Undocumented response properties
|
||||
|
||||
To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
|
||||
can also get all the extra fields on the Pydantic model as a dict with
|
||||
[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
|
||||
|
||||
### Configuring the HTTP client
|
||||
|
||||
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
|
||||
|
||||
- Support for proxies
|
||||
- Custom transports
|
||||
- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality
|
||||
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
|
||||
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
|
||||
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
|
||||
|
||||
```python
|
||||
import httpx
|
||||
from cloudflare import Cloudflare
|
||||
from cloudflare import Cloudflare, DefaultHttpxClient
|
||||
|
||||
client = Cloudflare(
|
||||
# Or use the `CLOUDFLARE_BASE_URL` env var
|
||||
base_url="http://my.test.server.example.com:8083",
|
||||
http_client=httpx.Client(
|
||||
proxies="http://my.test.proxy.example.com",
|
||||
http_client=DefaultHttpxClient(
|
||||
proxy="http://my.test.proxy.example.com",
|
||||
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
||||
),
|
||||
)
|
||||
```
|
||||
|
||||
You can also customize the client on a per-request basis by using `with_options()`:
|
||||
|
||||
```python
|
||||
client.with_options(http_client=DefaultHttpxClient(...))
|
||||
```
|
||||
|
||||
### Managing HTTP resources
|
||||
|
||||
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
||||
|
||||
## Versioning
|
||||
```py
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
with Cloudflare() as client:
|
||||
# make requests here
|
||||
...
|
||||
|
||||
# HTTP client is now closed
|
||||
```
|
||||
|
||||
## Semantic versioning
|
||||
|
||||
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
||||
|
||||
1. Changes that only affect static types, without breaking runtime behavior.
|
||||
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
|
||||
3. Changes that we do not expect to impact the vast majority of users in practice.
|
||||
1. Changes to library internals which are technically public but not intended or documented for external use.
|
||||
1. Changes that we do not expect to impact the vast majority of users in practice.
|
||||
|
||||
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
||||
### Determining the installed version
|
||||
|
||||
We are keen for your feedback; please open an [issue](https://www.github.com/cloudflare/cloudflare-python/issues) with questions, bugs, or suggestions.
|
||||
If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.
|
||||
|
||||
You can determine the version that is being used at runtime with:
|
||||
|
||||
```py
|
||||
import cloudflare
|
||||
print(cloudflare.__version__)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
Python 3.7 or higher.
|
||||
Python 3.8 or higher.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [the contributing documentation](./CONTRIBUTING.md).
|
||||
|
|
|
|||
3
SECURITY.md
Normal file
3
SECURITY.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Reporting Security Vulnerabilities
|
||||
|
||||
Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks!
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
"""Script that exits 1 if the current environment is not
|
||||
in sync with the `requirements-dev.lock` file.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import importlib_metadata
|
||||
|
||||
|
||||
def should_run_sync() -> bool:
|
||||
dev_lock = Path(__file__).parent.parent.joinpath("requirements-dev.lock")
|
||||
|
||||
for line in dev_lock.read_text().splitlines():
|
||||
if not line or line.startswith("#") or line.startswith("-e"):
|
||||
continue
|
||||
|
||||
dep, lock_version = line.split("==")
|
||||
|
||||
try:
|
||||
version = importlib_metadata.version(dep)
|
||||
|
||||
if lock_version != version:
|
||||
print(f"mismatch for {dep} current={version} lock={lock_version}")
|
||||
return True
|
||||
except Exception:
|
||||
print(f"could not import {dep}")
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if should_run_sync():
|
||||
exit(1)
|
||||
else:
|
||||
exit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
function prism_is_running() {
|
||||
curl --silent "http://localhost:4010" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
function is_overriding_api_base_url() {
|
||||
[ -n "$TEST_API_BASE_URL" ]
|
||||
}
|
||||
|
||||
if is_overriding_api_base_url ; then
|
||||
# If someone is running the tests against the live API, we can trust they know
|
||||
# what they're doing and exit early.
|
||||
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
|
||||
|
||||
exit 0
|
||||
elif prism_is_running ; then
|
||||
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
|
||||
echo
|
||||
|
||||
exit 0
|
||||
else
|
||||
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
|
||||
echo -e "running against your OpenAPI spec."
|
||||
echo
|
||||
echo -e "${YELLOW}To fix:${NC}"
|
||||
echo
|
||||
echo -e "1. Install Prism (requires Node 16+):"
|
||||
echo
|
||||
echo -e " With npm:"
|
||||
echo -e " \$ ${YELLOW}npm install -g @stoplight/prism-cli${NC}"
|
||||
echo
|
||||
echo -e " With yarn:"
|
||||
echo -e " \$ ${YELLOW}yarn global add @stoplight/prism-cli${NC}"
|
||||
echo
|
||||
echo -e "2. Run the mock server"
|
||||
echo
|
||||
echo -e " To run the server, pass in the path of your OpenAPI"
|
||||
echo -e " spec to the prism command:"
|
||||
echo
|
||||
echo -e " \$ ${YELLOW}prism mock path/to/your.openapi.yml${NC}"
|
||||
echo
|
||||
|
||||
exit 1
|
||||
fi
|
||||
3
bin/test
3
bin/test
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
bin/check-test-server && rye run pytest "$@"
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
File generated from our OpenAPI spec by Stainless.
|
||||
|
||||
This directory can be used to store example files demonstrating usage of this SDK.
|
||||
It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
|
||||
20
examples/ai/demo.py
Normal file
20
examples/ai/demo.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
account_id = os.getenv("CLOUDFLARE_ACCOUNT_ID")
|
||||
if account_id is None:
|
||||
sys.exit("CLOUDFLARE_ACCOUNT_ID is not defined")
|
||||
|
||||
client = Cloudflare()
|
||||
|
||||
t = client.ai.run(
|
||||
"@cf/meta/m2m100-1.2b",
|
||||
account_id=account_id,
|
||||
text="I'll have an order of the moule frites",
|
||||
target_lang="french",
|
||||
source_lang="english",
|
||||
)
|
||||
|
||||
# print(t['translated_text'])
|
||||
25
examples/dns/record.py
Normal file
25
examples/dns/record.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from cloudflare import Cloudflare
|
||||
|
||||
zone_id = os.getenv("CLOUDFLARE_ZONE_ID")
|
||||
if zone_id is None:
|
||||
sys.exit("CLOUDFLARE_ZONE_ID is not defined")
|
||||
|
||||
client = Cloudflare()
|
||||
|
||||
record = client.dns.records.create(
|
||||
zone_id=zone_id,
|
||||
type="A",
|
||||
name="www.mydns.com",
|
||||
content="198.51.100.1",
|
||||
proxied=True,
|
||||
)
|
||||
assert record is not None
|
||||
|
||||
# clean up after we're done
|
||||
client.dns.records.delete(
|
||||
zone_id=zone_id,
|
||||
dns_record_id=record.id,
|
||||
)
|
||||
97
examples/workers/script_upload.py
Normal file
97
examples/workers/script_upload.py
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"""Workers Script Upload Example
|
||||
|
||||
Generate an API token:
|
||||
https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
|
||||
(Not Global API Key!)
|
||||
|
||||
Find your account id:
|
||||
https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/
|
||||
|
||||
Set these environment variables:
|
||||
- CLOUDFLARE_API_TOKEN
|
||||
- CLOUDFLARE_ACCOUNT_ID
|
||||
|
||||
|
||||
### Workers for Platforms ###
|
||||
|
||||
For uploading a User Worker to a dispatch namespace:
|
||||
https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/
|
||||
|
||||
Change the entire "script = " line to the following:
|
||||
"script = client.workers_for_platforms.dispatch.namespaces.scripts.update("
|
||||
|
||||
Then, define a "dispatch_namespace_name" variable and add a
|
||||
"dispatch_namespace=dispatch_namespace_name" keyword argument to the "update" method.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from cloudflare import Cloudflare, BadRequestError
|
||||
|
||||
API_TOKEN = os.environ.get("CLOUDFLARE_API_TOKEN")
|
||||
if API_TOKEN is None:
|
||||
raise RuntimeError("Please set envar CLOUDFLARE_API_TOKEN")
|
||||
|
||||
ACCOUNT_ID = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
|
||||
if ACCOUNT_ID is None:
|
||||
raise RuntimeError("Please set envar CLOUDFLARE_ACCOUNT_ID")
|
||||
|
||||
client = Cloudflare(api_token=API_TOKEN)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Workers Script Upload Example"""
|
||||
|
||||
script_name = "my-hello-world-script"
|
||||
script_file_name = f"{script_name}.mjs"
|
||||
|
||||
# Workers Scripts prefer Module Syntax
|
||||
# https://blog.cloudflare.com/workers-javascript-modules/
|
||||
script_content = """
|
||||
export default {
|
||||
async fetch(request, env, ctx) {
|
||||
return new Response(env.MESSAGE, { status: 200 });
|
||||
}
|
||||
};
|
||||
"""
|
||||
|
||||
try:
|
||||
# https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update/
|
||||
script = client.workers.scripts.update(
|
||||
script_name,
|
||||
account_id=ACCOUNT_ID, # type: ignore
|
||||
# https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/
|
||||
metadata={
|
||||
"main_module": script_file_name,
|
||||
"bindings": [
|
||||
{
|
||||
"type": "plain_text",
|
||||
"name": "MESSAGE",
|
||||
"text": "Hello World!",
|
||||
}
|
||||
],
|
||||
},
|
||||
files={
|
||||
# Add main_module file
|
||||
script_file_name: (
|
||||
script_file_name,
|
||||
bytes(script_content, "utf-8"),
|
||||
"application/javascript+module",
|
||||
)
|
||||
# Can add other files, such as more modules or source maps
|
||||
# source_map_file_name: (
|
||||
# source_map_file_name,
|
||||
# bytes(source_map_content, "utf-8"),
|
||||
# "application/source-map"
|
||||
#)
|
||||
},
|
||||
)
|
||||
print("Script Upload success!")
|
||||
print(script.to_json(indent=2))
|
||||
except BadRequestError as err:
|
||||
print("Script Upload failure!")
|
||||
print(err)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
7
mypy.ini
7
mypy.ini
|
|
@ -5,7 +5,10 @@ show_error_codes = True
|
|||
# Exclude _files.py because mypy isn't smart enough to apply
|
||||
# the correct type narrowing and as this is an internal module
|
||||
# it's fine to just use Pyright.
|
||||
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py)$
|
||||
#
|
||||
# We also exclude our `tests` as mypy doesn't always infer
|
||||
# types correctly and Pyright will still catch any type errors.
|
||||
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|tests/.*|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py|src/cloudflare/resources/magic_transit/apps\.py)$
|
||||
|
||||
strict_equality = True
|
||||
implicit_reexport = True
|
||||
|
|
@ -38,7 +41,7 @@ cache_fine_grained = True
|
|||
# ```
|
||||
# Changing this codegen to make mypy happy would increase complexity
|
||||
# and would not be worth it.
|
||||
disable_error_code = func-returns-value
|
||||
disable_error_code = func-returns-value,overload-cannot-match
|
||||
|
||||
# https://github.com/python/mypy/issues/12162
|
||||
[mypy.overrides]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
[project]
|
||||
name = "cloudflare"
|
||||
version = "3.0.0-beta.4"
|
||||
version = "4.3.1"
|
||||
description = "The official Python library for the cloudflare API"
|
||||
readme = "README.md"
|
||||
dynamic = ["readme"]
|
||||
license = "Apache-2.0"
|
||||
authors = [
|
||||
{ name = "Cloudflare", email = "api@cloudflare.com" },
|
||||
|
|
@ -10,18 +10,15 @@ authors = [
|
|||
dependencies = [
|
||||
"httpx>=0.23.0, <1",
|
||||
"pydantic>=1.9.0, <3",
|
||||
"typing-extensions>=4.7, <5",
|
||||
"typing-extensions>=4.10, <5",
|
||||
"anyio>=3.5.0, <5",
|
||||
"distro>=1.7.0, <2",
|
||||
"sniffio",
|
||||
"cached-property; python_version < '3.8'",
|
||||
|
||||
]
|
||||
requires-python = ">= 3.7"
|
||||
requires-python = ">= 3.8"
|
||||
classifiers = [
|
||||
"Typing :: Typed",
|
||||
"Intended Audience :: Developers",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
|
|
@ -36,19 +33,16 @@ classifiers = [
|
|||
"License :: OSI Approved :: Apache Software License"
|
||||
]
|
||||
|
||||
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/cloudflare/cloudflare-python"
|
||||
Repository = "https://github.com/cloudflare/cloudflare-python"
|
||||
|
||||
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
# version pins are in requirements-dev.lock
|
||||
dev-dependencies = [
|
||||
"pyright",
|
||||
"pyright==1.1.399",
|
||||
"mypy",
|
||||
"respx",
|
||||
"pytest",
|
||||
|
|
@ -58,7 +52,9 @@ dev-dependencies = [
|
|||
"nox",
|
||||
"dirty-equals>=0.6.0",
|
||||
"importlib-metadata>=6.7.0",
|
||||
|
||||
"rich>=13.7.1",
|
||||
"nest_asyncio==1.6.0",
|
||||
"pytest-xdist>=3.6.1",
|
||||
]
|
||||
|
||||
[tool.rye.scripts]
|
||||
|
|
@ -66,18 +62,21 @@ format = { chain = [
|
|||
"format:ruff",
|
||||
"format:docs",
|
||||
"fix:ruff",
|
||||
# run formatting again to fix any inconsistencies when imports are stripped
|
||||
"format:ruff",
|
||||
]}
|
||||
"format:black" = "black ."
|
||||
"format:docs" = "python bin/ruffen-docs.py README.md api.md"
|
||||
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
|
||||
"format:ruff" = "ruff format"
|
||||
"format:isort" = "isort ."
|
||||
|
||||
"lint" = { chain = [
|
||||
"check:ruff",
|
||||
"typecheck",
|
||||
"check:importable",
|
||||
]}
|
||||
"check:ruff" = "ruff ."
|
||||
"fix:ruff" = "ruff --fix ."
|
||||
"check:ruff" = "ruff check ."
|
||||
"fix:ruff" = "ruff check --fix ."
|
||||
|
||||
"check:importable" = "python -c 'import cloudflare'"
|
||||
|
||||
typecheck = { chain = [
|
||||
"typecheck:pyright",
|
||||
|
|
@ -88,7 +87,7 @@ typecheck = { chain = [
|
|||
"typecheck:mypy" = "mypy ."
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build]
|
||||
|
|
@ -99,15 +98,38 @@ include = [
|
|||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/cloudflare"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
target-version = ["py37"]
|
||||
[tool.hatch.build.targets.sdist]
|
||||
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
|
||||
include = [
|
||||
"/*.toml",
|
||||
"/*.json",
|
||||
"/*.lock",
|
||||
"/*.md",
|
||||
"/mypy.ini",
|
||||
"/noxfile.py",
|
||||
"bin/*",
|
||||
"examples/*",
|
||||
"src/*",
|
||||
"tests/*",
|
||||
]
|
||||
|
||||
[tool.hatch.metadata.hooks.fancy-pypi-readme]
|
||||
content-type = "text/markdown"
|
||||
|
||||
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
||||
path = "README.md"
|
||||
|
||||
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
|
||||
# replace relative links with absolute links
|
||||
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
|
||||
replacement = '[\1](https://github.com/cloudflare/cloudflare-python/tree/main/\g<2>)'
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
addopts = "--tb=short"
|
||||
addopts = "--tb=short -n auto"
|
||||
xfail_strict = true
|
||||
asyncio_mode = "auto"
|
||||
asyncio_default_fixture_loop_scope = "session"
|
||||
filterwarnings = [
|
||||
"error"
|
||||
]
|
||||
|
|
@ -117,7 +139,7 @@ filterwarnings = [
|
|||
# there are a couple of flags that are still disabled by
|
||||
# default in strict mode as they are experimental and niche.
|
||||
typeCheckingMode = "strict"
|
||||
pythonVersion = "3.7"
|
||||
pythonVersion = "3.8"
|
||||
|
||||
exclude = [
|
||||
"_dev",
|
||||
|
|
@ -126,6 +148,7 @@ exclude = [
|
|||
]
|
||||
|
||||
reportImplicitOverride = true
|
||||
reportOverlappingOverload = false
|
||||
|
||||
reportImportCycles = false
|
||||
reportPrivateUsage = false
|
||||
|
|
@ -134,6 +157,11 @@ reportPrivateUsage = false
|
|||
line-length = 120
|
||||
output-format = "grouped"
|
||||
target-version = "py37"
|
||||
|
||||
[tool.ruff.format]
|
||||
docstring-code-format = true
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
# isort
|
||||
"I",
|
||||
|
|
@ -149,7 +177,9 @@ select = [
|
|||
"T201",
|
||||
"T203",
|
||||
# misuse of typing.TYPE_CHECKING
|
||||
"TCH004"
|
||||
"TC004",
|
||||
# import rules
|
||||
"TID251",
|
||||
]
|
||||
ignore = [
|
||||
# mutable defaults
|
||||
|
|
@ -160,10 +190,9 @@ unfixable = [
|
|||
"T201",
|
||||
"T203",
|
||||
]
|
||||
ignore-init-module-imports = true
|
||||
|
||||
[tool.ruff.format]
|
||||
docstring-code-format = true
|
||||
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
||||
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
length-sort = true
|
||||
|
|
@ -172,7 +201,8 @@ combine-as-imports = true
|
|||
extra-standard-library = ["typing_extensions"]
|
||||
known-first-party = ["cloudflare", "tests"]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"bin/**.py" = ["T201", "T203"]
|
||||
"scripts/**.py" = ["T201", "T203"]
|
||||
"tests/**.py" = ["T201", "T203"]
|
||||
"examples/**.py" = ["T201", "T203"]
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@
|
|||
# features: []
|
||||
# all-features: true
|
||||
# with-sources: false
|
||||
# generate-hashes: false
|
||||
# universal: false
|
||||
|
||||
-e file:.
|
||||
annotated-types==0.6.0
|
||||
# via pydantic
|
||||
anyio==4.1.0
|
||||
anyio==4.4.0
|
||||
# via cloudflare
|
||||
# via httpx
|
||||
argcomplete==3.1.2
|
||||
# via nox
|
||||
attrs==23.1.0
|
||||
# via pytest
|
||||
certifi==2023.7.22
|
||||
# via httpcore
|
||||
# via httpx
|
||||
|
|
@ -27,15 +27,18 @@ distlib==0.3.7
|
|||
# via virtualenv
|
||||
distro==1.8.0
|
||||
# via cloudflare
|
||||
exceptiongroup==1.1.3
|
||||
exceptiongroup==1.2.2
|
||||
# via anyio
|
||||
# via pytest
|
||||
execnet==2.1.1
|
||||
# via pytest-xdist
|
||||
filelock==3.12.4
|
||||
# via virtualenv
|
||||
h11==0.14.0
|
||||
# via httpcore
|
||||
httpcore==1.0.2
|
||||
# via httpx
|
||||
httpx==0.25.2
|
||||
httpx==0.28.1
|
||||
# via cloudflare
|
||||
# via respx
|
||||
idna==3.4
|
||||
|
|
@ -44,9 +47,14 @@ idna==3.4
|
|||
importlib-metadata==7.0.0
|
||||
iniconfig==2.0.0
|
||||
# via pytest
|
||||
mypy==1.7.1
|
||||
markdown-it-py==3.0.0
|
||||
# via rich
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
mypy==1.14.1
|
||||
mypy-extensions==1.0.0
|
||||
# via mypy
|
||||
nest-asyncio==1.6.0
|
||||
nodeenv==1.8.0
|
||||
# via pyright
|
||||
nox==2023.4.22
|
||||
|
|
@ -55,24 +63,27 @@ packaging==23.2
|
|||
# via pytest
|
||||
platformdirs==3.11.0
|
||||
# via virtualenv
|
||||
pluggy==1.3.0
|
||||
pluggy==1.5.0
|
||||
# via pytest
|
||||
py==1.11.0
|
||||
# via pytest
|
||||
pydantic==2.4.2
|
||||
pydantic==2.10.3
|
||||
# via cloudflare
|
||||
pydantic-core==2.10.1
|
||||
pydantic-core==2.27.1
|
||||
# via pydantic
|
||||
pyright==1.1.353
|
||||
pytest==7.1.1
|
||||
pygments==2.18.0
|
||||
# via rich
|
||||
pyright==1.1.399
|
||||
pytest==8.3.3
|
||||
# via pytest-asyncio
|
||||
pytest-asyncio==0.21.1
|
||||
# via pytest-xdist
|
||||
pytest-asyncio==0.24.0
|
||||
pytest-xdist==3.7.0
|
||||
python-dateutil==2.8.2
|
||||
# via time-machine
|
||||
pytz==2023.3.post1
|
||||
# via dirty-equals
|
||||
respx==0.20.2
|
||||
ruff==0.1.9
|
||||
respx==0.22.0
|
||||
rich==13.7.1
|
||||
ruff==0.9.4
|
||||
setuptools==68.2.2
|
||||
# via nodeenv
|
||||
six==1.16.0
|
||||
|
|
@ -80,16 +91,17 @@ six==1.16.0
|
|||
sniffio==1.3.0
|
||||
# via anyio
|
||||
# via cloudflare
|
||||
# via httpx
|
||||
time-machine==2.9.0
|
||||
tomli==2.0.1
|
||||
tomli==2.0.2
|
||||
# via mypy
|
||||
# via pytest
|
||||
typing-extensions==4.8.0
|
||||
typing-extensions==4.12.2
|
||||
# via anyio
|
||||
# via cloudflare
|
||||
# via mypy
|
||||
# via pydantic
|
||||
# via pydantic-core
|
||||
# via pyright
|
||||
virtualenv==20.24.5
|
||||
# via nox
|
||||
zipp==3.17.0
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@
|
|||
# features: []
|
||||
# all-features: true
|
||||
# with-sources: false
|
||||
# generate-hashes: false
|
||||
# universal: false
|
||||
|
||||
-e file:.
|
||||
annotated-types==0.6.0
|
||||
# via pydantic
|
||||
anyio==4.1.0
|
||||
anyio==4.4.0
|
||||
# via cloudflare
|
||||
# via httpx
|
||||
certifi==2023.7.22
|
||||
|
|
@ -18,26 +20,26 @@ certifi==2023.7.22
|
|||
# via httpx
|
||||
distro==1.8.0
|
||||
# via cloudflare
|
||||
exceptiongroup==1.1.3
|
||||
exceptiongroup==1.2.2
|
||||
# via anyio
|
||||
h11==0.14.0
|
||||
# via httpcore
|
||||
httpcore==1.0.2
|
||||
# via httpx
|
||||
httpx==0.25.2
|
||||
httpx==0.28.1
|
||||
# via cloudflare
|
||||
idna==3.4
|
||||
# via anyio
|
||||
# via httpx
|
||||
pydantic==2.4.2
|
||||
pydantic==2.10.3
|
||||
# via cloudflare
|
||||
pydantic-core==2.10.1
|
||||
pydantic-core==2.27.1
|
||||
# via pydantic
|
||||
sniffio==1.3.0
|
||||
# via anyio
|
||||
# via cloudflare
|
||||
# via httpx
|
||||
typing-extensions==4.8.0
|
||||
typing-extensions==4.12.2
|
||||
# via anyio
|
||||
# via cloudflare
|
||||
# via pydantic
|
||||
# via pydantic-core
|
||||
|
|
|
|||
19
scripts/bootstrap
Executable file
19
scripts/bootstrap
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
|
||||
brew bundle check >/dev/null 2>&1 || {
|
||||
echo "==> Installing Homebrew dependencies…"
|
||||
brew bundle
|
||||
}
|
||||
fi
|
||||
|
||||
echo "==> Installing Python dependencies…"
|
||||
|
||||
# experimental uv support makes installations significantly faster
|
||||
rye config --set-bool behavior.use-uv=true
|
||||
|
||||
rye sync --all-features
|
||||
8
scripts/format
Executable file
8
scripts/format
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "==> Running formatters"
|
||||
rye run format
|
||||
11
scripts/lint
Executable file
11
scripts/lint
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "==> Running lints"
|
||||
rye run lint
|
||||
|
||||
echo "==> Making sure it imports"
|
||||
rye run python -c 'import cloudflare'
|
||||
41
scripts/mock
Executable file
41
scripts/mock
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [[ -n "$1" && "$1" != '--'* ]]; then
|
||||
URL="$1"
|
||||
shift
|
||||
else
|
||||
URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)"
|
||||
fi
|
||||
|
||||
# Check if the URL is empty
|
||||
if [ -z "$URL" ]; then
|
||||
echo "Error: No OpenAPI spec path/url provided or found in .stats.yml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Starting mock server with URL ${URL}"
|
||||
|
||||
# Run prism mock on the given spec
|
||||
if [ "$1" == "--daemon" ]; then
|
||||
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
|
||||
|
||||
# Wait for server to come online
|
||||
echo -n "Waiting for server"
|
||||
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
|
||||
echo -n "."
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
if grep -q "✖ fatal" ".prism.log"; then
|
||||
cat .prism.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
else
|
||||
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
|
||||
fi
|
||||
61
scripts/test
Executable file
61
scripts/test
Executable file
|
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
function prism_is_running() {
|
||||
curl --silent "http://localhost:4010" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
kill_server_on_port() {
|
||||
pids=$(lsof -t -i tcp:"$1" || echo "")
|
||||
if [ "$pids" != "" ]; then
|
||||
kill "$pids"
|
||||
echo "Stopped $pids."
|
||||
fi
|
||||
}
|
||||
|
||||
function is_overriding_api_base_url() {
|
||||
[ -n "$TEST_API_BASE_URL" ]
|
||||
}
|
||||
|
||||
if ! is_overriding_api_base_url && ! prism_is_running ; then
|
||||
# When we exit this script, make sure to kill the background mock server process
|
||||
trap 'kill_server_on_port 4010' EXIT
|
||||
|
||||
# Start the dev server
|
||||
./scripts/mock --daemon
|
||||
fi
|
||||
|
||||
if is_overriding_api_base_url ; then
|
||||
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
|
||||
echo
|
||||
elif ! prism_is_running ; then
|
||||
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
|
||||
echo -e "running against your OpenAPI spec."
|
||||
echo
|
||||
echo -e "To run the server, pass in the path or url of your OpenAPI"
|
||||
echo -e "spec to the prism command:"
|
||||
echo
|
||||
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
|
||||
echo
|
||||
|
||||
exit 1
|
||||
else
|
||||
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
|
||||
echo
|
||||
fi
|
||||
|
||||
export DEFER_PYDANTIC_BUILD=false
|
||||
|
||||
echo "==> Running tests"
|
||||
rye run pytest "$@"
|
||||
|
||||
echo "==> Running Pydantic v1 tests"
|
||||
rye run nox -s test-pydantic-v1 -- "$@"
|
||||
|
|
@ -47,7 +47,7 @@ def format_str(
|
|||
with _collect_error(match):
|
||||
code = format_code_block(code)
|
||||
code = textwrap.indent(code, match["indent"])
|
||||
return f'{match["before"]}{code}{match["after"]}'
|
||||
return f"{match['before']}{code}{match['after']}"
|
||||
|
||||
def _pycon_match(match: Match[str]) -> str:
|
||||
code = ""
|
||||
|
|
@ -97,7 +97,7 @@ def format_str(
|
|||
def _md_pycon_match(match: Match[str]) -> str:
|
||||
code = _pycon_match(match)
|
||||
code = textwrap.indent(code, match["indent"])
|
||||
return f'{match["before"]}{code}{match["after"]}'
|
||||
return f"{match['before']}{code}{match['after']}"
|
||||
|
||||
src = MD_RE.sub(_md_match, src)
|
||||
src = MD_PYCON_RE.sub(_md_pycon_match, src)
|
||||
25
scripts/utils/upload-artifact.sh
Executable file
25
scripts/utils/upload-artifact.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
set -exuo pipefail
|
||||
|
||||
RESPONSE=$(curl -X POST "$URL" \
|
||||
-H "Authorization: Bearer $AUTH" \
|
||||
-H "Content-Type: application/json")
|
||||
|
||||
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
|
||||
|
||||
if [[ "$SIGNED_URL" == "null" ]]; then
|
||||
echo -e "\033[31mFailed to get signed URL.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
|
||||
-H "Content-Type: application/gzip" \
|
||||
--data-binary @- "$SIGNED_URL" 2>&1)
|
||||
|
||||
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
|
||||
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
|
||||
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/cloudflare-python/$SHA'\033[0m"
|
||||
else
|
||||
echo -e "\033[31mFailed to upload artifact.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
import typing as _t
|
||||
|
||||
from . import types
|
||||
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
|
||||
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
||||
from ._utils import file_from_path
|
||||
from ._client import (
|
||||
Client,
|
||||
|
|
@ -17,6 +19,7 @@ from ._client import (
|
|||
from ._models import BaseModel
|
||||
from ._version import __title__, __version__
|
||||
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
|
||||
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
|
||||
from ._exceptions import (
|
||||
APIError,
|
||||
ConflictError,
|
||||
|
|
@ -33,6 +36,7 @@ from ._exceptions import (
|
|||
UnprocessableEntityError,
|
||||
APIResponseValidationError,
|
||||
)
|
||||
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
|
||||
from ._utils._logs import setup_logging as _setup_logging
|
||||
|
||||
__all__ = [
|
||||
|
|
@ -44,6 +48,7 @@ __all__ = [
|
|||
"ProxiesTypes",
|
||||
"NotGiven",
|
||||
"NOT_GIVEN",
|
||||
"Omit",
|
||||
"CloudflareError",
|
||||
"APIError",
|
||||
"APIStatusError",
|
||||
|
|
@ -68,8 +73,16 @@ __all__ = [
|
|||
"AsyncCloudflare",
|
||||
"file_from_path",
|
||||
"BaseModel",
|
||||
"DEFAULT_TIMEOUT",
|
||||
"DEFAULT_MAX_RETRIES",
|
||||
"DEFAULT_CONNECTION_LIMITS",
|
||||
"DefaultHttpxClient",
|
||||
"DefaultAsyncHttpxClient",
|
||||
]
|
||||
|
||||
if not _t.TYPE_CHECKING:
|
||||
from ._utils._resources_proxy import resources as resources
|
||||
|
||||
_setup_logging()
|
||||
|
||||
# Update the __module__ attribute for exported symbols so that
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -2,12 +2,12 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
|
||||
from datetime import date, datetime
|
||||
from typing_extensions import Self
|
||||
from typing_extensions import Self, Literal
|
||||
|
||||
import pydantic
|
||||
from pydantic.fields import FieldInfo
|
||||
|
||||
from ._types import StrBytesIntFloat
|
||||
from ._types import IncEx, StrBytesIntFloat
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
|
||||
|
|
@ -118,10 +118,10 @@ def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
|
|||
return model.__fields__ # type: ignore
|
||||
|
||||
|
||||
def model_copy(model: _ModelT) -> _ModelT:
|
||||
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
|
||||
if PYDANTIC_V2:
|
||||
return model.model_copy()
|
||||
return model.copy() # type: ignore
|
||||
return model.model_copy(deep=deep)
|
||||
return model.copy(deep=deep) # type: ignore
|
||||
|
||||
|
||||
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
||||
|
|
@ -133,17 +133,25 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|||
def model_dump(
|
||||
model: pydantic.BaseModel,
|
||||
*,
|
||||
exclude: IncEx | None = None,
|
||||
exclude_unset: bool = False,
|
||||
exclude_defaults: bool = False,
|
||||
warnings: bool = True,
|
||||
mode: Literal["json", "python"] = "python",
|
||||
) -> dict[str, Any]:
|
||||
if PYDANTIC_V2:
|
||||
if PYDANTIC_V2 or hasattr(model, "model_dump"):
|
||||
return model.model_dump(
|
||||
mode=mode,
|
||||
exclude=exclude,
|
||||
exclude_unset=exclude_unset,
|
||||
exclude_defaults=exclude_defaults,
|
||||
# warnings are not supported in Pydantic v1
|
||||
warnings=warnings if PYDANTIC_V2 else True,
|
||||
)
|
||||
return cast(
|
||||
"dict[str, Any]",
|
||||
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
||||
exclude=exclude,
|
||||
exclude_unset=exclude_unset,
|
||||
exclude_defaults=exclude_defaults,
|
||||
),
|
||||
|
|
@ -159,22 +167,19 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
|
|||
# generic models
|
||||
if TYPE_CHECKING:
|
||||
|
||||
class GenericModel(pydantic.BaseModel):
|
||||
...
|
||||
class GenericModel(pydantic.BaseModel): ...
|
||||
|
||||
else:
|
||||
if PYDANTIC_V2:
|
||||
# there no longer needs to be a distinction in v2 but
|
||||
# we still have to create our own subclass to avoid
|
||||
# inconsistent MRO ordering errors
|
||||
class GenericModel(pydantic.BaseModel):
|
||||
...
|
||||
class GenericModel(pydantic.BaseModel): ...
|
||||
|
||||
else:
|
||||
import pydantic.generics
|
||||
|
||||
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel):
|
||||
...
|
||||
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
|
||||
|
||||
|
||||
# cached properties
|
||||
|
|
@ -193,30 +198,22 @@ if TYPE_CHECKING:
|
|||
func: Callable[[Any], _T]
|
||||
attrname: str | None
|
||||
|
||||
def __init__(self, func: Callable[[Any], _T]) -> None:
|
||||
...
|
||||
def __init__(self, func: Callable[[Any], _T]) -> None: ...
|
||||
|
||||
@overload
|
||||
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self:
|
||||
...
|
||||
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ...
|
||||
|
||||
@overload
|
||||
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T:
|
||||
...
|
||||
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ...
|
||||
|
||||
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T | Self:
|
||||
raise NotImplementedError()
|
||||
|
||||
def __set_name__(self, owner: type[Any], name: str) -> None:
|
||||
...
|
||||
def __set_name__(self, owner: type[Any], name: str) -> None: ...
|
||||
|
||||
# __set__ is not defined at runtime, but @cached_property is designed to be settable
|
||||
def __set__(self, instance: object, value: _T) -> None:
|
||||
...
|
||||
def __set__(self, instance: object, value: _T) -> None: ...
|
||||
else:
|
||||
try:
|
||||
from functools import cached_property as cached_property
|
||||
except ImportError:
|
||||
from cached_property import cached_property as cached_property
|
||||
from functools import cached_property as cached_property
|
||||
|
||||
typed_cached_property = cached_property
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
|
|||
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
|
||||
|
||||
# default timeout is 1 minute
|
||||
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0)
|
||||
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
|
||||
DEFAULT_MAX_RETRIES = 2
|
||||
DEFAULT_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
|
||||
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
|
||||
|
||||
INITIAL_RETRY_DELAY = 0.5
|
||||
MAX_RETRY_DELAY = 8.0
|
||||
|
|
|
|||
|
|
@ -2,10 +2,15 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, List, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ._utils import is_dict
|
||||
from ._models import construct_type
|
||||
from .types.shared.error_data import ErrorData
|
||||
|
||||
__all__ = [
|
||||
"BadRequestError",
|
||||
"AuthenticationError",
|
||||
|
|
@ -37,12 +42,19 @@ class APIError(CloudflareError):
|
|||
If there was no response associated with this error then it will be `None`.
|
||||
"""
|
||||
|
||||
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002
|
||||
errors: List[ErrorData]
|
||||
|
||||
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None:
|
||||
super().__init__(message)
|
||||
self.request = request
|
||||
self.message = message
|
||||
self.body = body
|
||||
|
||||
if is_dict(body):
|
||||
self.errors = cast(Any, construct_type(type_=List[ErrorData], value=body.get("errors")))
|
||||
else:
|
||||
self.errors = []
|
||||
|
||||
|
||||
class APIResponseValidationError(APIError):
|
||||
response: httpx.Response
|
||||
|
|
|
|||
|
|
@ -34,18 +34,16 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
|
|||
if not is_file_content(obj):
|
||||
prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
|
||||
raise RuntimeError(
|
||||
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead."
|
||||
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/cloudflare/cloudflare-python/tree/main#file-uploads"
|
||||
) from None
|
||||
|
||||
|
||||
@overload
|
||||
def to_httpx_files(files: None) -> None:
|
||||
...
|
||||
def to_httpx_files(files: None) -> None: ...
|
||||
|
||||
|
||||
@overload
|
||||
def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles:
|
||||
...
|
||||
def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
|
||||
|
||||
|
||||
def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
|
||||
|
|
@ -83,13 +81,11 @@ def _read_file_content(file: FileContent) -> HttpxFileContent:
|
|||
|
||||
|
||||
@overload
|
||||
async def async_to_httpx_files(files: None) -> None:
|
||||
...
|
||||
async def async_to_httpx_files(files: None) -> None: ...
|
||||
|
||||
|
||||
@overload
|
||||
async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles:
|
||||
...
|
||||
async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
|
||||
|
||||
|
||||
async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import inspect
|
||||
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
|
||||
from datetime import date, datetime
|
||||
from functools import lru_cache
|
||||
from typing_extensions import (
|
||||
Unpack,
|
||||
Literal,
|
||||
ClassVar,
|
||||
Protocol,
|
||||
Required,
|
||||
ParamSpec,
|
||||
TypedDict,
|
||||
TypeGuard,
|
||||
final,
|
||||
|
|
@ -18,7 +19,6 @@ from typing_extensions import (
|
|||
)
|
||||
|
||||
import pydantic
|
||||
import pydantic.generics
|
||||
from pydantic.fields import FieldInfo
|
||||
|
||||
from ._types import (
|
||||
|
|
@ -30,18 +30,23 @@ from ._types import (
|
|||
Timeout,
|
||||
NotGiven,
|
||||
AnyMapping,
|
||||
MultipartSyntax,
|
||||
HttpxRequestFiles,
|
||||
)
|
||||
from ._utils import (
|
||||
PropertyInfo,
|
||||
is_list,
|
||||
is_given,
|
||||
json_safe,
|
||||
lru_cache,
|
||||
is_mapping,
|
||||
parse_date,
|
||||
coerce_boolean,
|
||||
parse_datetime,
|
||||
strip_not_given,
|
||||
extract_type_arg,
|
||||
is_annotated_type,
|
||||
is_type_alias_type,
|
||||
strip_annotated_type,
|
||||
)
|
||||
from ._compat import (
|
||||
|
|
@ -60,11 +65,14 @@ from ._compat import (
|
|||
from ._constants import RAW_RESPONSE_HEADER
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pydantic_core.core_schema import ModelField, ModelFieldsSchema
|
||||
from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
|
||||
|
||||
__all__ = ["BaseModel", "GenericModel"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_BaseModelT = TypeVar("_BaseModelT", bound="BaseModel")
|
||||
|
||||
P = ParamSpec("P")
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
|
|
@ -74,7 +82,9 @@ class _ConfigProtocol(Protocol):
|
|||
|
||||
class BaseModel(pydantic.BaseModel):
|
||||
if PYDANTIC_V2:
|
||||
model_config: ClassVar[ConfigDict] = ConfigDict(extra="allow")
|
||||
model_config: ClassVar[ConfigDict] = ConfigDict(
|
||||
extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true"))
|
||||
)
|
||||
else:
|
||||
|
||||
@property
|
||||
|
|
@ -86,24 +96,97 @@ class BaseModel(pydantic.BaseModel):
|
|||
class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated]
|
||||
extra: Any = pydantic.Extra.allow # type: ignore
|
||||
|
||||
def to_dict(
|
||||
self,
|
||||
*,
|
||||
mode: Literal["json", "python"] = "python",
|
||||
use_api_names: bool = True,
|
||||
exclude_unset: bool = True,
|
||||
exclude_defaults: bool = False,
|
||||
exclude_none: bool = False,
|
||||
warnings: bool = True,
|
||||
) -> dict[str, object]:
|
||||
"""Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
|
||||
|
||||
By default, fields that were not set by the API will not be included,
|
||||
and keys will match the API response, *not* the property names from the model.
|
||||
|
||||
For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property,
|
||||
the output will use the `"fooBar"` key (unless `use_api_names=False` is passed).
|
||||
|
||||
Args:
|
||||
mode:
|
||||
If mode is 'json', the dictionary will only contain JSON serializable types. e.g. `datetime` will be turned into a string, `"2024-3-22T18:11:19.117000Z"`.
|
||||
If mode is 'python', the dictionary may contain any Python objects. e.g. `datetime(2024, 3, 22)`
|
||||
|
||||
use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`.
|
||||
exclude_unset: Whether to exclude fields that have not been explicitly set.
|
||||
exclude_defaults: Whether to exclude fields that are set to their default value from the output.
|
||||
exclude_none: Whether to exclude fields that have a value of `None` from the output.
|
||||
warnings: Whether to log warnings when invalid fields are encountered. This is only supported in Pydantic v2.
|
||||
"""
|
||||
return self.model_dump(
|
||||
mode=mode,
|
||||
by_alias=use_api_names,
|
||||
exclude_unset=exclude_unset,
|
||||
exclude_defaults=exclude_defaults,
|
||||
exclude_none=exclude_none,
|
||||
warnings=warnings,
|
||||
)
|
||||
|
||||
def to_json(
|
||||
self,
|
||||
*,
|
||||
indent: int | None = 2,
|
||||
use_api_names: bool = True,
|
||||
exclude_unset: bool = True,
|
||||
exclude_defaults: bool = False,
|
||||
exclude_none: bool = False,
|
||||
warnings: bool = True,
|
||||
) -> str:
|
||||
"""Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation).
|
||||
|
||||
By default, fields that were not set by the API will not be included,
|
||||
and keys will match the API response, *not* the property names from the model.
|
||||
|
||||
For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property,
|
||||
the output will use the `"fooBar"` key (unless `use_api_names=False` is passed).
|
||||
|
||||
Args:
|
||||
indent: Indentation to use in the JSON output. If `None` is passed, the output will be compact. Defaults to `2`
|
||||
use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`.
|
||||
exclude_unset: Whether to exclude fields that have not been explicitly set.
|
||||
exclude_defaults: Whether to exclude fields that have the default value.
|
||||
exclude_none: Whether to exclude fields that have a value of `None`.
|
||||
warnings: Whether to show any warnings that occurred during serialization. This is only supported in Pydantic v2.
|
||||
"""
|
||||
return self.model_dump_json(
|
||||
indent=indent,
|
||||
by_alias=use_api_names,
|
||||
exclude_unset=exclude_unset,
|
||||
exclude_defaults=exclude_defaults,
|
||||
exclude_none=exclude_none,
|
||||
warnings=warnings,
|
||||
)
|
||||
|
||||
@override
|
||||
def __str__(self) -> str:
|
||||
# mypy complains about an invalid self arg
|
||||
return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc]
|
||||
return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc]
|
||||
|
||||
# Override the 'construct' method in a way that supports recursive parsing without validation.
|
||||
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
|
||||
@classmethod
|
||||
@override
|
||||
def construct(
|
||||
cls: Type[ModelT],
|
||||
def construct( # pyright: ignore[reportIncompatibleMethodOverride]
|
||||
__cls: Type[ModelT],
|
||||
_fields_set: set[str] | None = None,
|
||||
**values: object,
|
||||
) -> ModelT:
|
||||
m = cls.__new__(cls)
|
||||
m = __cls.__new__(__cls)
|
||||
fields_values: dict[str, object] = {}
|
||||
|
||||
config = get_model_config(cls)
|
||||
config = get_model_config(__cls)
|
||||
populate_by_name = (
|
||||
config.allow_population_by_field_name
|
||||
if isinstance(config, _ConfigProtocol)
|
||||
|
|
@ -113,7 +196,7 @@ class BaseModel(pydantic.BaseModel):
|
|||
if _fields_set is None:
|
||||
_fields_set = set()
|
||||
|
||||
model_fields = get_model_fields(cls)
|
||||
model_fields = get_model_fields(__cls)
|
||||
for name, field in model_fields.items():
|
||||
key = field.alias
|
||||
if key is None or (key not in values and populate_by_name):
|
||||
|
|
@ -167,14 +250,16 @@ class BaseModel(pydantic.BaseModel):
|
|||
self,
|
||||
*,
|
||||
mode: Literal["json", "python"] | str = "python",
|
||||
include: IncEx = None,
|
||||
exclude: IncEx = None,
|
||||
include: IncEx | None = None,
|
||||
exclude: IncEx | None = None,
|
||||
by_alias: bool = False,
|
||||
exclude_unset: bool = False,
|
||||
exclude_defaults: bool = False,
|
||||
exclude_none: bool = False,
|
||||
round_trip: bool = False,
|
||||
warnings: bool = True,
|
||||
warnings: bool | Literal["none", "warn", "error"] = True,
|
||||
context: dict[str, Any] | None = None,
|
||||
serialize_as_any: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
|
||||
|
||||
|
|
@ -196,13 +281,17 @@ class BaseModel(pydantic.BaseModel):
|
|||
Returns:
|
||||
A dictionary representation of the model.
|
||||
"""
|
||||
if mode != "python":
|
||||
raise ValueError("mode is only supported in Pydantic v2")
|
||||
if mode not in {"json", "python"}:
|
||||
raise ValueError("mode must be either 'json' or 'python'")
|
||||
if round_trip != False:
|
||||
raise ValueError("round_trip is only supported in Pydantic v2")
|
||||
if warnings != True:
|
||||
raise ValueError("warnings is only supported in Pydantic v2")
|
||||
return super().dict( # pyright: ignore[reportDeprecated]
|
||||
if context is not None:
|
||||
raise ValueError("context is only supported in Pydantic v2")
|
||||
if serialize_as_any != False:
|
||||
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
||||
dumped = super().dict( # pyright: ignore[reportDeprecated]
|
||||
include=include,
|
||||
exclude=exclude,
|
||||
by_alias=by_alias,
|
||||
|
|
@ -211,19 +300,23 @@ class BaseModel(pydantic.BaseModel):
|
|||
exclude_none=exclude_none,
|
||||
)
|
||||
|
||||
return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
|
||||
|
||||
@override
|
||||
def model_dump_json(
|
||||
self,
|
||||
*,
|
||||
indent: int | None = None,
|
||||
include: IncEx = None,
|
||||
exclude: IncEx = None,
|
||||
include: IncEx | None = None,
|
||||
exclude: IncEx | None = None,
|
||||
by_alias: bool = False,
|
||||
exclude_unset: bool = False,
|
||||
exclude_defaults: bool = False,
|
||||
exclude_none: bool = False,
|
||||
round_trip: bool = False,
|
||||
warnings: bool = True,
|
||||
warnings: bool | Literal["none", "warn", "error"] = True,
|
||||
context: dict[str, Any] | None = None,
|
||||
serialize_as_any: bool = False,
|
||||
) -> str:
|
||||
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
|
||||
|
||||
|
|
@ -247,6 +340,10 @@ class BaseModel(pydantic.BaseModel):
|
|||
raise ValueError("round_trip is only supported in Pydantic v2")
|
||||
if warnings != True:
|
||||
raise ValueError("warnings is only supported in Pydantic v2")
|
||||
if context is not None:
|
||||
raise ValueError("context is only supported in Pydantic v2")
|
||||
if serialize_as_any != False:
|
||||
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
||||
return super().json( # type: ignore[reportDeprecated]
|
||||
indent=indent,
|
||||
include=include,
|
||||
|
|
@ -287,21 +384,63 @@ def is_basemodel(type_: type) -> bool:
|
|||
|
||||
def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericModel]]:
|
||||
origin = get_origin(type_) or type_
|
||||
if not inspect.isclass(origin):
|
||||
return False
|
||||
return issubclass(origin, BaseModel) or issubclass(origin, GenericModel)
|
||||
|
||||
|
||||
def build(
|
||||
base_model_cls: Callable[P, _BaseModelT],
|
||||
*args: P.args,
|
||||
**kwargs: P.kwargs,
|
||||
) -> _BaseModelT:
|
||||
"""Construct a BaseModel class without validation.
|
||||
|
||||
This is useful for cases where you need to instantiate a `BaseModel`
|
||||
from an API response as this provides type-safe params which isn't supported
|
||||
by helpers like `construct_type()`.
|
||||
|
||||
```py
|
||||
build(MyModel, my_field_a="foo", my_field_b=123)
|
||||
```
|
||||
"""
|
||||
if args:
|
||||
raise TypeError(
|
||||
"Received positional arguments which are not supported; Keyword arguments must be used instead",
|
||||
)
|
||||
|
||||
return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs))
|
||||
|
||||
|
||||
def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
|
||||
"""Loose coercion to the expected type with construction of nested values.
|
||||
|
||||
Note: the returned value from this function is not guaranteed to match the
|
||||
given type.
|
||||
"""
|
||||
return cast(_T, construct_type(value=value, type_=type_))
|
||||
|
||||
|
||||
def construct_type(*, value: object, type_: object) -> object:
|
||||
"""Loose coercion to the expected type with construction of nested values.
|
||||
|
||||
If the given value does not match the expected type then it is returned as-is.
|
||||
"""
|
||||
|
||||
# store a reference to the original type we were given before we extract any inner
|
||||
# types so that we can properly resolve forward references in `TypeAliasType` annotations
|
||||
original_type = None
|
||||
|
||||
# we allow `object` as the input type because otherwise, passing things like
|
||||
# `Literal['value']` will be reported as a type error by type checkers
|
||||
type_ = cast("type[object]", type_)
|
||||
if is_type_alias_type(type_):
|
||||
original_type = type_ # type: ignore[unreachable]
|
||||
type_ = type_.__value__ # type: ignore[unreachable]
|
||||
|
||||
# unwrap `Annotated[T, ...]` -> `T`
|
||||
if is_annotated_type(type_):
|
||||
meta = get_args(type_)[1:]
|
||||
meta: tuple[Any, ...] = get_args(type_)[1:]
|
||||
type_ = extract_type_arg(type_, 0)
|
||||
else:
|
||||
meta = tuple()
|
||||
|
|
@ -313,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object:
|
|||
|
||||
if is_union(origin):
|
||||
try:
|
||||
return validate_type(type_=cast("type[object]", type_), value=value)
|
||||
return validate_type(type_=cast("type[object]", original_type or type_), value=value)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
|
@ -355,7 +494,11 @@ def construct_type(*, value: object, type_: object) -> object:
|
|||
_, items_type = get_args(type_) # Dict[_, items_type]
|
||||
return {key: construct_type(value=item, type_=items_type) for key, item in value.items()}
|
||||
|
||||
if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)):
|
||||
if (
|
||||
not is_literal_type(type_)
|
||||
and inspect.isclass(origin)
|
||||
and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel))
|
||||
):
|
||||
if is_list(value):
|
||||
return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value]
|
||||
|
||||
|
|
@ -473,7 +616,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|||
field_schema = field["schema"]
|
||||
|
||||
if field_schema["type"] == "literal":
|
||||
for entry in field_schema["expected"]:
|
||||
for entry in cast("LiteralSchema", field_schema)["expected"]:
|
||||
if isinstance(entry, str):
|
||||
mapping[entry] = variant
|
||||
else:
|
||||
|
|
@ -484,8 +627,8 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|||
# Note: if one variant defines an alias then they all should
|
||||
discriminator_alias = field_info.alias
|
||||
|
||||
if field_info.annotation and is_literal_type(field_info.annotation):
|
||||
for entry in get_args(field_info.annotation):
|
||||
if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
|
||||
for entry in get_args(annotation):
|
||||
if isinstance(entry, str):
|
||||
mapping[entry] = variant
|
||||
|
||||
|
|
@ -503,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|||
|
||||
def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None:
|
||||
schema = model.__pydantic_core_schema__
|
||||
if schema["type"] == "definitions":
|
||||
schema = schema["schema"]
|
||||
|
||||
if schema["type"] != "model":
|
||||
return None
|
||||
|
||||
schema = cast("ModelSchema", schema)
|
||||
fields_schema = schema["schema"]
|
||||
if fields_schema["type"] != "model-fields":
|
||||
return None
|
||||
|
||||
fields_schema = cast("ModelFieldsSchema", fields_schema)
|
||||
|
||||
field = fields_schema["fields"].get(field_name)
|
||||
if not field:
|
||||
return None
|
||||
|
|
@ -527,7 +673,15 @@ def validate_type(*, type_: type[_T], value: object) -> _T:
|
|||
return cast(_T, _validate_non_model_type(type_=type_, value=value))
|
||||
|
||||
|
||||
# our use of subclasssing here causes weirdness for type checkers,
|
||||
def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
|
||||
"""Add a pydantic config for the given type.
|
||||
|
||||
Note: this is a no-op on Pydantic v1.
|
||||
"""
|
||||
setattr(typ, "__pydantic_config__", config) # noqa: B010
|
||||
|
||||
|
||||
# our use of subclassing here causes weirdness for type checkers,
|
||||
# so we just pretend that we don't subclass
|
||||
if TYPE_CHECKING:
|
||||
GenericModel = BaseModel
|
||||
|
|
@ -538,12 +692,14 @@ else:
|
|||
|
||||
|
||||
if PYDANTIC_V2:
|
||||
from pydantic import TypeAdapter as _TypeAdapter
|
||||
|
||||
_CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter))
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pydantic import TypeAdapter
|
||||
else:
|
||||
from pydantic import TypeAdapter as _TypeAdapter
|
||||
|
||||
TypeAdapter = lru_cache(_TypeAdapter)
|
||||
TypeAdapter = _CachedTypeAdapter
|
||||
|
||||
def _validate_non_model_type(*, type_: type[_T], value: object) -> _T:
|
||||
return TypeAdapter(type_).validate_python(value)
|
||||
|
|
@ -582,6 +738,8 @@ class FinalRequestOptionsInput(TypedDict, total=False):
|
|||
idempotency_key: str
|
||||
json_data: Body
|
||||
extra_json: AnyMapping
|
||||
multipart_syntax: MultipartSyntax
|
||||
follow_redirects: bool
|
||||
|
||||
|
||||
@final
|
||||
|
|
@ -594,7 +752,9 @@ class FinalRequestOptions(pydantic.BaseModel):
|
|||
timeout: Union[float, Timeout, None, NotGiven] = NotGiven()
|
||||
files: Union[HttpxRequestFiles, None] = None
|
||||
idempotency_key: Union[str, None] = None
|
||||
multipart_syntax: Union[MultipartSyntax, None] = None
|
||||
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
|
||||
follow_redirects: Union[bool, None] = None
|
||||
|
||||
# It should be noted that we cannot use `json` here as that would override
|
||||
# a BaseModel method in an incompatible fashion.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import httpx
|
|||
import pydantic
|
||||
|
||||
from ._types import NoneType
|
||||
from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base
|
||||
from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base
|
||||
from ._models import BaseModel, is_basemodel
|
||||
from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER
|
||||
from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type
|
||||
|
|
@ -55,6 +55,9 @@ class BaseAPIResponse(Generic[R]):
|
|||
|
||||
http_response: httpx.Response
|
||||
|
||||
retries_taken: int
|
||||
"""The number of retries made. If no retries happened this will be `0`"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
|
|
@ -64,6 +67,7 @@ class BaseAPIResponse(Generic[R]):
|
|||
stream: bool,
|
||||
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
|
||||
options: FinalRequestOptions,
|
||||
retries_taken: int = 0,
|
||||
) -> None:
|
||||
self._cast_to = cast_to
|
||||
self._client = client
|
||||
|
|
@ -72,6 +76,7 @@ class BaseAPIResponse(Generic[R]):
|
|||
self._stream_cls = stream_cls
|
||||
self._options = options
|
||||
self.http_response = raw
|
||||
self.retries_taken = retries_taken
|
||||
|
||||
@property
|
||||
def headers(self) -> httpx.Headers:
|
||||
|
|
@ -121,9 +126,17 @@ class BaseAPIResponse(Generic[R]):
|
|||
)
|
||||
|
||||
def _parse(self, *, to: type[_T] | None = None) -> R | _T:
|
||||
cast_to = to if to is not None else self._cast_to
|
||||
|
||||
# unwrap `TypeAlias('Name', T)` -> `T`
|
||||
if is_type_alias_type(cast_to):
|
||||
cast_to = cast_to.__value__ # type: ignore[unreachable]
|
||||
|
||||
# unwrap `Annotated[T, ...]` -> `T`
|
||||
if to and is_annotated_type(to):
|
||||
to = extract_type_arg(to, 0)
|
||||
if cast_to and is_annotated_type(cast_to):
|
||||
cast_to = extract_type_arg(cast_to, 0)
|
||||
|
||||
origin = get_origin(cast_to) or cast_to
|
||||
|
||||
if self._is_sse_stream:
|
||||
if to:
|
||||
|
|
@ -159,18 +172,12 @@ class BaseAPIResponse(Generic[R]):
|
|||
return cast(
|
||||
R,
|
||||
stream_cls(
|
||||
cast_to=self._cast_to,
|
||||
cast_to=cast_to,
|
||||
response=self.http_response,
|
||||
client=cast(Any, self._client),
|
||||
),
|
||||
)
|
||||
|
||||
cast_to = to if to is not None else self._cast_to
|
||||
|
||||
# unwrap `Annotated[T, ...]` -> `T`
|
||||
if is_annotated_type(cast_to):
|
||||
cast_to = extract_type_arg(cast_to, 0)
|
||||
|
||||
if cast_to is NoneType:
|
||||
return cast(R, None)
|
||||
|
||||
|
|
@ -187,7 +194,8 @@ class BaseAPIResponse(Generic[R]):
|
|||
if cast_to == float:
|
||||
return cast(R, float(response.text))
|
||||
|
||||
origin = get_origin(cast_to) or cast_to
|
||||
if cast_to == bool:
|
||||
return cast(R, response.text.lower() == "true")
|
||||
|
||||
if origin == APIResponse:
|
||||
raise RuntimeError("Unexpected state - cast_to is `APIResponse`")
|
||||
|
|
@ -202,7 +210,13 @@ class BaseAPIResponse(Generic[R]):
|
|||
raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`")
|
||||
return cast(R, response)
|
||||
|
||||
if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel):
|
||||
if (
|
||||
inspect.isclass(
|
||||
origin # pyright: ignore[reportUnknownArgumentType]
|
||||
)
|
||||
and not issubclass(origin, BaseModel)
|
||||
and issubclass(origin, pydantic.BaseModel)
|
||||
):
|
||||
raise TypeError(
|
||||
"Pydantic models must subclass our base model type, e.g. `from cloudflare import BaseModel`"
|
||||
)
|
||||
|
|
@ -221,7 +235,7 @@ class BaseAPIResponse(Generic[R]):
|
|||
# split is required to handle cases where additional information is included
|
||||
# in the response, e.g. application/json; charset=utf-8
|
||||
content_type, *_ = response.headers.get("content-type", "*").split(";")
|
||||
if content_type != "application/json":
|
||||
if not content_type.endswith("json"):
|
||||
if is_basemodel(cast_to):
|
||||
try:
|
||||
data = response.json()
|
||||
|
|
@ -257,12 +271,10 @@ class BaseAPIResponse(Generic[R]):
|
|||
|
||||
class APIResponse(BaseAPIResponse[R]):
|
||||
@overload
|
||||
def parse(self, *, to: type[_T]) -> _T:
|
||||
...
|
||||
def parse(self, *, to: type[_T]) -> _T: ...
|
||||
|
||||
@overload
|
||||
def parse(self) -> R:
|
||||
...
|
||||
def parse(self) -> R: ...
|
||||
|
||||
def parse(self, *, to: type[_T] | None = None) -> R | _T:
|
||||
"""Returns the rich python representation of this response's data.
|
||||
|
|
@ -361,12 +373,10 @@ class APIResponse(BaseAPIResponse[R]):
|
|||
|
||||
class AsyncAPIResponse(BaseAPIResponse[R]):
|
||||
@overload
|
||||
async def parse(self, *, to: type[_T]) -> _T:
|
||||
...
|
||||
async def parse(self, *, to: type[_T]) -> _T: ...
|
||||
|
||||
@overload
|
||||
async def parse(self) -> R:
|
||||
...
|
||||
async def parse(self) -> R: ...
|
||||
|
||||
async def parse(self, *, to: type[_T] | None = None) -> R | _T:
|
||||
"""Returns the rich python representation of this response's data.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Stream(Generic[_T]):
|
|||
|
||||
response: httpx.Response
|
||||
|
||||
_decoder: SSEDecoder | SSEBytesDecoder
|
||||
_decoder: SSEBytesDecoder
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
@ -46,10 +46,7 @@ class Stream(Generic[_T]):
|
|||
yield item
|
||||
|
||||
def _iter_events(self) -> Iterator[ServerSentEvent]:
|
||||
if isinstance(self._decoder, SSEBytesDecoder):
|
||||
yield from self._decoder.iter_bytes(self.response.iter_bytes())
|
||||
else:
|
||||
yield from self._decoder.iter(self.response.iter_lines())
|
||||
yield from self._decoder.iter_bytes(self.response.iter_bytes())
|
||||
|
||||
def __stream__(self) -> Iterator[_T]:
|
||||
cast_to = cast(Any, self._cast_to)
|
||||
|
|
@ -112,12 +109,8 @@ class AsyncStream(Generic[_T]):
|
|||
yield item
|
||||
|
||||
async def _iter_events(self) -> AsyncIterator[ServerSentEvent]:
|
||||
if isinstance(self._decoder, SSEBytesDecoder):
|
||||
async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()):
|
||||
yield sse
|
||||
else:
|
||||
async for sse in self._decoder.aiter(self.response.aiter_lines()):
|
||||
yield sse
|
||||
async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()):
|
||||
yield sse
|
||||
|
||||
async def __stream__(self) -> AsyncIterator[_T]:
|
||||
cast_to = cast(Any, self._cast_to)
|
||||
|
|
@ -205,21 +198,49 @@ class SSEDecoder:
|
|||
self._last_event_id = None
|
||||
self._retry = None
|
||||
|
||||
def iter(self, iterator: Iterator[str]) -> Iterator[ServerSentEvent]:
|
||||
"""Given an iterator that yields lines, iterate over it & yield every event encountered"""
|
||||
for line in iterator:
|
||||
line = line.rstrip("\n")
|
||||
sse = self.decode(line)
|
||||
if sse is not None:
|
||||
yield sse
|
||||
def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]:
|
||||
"""Given an iterator that yields raw binary data, iterate over it & yield every event encountered"""
|
||||
for chunk in self._iter_chunks(iterator):
|
||||
# Split before decoding so splitlines() only uses \r and \n
|
||||
for raw_line in chunk.splitlines():
|
||||
line = raw_line.decode("utf-8")
|
||||
sse = self.decode(line)
|
||||
if sse:
|
||||
yield sse
|
||||
|
||||
async def aiter(self, iterator: AsyncIterator[str]) -> AsyncIterator[ServerSentEvent]:
|
||||
"""Given an async iterator that yields lines, iterate over it & yield every event encountered"""
|
||||
async for line in iterator:
|
||||
line = line.rstrip("\n")
|
||||
sse = self.decode(line)
|
||||
if sse is not None:
|
||||
yield sse
|
||||
def _iter_chunks(self, iterator: Iterator[bytes]) -> Iterator[bytes]:
|
||||
"""Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks"""
|
||||
data = b""
|
||||
for chunk in iterator:
|
||||
for line in chunk.splitlines(keepends=True):
|
||||
data += line
|
||||
if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")):
|
||||
yield data
|
||||
data = b""
|
||||
if data:
|
||||
yield data
|
||||
|
||||
async def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]:
|
||||
"""Given an iterator that yields raw binary data, iterate over it & yield every event encountered"""
|
||||
async for chunk in self._aiter_chunks(iterator):
|
||||
# Split before decoding so splitlines() only uses \r and \n
|
||||
for raw_line in chunk.splitlines():
|
||||
line = raw_line.decode("utf-8")
|
||||
sse = self.decode(line)
|
||||
if sse:
|
||||
yield sse
|
||||
|
||||
async def _aiter_chunks(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[bytes]:
|
||||
"""Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks"""
|
||||
data = b""
|
||||
async for chunk in iterator:
|
||||
for line in chunk.splitlines(keepends=True):
|
||||
data += line
|
||||
if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")):
|
||||
yield data
|
||||
data = b""
|
||||
if data:
|
||||
yield data
|
||||
|
||||
def decode(self, line: str) -> ServerSentEvent | None:
|
||||
# See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from typing import (
|
|||
Optional,
|
||||
Sequence,
|
||||
)
|
||||
from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
|
||||
from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
|
||||
|
||||
import httpx
|
||||
import pydantic
|
||||
|
|
@ -71,6 +71,8 @@ HttpxFileTypes = Union[
|
|||
]
|
||||
HttpxRequestFiles = Union[Mapping[str, HttpxFileTypes], Sequence[Tuple[str, HttpxFileTypes]]]
|
||||
|
||||
MultipartSyntax = Literal["query", "json"]
|
||||
|
||||
# Workaround to support (cast_to: Type[ResponseT]) -> ResponseT
|
||||
# where ResponseT includes `None`. In order to support directly
|
||||
# passing `None`, overloads would have to be defined for every
|
||||
|
|
@ -100,6 +102,8 @@ class RequestOptions(TypedDict, total=False):
|
|||
params: Query
|
||||
extra_json: AnyMapping
|
||||
idempotency_key: str
|
||||
multipart_syntax: MultipartSyntax
|
||||
follow_redirects: bool
|
||||
|
||||
|
||||
# Sentinel class used until PEP 0661 is accepted
|
||||
|
|
@ -111,8 +115,7 @@ class NotGiven:
|
|||
For example:
|
||||
|
||||
```py
|
||||
def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response:
|
||||
...
|
||||
def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ...
|
||||
|
||||
|
||||
get(timeout=1) # 1s timeout
|
||||
|
|
@ -162,16 +165,14 @@ class ModelBuilderProtocol(Protocol):
|
|||
*,
|
||||
response: Response,
|
||||
data: object,
|
||||
) -> _T:
|
||||
...
|
||||
) -> _T: ...
|
||||
|
||||
|
||||
Headers = Mapping[str, Union[str, Omit]]
|
||||
|
||||
|
||||
class HeadersLikeProtocol(Protocol):
|
||||
def get(self, __key: str) -> str | None:
|
||||
...
|
||||
def get(self, __key: str) -> str | None: ...
|
||||
|
||||
|
||||
HeadersLike = Union[Headers, HeadersLikeProtocol]
|
||||
|
|
@ -195,8 +196,8 @@ ResponseT = TypeVar(
|
|||
StrBytesIntFloat = Union[str, bytes, int, float]
|
||||
|
||||
# Note: copied from Pydantic
|
||||
# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49
|
||||
IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None"
|
||||
# https://github.com/pydantic/pydantic/blob/6f31f8f68ef011f84357330186f603ff295312fd/pydantic/main.py#L79
|
||||
IncEx: TypeAlias = Union[Set[int], Set[str], Mapping[int, Union["IncEx", bool]], Mapping[str, Union["IncEx", bool]]]
|
||||
|
||||
PostParser = Callable[[Any], Any]
|
||||
|
||||
|
|
@ -218,3 +219,4 @@ class _GenericAlias(Protocol):
|
|||
|
||||
class HttpxSendArgs(TypedDict, total=False):
|
||||
auth: httpx.Auth
|
||||
follow_redirects: bool
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ from ._utils import (
|
|||
is_list as is_list,
|
||||
is_given as is_given,
|
||||
is_tuple as is_tuple,
|
||||
json_safe as json_safe,
|
||||
lru_cache as lru_cache,
|
||||
is_mapping as is_mapping,
|
||||
is_tuple_t as is_tuple_t,
|
||||
parse_date as parse_date,
|
||||
|
|
@ -37,6 +39,7 @@ from ._typing import (
|
|||
is_iterable_type as is_iterable_type,
|
||||
is_required_type as is_required_type,
|
||||
is_annotated_type as is_annotated_type,
|
||||
is_type_alias_type as is_type_alias_type,
|
||||
strip_annotated_type as strip_annotated_type,
|
||||
extract_type_var_from_base as extract_type_var_from_base,
|
||||
)
|
||||
|
|
@ -48,3 +51,7 @@ from ._transform import (
|
|||
maybe_transform as maybe_transform,
|
||||
async_maybe_transform as async_maybe_transform,
|
||||
)
|
||||
from ._reflection import (
|
||||
function_has_argument as function_has_argument,
|
||||
assert_signatures_in_sync as assert_signatures_in_sync,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ T = TypeVar("T")
|
|||
class LazyProxy(Generic[T], ABC):
|
||||
"""Implements data methods to pretend that an instance is another instance.
|
||||
|
||||
This includes forwarding attribute access and othe methods.
|
||||
This includes forwarding attribute access and other methods.
|
||||
"""
|
||||
|
||||
# Note: we have to special case proxies that themselves return proxies
|
||||
|
|
@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
|
|||
@property # type: ignore
|
||||
@override
|
||||
def __class__(self) -> type: # pyright: ignore
|
||||
proxied = self.__get_proxied__()
|
||||
try:
|
||||
proxied = self.__get_proxied__()
|
||||
except Exception:
|
||||
return type(self)
|
||||
if issubclass(type(proxied), LazyProxy):
|
||||
return type(proxied)
|
||||
return proxied.__class__
|
||||
|
|
@ -59,5 +62,4 @@ class LazyProxy(Generic[T], ABC):
|
|||
return cast(T, self)
|
||||
|
||||
@abstractmethod
|
||||
def __load__(self) -> T:
|
||||
...
|
||||
def __load__(self) -> T: ...
|
||||
|
|
|
|||
42
src/cloudflare/_utils/_reflection.py
Normal file
42
src/cloudflare/_utils/_reflection.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
from typing import Any, Callable
|
||||
|
||||
|
||||
def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool:
|
||||
"""Returns whether or not the given function has a specific parameter"""
|
||||
sig = inspect.signature(func)
|
||||
return arg_name in sig.parameters
|
||||
|
||||
|
||||
def assert_signatures_in_sync(
|
||||
source_func: Callable[..., Any],
|
||||
check_func: Callable[..., Any],
|
||||
*,
|
||||
exclude_params: set[str] = set(),
|
||||
) -> None:
|
||||
"""Ensure that the signature of the second function matches the first."""
|
||||
|
||||
check_sig = inspect.signature(check_func)
|
||||
source_sig = inspect.signature(source_func)
|
||||
|
||||
errors: list[str] = []
|
||||
|
||||
for name, source_param in source_sig.parameters.items():
|
||||
if name in exclude_params:
|
||||
continue
|
||||
|
||||
custom_param = check_sig.parameters.get(name)
|
||||
if not custom_param:
|
||||
errors.append(f"the `{name}` param is missing")
|
||||
continue
|
||||
|
||||
if custom_param.annotation != source_param.annotation:
|
||||
errors.append(
|
||||
f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(custom_param.annotation)}"
|
||||
)
|
||||
continue
|
||||
|
||||
if errors:
|
||||
raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors))
|
||||
24
src/cloudflare/_utils/_resources_proxy.py
Normal file
24
src/cloudflare/_utils/_resources_proxy.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing_extensions import override
|
||||
|
||||
from ._proxy import LazyProxy
|
||||
|
||||
|
||||
class ResourcesProxy(LazyProxy[Any]):
|
||||
"""A proxy for the `cloudflare.resources` module.
|
||||
|
||||
This is used so that we can lazily import `cloudflare.resources` only when
|
||||
needed *and* so that users can just import `cloudflare` and reference `cloudflare.resources`
|
||||
"""
|
||||
|
||||
@override
|
||||
def __load__(self) -> Any:
|
||||
import importlib
|
||||
|
||||
mod = importlib.import_module("cloudflare.resources")
|
||||
return mod
|
||||
|
||||
|
||||
resources = ResourcesProxy().__as_proxied__()
|
||||
|
|
@ -1,54 +1,77 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import asyncio
|
||||
import functools
|
||||
from typing import TypeVar, Callable, Awaitable
|
||||
import contextvars
|
||||
from typing import Any, TypeVar, Callable, Awaitable
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
import anyio
|
||||
import sniffio
|
||||
import anyio.to_thread
|
||||
|
||||
T_Retval = TypeVar("T_Retval")
|
||||
T_ParamSpec = ParamSpec("T_ParamSpec")
|
||||
|
||||
|
||||
# copied from `asyncer`, https://github.com/tiangolo/asyncer
|
||||
def asyncify(
|
||||
function: Callable[T_ParamSpec, T_Retval],
|
||||
*,
|
||||
cancellable: bool = False,
|
||||
limiter: anyio.CapacityLimiter | None = None,
|
||||
) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
||||
if sys.version_info >= (3, 9):
|
||||
_asyncio_to_thread = asyncio.to_thread
|
||||
else:
|
||||
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
||||
# for Python 3.8 support
|
||||
async def _asyncio_to_thread(
|
||||
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
||||
) -> Any:
|
||||
"""Asynchronously run function *func* in a separate thread.
|
||||
|
||||
Any *args and **kwargs supplied for this function are directly passed
|
||||
to *func*. Also, the current :class:`contextvars.Context` is propagated,
|
||||
allowing context variables from the main thread to be accessed in the
|
||||
separate thread.
|
||||
|
||||
Returns a coroutine that can be awaited to get the eventual result of *func*.
|
||||
"""
|
||||
loop = asyncio.events.get_running_loop()
|
||||
ctx = contextvars.copy_context()
|
||||
func_call = functools.partial(ctx.run, func, *args, **kwargs)
|
||||
return await loop.run_in_executor(None, func_call)
|
||||
|
||||
|
||||
async def to_thread(
|
||||
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
||||
) -> T_Retval:
|
||||
if sniffio.current_async_library() == "asyncio":
|
||||
return await _asyncio_to_thread(func, *args, **kwargs)
|
||||
|
||||
return await anyio.to_thread.run_sync(
|
||||
functools.partial(func, *args, **kwargs),
|
||||
)
|
||||
|
||||
|
||||
# inspired by `asyncer`, https://github.com/tiangolo/asyncer
|
||||
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
||||
"""
|
||||
Take a blocking function and create an async one that receives the same
|
||||
positional and keyword arguments, and that when called, calls the original function
|
||||
in a worker thread using `anyio.to_thread.run_sync()`. Internally,
|
||||
`asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports
|
||||
keyword arguments additional to positional arguments and it adds better support for
|
||||
autocompletion and inline errors for the arguments of the function called and the
|
||||
return value.
|
||||
positional and keyword arguments. For python version 3.9 and above, it uses
|
||||
asyncio.to_thread to run the function in a separate thread. For python version
|
||||
3.8, it uses locally defined copy of the asyncio.to_thread function which was
|
||||
introduced in python 3.9.
|
||||
|
||||
If the `cancellable` option is enabled and the task waiting for its completion is
|
||||
cancelled, the thread will still run its course but its return value (or any raised
|
||||
exception) will be ignored.
|
||||
Usage:
|
||||
|
||||
Use it like this:
|
||||
|
||||
```Python
|
||||
def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str:
|
||||
# Do work
|
||||
return "Some result"
|
||||
```python
|
||||
def blocking_func(arg1, arg2, kwarg1=None):
|
||||
# blocking code
|
||||
return result
|
||||
|
||||
|
||||
result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b")
|
||||
print(result)
|
||||
result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
`function`: a blocking regular callable (e.g. a function)
|
||||
`cancellable`: `True` to allow cancellation of the operation
|
||||
`limiter`: capacity limiter to use to limit the total amount of threads running
|
||||
(if omitted, the default limiter is used)
|
||||
|
||||
## Return
|
||||
|
||||
|
|
@ -58,7 +81,6 @@ def asyncify(
|
|||
"""
|
||||
|
||||
async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval:
|
||||
partial_f = functools.partial(function, *args, **kwargs)
|
||||
return await anyio.to_thread.run_sync(partial_f, cancellable=cancellable, limiter=limiter)
|
||||
return await to_thread(function, *args, **kwargs)
|
||||
|
||||
return wrapper
|
||||
|
|
|
|||
|
|
@ -5,13 +5,15 @@ import base64
|
|||
import pathlib
|
||||
from typing import Any, Mapping, TypeVar, cast
|
||||
from datetime import date, datetime
|
||||
from typing_extensions import Literal, get_args, override, get_type_hints
|
||||
from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints
|
||||
|
||||
import anyio
|
||||
import pydantic
|
||||
|
||||
from ._utils import (
|
||||
is_list,
|
||||
is_given,
|
||||
lru_cache,
|
||||
is_mapping,
|
||||
is_iterable,
|
||||
)
|
||||
|
|
@ -25,7 +27,7 @@ from ._typing import (
|
|||
is_annotated_type,
|
||||
strip_annotated_type,
|
||||
)
|
||||
from .._compat import model_dump, is_typeddict
|
||||
from .._compat import get_origin, model_dump, is_typeddict
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
|
@ -108,6 +110,7 @@ def transform(
|
|||
return cast(_T, transformed)
|
||||
|
||||
|
||||
@lru_cache(maxsize=8096)
|
||||
def _get_annotated_type(type_: type) -> type | None:
|
||||
"""If the given type is an `Annotated` type then it is returned, if not `None` is returned.
|
||||
|
||||
|
|
@ -126,7 +129,7 @@ def _get_annotated_type(type_: type) -> type | None:
|
|||
def _maybe_transform_key(key: str, type_: type) -> str:
|
||||
"""Transform the given `data` based on the annotations provided in `type_`.
|
||||
|
||||
Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
|
||||
Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata.
|
||||
"""
|
||||
annotated_type = _get_annotated_type(type_)
|
||||
if annotated_type is None:
|
||||
|
|
@ -142,6 +145,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
|
|||
return key
|
||||
|
||||
|
||||
def _no_transform_needed(annotation: type) -> bool:
|
||||
return annotation == float or annotation == int
|
||||
|
||||
|
||||
def _transform_recursive(
|
||||
data: object,
|
||||
*,
|
||||
|
|
@ -164,16 +171,35 @@ def _transform_recursive(
|
|||
inner_type = annotation
|
||||
|
||||
stripped_type = strip_annotated_type(inner_type)
|
||||
origin = get_origin(stripped_type) or stripped_type
|
||||
if is_typeddict(stripped_type) and is_mapping(data):
|
||||
return _transform_typeddict(data, stripped_type)
|
||||
|
||||
if origin == dict and is_mapping(data):
|
||||
items_type = get_args(stripped_type)[1]
|
||||
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
||||
|
||||
if (
|
||||
# List[T]
|
||||
(is_list_type(stripped_type) and is_list(data))
|
||||
# Iterable[T]
|
||||
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
|
||||
):
|
||||
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
|
||||
# intended as an iterable, so we don't transform it.
|
||||
if isinstance(data, dict):
|
||||
return cast(object, data)
|
||||
|
||||
inner_type = extract_type_arg(stripped_type, 0)
|
||||
if _no_transform_needed(inner_type):
|
||||
# for some types there is no need to transform anything, so we can get a small
|
||||
# perf boost from skipping that work.
|
||||
#
|
||||
# but we still need to convert to a list to ensure the data is json-serializable
|
||||
if is_list(data):
|
||||
return data
|
||||
return list(data)
|
||||
|
||||
return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
|
||||
|
||||
if is_union_type(stripped_type):
|
||||
|
|
@ -186,7 +212,7 @@ def _transform_recursive(
|
|||
return data
|
||||
|
||||
if isinstance(data, pydantic.BaseModel):
|
||||
return model_dump(data, exclude_unset=True)
|
||||
return model_dump(data, exclude_unset=True, mode="json")
|
||||
|
||||
annotated_type = _get_annotated_type(annotation)
|
||||
if annotated_type is None:
|
||||
|
|
@ -235,6 +261,11 @@ def _transform_typeddict(
|
|||
result: dict[str, object] = {}
|
||||
annotations = get_type_hints(expected_type, include_extras=True)
|
||||
for key, value in data.items():
|
||||
if not is_given(value):
|
||||
# we don't need to include `NotGiven` values here as they'll
|
||||
# be stripped out before the request is sent anyway
|
||||
continue
|
||||
|
||||
type_ = annotations.get(key)
|
||||
if type_ is None:
|
||||
# we do not have a type annotation for this field, leave it as is
|
||||
|
|
@ -302,16 +333,35 @@ async def _async_transform_recursive(
|
|||
inner_type = annotation
|
||||
|
||||
stripped_type = strip_annotated_type(inner_type)
|
||||
origin = get_origin(stripped_type) or stripped_type
|
||||
if is_typeddict(stripped_type) and is_mapping(data):
|
||||
return await _async_transform_typeddict(data, stripped_type)
|
||||
|
||||
if origin == dict and is_mapping(data):
|
||||
items_type = get_args(stripped_type)[1]
|
||||
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
||||
|
||||
if (
|
||||
# List[T]
|
||||
(is_list_type(stripped_type) and is_list(data))
|
||||
# Iterable[T]
|
||||
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
|
||||
):
|
||||
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
|
||||
# intended as an iterable, so we don't transform it.
|
||||
if isinstance(data, dict):
|
||||
return cast(object, data)
|
||||
|
||||
inner_type = extract_type_arg(stripped_type, 0)
|
||||
if _no_transform_needed(inner_type):
|
||||
# for some types there is no need to transform anything, so we can get a small
|
||||
# perf boost from skipping that work.
|
||||
#
|
||||
# but we still need to convert to a list to ensure the data is json-serializable
|
||||
if is_list(data):
|
||||
return data
|
||||
return list(data)
|
||||
|
||||
return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
|
||||
|
||||
if is_union_type(stripped_type):
|
||||
|
|
@ -324,7 +374,7 @@ async def _async_transform_recursive(
|
|||
return data
|
||||
|
||||
if isinstance(data, pydantic.BaseModel):
|
||||
return model_dump(data, exclude_unset=True)
|
||||
return model_dump(data, exclude_unset=True, mode="json")
|
||||
|
||||
annotated_type = _get_annotated_type(annotation)
|
||||
if annotated_type is None:
|
||||
|
|
@ -373,6 +423,11 @@ async def _async_transform_typeddict(
|
|||
result: dict[str, object] = {}
|
||||
annotations = get_type_hints(expected_type, include_extras=True)
|
||||
for key, value in data.items():
|
||||
if not is_given(value):
|
||||
# we don't need to include `NotGiven` values here as they'll
|
||||
# be stripped out before the request is sent anyway
|
||||
continue
|
||||
|
||||
type_ = annotations.get(key)
|
||||
if type_ is None:
|
||||
# we do not have a type annotation for this field, leave it as is
|
||||
|
|
@ -380,3 +435,13 @@ async def _async_transform_typeddict(
|
|||
else:
|
||||
result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_)
|
||||
return result
|
||||
|
||||
|
||||
@lru_cache(maxsize=8096)
|
||||
def get_type_hints(
|
||||
obj: Any,
|
||||
globalns: dict[str, Any] | None = None,
|
||||
localns: Mapping[str, Any] | None = None,
|
||||
include_extras: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import typing
|
||||
import typing_extensions
|
||||
from typing import Any, TypeVar, Iterable, cast
|
||||
from collections import abc as _c_abc
|
||||
from typing_extensions import Required, Annotated, get_args, get_origin
|
||||
from typing_extensions import (
|
||||
TypeIs,
|
||||
Required,
|
||||
Annotated,
|
||||
get_args,
|
||||
get_origin,
|
||||
)
|
||||
|
||||
from ._utils import lru_cache
|
||||
from .._types import InheritsGeneric
|
||||
from .._compat import is_union as _is_union
|
||||
|
||||
|
|
@ -36,7 +46,28 @@ def is_typevar(typ: type) -> bool:
|
|||
return type(typ) == TypeVar # type: ignore
|
||||
|
||||
|
||||
_TYPE_ALIAS_TYPES: tuple[type[typing_extensions.TypeAliasType], ...] = (typing_extensions.TypeAliasType,)
|
||||
if sys.version_info >= (3, 12):
|
||||
_TYPE_ALIAS_TYPES = (*_TYPE_ALIAS_TYPES, typing.TypeAliasType)
|
||||
|
||||
|
||||
def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
|
||||
"""Return whether the provided argument is an instance of `TypeAliasType`.
|
||||
|
||||
```python
|
||||
type Int = int
|
||||
is_type_alias_type(Int)
|
||||
# > True
|
||||
Str = TypeAliasType("Str", str)
|
||||
is_type_alias_type(Str)
|
||||
# > True
|
||||
```
|
||||
"""
|
||||
return isinstance(tp, _TYPE_ALIAS_TYPES)
|
||||
|
||||
|
||||
# Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
|
||||
@lru_cache(maxsize=8096)
|
||||
def strip_annotated_type(typ: type) -> type:
|
||||
if is_required_type(typ) or is_annotated_type(typ):
|
||||
return strip_annotated_type(cast(type, get_args(typ)[0]))
|
||||
|
|
@ -79,7 +110,7 @@ def extract_type_var_from_base(
|
|||
```
|
||||
"""
|
||||
cls = cast(object, get_origin(typ) or typ)
|
||||
if cls in generic_bases:
|
||||
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
|
||||
# we're given the class directly
|
||||
return extract_type_arg(typ, index)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@ from typing import (
|
|||
overload,
|
||||
)
|
||||
from pathlib import Path
|
||||
from datetime import date, datetime
|
||||
from typing_extensions import TypeGuard
|
||||
|
||||
import sniffio
|
||||
|
||||
from .._types import Headers, NotGiven, FileTypes, NotGivenOr, HeadersLike
|
||||
from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
|
||||
from .._compat import parse_date as parse_date, parse_datetime as parse_datetime
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
|
@ -71,8 +72,16 @@ def _extract_items(
|
|||
from .._files import assert_is_file_content
|
||||
|
||||
# We have exhausted the path, return the entry we found.
|
||||
assert_is_file_content(obj, key=flattened_key)
|
||||
assert flattened_key is not None
|
||||
|
||||
if is_list(obj):
|
||||
files: list[tuple[str, FileTypes]] = []
|
||||
for entry in obj:
|
||||
assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
|
||||
files.append((flattened_key + "[]", cast(FileTypes, entry)))
|
||||
return files
|
||||
|
||||
assert_is_file_content(obj, key=flattened_key)
|
||||
return [(flattened_key, cast(FileTypes, obj))]
|
||||
|
||||
index += 1
|
||||
|
|
@ -211,20 +220,17 @@ def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]:
|
|||
Example usage:
|
||||
```py
|
||||
@overload
|
||||
def foo(*, a: str) -> str:
|
||||
...
|
||||
def foo(*, a: str) -> str: ...
|
||||
|
||||
|
||||
@overload
|
||||
def foo(*, b: bool) -> str:
|
||||
...
|
||||
def foo(*, b: bool) -> str: ...
|
||||
|
||||
|
||||
# This enforces the same constraints that a static type checker would
|
||||
# i.e. that either a or b must be passed to the function
|
||||
@required_args(["a"], ["b"])
|
||||
def foo(*, a: str | None = None, b: bool | None = None) -> str:
|
||||
...
|
||||
def foo(*, a: str | None = None, b: bool | None = None) -> str: ...
|
||||
```
|
||||
"""
|
||||
|
||||
|
|
@ -265,6 +271,8 @@ def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]:
|
|||
)
|
||||
msg = f"Missing required arguments; Expected either {variations} arguments to be given"
|
||||
else:
|
||||
assert len(variants) > 0
|
||||
|
||||
# TODO: this error message is not deterministic
|
||||
missing = list(set(variants[0]) - given_params)
|
||||
if len(missing) > 1:
|
||||
|
|
@ -284,18 +292,15 @@ _V = TypeVar("_V")
|
|||
|
||||
|
||||
@overload
|
||||
def strip_not_given(obj: None) -> None:
|
||||
...
|
||||
def strip_not_given(obj: None) -> None: ...
|
||||
|
||||
|
||||
@overload
|
||||
def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]:
|
||||
...
|
||||
def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: ...
|
||||
|
||||
|
||||
@overload
|
||||
def strip_not_given(obj: object) -> object:
|
||||
...
|
||||
def strip_not_given(obj: object) -> object: ...
|
||||
|
||||
|
||||
def strip_not_given(obj: object | None) -> object:
|
||||
|
|
@ -367,13 +372,13 @@ def file_from_path(path: str) -> FileTypes:
|
|||
|
||||
def get_required_header(headers: HeadersLike, header: str) -> str:
|
||||
lower_header = header.lower()
|
||||
if isinstance(headers, Mapping):
|
||||
headers = cast(Headers, headers)
|
||||
for k, v in headers.items():
|
||||
if is_mapping_t(headers):
|
||||
# mypy doesn't understand the type narrowing here
|
||||
for k, v in headers.items(): # type: ignore
|
||||
if k.lower() == lower_header and isinstance(v, str):
|
||||
return v
|
||||
|
||||
""" to deal with the case where the header looks like Stainless-Event-Id """
|
||||
# to deal with the case where the header looks like Stainless-Event-Id
|
||||
intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize())
|
||||
|
||||
for normalized_header in [header, lower_header, header.upper(), intercaps_header]:
|
||||
|
|
@ -389,3 +394,29 @@ def get_async_library() -> str:
|
|||
return sniffio.current_async_library()
|
||||
except Exception:
|
||||
return "false"
|
||||
|
||||
|
||||
def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
|
||||
"""A version of functools.lru_cache that retains the type signature
|
||||
for the wrapped function arguments.
|
||||
"""
|
||||
wrapper = functools.lru_cache( # noqa: TID251
|
||||
maxsize=maxsize,
|
||||
)
|
||||
return cast(Any, wrapper) # type: ignore[no-any-return]
|
||||
|
||||
|
||||
def json_safe(data: object) -> object:
|
||||
"""Translates a mapping / sequence recursively in the same fashion
|
||||
as `pydantic` v2's `model_dump(mode="json")`.
|
||||
"""
|
||||
if is_mapping(data):
|
||||
return {json_safe(key): json_safe(value) for key, value in data.items()}
|
||||
|
||||
if is_iterable(data) and not isinstance(data, (str, bytes, bytearray)):
|
||||
return [json_safe(item) for item in data]
|
||||
|
||||
if isinstance(data, (datetime, date)):
|
||||
return data.isoformat()
|
||||
|
||||
return data
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
__title__ = "cloudflare"
|
||||
__version__ = "3.0.0-beta.4" # x-release-please-version
|
||||
__version__ = "4.3.1" # x-release-please-version
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Any, List, Type, Generic, Mapping, TypeVar, Optional, cast
|
||||
from typing import List, Generic, TypeVar, Optional, cast
|
||||
from typing_extensions import override
|
||||
|
||||
from httpx import Response
|
||||
|
||||
from ._utils import is_mapping
|
||||
from ._models import BaseModel, GenericModel
|
||||
from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage
|
||||
|
||||
|
|
@ -27,8 +24,6 @@ __all__ = [
|
|||
"AsyncSinglePage",
|
||||
]
|
||||
|
||||
_BaseModelT = TypeVar("_BaseModelT", bound=BaseModel)
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
|
|
@ -50,23 +45,17 @@ class SyncV4PagePagination(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def _get_page_items(self) -> List[_T]:
|
||||
items = None
|
||||
if self.result is not None:
|
||||
items = self.result.items
|
||||
if self.result.items is not None:
|
||||
items = self.result.items
|
||||
if not items:
|
||||
return []
|
||||
return items
|
||||
|
||||
@override
|
||||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
current_page = cast("int | None", self._options.params.get("page"))
|
||||
if current_page is None:
|
||||
current_page = 1
|
||||
last_page = cast("int | None", self._options.params.get("page")) or 1
|
||||
|
||||
last_page = cast("int | None", self._options.params.get("page"))
|
||||
if last_page is not None and current_page <= last_page:
|
||||
# The API didn't return a new page in the last request
|
||||
return None
|
||||
|
||||
return PageInfo(params={"page": current_page + 1})
|
||||
return PageInfo(params={"page": last_page + 1})
|
||||
|
||||
|
||||
class AsyncV4PagePagination(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
||||
|
|
@ -77,23 +66,17 @@ class AsyncV4PagePagination(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def _get_page_items(self) -> List[_T]:
|
||||
items = None
|
||||
if self.result is not None:
|
||||
items = self.result.items
|
||||
if self.result.items is not None:
|
||||
items = self.result.items
|
||||
if not items:
|
||||
return []
|
||||
return items
|
||||
|
||||
@override
|
||||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
current_page = cast("int | None", self._options.params.get("page"))
|
||||
if current_page is None:
|
||||
current_page = 1
|
||||
last_page = cast("int | None", self._options.params.get("page")) or 1
|
||||
|
||||
last_page = cast("int | None", self._options.params.get("page"))
|
||||
if last_page is not None and current_page <= last_page:
|
||||
# The API didn't return a new page in the last request
|
||||
return None
|
||||
|
||||
return PageInfo(params={"page": current_page + 1})
|
||||
return PageInfo(params={"page": last_page + 1})
|
||||
|
||||
|
||||
class V4PagePaginationArrayResultInfo(BaseModel):
|
||||
|
|
@ -115,16 +98,9 @@ class SyncV4PagePaginationArray(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
|
||||
@override
|
||||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
current_page = cast("int | None", self._options.params.get("page"))
|
||||
if current_page is None:
|
||||
current_page = 1
|
||||
last_page = cast("int | None", self._options.params.get("page")) or 1
|
||||
|
||||
last_page = cast("int | None", self._options.params.get("page"))
|
||||
if last_page is not None and current_page <= last_page:
|
||||
# The API didn't return a new page in the last request
|
||||
return None
|
||||
|
||||
return PageInfo(params={"page": current_page + 1})
|
||||
return PageInfo(params={"page": last_page + 1})
|
||||
|
||||
|
||||
class AsyncV4PagePaginationArray(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
||||
|
|
@ -140,16 +116,9 @@ class AsyncV4PagePaginationArray(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
|
||||
@override
|
||||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
current_page = cast("int | None", self._options.params.get("page"))
|
||||
if current_page is None:
|
||||
current_page = 1
|
||||
last_page = cast("int | None", self._options.params.get("page")) or 1
|
||||
|
||||
last_page = cast("int | None", self._options.params.get("page"))
|
||||
if last_page is not None and current_page <= last_page:
|
||||
# The API didn't return a new page in the last request
|
||||
return None
|
||||
|
||||
return PageInfo(params={"page": current_page + 1})
|
||||
return PageInfo(params={"page": last_page + 1})
|
||||
|
||||
|
||||
class CursorPaginationResultInfo(BaseModel):
|
||||
|
|
@ -175,7 +144,8 @@ class SyncCursorPagination(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
cursor = None
|
||||
if self.result_info is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if self.result_info.cursor is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if not cursor:
|
||||
return None
|
||||
|
||||
|
|
@ -197,7 +167,8 @@ class AsyncCursorPagination(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
cursor = None
|
||||
if self.result_info is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if self.result_info.cursor is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if not cursor:
|
||||
return None
|
||||
|
||||
|
|
@ -227,7 +198,8 @@ class SyncCursorLimitPagination(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
cursor = None
|
||||
if self.result_info is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if self.result_info.cursor is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if not cursor:
|
||||
return None
|
||||
|
||||
|
|
@ -249,7 +221,8 @@ class AsyncCursorLimitPagination(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
def next_page_info(self) -> Optional[PageInfo]:
|
||||
cursor = None
|
||||
if self.result_info is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if self.result_info.cursor is not None:
|
||||
cursor = self.result_info.cursor
|
||||
if not cursor:
|
||||
return None
|
||||
|
||||
|
|
@ -257,14 +230,14 @@ class AsyncCursorLimitPagination(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
|
||||
|
||||
class SyncSinglePage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
||||
items: List[_T]
|
||||
result: List[_T]
|
||||
|
||||
@override
|
||||
def _get_page_items(self) -> List[_T]:
|
||||
items = self.items
|
||||
if not items:
|
||||
result = self.result
|
||||
if not result:
|
||||
return []
|
||||
return items
|
||||
return result
|
||||
|
||||
@override
|
||||
def next_page_info(self) -> None:
|
||||
|
|
@ -274,25 +247,16 @@ class SyncSinglePage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
"""
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003
|
||||
return cls.construct(
|
||||
None,
|
||||
**{
|
||||
**(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class AsyncSinglePage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
||||
items: List[_T]
|
||||
result: List[_T]
|
||||
|
||||
@override
|
||||
def _get_page_items(self) -> List[_T]:
|
||||
items = self.items
|
||||
if not items:
|
||||
result = self.result
|
||||
if not result:
|
||||
return []
|
||||
return items
|
||||
return result
|
||||
|
||||
@override
|
||||
def next_page_info(self) -> None:
|
||||
|
|
@ -301,12 +265,3 @@ class AsyncSinglePage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|||
so there will never be a next page.
|
||||
"""
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003
|
||||
return cls.construct(
|
||||
None,
|
||||
**{
|
||||
**(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
2967
src/cloudflare/resources/abuse_reports.py
Normal file
2967
src/cloudflare/resources/abuse_reports.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,47 +1,89 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .logs import (
|
||||
LogsResource,
|
||||
AsyncLogsResource,
|
||||
LogsResourceWithRawResponse,
|
||||
AsyncLogsResourceWithRawResponse,
|
||||
LogsResourceWithStreamingResponse,
|
||||
AsyncLogsResourceWithStreamingResponse,
|
||||
)
|
||||
from .roles import (
|
||||
Roles,
|
||||
AsyncRoles,
|
||||
RolesWithRawResponse,
|
||||
AsyncRolesWithRawResponse,
|
||||
RolesWithStreamingResponse,
|
||||
AsyncRolesWithStreamingResponse,
|
||||
RolesResource,
|
||||
AsyncRolesResource,
|
||||
RolesResourceWithRawResponse,
|
||||
AsyncRolesResourceWithRawResponse,
|
||||
RolesResourceWithStreamingResponse,
|
||||
AsyncRolesResourceWithStreamingResponse,
|
||||
)
|
||||
from .tokens import (
|
||||
TokensResource,
|
||||
AsyncTokensResource,
|
||||
TokensResourceWithRawResponse,
|
||||
AsyncTokensResourceWithRawResponse,
|
||||
TokensResourceWithStreamingResponse,
|
||||
AsyncTokensResourceWithStreamingResponse,
|
||||
)
|
||||
from .members import (
|
||||
Members,
|
||||
AsyncMembers,
|
||||
MembersWithRawResponse,
|
||||
AsyncMembersWithRawResponse,
|
||||
MembersWithStreamingResponse,
|
||||
AsyncMembersWithStreamingResponse,
|
||||
MembersResource,
|
||||
AsyncMembersResource,
|
||||
MembersResourceWithRawResponse,
|
||||
AsyncMembersResourceWithRawResponse,
|
||||
MembersResourceWithStreamingResponse,
|
||||
AsyncMembersResourceWithStreamingResponse,
|
||||
)
|
||||
from .accounts import (
|
||||
Accounts,
|
||||
AsyncAccounts,
|
||||
AccountsWithRawResponse,
|
||||
AsyncAccountsWithRawResponse,
|
||||
AccountsWithStreamingResponse,
|
||||
AsyncAccountsWithStreamingResponse,
|
||||
AccountsResource,
|
||||
AsyncAccountsResource,
|
||||
AccountsResourceWithRawResponse,
|
||||
AsyncAccountsResourceWithRawResponse,
|
||||
AccountsResourceWithStreamingResponse,
|
||||
AsyncAccountsResourceWithStreamingResponse,
|
||||
)
|
||||
from .subscriptions import (
|
||||
SubscriptionsResource,
|
||||
AsyncSubscriptionsResource,
|
||||
SubscriptionsResourceWithRawResponse,
|
||||
AsyncSubscriptionsResourceWithRawResponse,
|
||||
SubscriptionsResourceWithStreamingResponse,
|
||||
AsyncSubscriptionsResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Members",
|
||||
"AsyncMembers",
|
||||
"MembersWithRawResponse",
|
||||
"AsyncMembersWithRawResponse",
|
||||
"MembersWithStreamingResponse",
|
||||
"AsyncMembersWithStreamingResponse",
|
||||
"Roles",
|
||||
"AsyncRoles",
|
||||
"RolesWithRawResponse",
|
||||
"AsyncRolesWithRawResponse",
|
||||
"RolesWithStreamingResponse",
|
||||
"AsyncRolesWithStreamingResponse",
|
||||
"Accounts",
|
||||
"AsyncAccounts",
|
||||
"AccountsWithRawResponse",
|
||||
"AsyncAccountsWithRawResponse",
|
||||
"AccountsWithStreamingResponse",
|
||||
"AsyncAccountsWithStreamingResponse",
|
||||
"MembersResource",
|
||||
"AsyncMembersResource",
|
||||
"MembersResourceWithRawResponse",
|
||||
"AsyncMembersResourceWithRawResponse",
|
||||
"MembersResourceWithStreamingResponse",
|
||||
"AsyncMembersResourceWithStreamingResponse",
|
||||
"RolesResource",
|
||||
"AsyncRolesResource",
|
||||
"RolesResourceWithRawResponse",
|
||||
"AsyncRolesResourceWithRawResponse",
|
||||
"RolesResourceWithStreamingResponse",
|
||||
"AsyncRolesResourceWithStreamingResponse",
|
||||
"SubscriptionsResource",
|
||||
"AsyncSubscriptionsResource",
|
||||
"SubscriptionsResourceWithRawResponse",
|
||||
"AsyncSubscriptionsResourceWithRawResponse",
|
||||
"SubscriptionsResourceWithStreamingResponse",
|
||||
"AsyncSubscriptionsResourceWithStreamingResponse",
|
||||
"TokensResource",
|
||||
"AsyncTokensResource",
|
||||
"TokensResourceWithRawResponse",
|
||||
"AsyncTokensResourceWithRawResponse",
|
||||
"TokensResourceWithStreamingResponse",
|
||||
"AsyncTokensResourceWithStreamingResponse",
|
||||
"LogsResource",
|
||||
"AsyncLogsResource",
|
||||
"LogsResourceWithRawResponse",
|
||||
"AsyncLogsResourceWithRawResponse",
|
||||
"LogsResourceWithStreamingResponse",
|
||||
"AsyncLogsResourceWithStreamingResponse",
|
||||
"AccountsResource",
|
||||
"AsyncAccountsResource",
|
||||
"AccountsResourceWithRawResponse",
|
||||
"AsyncAccountsResourceWithRawResponse",
|
||||
"AccountsResourceWithStreamingResponse",
|
||||
"AsyncAccountsResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2,39 +2,38 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, cast
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from .roles import (
|
||||
Roles,
|
||||
AsyncRoles,
|
||||
RolesWithRawResponse,
|
||||
AsyncRolesWithRawResponse,
|
||||
RolesWithStreamingResponse,
|
||||
AsyncRolesWithStreamingResponse,
|
||||
)
|
||||
from ...types import (
|
||||
AccountGetResponse,
|
||||
AccountUpdateResponse,
|
||||
account_list_params,
|
||||
account_update_params,
|
||||
RolesResource,
|
||||
AsyncRolesResource,
|
||||
RolesResourceWithRawResponse,
|
||||
AsyncRolesResourceWithRawResponse,
|
||||
RolesResourceWithStreamingResponse,
|
||||
AsyncRolesResourceWithStreamingResponse,
|
||||
)
|
||||
from .members import (
|
||||
Members,
|
||||
AsyncMembers,
|
||||
MembersWithRawResponse,
|
||||
AsyncMembersWithRawResponse,
|
||||
MembersWithStreamingResponse,
|
||||
AsyncMembersWithStreamingResponse,
|
||||
MembersResource,
|
||||
AsyncMembersResource,
|
||||
MembersResourceWithRawResponse,
|
||||
AsyncMembersResourceWithRawResponse,
|
||||
MembersResourceWithStreamingResponse,
|
||||
AsyncMembersResourceWithStreamingResponse,
|
||||
)
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._utils import maybe_transform, async_maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from .logs.logs import (
|
||||
LogsResource,
|
||||
AsyncLogsResource,
|
||||
LogsResourceWithRawResponse,
|
||||
AsyncLogsResourceWithRawResponse,
|
||||
LogsResourceWithStreamingResponse,
|
||||
AsyncLogsResourceWithStreamingResponse,
|
||||
)
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
|
|
@ -44,35 +43,129 @@ from ..._response import (
|
|||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ..._base_client import (
|
||||
AsyncPaginator,
|
||||
make_request_options,
|
||||
from .subscriptions import (
|
||||
SubscriptionsResource,
|
||||
AsyncSubscriptionsResource,
|
||||
SubscriptionsResourceWithRawResponse,
|
||||
AsyncSubscriptionsResourceWithRawResponse,
|
||||
SubscriptionsResourceWithStreamingResponse,
|
||||
AsyncSubscriptionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .tokens.tokens import (
|
||||
TokensResource,
|
||||
AsyncTokensResource,
|
||||
TokensResourceWithRawResponse,
|
||||
AsyncTokensResourceWithRawResponse,
|
||||
TokensResourceWithStreamingResponse,
|
||||
AsyncTokensResourceWithStreamingResponse,
|
||||
)
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.accounts import account_list_params, account_create_params, account_update_params
|
||||
from ...types.accounts.account import Account
|
||||
from ...types.accounts.account_delete_response import AccountDeleteResponse
|
||||
|
||||
__all__ = ["Accounts", "AsyncAccounts"]
|
||||
__all__ = ["AccountsResource", "AsyncAccountsResource"]
|
||||
|
||||
|
||||
class Accounts(SyncAPIResource):
|
||||
class AccountsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def members(self) -> Members:
|
||||
return Members(self._client)
|
||||
def members(self) -> MembersResource:
|
||||
return MembersResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> Roles:
|
||||
return Roles(self._client)
|
||||
def roles(self) -> RolesResource:
|
||||
return RolesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AccountsWithRawResponse:
|
||||
return AccountsWithRawResponse(self)
|
||||
def subscriptions(self) -> SubscriptionsResource:
|
||||
return SubscriptionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AccountsWithStreamingResponse:
|
||||
return AccountsWithStreamingResponse(self)
|
||||
def tokens(self) -> TokensResource:
|
||||
return TokensResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> LogsResource:
|
||||
return LogsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AccountsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AccountsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AccountsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
type: Literal["standard", "enterprise"],
|
||||
unit: account_create_params.Unit | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Create an account (only available for tenant admins at this time)
|
||||
|
||||
Args:
|
||||
name: Account name
|
||||
|
||||
type: the type of account being created. For self-serve customers, use standard. for
|
||||
enterprise customers, use enterprise.
|
||||
|
||||
unit: information related to the tenant unit, and optionally, an id of the unit to
|
||||
create the account on. see
|
||||
https://developers.cloudflare.com/tenant/how-to/manage-accounts/
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return self._post(
|
||||
"/accounts",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"type": type,
|
||||
"unit": unit,
|
||||
},
|
||||
account_create_params.AccountCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
id: str,
|
||||
name: str,
|
||||
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -81,11 +174,15 @@ class Accounts(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountUpdateResponse:
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Update an existing account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
id: Identifier
|
||||
|
||||
name: Account name
|
||||
|
||||
settings: Account settings
|
||||
|
|
@ -98,34 +195,33 @@ class Accounts(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
AccountUpdateResponse,
|
||||
self._put(
|
||||
f"/accounts/{account_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"settings": settings,
|
||||
},
|
||||
account_update_params.AccountUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"id": id,
|
||||
"name": name,
|
||||
"settings": settings,
|
||||
},
|
||||
account_update_params.AccountUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
name: str | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -134,13 +230,15 @@ class Accounts(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncV4PagePaginationArray[object]:
|
||||
) -> SyncV4PagePaginationArray[Account]:
|
||||
"""
|
||||
List all accounts you have ownership or verified access to.
|
||||
|
||||
Args:
|
||||
direction: Direction to order results.
|
||||
|
||||
name: Name of the account.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Maximum number of results per page.
|
||||
|
|
@ -155,7 +253,7 @@ class Accounts(SyncAPIResource):
|
|||
"""
|
||||
return self._get_api_list(
|
||||
"/accounts",
|
||||
page=SyncV4PagePaginationArray[object],
|
||||
page=SyncV4PagePaginationArray[Account],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -164,30 +262,75 @@ class Accounts(SyncAPIResource):
|
|||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"name": name,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
account_list_params.AccountListParams,
|
||||
),
|
||||
),
|
||||
model=object,
|
||||
model=Account,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AccountDeleteResponse]:
|
||||
"""Delete a specific account (only available for tenant admins at this time).
|
||||
|
||||
This
|
||||
is a permanent operation that will delete any zones or other resources under the
|
||||
account
|
||||
|
||||
Args:
|
||||
account_id: The account ID of the account to be deleted
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AccountDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AccountDeleteResponse]], ResultWrapper[AccountDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountGetResponse:
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Get information about a specific account that you are a member of.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -196,45 +339,120 @@ class Accounts(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
AccountGetResponse,
|
||||
self._get(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAccounts(AsyncAPIResource):
|
||||
class AsyncAccountsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def members(self) -> AsyncMembers:
|
||||
return AsyncMembers(self._client)
|
||||
def members(self) -> AsyncMembersResource:
|
||||
return AsyncMembersResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> AsyncRoles:
|
||||
return AsyncRoles(self._client)
|
||||
def roles(self) -> AsyncRolesResource:
|
||||
return AsyncRolesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAccountsWithRawResponse:
|
||||
return AsyncAccountsWithRawResponse(self)
|
||||
def subscriptions(self) -> AsyncSubscriptionsResource:
|
||||
return AsyncSubscriptionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAccountsWithStreamingResponse:
|
||||
return AsyncAccountsWithStreamingResponse(self)
|
||||
def tokens(self) -> AsyncTokensResource:
|
||||
return AsyncTokensResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> AsyncLogsResource:
|
||||
return AsyncLogsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAccountsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAccountsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
type: Literal["standard", "enterprise"],
|
||||
unit: account_create_params.Unit | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Create an account (only available for tenant admins at this time)
|
||||
|
||||
Args:
|
||||
name: Account name
|
||||
|
||||
type: the type of account being created. For self-serve customers, use standard. for
|
||||
enterprise customers, use enterprise.
|
||||
|
||||
unit: information related to the tenant unit, and optionally, an id of the unit to
|
||||
create the account on. see
|
||||
https://developers.cloudflare.com/tenant/how-to/manage-accounts/
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return await self._post(
|
||||
"/accounts",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"type": type,
|
||||
"unit": unit,
|
||||
},
|
||||
account_create_params.AccountCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
id: str,
|
||||
name: str,
|
||||
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -243,11 +461,15 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountUpdateResponse:
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Update an existing account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
id: Identifier
|
||||
|
||||
name: Account name
|
||||
|
||||
settings: Account settings
|
||||
|
|
@ -260,34 +482,33 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
AccountUpdateResponse,
|
||||
await self._put(
|
||||
f"/accounts/{account_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"settings": settings,
|
||||
},
|
||||
account_update_params.AccountUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"id": id,
|
||||
"name": name,
|
||||
"settings": settings,
|
||||
},
|
||||
account_update_params.AccountUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
name: str | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
|
|
@ -296,13 +517,15 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]:
|
||||
) -> AsyncPaginator[Account, AsyncV4PagePaginationArray[Account]]:
|
||||
"""
|
||||
List all accounts you have ownership or verified access to.
|
||||
|
||||
Args:
|
||||
direction: Direction to order results.
|
||||
|
||||
name: Name of the account.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Maximum number of results per page.
|
||||
|
|
@ -317,7 +540,7 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
"""
|
||||
return self._get_api_list(
|
||||
"/accounts",
|
||||
page=AsyncV4PagePaginationArray[object],
|
||||
page=AsyncV4PagePaginationArray[Account],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -326,30 +549,36 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"name": name,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
account_list_params.AccountListParams,
|
||||
),
|
||||
),
|
||||
model=object,
|
||||
model=Account,
|
||||
)
|
||||
|
||||
async def get(
|
||||
async def delete(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountGetResponse:
|
||||
"""
|
||||
Get information about a specific account that you are a member of.
|
||||
) -> Optional[AccountDeleteResponse]:
|
||||
"""Delete a specific account (only available for tenant admins at this time).
|
||||
|
||||
This
|
||||
is a permanent operation that will delete any zones or other resources under the
|
||||
account
|
||||
|
||||
Args:
|
||||
account_id: The account ID of the account to be deleted
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -358,111 +587,219 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
AccountGetResponse,
|
||||
await self._get(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AccountDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AccountDeleteResponse]], ResultWrapper[AccountDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Account]:
|
||||
"""
|
||||
Get information about a specific account that you are a member of.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Account]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Account]], ResultWrapper[Account]),
|
||||
)
|
||||
|
||||
|
||||
class AccountsWithRawResponse:
|
||||
def __init__(self, accounts: Accounts) -> None:
|
||||
class AccountsResourceWithRawResponse:
|
||||
def __init__(self, accounts: AccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
accounts.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
accounts.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
accounts.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
accounts.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
accounts.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def members(self) -> MembersWithRawResponse:
|
||||
return MembersWithRawResponse(self._accounts.members)
|
||||
def members(self) -> MembersResourceWithRawResponse:
|
||||
return MembersResourceWithRawResponse(self._accounts.members)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> RolesWithRawResponse:
|
||||
return RolesWithRawResponse(self._accounts.roles)
|
||||
def roles(self) -> RolesResourceWithRawResponse:
|
||||
return RolesResourceWithRawResponse(self._accounts.roles)
|
||||
|
||||
@cached_property
|
||||
def subscriptions(self) -> SubscriptionsResourceWithRawResponse:
|
||||
return SubscriptionsResourceWithRawResponse(self._accounts.subscriptions)
|
||||
|
||||
@cached_property
|
||||
def tokens(self) -> TokensResourceWithRawResponse:
|
||||
return TokensResourceWithRawResponse(self._accounts.tokens)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> LogsResourceWithRawResponse:
|
||||
return LogsResourceWithRawResponse(self._accounts.logs)
|
||||
|
||||
|
||||
class AsyncAccountsWithRawResponse:
|
||||
def __init__(self, accounts: AsyncAccounts) -> None:
|
||||
class AsyncAccountsResourceWithRawResponse:
|
||||
def __init__(self, accounts: AsyncAccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
accounts.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
accounts.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
accounts.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
accounts.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
accounts.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def members(self) -> AsyncMembersWithRawResponse:
|
||||
return AsyncMembersWithRawResponse(self._accounts.members)
|
||||
def members(self) -> AsyncMembersResourceWithRawResponse:
|
||||
return AsyncMembersResourceWithRawResponse(self._accounts.members)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> AsyncRolesWithRawResponse:
|
||||
return AsyncRolesWithRawResponse(self._accounts.roles)
|
||||
def roles(self) -> AsyncRolesResourceWithRawResponse:
|
||||
return AsyncRolesResourceWithRawResponse(self._accounts.roles)
|
||||
|
||||
@cached_property
|
||||
def subscriptions(self) -> AsyncSubscriptionsResourceWithRawResponse:
|
||||
return AsyncSubscriptionsResourceWithRawResponse(self._accounts.subscriptions)
|
||||
|
||||
@cached_property
|
||||
def tokens(self) -> AsyncTokensResourceWithRawResponse:
|
||||
return AsyncTokensResourceWithRawResponse(self._accounts.tokens)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> AsyncLogsResourceWithRawResponse:
|
||||
return AsyncLogsResourceWithRawResponse(self._accounts.logs)
|
||||
|
||||
|
||||
class AccountsWithStreamingResponse:
|
||||
def __init__(self, accounts: Accounts) -> None:
|
||||
class AccountsResourceWithStreamingResponse:
|
||||
def __init__(self, accounts: AccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
accounts.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
accounts.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
accounts.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
accounts.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
accounts.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def members(self) -> MembersWithStreamingResponse:
|
||||
return MembersWithStreamingResponse(self._accounts.members)
|
||||
def members(self) -> MembersResourceWithStreamingResponse:
|
||||
return MembersResourceWithStreamingResponse(self._accounts.members)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> RolesWithStreamingResponse:
|
||||
return RolesWithStreamingResponse(self._accounts.roles)
|
||||
def roles(self) -> RolesResourceWithStreamingResponse:
|
||||
return RolesResourceWithStreamingResponse(self._accounts.roles)
|
||||
|
||||
@cached_property
|
||||
def subscriptions(self) -> SubscriptionsResourceWithStreamingResponse:
|
||||
return SubscriptionsResourceWithStreamingResponse(self._accounts.subscriptions)
|
||||
|
||||
@cached_property
|
||||
def tokens(self) -> TokensResourceWithStreamingResponse:
|
||||
return TokensResourceWithStreamingResponse(self._accounts.tokens)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> LogsResourceWithStreamingResponse:
|
||||
return LogsResourceWithStreamingResponse(self._accounts.logs)
|
||||
|
||||
|
||||
class AsyncAccountsWithStreamingResponse:
|
||||
def __init__(self, accounts: AsyncAccounts) -> None:
|
||||
class AsyncAccountsResourceWithStreamingResponse:
|
||||
def __init__(self, accounts: AsyncAccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
accounts.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
accounts.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
accounts.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
accounts.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
accounts.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def members(self) -> AsyncMembersWithStreamingResponse:
|
||||
return AsyncMembersWithStreamingResponse(self._accounts.members)
|
||||
def members(self) -> AsyncMembersResourceWithStreamingResponse:
|
||||
return AsyncMembersResourceWithStreamingResponse(self._accounts.members)
|
||||
|
||||
@cached_property
|
||||
def roles(self) -> AsyncRolesWithStreamingResponse:
|
||||
return AsyncRolesWithStreamingResponse(self._accounts.roles)
|
||||
def roles(self) -> AsyncRolesResourceWithStreamingResponse:
|
||||
return AsyncRolesResourceWithStreamingResponse(self._accounts.roles)
|
||||
|
||||
@cached_property
|
||||
def subscriptions(self) -> AsyncSubscriptionsResourceWithStreamingResponse:
|
||||
return AsyncSubscriptionsResourceWithStreamingResponse(self._accounts.subscriptions)
|
||||
|
||||
@cached_property
|
||||
def tokens(self) -> AsyncTokensResourceWithStreamingResponse:
|
||||
return AsyncTokensResourceWithStreamingResponse(self._accounts.tokens)
|
||||
|
||||
@cached_property
|
||||
def logs(self) -> AsyncLogsResourceWithStreamingResponse:
|
||||
return AsyncLogsResourceWithStreamingResponse(self._accounts.logs)
|
||||
|
|
|
|||
33
src/cloudflare/resources/accounts/logs/__init__.py
Normal file
33
src/cloudflare/resources/accounts/logs/__init__.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .logs import (
|
||||
LogsResource,
|
||||
AsyncLogsResource,
|
||||
LogsResourceWithRawResponse,
|
||||
AsyncLogsResourceWithRawResponse,
|
||||
LogsResourceWithStreamingResponse,
|
||||
AsyncLogsResourceWithStreamingResponse,
|
||||
)
|
||||
from .audit import (
|
||||
AuditResource,
|
||||
AsyncAuditResource,
|
||||
AuditResourceWithRawResponse,
|
||||
AsyncAuditResourceWithRawResponse,
|
||||
AuditResourceWithStreamingResponse,
|
||||
AsyncAuditResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"AuditResource",
|
||||
"AsyncAuditResource",
|
||||
"AuditResourceWithRawResponse",
|
||||
"AsyncAuditResourceWithRawResponse",
|
||||
"AuditResourceWithStreamingResponse",
|
||||
"AsyncAuditResourceWithStreamingResponse",
|
||||
"LogsResource",
|
||||
"AsyncLogsResource",
|
||||
"LogsResourceWithRawResponse",
|
||||
"AsyncLogsResourceWithRawResponse",
|
||||
"LogsResourceWithStreamingResponse",
|
||||
"AsyncLogsResourceWithStreamingResponse",
|
||||
]
|
||||
342
src/cloudflare/resources/accounts/logs/audit.py
Normal file
342
src/cloudflare/resources/accounts/logs/audit.py
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Union
|
||||
from datetime import date
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.accounts.logs import audit_list_params
|
||||
from ....types.accounts.logs.audit_list_response import AuditListResponse
|
||||
|
||||
__all__ = ["AuditResource", "AsyncAuditResource"]
|
||||
|
||||
|
||||
class AuditResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AuditResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AuditResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AuditResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AuditResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
before: Union[str, date],
|
||||
since: Union[str, date],
|
||||
account_name: audit_list_params.AccountName | NotGiven = NOT_GIVEN,
|
||||
action_result: audit_list_params.ActionResult | NotGiven = NOT_GIVEN,
|
||||
action_type: audit_list_params.ActionType | NotGiven = NOT_GIVEN,
|
||||
actor_context: audit_list_params.ActorContext | NotGiven = NOT_GIVEN,
|
||||
actor_email: audit_list_params.ActorEmail | NotGiven = NOT_GIVEN,
|
||||
actor_id: audit_list_params.ActorID | NotGiven = NOT_GIVEN,
|
||||
actor_ip_address: audit_list_params.ActorIPAddress | NotGiven = NOT_GIVEN,
|
||||
actor_token_id: audit_list_params.ActorTokenID | NotGiven = NOT_GIVEN,
|
||||
actor_token_name: audit_list_params.ActorTokenName | NotGiven = NOT_GIVEN,
|
||||
actor_type: audit_list_params.ActorType | NotGiven = NOT_GIVEN,
|
||||
audit_log_id: audit_list_params.AuditLogID | NotGiven = NOT_GIVEN,
|
||||
cursor: str | NotGiven = NOT_GIVEN,
|
||||
direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN,
|
||||
limit: float | NotGiven = NOT_GIVEN,
|
||||
raw_cf_rayid: audit_list_params.RawCfRayID | NotGiven = NOT_GIVEN,
|
||||
raw_method: audit_list_params.RawMethod | NotGiven = NOT_GIVEN,
|
||||
raw_status_code: audit_list_params.RawStatusCode | NotGiven = NOT_GIVEN,
|
||||
raw_uri: audit_list_params.RawURI | NotGiven = NOT_GIVEN,
|
||||
resource_id: audit_list_params.ResourceID | NotGiven = NOT_GIVEN,
|
||||
resource_product: audit_list_params.ResourceProduct | NotGiven = NOT_GIVEN,
|
||||
resource_scope: audit_list_params.ResourceScope | NotGiven = NOT_GIVEN,
|
||||
resource_type: audit_list_params.ResourceType | NotGiven = NOT_GIVEN,
|
||||
zone_id: audit_list_params.ZoneID | NotGiven = NOT_GIVEN,
|
||||
zone_name: audit_list_params.ZoneName | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncCursorLimitPagination[AuditListResponse]:
|
||||
"""Gets a list of audit logs for an account.
|
||||
|
||||
<br /> <br /> This is the beta release
|
||||
of Audit Logs Version 2. Since this is a beta version, there may be gaps or
|
||||
missing entries in the available audit logs. Be aware of the following
|
||||
limitations. <br /> <ul> <li>Audit logs are available only for the past 30 days.
|
||||
<br /></li> <li>Error handling is not yet implemented. <br /> </li> </ul>
|
||||
|
||||
Args:
|
||||
account_id: The unique id that identifies the account.
|
||||
|
||||
before: Limits the returned results to logs older than the specified date. This can be a
|
||||
date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that
|
||||
conforms to RFC3339.
|
||||
|
||||
since: Limits the returned results to logs newer than the specified date. This can be a
|
||||
date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that
|
||||
conforms to RFC3339.
|
||||
|
||||
cursor: The cursor is an opaque token used to paginate through large sets of records. It
|
||||
indicates the position from which to continue when requesting the next set of
|
||||
records. A valid cursor value can be obtained from the cursor object in the
|
||||
result_info structure of a previous response.
|
||||
|
||||
direction: Sets sorting order.
|
||||
|
||||
limit: The number limits the objects to return. The cursor attribute may be used to
|
||||
iterate over the next batch of objects if there are more than the limit.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/logs/audit",
|
||||
page=SyncCursorLimitPagination[AuditListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"before": before,
|
||||
"since": since,
|
||||
"account_name": account_name,
|
||||
"action_result": action_result,
|
||||
"action_type": action_type,
|
||||
"actor_context": actor_context,
|
||||
"actor_email": actor_email,
|
||||
"actor_id": actor_id,
|
||||
"actor_ip_address": actor_ip_address,
|
||||
"actor_token_id": actor_token_id,
|
||||
"actor_token_name": actor_token_name,
|
||||
"actor_type": actor_type,
|
||||
"audit_log_id": audit_log_id,
|
||||
"cursor": cursor,
|
||||
"direction": direction,
|
||||
"limit": limit,
|
||||
"raw_cf_rayid": raw_cf_rayid,
|
||||
"raw_method": raw_method,
|
||||
"raw_status_code": raw_status_code,
|
||||
"raw_uri": raw_uri,
|
||||
"resource_id": resource_id,
|
||||
"resource_product": resource_product,
|
||||
"resource_scope": resource_scope,
|
||||
"resource_type": resource_type,
|
||||
"zone_id": zone_id,
|
||||
"zone_name": zone_name,
|
||||
},
|
||||
audit_list_params.AuditListParams,
|
||||
),
|
||||
),
|
||||
model=AuditListResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAuditResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAuditResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAuditResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAuditResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
before: Union[str, date],
|
||||
since: Union[str, date],
|
||||
account_name: audit_list_params.AccountName | NotGiven = NOT_GIVEN,
|
||||
action_result: audit_list_params.ActionResult | NotGiven = NOT_GIVEN,
|
||||
action_type: audit_list_params.ActionType | NotGiven = NOT_GIVEN,
|
||||
actor_context: audit_list_params.ActorContext | NotGiven = NOT_GIVEN,
|
||||
actor_email: audit_list_params.ActorEmail | NotGiven = NOT_GIVEN,
|
||||
actor_id: audit_list_params.ActorID | NotGiven = NOT_GIVEN,
|
||||
actor_ip_address: audit_list_params.ActorIPAddress | NotGiven = NOT_GIVEN,
|
||||
actor_token_id: audit_list_params.ActorTokenID | NotGiven = NOT_GIVEN,
|
||||
actor_token_name: audit_list_params.ActorTokenName | NotGiven = NOT_GIVEN,
|
||||
actor_type: audit_list_params.ActorType | NotGiven = NOT_GIVEN,
|
||||
audit_log_id: audit_list_params.AuditLogID | NotGiven = NOT_GIVEN,
|
||||
cursor: str | NotGiven = NOT_GIVEN,
|
||||
direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN,
|
||||
limit: float | NotGiven = NOT_GIVEN,
|
||||
raw_cf_rayid: audit_list_params.RawCfRayID | NotGiven = NOT_GIVEN,
|
||||
raw_method: audit_list_params.RawMethod | NotGiven = NOT_GIVEN,
|
||||
raw_status_code: audit_list_params.RawStatusCode | NotGiven = NOT_GIVEN,
|
||||
raw_uri: audit_list_params.RawURI | NotGiven = NOT_GIVEN,
|
||||
resource_id: audit_list_params.ResourceID | NotGiven = NOT_GIVEN,
|
||||
resource_product: audit_list_params.ResourceProduct | NotGiven = NOT_GIVEN,
|
||||
resource_scope: audit_list_params.ResourceScope | NotGiven = NOT_GIVEN,
|
||||
resource_type: audit_list_params.ResourceType | NotGiven = NOT_GIVEN,
|
||||
zone_id: audit_list_params.ZoneID | NotGiven = NOT_GIVEN,
|
||||
zone_name: audit_list_params.ZoneName | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[AuditListResponse, AsyncCursorLimitPagination[AuditListResponse]]:
|
||||
"""Gets a list of audit logs for an account.
|
||||
|
||||
<br /> <br /> This is the beta release
|
||||
of Audit Logs Version 2. Since this is a beta version, there may be gaps or
|
||||
missing entries in the available audit logs. Be aware of the following
|
||||
limitations. <br /> <ul> <li>Audit logs are available only for the past 30 days.
|
||||
<br /></li> <li>Error handling is not yet implemented. <br /> </li> </ul>
|
||||
|
||||
Args:
|
||||
account_id: The unique id that identifies the account.
|
||||
|
||||
before: Limits the returned results to logs older than the specified date. This can be a
|
||||
date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that
|
||||
conforms to RFC3339.
|
||||
|
||||
since: Limits the returned results to logs newer than the specified date. This can be a
|
||||
date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that
|
||||
conforms to RFC3339.
|
||||
|
||||
cursor: The cursor is an opaque token used to paginate through large sets of records. It
|
||||
indicates the position from which to continue when requesting the next set of
|
||||
records. A valid cursor value can be obtained from the cursor object in the
|
||||
result_info structure of a previous response.
|
||||
|
||||
direction: Sets sorting order.
|
||||
|
||||
limit: The number limits the objects to return. The cursor attribute may be used to
|
||||
iterate over the next batch of objects if there are more than the limit.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/logs/audit",
|
||||
page=AsyncCursorLimitPagination[AuditListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"before": before,
|
||||
"since": since,
|
||||
"account_name": account_name,
|
||||
"action_result": action_result,
|
||||
"action_type": action_type,
|
||||
"actor_context": actor_context,
|
||||
"actor_email": actor_email,
|
||||
"actor_id": actor_id,
|
||||
"actor_ip_address": actor_ip_address,
|
||||
"actor_token_id": actor_token_id,
|
||||
"actor_token_name": actor_token_name,
|
||||
"actor_type": actor_type,
|
||||
"audit_log_id": audit_log_id,
|
||||
"cursor": cursor,
|
||||
"direction": direction,
|
||||
"limit": limit,
|
||||
"raw_cf_rayid": raw_cf_rayid,
|
||||
"raw_method": raw_method,
|
||||
"raw_status_code": raw_status_code,
|
||||
"raw_uri": raw_uri,
|
||||
"resource_id": resource_id,
|
||||
"resource_product": resource_product,
|
||||
"resource_scope": resource_scope,
|
||||
"resource_type": resource_type,
|
||||
"zone_id": zone_id,
|
||||
"zone_name": zone_name,
|
||||
},
|
||||
audit_list_params.AuditListParams,
|
||||
),
|
||||
),
|
||||
model=AuditListResponse,
|
||||
)
|
||||
|
||||
|
||||
class AuditResourceWithRawResponse:
|
||||
def __init__(self, audit: AuditResource) -> None:
|
||||
self._audit = audit
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
audit.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAuditResourceWithRawResponse:
|
||||
def __init__(self, audit: AsyncAuditResource) -> None:
|
||||
self._audit = audit
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
audit.list,
|
||||
)
|
||||
|
||||
|
||||
class AuditResourceWithStreamingResponse:
|
||||
def __init__(self, audit: AuditResource) -> None:
|
||||
self._audit = audit
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
audit.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAuditResourceWithStreamingResponse:
|
||||
def __init__(self, audit: AsyncAuditResource) -> None:
|
||||
self._audit = audit
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
audit.list,
|
||||
)
|
||||
102
src/cloudflare/resources/accounts/logs/logs.py
Normal file
102
src/cloudflare/resources/accounts/logs/logs.py
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .audit import (
|
||||
AuditResource,
|
||||
AsyncAuditResource,
|
||||
AuditResourceWithRawResponse,
|
||||
AsyncAuditResourceWithRawResponse,
|
||||
AuditResourceWithStreamingResponse,
|
||||
AsyncAuditResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
|
||||
__all__ = ["LogsResource", "AsyncLogsResource"]
|
||||
|
||||
|
||||
class LogsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def audit(self) -> AuditResource:
|
||||
return AuditResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> LogsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return LogsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> LogsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return LogsResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncLogsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def audit(self) -> AsyncAuditResource:
|
||||
return AsyncAuditResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncLogsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncLogsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncLogsResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class LogsResourceWithRawResponse:
|
||||
def __init__(self, logs: LogsResource) -> None:
|
||||
self._logs = logs
|
||||
|
||||
@cached_property
|
||||
def audit(self) -> AuditResourceWithRawResponse:
|
||||
return AuditResourceWithRawResponse(self._logs.audit)
|
||||
|
||||
|
||||
class AsyncLogsResourceWithRawResponse:
|
||||
def __init__(self, logs: AsyncLogsResource) -> None:
|
||||
self._logs = logs
|
||||
|
||||
@cached_property
|
||||
def audit(self) -> AsyncAuditResourceWithRawResponse:
|
||||
return AsyncAuditResourceWithRawResponse(self._logs.audit)
|
||||
|
||||
|
||||
class LogsResourceWithStreamingResponse:
|
||||
def __init__(self, logs: LogsResource) -> None:
|
||||
self._logs = logs
|
||||
|
||||
@cached_property
|
||||
def audit(self) -> AuditResourceWithStreamingResponse:
|
||||
return AuditResourceWithStreamingResponse(self._logs.audit)
|
||||
|
||||
|
||||
class AsyncLogsResourceWithStreamingResponse:
|
||||
def __init__(self, logs: AsyncLogsResource) -> None:
|
||||
self._logs = logs
|
||||
|
||||
@cached_property
|
||||
def audit(self) -> AsyncAuditResourceWithStreamingResponse:
|
||||
return AsyncAuditResourceWithStreamingResponse(self._logs.audit)
|
||||
|
|
@ -3,15 +3,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import List, Type, Iterable, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, overload
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._utils import required_args, maybe_transform, async_maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
|
|
@ -22,36 +19,40 @@ from ..._response import (
|
|||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ..._base_client import (
|
||||
AsyncPaginator,
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.accounts import (
|
||||
AccountMember,
|
||||
MemberListResponse,
|
||||
AccountMemberWithID,
|
||||
MemberDeleteResponse,
|
||||
member_list_params,
|
||||
member_create_params,
|
||||
member_update_params,
|
||||
)
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.accounts import member_list_params, member_create_params, member_update_params
|
||||
from ...types.shared.member import Member
|
||||
from ...types.shared_params.role import Role
|
||||
from ...types.accounts.member_delete_response import MemberDeleteResponse
|
||||
|
||||
__all__ = ["Members", "AsyncMembers"]
|
||||
__all__ = ["MembersResource", "AsyncMembersResource"]
|
||||
|
||||
|
||||
class Members(SyncAPIResource):
|
||||
class MembersResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MembersWithRawResponse:
|
||||
return MembersWithRawResponse(self)
|
||||
def with_raw_response(self) -> MembersResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return MembersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MembersWithStreamingResponse:
|
||||
return MembersWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> MembersResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return MembersResourceWithStreamingResponse(self)
|
||||
|
||||
@overload
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
email: str,
|
||||
roles: List[str],
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -61,11 +62,13 @@ class Members(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMemberWithID:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Add a user to the list of members for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
email: The contact email address of the user.
|
||||
|
||||
roles: Array of roles associated with this member.
|
||||
|
|
@ -78,6 +81,61 @@ class Members(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy],
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Add a user to the list of members for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
email: The contact email address of the user.
|
||||
|
||||
policies: Array of policies associated with this member.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"])
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
roles: List[str] | NotGiven = NOT_GIVEN,
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/members",
|
||||
body=maybe_transform(
|
||||
|
|
@ -85,6 +143,7 @@ class Members(SyncAPIResource):
|
|||
"email": email,
|
||||
"roles": roles,
|
||||
"status": status,
|
||||
"policies": policies,
|
||||
},
|
||||
member_create_params.MemberCreateParams,
|
||||
),
|
||||
|
|
@ -93,28 +152,31 @@ class Members(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMemberWithID], ResultWrapper[AccountMemberWithID]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
@overload
|
||||
def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
roles: Iterable[member_update_params.Role],
|
||||
account_id: str,
|
||||
roles: Iterable[Role] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMember:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Modify an account member.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
roles: Roles assigned to this member.
|
||||
|
|
@ -127,25 +189,84 @@ class Members(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Modify an account member.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
policies: Array of policies associated with this member.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id"], ["account_id", "policies"])
|
||||
def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
roles: Iterable[Role] | NotGiven = NOT_GIVEN,
|
||||
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/members/{member_id}",
|
||||
body=maybe_transform({"roles": roles}, member_update_params.MemberUpdateParams),
|
||||
body=maybe_transform(
|
||||
{
|
||||
"roles": roles,
|
||||
"policies": policies,
|
||||
},
|
||||
member_update_params.MemberUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMember], ResultWrapper[AccountMember]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -157,11 +278,13 @@ class Members(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncV4PagePaginationArray[MemberListResponse]:
|
||||
) -> SyncV4PagePaginationArray[Member]:
|
||||
"""
|
||||
List all members of an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
direction: Direction to order results.
|
||||
|
||||
order: Field to order results by.
|
||||
|
|
@ -180,9 +303,11 @@ class Members(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/members",
|
||||
page=SyncV4PagePaginationArray[MemberListResponse],
|
||||
page=SyncV4PagePaginationArray[Member],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -199,14 +324,14 @@ class Members(SyncAPIResource):
|
|||
member_list_params.MemberListParams,
|
||||
),
|
||||
),
|
||||
model=MemberListResponse,
|
||||
model=Member,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -218,6 +343,8 @@ class Members(SyncAPIResource):
|
|||
Remove a member from an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -228,6 +355,8 @@ class Members(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return self._delete(
|
||||
|
|
@ -237,7 +366,7 @@ class Members(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[MemberDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]),
|
||||
)
|
||||
|
|
@ -246,18 +375,20 @@ class Members(SyncAPIResource):
|
|||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMember:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Get information about a specific member of an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -268,6 +399,8 @@ class Members(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return self._get(
|
||||
|
|
@ -277,25 +410,37 @@ class Members(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMember], ResultWrapper[AccountMember]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncMembers(AsyncAPIResource):
|
||||
class AsyncMembersResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMembersWithRawResponse:
|
||||
return AsyncMembersWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncMembersResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncMembersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMembersWithStreamingResponse:
|
||||
return AsyncMembersWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncMembersResourceWithStreamingResponse(self)
|
||||
|
||||
@overload
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
email: str,
|
||||
roles: List[str],
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -305,11 +450,13 @@ class AsyncMembers(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMemberWithID:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Add a user to the list of members for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
email: The contact email address of the user.
|
||||
|
||||
roles: Array of roles associated with this member.
|
||||
|
|
@ -322,6 +469,61 @@ class AsyncMembers(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy],
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Add a user to the list of members for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
email: The contact email address of the user.
|
||||
|
||||
policies: Array of policies associated with this member.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"])
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
email: str,
|
||||
roles: List[str] | NotGiven = NOT_GIVEN,
|
||||
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
|
||||
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/members",
|
||||
body=await async_maybe_transform(
|
||||
|
|
@ -329,6 +531,7 @@ class AsyncMembers(AsyncAPIResource):
|
|||
"email": email,
|
||||
"roles": roles,
|
||||
"status": status,
|
||||
"policies": policies,
|
||||
},
|
||||
member_create_params.MemberCreateParams,
|
||||
),
|
||||
|
|
@ -337,28 +540,31 @@ class AsyncMembers(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMemberWithID], ResultWrapper[AccountMemberWithID]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
@overload
|
||||
async def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
roles: Iterable[member_update_params.Role],
|
||||
account_id: str,
|
||||
roles: Iterable[Role] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMember:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Modify an account member.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
roles: Roles assigned to this member.
|
||||
|
|
@ -371,25 +577,84 @@ class AsyncMembers(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
async def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Modify an account member.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
policies: Array of policies associated with this member.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
...
|
||||
|
||||
@required_args(["account_id"], ["account_id", "policies"])
|
||||
async def update(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
roles: Iterable[Role] | NotGiven = NOT_GIVEN,
|
||||
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Member]:
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/members/{member_id}",
|
||||
body=await async_maybe_transform({"roles": roles}, member_update_params.MemberUpdateParams),
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"roles": roles,
|
||||
"policies": policies,
|
||||
},
|
||||
member_update_params.MemberUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMember], ResultWrapper[AccountMember]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -401,11 +666,13 @@ class AsyncMembers(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[MemberListResponse, AsyncV4PagePaginationArray[MemberListResponse]]:
|
||||
) -> AsyncPaginator[Member, AsyncV4PagePaginationArray[Member]]:
|
||||
"""
|
||||
List all members of an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
direction: Direction to order results.
|
||||
|
||||
order: Field to order results by.
|
||||
|
|
@ -424,9 +691,11 @@ class AsyncMembers(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/members",
|
||||
page=AsyncV4PagePaginationArray[MemberListResponse],
|
||||
page=AsyncV4PagePaginationArray[Member],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
|
|
@ -443,14 +712,14 @@ class AsyncMembers(AsyncAPIResource):
|
|||
member_list_params.MemberListParams,
|
||||
),
|
||||
),
|
||||
model=MemberListResponse,
|
||||
model=Member,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -462,6 +731,8 @@ class AsyncMembers(AsyncAPIResource):
|
|||
Remove a member from an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -472,6 +743,8 @@ class AsyncMembers(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return await self._delete(
|
||||
|
|
@ -481,7 +754,7 @@ class AsyncMembers(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[MemberDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]),
|
||||
)
|
||||
|
|
@ -490,18 +763,20 @@ class AsyncMembers(AsyncAPIResource):
|
|||
self,
|
||||
member_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AccountMember:
|
||||
) -> Optional[Member]:
|
||||
"""
|
||||
Get information about a specific member of an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
member_id: Membership identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
|
@ -512,6 +787,8 @@ class AsyncMembers(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not member_id:
|
||||
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
|
||||
return await self._get(
|
||||
|
|
@ -521,14 +798,14 @@ class AsyncMembers(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Member]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AccountMember], ResultWrapper[AccountMember]),
|
||||
cast_to=cast(Type[Optional[Member]], ResultWrapper[Member]),
|
||||
)
|
||||
|
||||
|
||||
class MembersWithRawResponse:
|
||||
def __init__(self, members: Members) -> None:
|
||||
class MembersResourceWithRawResponse:
|
||||
def __init__(self, members: MembersResource) -> None:
|
||||
self._members = members
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
|
|
@ -548,8 +825,8 @@ class MembersWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncMembersWithRawResponse:
|
||||
def __init__(self, members: AsyncMembers) -> None:
|
||||
class AsyncMembersResourceWithRawResponse:
|
||||
def __init__(self, members: AsyncMembersResource) -> None:
|
||||
self._members = members
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
|
|
@ -569,8 +846,8 @@ class AsyncMembersWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class MembersWithStreamingResponse:
|
||||
def __init__(self, members: Members) -> None:
|
||||
class MembersResourceWithStreamingResponse:
|
||||
def __init__(self, members: MembersResource) -> None:
|
||||
self._members = members
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
|
|
@ -590,8 +867,8 @@ class MembersWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncMembersWithStreamingResponse:
|
||||
def __init__(self, members: AsyncMembers) -> None:
|
||||
class AsyncMembersResourceWithStreamingResponse:
|
||||
def __init__(self, members: AsyncMembersResource) -> None:
|
||||
self._members = members
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
|
|
@ -16,38 +17,57 @@ from ..._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.accounts import RoleGetResponse, RoleListResponse
|
||||
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.accounts import role_list_params
|
||||
from ...types.shared.role import Role
|
||||
|
||||
__all__ = ["Roles", "AsyncRoles"]
|
||||
__all__ = ["RolesResource", "AsyncRolesResource"]
|
||||
|
||||
|
||||
class Roles(SyncAPIResource):
|
||||
class RolesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RolesWithRawResponse:
|
||||
return RolesWithRawResponse(self)
|
||||
def with_raw_response(self) -> RolesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return RolesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RolesWithStreamingResponse:
|
||||
return RolesWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> RolesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return RolesResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RoleListResponse]:
|
||||
) -> SyncV4PagePaginationArray[Role]:
|
||||
"""
|
||||
Get all available roles for an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Number of roles per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -56,34 +76,47 @@ class Roles(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return self._get(
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/roles",
|
||||
page=SyncV4PagePaginationArray[Role],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
role_list_params.RoleListParams,
|
||||
),
|
||||
),
|
||||
cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]),
|
||||
model=Role,
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
role_id: object,
|
||||
role_id: str,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RoleGetResponse:
|
||||
) -> Optional[Role]:
|
||||
"""
|
||||
Get information about a specific role for an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
role_id: Role identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -92,84 +125,66 @@ class Roles(SyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
RoleGetResponse,
|
||||
self._get(
|
||||
f"/accounts/{account_id}/roles/{role_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[RoleGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class AsyncRoles(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRolesWithRawResponse:
|
||||
return AsyncRolesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRolesWithStreamingResponse:
|
||||
return AsyncRolesWithStreamingResponse(self)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
*,
|
||||
account_id: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RoleListResponse]:
|
||||
"""
|
||||
Get all available roles for an account.
|
||||
|
||||
Args:
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/roles",
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not role_id:
|
||||
raise ValueError(f"Expected a non-empty value for `role_id` but received {role_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/roles/{role_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Role]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]),
|
||||
cast_to=cast(Type[Optional[Role]], ResultWrapper[Role]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
||||
class AsyncRolesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRolesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncRolesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncRolesResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
role_id: object,
|
||||
*,
|
||||
account_id: object,
|
||||
account_id: str,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RoleGetResponse:
|
||||
) -> AsyncPaginator[Role, AsyncV4PagePaginationArray[Role]]:
|
||||
"""
|
||||
Get information about a specific role for an account.
|
||||
Get all available roles for an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Number of roles per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -178,26 +193,74 @@ class AsyncRoles(AsyncAPIResource):
|
|||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return cast(
|
||||
RoleGetResponse,
|
||||
await self._get(
|
||||
f"/accounts/{account_id}/roles/{role_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/roles",
|
||||
page=AsyncV4PagePaginationArray[Role],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
role_list_params.RoleListParams,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[RoleGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
model=Role,
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
role_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Role]:
|
||||
"""
|
||||
Get information about a specific role for an account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
role_id: Role identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not role_id:
|
||||
raise ValueError(f"Expected a non-empty value for `role_id` but received {role_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/roles/{role_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Role]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Role]], ResultWrapper[Role]),
|
||||
)
|
||||
|
||||
|
||||
class RolesWithRawResponse:
|
||||
def __init__(self, roles: Roles) -> None:
|
||||
class RolesResourceWithRawResponse:
|
||||
def __init__(self, roles: RolesResource) -> None:
|
||||
self._roles = roles
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
|
|
@ -208,8 +271,8 @@ class RolesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncRolesWithRawResponse:
|
||||
def __init__(self, roles: AsyncRoles) -> None:
|
||||
class AsyncRolesResourceWithRawResponse:
|
||||
def __init__(self, roles: AsyncRolesResource) -> None:
|
||||
self._roles = roles
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
|
|
@ -220,8 +283,8 @@ class AsyncRolesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class RolesWithStreamingResponse:
|
||||
def __init__(self, roles: Roles) -> None:
|
||||
class RolesResourceWithStreamingResponse:
|
||||
def __init__(self, roles: RolesResource) -> None:
|
||||
self._roles = roles
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
|
|
@ -232,8 +295,8 @@ class RolesWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncRolesWithStreamingResponse:
|
||||
def __init__(self, roles: AsyncRoles) -> None:
|
||||
class AsyncRolesResourceWithStreamingResponse:
|
||||
def __init__(self, roles: AsyncRolesResource) -> None:
|
||||
self._roles = roles
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
528
src/cloudflare/resources/accounts/subscriptions.py
Normal file
528
src/cloudflare/resources/accounts/subscriptions.py
Normal file
|
|
@ -0,0 +1,528 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import maybe_transform, async_maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ...pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.accounts import subscription_create_params, subscription_update_params
|
||||
from ...types.shared.subscription import Subscription
|
||||
from ...types.shared_params.rate_plan import RatePlan
|
||||
from ...types.accounts.subscription_delete_response import SubscriptionDeleteResponse
|
||||
|
||||
__all__ = ["SubscriptionsResource", "AsyncSubscriptionsResource"]
|
||||
|
||||
|
||||
class SubscriptionsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SubscriptionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return SubscriptionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return SubscriptionsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
|
||||
rate_plan: RatePlan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Subscription:
|
||||
"""
|
||||
Creates an account subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
frequency: How often the subscription is renewed automatically.
|
||||
|
||||
rate_plan: The rate plan applied to the subscription.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/subscriptions",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"frequency": frequency,
|
||||
"rate_plan": rate_plan,
|
||||
},
|
||||
subscription_create_params.SubscriptionCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Subscription]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Subscription], ResultWrapper[Subscription]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
subscription_identifier: str,
|
||||
*,
|
||||
account_id: str,
|
||||
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
|
||||
rate_plan: RatePlan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Subscription:
|
||||
"""
|
||||
Updates an account subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
subscription_identifier: Subscription identifier tag.
|
||||
|
||||
frequency: How often the subscription is renewed automatically.
|
||||
|
||||
rate_plan: The rate plan applied to the subscription.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not subscription_identifier:
|
||||
raise ValueError(
|
||||
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
|
||||
)
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"frequency": frequency,
|
||||
"rate_plan": rate_plan,
|
||||
},
|
||||
subscription_update_params.SubscriptionUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Subscription]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Subscription], ResultWrapper[Subscription]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
subscription_identifier: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SubscriptionDeleteResponse:
|
||||
"""
|
||||
Deletes an account's subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
subscription_identifier: Subscription identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not subscription_identifier:
|
||||
raise ValueError(
|
||||
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
|
||||
)
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[SubscriptionDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SubscriptionDeleteResponse], ResultWrapper[SubscriptionDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[Subscription]:
|
||||
"""
|
||||
Lists all of an account's subscriptions.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/subscriptions",
|
||||
page=SyncSinglePage[Subscription],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=Subscription,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubscriptionsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSubscriptionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncSubscriptionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncSubscriptionsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
|
||||
rate_plan: RatePlan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Subscription:
|
||||
"""
|
||||
Creates an account subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
frequency: How often the subscription is renewed automatically.
|
||||
|
||||
rate_plan: The rate plan applied to the subscription.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/subscriptions",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"frequency": frequency,
|
||||
"rate_plan": rate_plan,
|
||||
},
|
||||
subscription_create_params.SubscriptionCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Subscription]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Subscription], ResultWrapper[Subscription]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
subscription_identifier: str,
|
||||
*,
|
||||
account_id: str,
|
||||
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
|
||||
rate_plan: RatePlan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Subscription:
|
||||
"""
|
||||
Updates an account subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
subscription_identifier: Subscription identifier tag.
|
||||
|
||||
frequency: How often the subscription is renewed automatically.
|
||||
|
||||
rate_plan: The rate plan applied to the subscription.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not subscription_identifier:
|
||||
raise ValueError(
|
||||
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
|
||||
)
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"frequency": frequency,
|
||||
"rate_plan": rate_plan,
|
||||
},
|
||||
subscription_update_params.SubscriptionUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Subscription]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Subscription], ResultWrapper[Subscription]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
subscription_identifier: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SubscriptionDeleteResponse:
|
||||
"""
|
||||
Deletes an account's subscription.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
subscription_identifier: Subscription identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not subscription_identifier:
|
||||
raise ValueError(
|
||||
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
|
||||
)
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[SubscriptionDeleteResponse]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SubscriptionDeleteResponse], ResultWrapper[SubscriptionDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]:
|
||||
"""
|
||||
Lists all of an account's subscriptions.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/subscriptions",
|
||||
page=AsyncSinglePage[Subscription],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=Subscription,
|
||||
)
|
||||
|
||||
|
||||
class SubscriptionsResourceWithRawResponse:
|
||||
def __init__(self, subscriptions: SubscriptionsResource) -> None:
|
||||
self._subscriptions = subscriptions
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
subscriptions.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
subscriptions.update,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
subscriptions.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
subscriptions.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubscriptionsResourceWithRawResponse:
|
||||
def __init__(self, subscriptions: AsyncSubscriptionsResource) -> None:
|
||||
self._subscriptions = subscriptions
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
subscriptions.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
subscriptions.update,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
subscriptions.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
subscriptions.get,
|
||||
)
|
||||
|
||||
|
||||
class SubscriptionsResourceWithStreamingResponse:
|
||||
def __init__(self, subscriptions: SubscriptionsResource) -> None:
|
||||
self._subscriptions = subscriptions
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
subscriptions.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
subscriptions.update,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
subscriptions.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
subscriptions.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSubscriptionsResourceWithStreamingResponse:
|
||||
def __init__(self, subscriptions: AsyncSubscriptionsResource) -> None:
|
||||
self._subscriptions = subscriptions
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
subscriptions.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
subscriptions.update,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
subscriptions.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
subscriptions.get,
|
||||
)
|
||||
47
src/cloudflare/resources/accounts/tokens/__init__.py
Normal file
47
src/cloudflare/resources/accounts/tokens/__init__.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .value import (
|
||||
ValueResource,
|
||||
AsyncValueResource,
|
||||
ValueResourceWithRawResponse,
|
||||
AsyncValueResourceWithRawResponse,
|
||||
ValueResourceWithStreamingResponse,
|
||||
AsyncValueResourceWithStreamingResponse,
|
||||
)
|
||||
from .tokens import (
|
||||
TokensResource,
|
||||
AsyncTokensResource,
|
||||
TokensResourceWithRawResponse,
|
||||
AsyncTokensResourceWithRawResponse,
|
||||
TokensResourceWithStreamingResponse,
|
||||
AsyncTokensResourceWithStreamingResponse,
|
||||
)
|
||||
from .permission_groups import (
|
||||
PermissionGroupsResource,
|
||||
AsyncPermissionGroupsResource,
|
||||
PermissionGroupsResourceWithRawResponse,
|
||||
AsyncPermissionGroupsResourceWithRawResponse,
|
||||
PermissionGroupsResourceWithStreamingResponse,
|
||||
AsyncPermissionGroupsResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"PermissionGroupsResource",
|
||||
"AsyncPermissionGroupsResource",
|
||||
"PermissionGroupsResourceWithRawResponse",
|
||||
"AsyncPermissionGroupsResourceWithRawResponse",
|
||||
"PermissionGroupsResourceWithStreamingResponse",
|
||||
"AsyncPermissionGroupsResourceWithStreamingResponse",
|
||||
"ValueResource",
|
||||
"AsyncValueResource",
|
||||
"ValueResourceWithRawResponse",
|
||||
"AsyncValueResourceWithRawResponse",
|
||||
"ValueResourceWithStreamingResponse",
|
||||
"AsyncValueResourceWithStreamingResponse",
|
||||
"TokensResource",
|
||||
"AsyncTokensResource",
|
||||
"TokensResourceWithRawResponse",
|
||||
"AsyncTokensResourceWithRawResponse",
|
||||
"TokensResourceWithStreamingResponse",
|
||||
"AsyncTokensResourceWithStreamingResponse",
|
||||
]
|
||||
255
src/cloudflare/resources/accounts/tokens/permission_groups.py
Normal file
255
src/cloudflare/resources/accounts/tokens/permission_groups.py
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.accounts.tokens.permission_group_get_response import PermissionGroupGetResponse
|
||||
from ....types.accounts.tokens.permission_group_list_response import PermissionGroupListResponse
|
||||
|
||||
__all__ = ["PermissionGroupsResource", "AsyncPermissionGroupsResource"]
|
||||
|
||||
|
||||
class PermissionGroupsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PermissionGroupsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return PermissionGroupsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PermissionGroupsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return PermissionGroupsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[PermissionGroupListResponse]:
|
||||
"""
|
||||
Find all available permission groups for Account Owned API Tokens
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens/permission_groups",
|
||||
page=SyncSinglePage[PermissionGroupListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PermissionGroupListResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[PermissionGroupGetResponse]:
|
||||
"""
|
||||
Find all available permission groups for Account Owned API Tokens
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens/permission_groups",
|
||||
page=SyncSinglePage[PermissionGroupGetResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PermissionGroupGetResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPermissionGroupsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPermissionGroupsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncPermissionGroupsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPermissionGroupsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncPermissionGroupsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[PermissionGroupListResponse, AsyncSinglePage[PermissionGroupListResponse]]:
|
||||
"""
|
||||
Find all available permission groups for Account Owned API Tokens
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens/permission_groups",
|
||||
page=AsyncSinglePage[PermissionGroupListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PermissionGroupListResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[PermissionGroupGetResponse, AsyncSinglePage[PermissionGroupGetResponse]]:
|
||||
"""
|
||||
Find all available permission groups for Account Owned API Tokens
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens/permission_groups",
|
||||
page=AsyncSinglePage[PermissionGroupGetResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PermissionGroupGetResponse,
|
||||
)
|
||||
|
||||
|
||||
class PermissionGroupsResourceWithRawResponse:
|
||||
def __init__(self, permission_groups: PermissionGroupsResource) -> None:
|
||||
self._permission_groups = permission_groups
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
permission_groups.list,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
permission_groups.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPermissionGroupsResourceWithRawResponse:
|
||||
def __init__(self, permission_groups: AsyncPermissionGroupsResource) -> None:
|
||||
self._permission_groups = permission_groups
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
permission_groups.list,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
permission_groups.get,
|
||||
)
|
||||
|
||||
|
||||
class PermissionGroupsResourceWithStreamingResponse:
|
||||
def __init__(self, permission_groups: PermissionGroupsResource) -> None:
|
||||
self._permission_groups = permission_groups
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
permission_groups.list,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
permission_groups.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPermissionGroupsResourceWithStreamingResponse:
|
||||
def __init__(self, permission_groups: AsyncPermissionGroupsResource) -> None:
|
||||
self._permission_groups = permission_groups
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
permission_groups.list,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
permission_groups.get,
|
||||
)
|
||||
869
src/cloudflare/resources/accounts/tokens/tokens.py
Normal file
869
src/cloudflare/resources/accounts/tokens/tokens.py
Normal file
|
|
@ -0,0 +1,869 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Union, Iterable, Optional, cast
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from .value import (
|
||||
ValueResource,
|
||||
AsyncValueResource,
|
||||
ValueResourceWithRawResponse,
|
||||
AsyncValueResourceWithRawResponse,
|
||||
ValueResourceWithStreamingResponse,
|
||||
AsyncValueResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.accounts import token_list_params, token_create_params, token_update_params
|
||||
from .permission_groups import (
|
||||
PermissionGroupsResource,
|
||||
AsyncPermissionGroupsResource,
|
||||
PermissionGroupsResourceWithRawResponse,
|
||||
AsyncPermissionGroupsResourceWithRawResponse,
|
||||
PermissionGroupsResourceWithStreamingResponse,
|
||||
AsyncPermissionGroupsResourceWithStreamingResponse,
|
||||
)
|
||||
from ....types.shared.token import Token
|
||||
from ....types.shared_params.token_policy import TokenPolicy
|
||||
from ....types.accounts.token_create_response import TokenCreateResponse
|
||||
from ....types.accounts.token_delete_response import TokenDeleteResponse
|
||||
from ....types.accounts.token_verify_response import TokenVerifyResponse
|
||||
|
||||
__all__ = ["TokensResource", "AsyncTokensResource"]
|
||||
|
||||
|
||||
class TokensResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def permission_groups(self) -> PermissionGroupsResource:
|
||||
return PermissionGroupsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> ValueResource:
|
||||
return ValueResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TokensResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return TokensResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TokensResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return TokensResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
policies: Iterable[TokenPolicy],
|
||||
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
|
||||
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenCreateResponse]:
|
||||
"""
|
||||
Create a new Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
name: Token name.
|
||||
|
||||
policies: List of access policies assigned to the token.
|
||||
|
||||
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
|
||||
processing.
|
||||
|
||||
not_before: The time before which the token MUST NOT be accepted for processing.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/tokens",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"policies": policies,
|
||||
"condition": condition,
|
||||
"expires_on": expires_on,
|
||||
"not_before": not_before,
|
||||
},
|
||||
token_create_params.TokenCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenCreateResponse]], ResultWrapper[TokenCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
policies: Iterable[TokenPolicy],
|
||||
status: Literal["active", "disabled", "expired"],
|
||||
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
|
||||
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Token]:
|
||||
"""
|
||||
Update an existing token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
name: Token name.
|
||||
|
||||
policies: List of access policies assigned to the token.
|
||||
|
||||
status: Status of the token.
|
||||
|
||||
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
|
||||
processing.
|
||||
|
||||
not_before: The time before which the token MUST NOT be accepted for processing.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"policies": policies,
|
||||
"status": status,
|
||||
"condition": condition,
|
||||
"expires_on": expires_on,
|
||||
"not_before": not_before,
|
||||
},
|
||||
token_update_params.TokenUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Token]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Token]], ResultWrapper[Token]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncV4PagePaginationArray[Token]:
|
||||
"""
|
||||
List all Account Owned API tokens created for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
direction: Direction to order results.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Maximum number of results per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens",
|
||||
page=SyncV4PagePaginationArray[Token],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
token_list_params.TokenListParams,
|
||||
),
|
||||
),
|
||||
model=Token,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenDeleteResponse]:
|
||||
"""
|
||||
Destroy an Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenDeleteResponse]], ResultWrapper[TokenDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Token]:
|
||||
"""
|
||||
Get information about a specific Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Token]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Token]], ResultWrapper[Token]),
|
||||
)
|
||||
|
||||
def verify(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenVerifyResponse]:
|
||||
"""
|
||||
Test whether a token works.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/tokens/verify",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenVerifyResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenVerifyResponse]], ResultWrapper[TokenVerifyResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTokensResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def permission_groups(self) -> AsyncPermissionGroupsResource:
|
||||
return AsyncPermissionGroupsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> AsyncValueResource:
|
||||
return AsyncValueResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTokensResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncTokensResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncTokensResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
policies: Iterable[TokenPolicy],
|
||||
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
|
||||
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenCreateResponse]:
|
||||
"""
|
||||
Create a new Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
name: Token name.
|
||||
|
||||
policies: List of access policies assigned to the token.
|
||||
|
||||
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
|
||||
processing.
|
||||
|
||||
not_before: The time before which the token MUST NOT be accepted for processing.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/tokens",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"policies": policies,
|
||||
"condition": condition,
|
||||
"expires_on": expires_on,
|
||||
"not_before": not_before,
|
||||
},
|
||||
token_create_params.TokenCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenCreateResponse]], ResultWrapper[TokenCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
name: str,
|
||||
policies: Iterable[TokenPolicy],
|
||||
status: Literal["active", "disabled", "expired"],
|
||||
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
|
||||
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Token]:
|
||||
"""
|
||||
Update an existing token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
name: Token name.
|
||||
|
||||
policies: List of access policies assigned to the token.
|
||||
|
||||
status: Status of the token.
|
||||
|
||||
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
|
||||
processing.
|
||||
|
||||
not_before: The time before which the token MUST NOT be accepted for processing.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"name": name,
|
||||
"policies": policies,
|
||||
"status": status,
|
||||
"condition": condition,
|
||||
"expires_on": expires_on,
|
||||
"not_before": not_before,
|
||||
},
|
||||
token_update_params.TokenUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Token]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Token]], ResultWrapper[Token]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[Token, AsyncV4PagePaginationArray[Token]]:
|
||||
"""
|
||||
List all Account Owned API tokens created for this account.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
direction: Direction to order results.
|
||||
|
||||
page: Page number of paginated results.
|
||||
|
||||
per_page: Maximum number of results per page.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/tokens",
|
||||
page=AsyncV4PagePaginationArray[Token],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
query=maybe_transform(
|
||||
{
|
||||
"direction": direction,
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
},
|
||||
token_list_params.TokenListParams,
|
||||
),
|
||||
),
|
||||
model=Token,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenDeleteResponse]:
|
||||
"""
|
||||
Destroy an Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenDeleteResponse]], ResultWrapper[TokenDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Token]:
|
||||
"""
|
||||
Get information about a specific Account Owned API token.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/tokens/{token_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Token]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Token]], ResultWrapper[Token]),
|
||||
)
|
||||
|
||||
async def verify(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TokenVerifyResponse]:
|
||||
"""
|
||||
Test whether a token works.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/tokens/verify",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenVerifyResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TokenVerifyResponse]], ResultWrapper[TokenVerifyResponse]),
|
||||
)
|
||||
|
||||
|
||||
class TokensResourceWithRawResponse:
|
||||
def __init__(self, tokens: TokensResource) -> None:
|
||||
self._tokens = tokens
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
tokens.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
tokens.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
tokens.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
tokens.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
tokens.get,
|
||||
)
|
||||
self.verify = to_raw_response_wrapper(
|
||||
tokens.verify,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def permission_groups(self) -> PermissionGroupsResourceWithRawResponse:
|
||||
return PermissionGroupsResourceWithRawResponse(self._tokens.permission_groups)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> ValueResourceWithRawResponse:
|
||||
return ValueResourceWithRawResponse(self._tokens.value)
|
||||
|
||||
|
||||
class AsyncTokensResourceWithRawResponse:
|
||||
def __init__(self, tokens: AsyncTokensResource) -> None:
|
||||
self._tokens = tokens
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
tokens.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
tokens.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
tokens.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
tokens.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
tokens.get,
|
||||
)
|
||||
self.verify = async_to_raw_response_wrapper(
|
||||
tokens.verify,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def permission_groups(self) -> AsyncPermissionGroupsResourceWithRawResponse:
|
||||
return AsyncPermissionGroupsResourceWithRawResponse(self._tokens.permission_groups)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> AsyncValueResourceWithRawResponse:
|
||||
return AsyncValueResourceWithRawResponse(self._tokens.value)
|
||||
|
||||
|
||||
class TokensResourceWithStreamingResponse:
|
||||
def __init__(self, tokens: TokensResource) -> None:
|
||||
self._tokens = tokens
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
tokens.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
tokens.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
tokens.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
tokens.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
tokens.get,
|
||||
)
|
||||
self.verify = to_streamed_response_wrapper(
|
||||
tokens.verify,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def permission_groups(self) -> PermissionGroupsResourceWithStreamingResponse:
|
||||
return PermissionGroupsResourceWithStreamingResponse(self._tokens.permission_groups)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> ValueResourceWithStreamingResponse:
|
||||
return ValueResourceWithStreamingResponse(self._tokens.value)
|
||||
|
||||
|
||||
class AsyncTokensResourceWithStreamingResponse:
|
||||
def __init__(self, tokens: AsyncTokensResource) -> None:
|
||||
self._tokens = tokens
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
tokens.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
tokens.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
tokens.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
tokens.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
tokens.get,
|
||||
)
|
||||
self.verify = async_to_streamed_response_wrapper(
|
||||
tokens.verify,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def permission_groups(self) -> AsyncPermissionGroupsResourceWithStreamingResponse:
|
||||
return AsyncPermissionGroupsResourceWithStreamingResponse(self._tokens.permission_groups)
|
||||
|
||||
@cached_property
|
||||
def value(self) -> AsyncValueResourceWithStreamingResponse:
|
||||
return AsyncValueResourceWithStreamingResponse(self._tokens.value)
|
||||
194
src/cloudflare/resources/accounts/tokens/value.py
Normal file
194
src/cloudflare/resources/accounts/tokens/value.py
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.accounts.tokens import value_update_params
|
||||
from ....types.shared.token_value import TokenValue
|
||||
|
||||
__all__ = ["ValueResource", "AsyncValueResource"]
|
||||
|
||||
|
||||
class ValueResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ValueResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ValueResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ValueResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ValueResourceWithStreamingResponse(self)
|
||||
|
||||
def update(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> str:
|
||||
"""
|
||||
Roll the Account Owned API token secret.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/tokens/{token_id}/value",
|
||||
body=maybe_transform(body, value_update_params.ValueUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenValue]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[str], ResultWrapper[str]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncValueResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncValueResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncValueResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncValueResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncValueResourceWithStreamingResponse(self)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
token_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> str:
|
||||
"""
|
||||
Roll the Account Owned API token secret.
|
||||
|
||||
Args:
|
||||
account_id: Account identifier tag.
|
||||
|
||||
token_id: Token identifier tag.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not token_id:
|
||||
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/tokens/{token_id}/value",
|
||||
body=await async_maybe_transform(body, value_update_params.ValueUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TokenValue]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[str], ResultWrapper[str]),
|
||||
)
|
||||
|
||||
|
||||
class ValueResourceWithRawResponse:
|
||||
def __init__(self, value: ValueResource) -> None:
|
||||
self._value = value
|
||||
|
||||
self.update = to_raw_response_wrapper(
|
||||
value.update,
|
||||
)
|
||||
|
||||
|
||||
class AsyncValueResourceWithRawResponse:
|
||||
def __init__(self, value: AsyncValueResource) -> None:
|
||||
self._value = value
|
||||
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
value.update,
|
||||
)
|
||||
|
||||
|
||||
class ValueResourceWithStreamingResponse:
|
||||
def __init__(self, value: ValueResource) -> None:
|
||||
self._value = value
|
||||
|
||||
self.update = to_streamed_response_wrapper(
|
||||
value.update,
|
||||
)
|
||||
|
||||
|
||||
class AsyncValueResourceWithStreamingResponse:
|
||||
def __init__(self, value: AsyncValueResource) -> None:
|
||||
self._value = value
|
||||
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
value.update,
|
||||
)
|
||||
|
|
@ -1,33 +1,33 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .acm import (
|
||||
ACM,
|
||||
AsyncACM,
|
||||
ACMWithRawResponse,
|
||||
AsyncACMWithRawResponse,
|
||||
ACMWithStreamingResponse,
|
||||
AsyncACMWithStreamingResponse,
|
||||
ACMResource,
|
||||
AsyncACMResource,
|
||||
ACMResourceWithRawResponse,
|
||||
AsyncACMResourceWithRawResponse,
|
||||
ACMResourceWithStreamingResponse,
|
||||
AsyncACMResourceWithStreamingResponse,
|
||||
)
|
||||
from .total_tls import (
|
||||
TotalTLS,
|
||||
AsyncTotalTLS,
|
||||
TotalTLSWithRawResponse,
|
||||
AsyncTotalTLSWithRawResponse,
|
||||
TotalTLSWithStreamingResponse,
|
||||
AsyncTotalTLSWithStreamingResponse,
|
||||
TotalTLSResource,
|
||||
AsyncTotalTLSResource,
|
||||
TotalTLSResourceWithRawResponse,
|
||||
AsyncTotalTLSResourceWithRawResponse,
|
||||
TotalTLSResourceWithStreamingResponse,
|
||||
AsyncTotalTLSResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"TotalTLS",
|
||||
"AsyncTotalTLS",
|
||||
"TotalTLSWithRawResponse",
|
||||
"AsyncTotalTLSWithRawResponse",
|
||||
"TotalTLSWithStreamingResponse",
|
||||
"AsyncTotalTLSWithStreamingResponse",
|
||||
"ACM",
|
||||
"AsyncACM",
|
||||
"ACMWithRawResponse",
|
||||
"AsyncACMWithRawResponse",
|
||||
"ACMWithStreamingResponse",
|
||||
"AsyncACMWithStreamingResponse",
|
||||
"TotalTLSResource",
|
||||
"AsyncTotalTLSResource",
|
||||
"TotalTLSResourceWithRawResponse",
|
||||
"AsyncTotalTLSResourceWithRawResponse",
|
||||
"TotalTLSResourceWithStreamingResponse",
|
||||
"AsyncTotalTLSResourceWithStreamingResponse",
|
||||
"ACMResource",
|
||||
"AsyncACMResource",
|
||||
"ACMResourceWithRawResponse",
|
||||
"AsyncACMResourceWithRawResponse",
|
||||
"ACMResourceWithStreamingResponse",
|
||||
"AsyncACMResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -4,77 +4,99 @@ from __future__ import annotations
|
|||
|
||||
from ..._compat import cached_property
|
||||
from .total_tls import (
|
||||
TotalTLS,
|
||||
AsyncTotalTLS,
|
||||
TotalTLSWithRawResponse,
|
||||
AsyncTotalTLSWithRawResponse,
|
||||
TotalTLSWithStreamingResponse,
|
||||
AsyncTotalTLSWithStreamingResponse,
|
||||
TotalTLSResource,
|
||||
AsyncTotalTLSResource,
|
||||
TotalTLSResourceWithRawResponse,
|
||||
AsyncTotalTLSResourceWithRawResponse,
|
||||
TotalTLSResourceWithStreamingResponse,
|
||||
AsyncTotalTLSResourceWithStreamingResponse,
|
||||
)
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
|
||||
__all__ = ["ACM", "AsyncACM"]
|
||||
__all__ = ["ACMResource", "AsyncACMResource"]
|
||||
|
||||
|
||||
class ACM(SyncAPIResource):
|
||||
class ACMResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def total_tls(self) -> TotalTLS:
|
||||
return TotalTLS(self._client)
|
||||
def total_tls(self) -> TotalTLSResource:
|
||||
return TotalTLSResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ACMWithRawResponse:
|
||||
return ACMWithRawResponse(self)
|
||||
def with_raw_response(self) -> ACMResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ACMResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ACMWithStreamingResponse:
|
||||
return ACMWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> ACMResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ACMResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncACM(AsyncAPIResource):
|
||||
class AsyncACMResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def total_tls(self) -> AsyncTotalTLS:
|
||||
return AsyncTotalTLS(self._client)
|
||||
def total_tls(self) -> AsyncTotalTLSResource:
|
||||
return AsyncTotalTLSResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncACMWithRawResponse:
|
||||
return AsyncACMWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncACMResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncACMResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncACMWithStreamingResponse:
|
||||
return AsyncACMWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncACMResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncACMResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class ACMWithRawResponse:
|
||||
def __init__(self, acm: ACM) -> None:
|
||||
class ACMResourceWithRawResponse:
|
||||
def __init__(self, acm: ACMResource) -> None:
|
||||
self._acm = acm
|
||||
|
||||
@cached_property
|
||||
def total_tls(self) -> TotalTLSWithRawResponse:
|
||||
return TotalTLSWithRawResponse(self._acm.total_tls)
|
||||
def total_tls(self) -> TotalTLSResourceWithRawResponse:
|
||||
return TotalTLSResourceWithRawResponse(self._acm.total_tls)
|
||||
|
||||
|
||||
class AsyncACMWithRawResponse:
|
||||
def __init__(self, acm: AsyncACM) -> None:
|
||||
class AsyncACMResourceWithRawResponse:
|
||||
def __init__(self, acm: AsyncACMResource) -> None:
|
||||
self._acm = acm
|
||||
|
||||
@cached_property
|
||||
def total_tls(self) -> AsyncTotalTLSWithRawResponse:
|
||||
return AsyncTotalTLSWithRawResponse(self._acm.total_tls)
|
||||
def total_tls(self) -> AsyncTotalTLSResourceWithRawResponse:
|
||||
return AsyncTotalTLSResourceWithRawResponse(self._acm.total_tls)
|
||||
|
||||
|
||||
class ACMWithStreamingResponse:
|
||||
def __init__(self, acm: ACM) -> None:
|
||||
class ACMResourceWithStreamingResponse:
|
||||
def __init__(self, acm: ACMResource) -> None:
|
||||
self._acm = acm
|
||||
|
||||
@cached_property
|
||||
def total_tls(self) -> TotalTLSWithStreamingResponse:
|
||||
return TotalTLSWithStreamingResponse(self._acm.total_tls)
|
||||
def total_tls(self) -> TotalTLSResourceWithStreamingResponse:
|
||||
return TotalTLSResourceWithStreamingResponse(self._acm.total_tls)
|
||||
|
||||
|
||||
class AsyncACMWithStreamingResponse:
|
||||
def __init__(self, acm: AsyncACM) -> None:
|
||||
class AsyncACMResourceWithStreamingResponse:
|
||||
def __init__(self, acm: AsyncACMResource) -> None:
|
||||
self._acm = acm
|
||||
|
||||
@cached_property
|
||||
def total_tls(self) -> AsyncTotalTLSWithStreamingResponse:
|
||||
return AsyncTotalTLSWithStreamingResponse(self._acm.total_tls)
|
||||
def total_tls(self) -> AsyncTotalTLSResourceWithStreamingResponse:
|
||||
return AsyncTotalTLSResourceWithStreamingResponse(self._acm.total_tls)
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
from typing_extensions import Literal
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._utils import maybe_transform, async_maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
|
|
@ -21,41 +17,53 @@ from ..._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ...types.acm import TotalTLSGetResponse, TotalTLSCreateResponse, total_tls_create_params
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.acm import CertificateAuthority, total_tls_create_params
|
||||
from ..._base_client import make_request_options
|
||||
from ...types.acm.certificate_authority import CertificateAuthority
|
||||
from ...types.acm.total_tls_get_response import TotalTLSGetResponse
|
||||
from ...types.acm.total_tls_create_response import TotalTLSCreateResponse
|
||||
|
||||
__all__ = ["TotalTLS", "AsyncTotalTLS"]
|
||||
__all__ = ["TotalTLSResource", "AsyncTotalTLSResource"]
|
||||
|
||||
|
||||
class TotalTLS(SyncAPIResource):
|
||||
class TotalTLSResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TotalTLSWithRawResponse:
|
||||
return TotalTLSWithRawResponse(self)
|
||||
def with_raw_response(self) -> TotalTLSResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return TotalTLSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TotalTLSWithStreamingResponse:
|
||||
return TotalTLSWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> TotalTLSResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return TotalTLSResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
enabled: bool,
|
||||
certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN,
|
||||
certificate_authority: CertificateAuthority | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> TotalTLSCreateResponse:
|
||||
) -> Optional[TotalTLSCreateResponse]:
|
||||
"""
|
||||
Set Total TLS Settings or disable the feature for a Zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier.
|
||||
|
||||
enabled: If enabled, Total TLS will order a hostname specific TLS certificate for any
|
||||
proxied A, AAAA, or CNAME record in your zone.
|
||||
|
|
@ -86,9 +94,9 @@ class TotalTLS(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]),
|
||||
cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -101,12 +109,12 @@ class TotalTLS(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> TotalTLSGetResponse:
|
||||
) -> Optional[TotalTLSGetResponse]:
|
||||
"""
|
||||
Get Total TLS Settings for a Zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -125,39 +133,50 @@ class TotalTLS(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]),
|
||||
cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTotalTLS(AsyncAPIResource):
|
||||
class AsyncTotalTLSResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTotalTLSWithRawResponse:
|
||||
return AsyncTotalTLSWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncTotalTLSResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncTotalTLSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTotalTLSWithStreamingResponse:
|
||||
return AsyncTotalTLSWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncTotalTLSResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncTotalTLSResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
enabled: bool,
|
||||
certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN,
|
||||
certificate_authority: CertificateAuthority | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> TotalTLSCreateResponse:
|
||||
) -> Optional[TotalTLSCreateResponse]:
|
||||
"""
|
||||
Set Total TLS Settings or disable the feature for a Zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier.
|
||||
|
||||
enabled: If enabled, Total TLS will order a hostname specific TLS certificate for any
|
||||
proxied A, AAAA, or CNAME record in your zone.
|
||||
|
|
@ -188,9 +207,9 @@ class AsyncTotalTLS(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]),
|
||||
cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -203,12 +222,12 @@ class AsyncTotalTLS(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> TotalTLSGetResponse:
|
||||
) -> Optional[TotalTLSGetResponse]:
|
||||
"""
|
||||
Get Total TLS Settings for a Zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -227,14 +246,14 @@ class AsyncTotalTLS(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]),
|
||||
cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class TotalTLSWithRawResponse:
|
||||
def __init__(self, total_tls: TotalTLS) -> None:
|
||||
class TotalTLSResourceWithRawResponse:
|
||||
def __init__(self, total_tls: TotalTLSResource) -> None:
|
||||
self._total_tls = total_tls
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
|
|
@ -245,8 +264,8 @@ class TotalTLSWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncTotalTLSWithRawResponse:
|
||||
def __init__(self, total_tls: AsyncTotalTLS) -> None:
|
||||
class AsyncTotalTLSResourceWithRawResponse:
|
||||
def __init__(self, total_tls: AsyncTotalTLSResource) -> None:
|
||||
self._total_tls = total_tls
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
|
|
@ -257,8 +276,8 @@ class AsyncTotalTLSWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class TotalTLSWithStreamingResponse:
|
||||
def __init__(self, total_tls: TotalTLS) -> None:
|
||||
class TotalTLSResourceWithStreamingResponse:
|
||||
def __init__(self, total_tls: TotalTLSResource) -> None:
|
||||
self._total_tls = total_tls
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
|
|
@ -269,8 +288,8 @@ class TotalTLSWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncTotalTLSWithStreamingResponse:
|
||||
def __init__(self, total_tls: AsyncTotalTLS) -> None:
|
||||
class AsyncTotalTLSResourceWithStreamingResponse:
|
||||
def __init__(self, total_tls: AsyncTotalTLSResource) -> None:
|
||||
self._total_tls = total_tls
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -1,75 +1,89 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .prefixes import (
|
||||
Prefixes,
|
||||
AsyncPrefixes,
|
||||
PrefixesWithRawResponse,
|
||||
AsyncPrefixesWithRawResponse,
|
||||
PrefixesWithStreamingResponse,
|
||||
AsyncPrefixesWithStreamingResponse,
|
||||
PrefixesResource,
|
||||
AsyncPrefixesResource,
|
||||
PrefixesResourceWithRawResponse,
|
||||
AsyncPrefixesResourceWithRawResponse,
|
||||
PrefixesResourceWithStreamingResponse,
|
||||
AsyncPrefixesResourceWithStreamingResponse,
|
||||
)
|
||||
from .services import (
|
||||
Services,
|
||||
AsyncServices,
|
||||
ServicesWithRawResponse,
|
||||
AsyncServicesWithRawResponse,
|
||||
ServicesWithStreamingResponse,
|
||||
AsyncServicesWithStreamingResponse,
|
||||
ServicesResource,
|
||||
AsyncServicesResource,
|
||||
ServicesResourceWithRawResponse,
|
||||
AsyncServicesResourceWithRawResponse,
|
||||
ServicesResourceWithStreamingResponse,
|
||||
AsyncServicesResourceWithStreamingResponse,
|
||||
)
|
||||
from .addressing import (
|
||||
Addressing,
|
||||
AsyncAddressing,
|
||||
AddressingWithRawResponse,
|
||||
AsyncAddressingWithRawResponse,
|
||||
AddressingWithStreamingResponse,
|
||||
AsyncAddressingWithStreamingResponse,
|
||||
AddressingResource,
|
||||
AsyncAddressingResource,
|
||||
AddressingResourceWithRawResponse,
|
||||
AsyncAddressingResourceWithRawResponse,
|
||||
AddressingResourceWithStreamingResponse,
|
||||
AsyncAddressingResourceWithStreamingResponse,
|
||||
)
|
||||
from .address_maps import (
|
||||
AddressMaps,
|
||||
AsyncAddressMaps,
|
||||
AddressMapsWithRawResponse,
|
||||
AsyncAddressMapsWithRawResponse,
|
||||
AddressMapsWithStreamingResponse,
|
||||
AsyncAddressMapsWithStreamingResponse,
|
||||
AddressMapsResource,
|
||||
AsyncAddressMapsResource,
|
||||
AddressMapsResourceWithRawResponse,
|
||||
AsyncAddressMapsResourceWithRawResponse,
|
||||
AddressMapsResourceWithStreamingResponse,
|
||||
AsyncAddressMapsResourceWithStreamingResponse,
|
||||
)
|
||||
from .loa_documents import (
|
||||
LOADocuments,
|
||||
AsyncLOADocuments,
|
||||
LOADocumentsWithRawResponse,
|
||||
AsyncLOADocumentsWithRawResponse,
|
||||
LOADocumentsWithStreamingResponse,
|
||||
AsyncLOADocumentsWithStreamingResponse,
|
||||
LOADocumentsResource,
|
||||
AsyncLOADocumentsResource,
|
||||
LOADocumentsResourceWithRawResponse,
|
||||
AsyncLOADocumentsResourceWithRawResponse,
|
||||
LOADocumentsResourceWithStreamingResponse,
|
||||
AsyncLOADocumentsResourceWithStreamingResponse,
|
||||
)
|
||||
from .regional_hostnames import (
|
||||
RegionalHostnamesResource,
|
||||
AsyncRegionalHostnamesResource,
|
||||
RegionalHostnamesResourceWithRawResponse,
|
||||
AsyncRegionalHostnamesResourceWithRawResponse,
|
||||
RegionalHostnamesResourceWithStreamingResponse,
|
||||
AsyncRegionalHostnamesResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Services",
|
||||
"AsyncServices",
|
||||
"ServicesWithRawResponse",
|
||||
"AsyncServicesWithRawResponse",
|
||||
"ServicesWithStreamingResponse",
|
||||
"AsyncServicesWithStreamingResponse",
|
||||
"AddressMaps",
|
||||
"AsyncAddressMaps",
|
||||
"AddressMapsWithRawResponse",
|
||||
"AsyncAddressMapsWithRawResponse",
|
||||
"AddressMapsWithStreamingResponse",
|
||||
"AsyncAddressMapsWithStreamingResponse",
|
||||
"LOADocuments",
|
||||
"AsyncLOADocuments",
|
||||
"LOADocumentsWithRawResponse",
|
||||
"AsyncLOADocumentsWithRawResponse",
|
||||
"LOADocumentsWithStreamingResponse",
|
||||
"AsyncLOADocumentsWithStreamingResponse",
|
||||
"Prefixes",
|
||||
"AsyncPrefixes",
|
||||
"PrefixesWithRawResponse",
|
||||
"AsyncPrefixesWithRawResponse",
|
||||
"PrefixesWithStreamingResponse",
|
||||
"AsyncPrefixesWithStreamingResponse",
|
||||
"Addressing",
|
||||
"AsyncAddressing",
|
||||
"AddressingWithRawResponse",
|
||||
"AsyncAddressingWithRawResponse",
|
||||
"AddressingWithStreamingResponse",
|
||||
"AsyncAddressingWithStreamingResponse",
|
||||
"RegionalHostnamesResource",
|
||||
"AsyncRegionalHostnamesResource",
|
||||
"RegionalHostnamesResourceWithRawResponse",
|
||||
"AsyncRegionalHostnamesResourceWithRawResponse",
|
||||
"RegionalHostnamesResourceWithStreamingResponse",
|
||||
"AsyncRegionalHostnamesResourceWithStreamingResponse",
|
||||
"ServicesResource",
|
||||
"AsyncServicesResource",
|
||||
"ServicesResourceWithRawResponse",
|
||||
"AsyncServicesResourceWithRawResponse",
|
||||
"ServicesResourceWithStreamingResponse",
|
||||
"AsyncServicesResourceWithStreamingResponse",
|
||||
"AddressMapsResource",
|
||||
"AsyncAddressMapsResource",
|
||||
"AddressMapsResourceWithRawResponse",
|
||||
"AsyncAddressMapsResourceWithRawResponse",
|
||||
"AddressMapsResourceWithStreamingResponse",
|
||||
"AsyncAddressMapsResourceWithStreamingResponse",
|
||||
"LOADocumentsResource",
|
||||
"AsyncLOADocumentsResource",
|
||||
"LOADocumentsResourceWithRawResponse",
|
||||
"AsyncLOADocumentsResourceWithRawResponse",
|
||||
"LOADocumentsResourceWithStreamingResponse",
|
||||
"AsyncLOADocumentsResourceWithStreamingResponse",
|
||||
"PrefixesResource",
|
||||
"AsyncPrefixesResource",
|
||||
"PrefixesResourceWithRawResponse",
|
||||
"AsyncPrefixesResourceWithRawResponse",
|
||||
"PrefixesResourceWithStreamingResponse",
|
||||
"AsyncPrefixesResourceWithStreamingResponse",
|
||||
"AddressingResource",
|
||||
"AsyncAddressingResource",
|
||||
"AddressingResourceWithRawResponse",
|
||||
"AsyncAddressingResourceWithRawResponse",
|
||||
"AddressingResourceWithStreamingResponse",
|
||||
"AsyncAddressingResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,61 +1,61 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .ips import (
|
||||
IPs,
|
||||
AsyncIPs,
|
||||
IPsWithRawResponse,
|
||||
AsyncIPsWithRawResponse,
|
||||
IPsWithStreamingResponse,
|
||||
AsyncIPsWithStreamingResponse,
|
||||
IPsResource,
|
||||
AsyncIPsResource,
|
||||
IPsResourceWithRawResponse,
|
||||
AsyncIPsResourceWithRawResponse,
|
||||
IPsResourceWithStreamingResponse,
|
||||
AsyncIPsResourceWithStreamingResponse,
|
||||
)
|
||||
from .zones import (
|
||||
Zones,
|
||||
AsyncZones,
|
||||
ZonesWithRawResponse,
|
||||
AsyncZonesWithRawResponse,
|
||||
ZonesWithStreamingResponse,
|
||||
AsyncZonesWithStreamingResponse,
|
||||
ZonesResource,
|
||||
AsyncZonesResource,
|
||||
ZonesResourceWithRawResponse,
|
||||
AsyncZonesResourceWithRawResponse,
|
||||
ZonesResourceWithStreamingResponse,
|
||||
AsyncZonesResourceWithStreamingResponse,
|
||||
)
|
||||
from .accounts import (
|
||||
Accounts,
|
||||
AsyncAccounts,
|
||||
AccountsWithRawResponse,
|
||||
AsyncAccountsWithRawResponse,
|
||||
AccountsWithStreamingResponse,
|
||||
AsyncAccountsWithStreamingResponse,
|
||||
AccountsResource,
|
||||
AsyncAccountsResource,
|
||||
AccountsResourceWithRawResponse,
|
||||
AsyncAccountsResourceWithRawResponse,
|
||||
AccountsResourceWithStreamingResponse,
|
||||
AsyncAccountsResourceWithStreamingResponse,
|
||||
)
|
||||
from .address_maps import (
|
||||
AddressMaps,
|
||||
AsyncAddressMaps,
|
||||
AddressMapsWithRawResponse,
|
||||
AsyncAddressMapsWithRawResponse,
|
||||
AddressMapsWithStreamingResponse,
|
||||
AsyncAddressMapsWithStreamingResponse,
|
||||
AddressMapsResource,
|
||||
AsyncAddressMapsResource,
|
||||
AddressMapsResourceWithRawResponse,
|
||||
AsyncAddressMapsResourceWithRawResponse,
|
||||
AddressMapsResourceWithStreamingResponse,
|
||||
AsyncAddressMapsResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Accounts",
|
||||
"AsyncAccounts",
|
||||
"AccountsWithRawResponse",
|
||||
"AsyncAccountsWithRawResponse",
|
||||
"AccountsWithStreamingResponse",
|
||||
"AsyncAccountsWithStreamingResponse",
|
||||
"IPs",
|
||||
"AsyncIPs",
|
||||
"IPsWithRawResponse",
|
||||
"AsyncIPsWithRawResponse",
|
||||
"IPsWithStreamingResponse",
|
||||
"AsyncIPsWithStreamingResponse",
|
||||
"Zones",
|
||||
"AsyncZones",
|
||||
"ZonesWithRawResponse",
|
||||
"AsyncZonesWithRawResponse",
|
||||
"ZonesWithStreamingResponse",
|
||||
"AsyncZonesWithStreamingResponse",
|
||||
"AddressMaps",
|
||||
"AsyncAddressMaps",
|
||||
"AddressMapsWithRawResponse",
|
||||
"AsyncAddressMapsWithRawResponse",
|
||||
"AddressMapsWithStreamingResponse",
|
||||
"AsyncAddressMapsWithStreamingResponse",
|
||||
"AccountsResource",
|
||||
"AsyncAccountsResource",
|
||||
"AccountsResourceWithRawResponse",
|
||||
"AsyncAccountsResourceWithRawResponse",
|
||||
"AccountsResourceWithStreamingResponse",
|
||||
"AsyncAccountsResourceWithStreamingResponse",
|
||||
"IPsResource",
|
||||
"AsyncIPsResource",
|
||||
"IPsResourceWithRawResponse",
|
||||
"AsyncIPsResourceWithRawResponse",
|
||||
"IPsResourceWithStreamingResponse",
|
||||
"AsyncIPsResourceWithStreamingResponse",
|
||||
"ZonesResource",
|
||||
"AsyncZonesResource",
|
||||
"ZonesResourceWithRawResponse",
|
||||
"AsyncZonesResourceWithRawResponse",
|
||||
"ZonesResourceWithStreamingResponse",
|
||||
"AsyncZonesResourceWithStreamingResponse",
|
||||
"AddressMapsResource",
|
||||
"AsyncAddressMapsResource",
|
||||
"AddressMapsResourceWithRawResponse",
|
||||
"AsyncAddressMapsResourceWithRawResponse",
|
||||
"AddressMapsResourceWithStreamingResponse",
|
||||
"AsyncAddressMapsResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -15,43 +14,54 @@ from ...._response import (
|
|||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing.address_maps import AccountDeleteResponse, AccountUpdateResponse
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.addressing.address_maps import account_update_params
|
||||
from ....types.addressing.address_maps.account_delete_response import AccountDeleteResponse
|
||||
from ....types.addressing.address_maps.account_update_response import AccountUpdateResponse
|
||||
|
||||
__all__ = ["Accounts", "AsyncAccounts"]
|
||||
__all__ = ["AccountsResource", "AsyncAccountsResource"]
|
||||
|
||||
|
||||
class Accounts(SyncAPIResource):
|
||||
class AccountsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AccountsWithRawResponse:
|
||||
return AccountsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AccountsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AccountsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AccountsWithStreamingResponse:
|
||||
return AccountsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AccountsResourceWithStreamingResponse(self)
|
||||
|
||||
def update(
|
||||
self,
|
||||
address_map_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AccountUpdateResponse]:
|
||||
) -> AccountUpdateResponse:
|
||||
"""
|
||||
Add an account as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -65,21 +75,13 @@ class Accounts(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AccountUpdateResponse],
|
||||
self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
body=maybe_transform(body, account_update_params.AccountUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AccountUpdateResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -93,14 +95,14 @@ class Accounts(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AccountDeleteResponse]:
|
||||
) -> AccountDeleteResponse:
|
||||
"""
|
||||
Remove an account as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -114,52 +116,55 @@ class Accounts(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AccountDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AccountDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAccounts(AsyncAPIResource):
|
||||
class AsyncAccountsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAccountsWithRawResponse:
|
||||
return AsyncAccountsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAccountsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAccountsWithStreamingResponse:
|
||||
return AsyncAccountsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAccountsResourceWithStreamingResponse(self)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
address_map_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AccountUpdateResponse]:
|
||||
) -> AccountUpdateResponse:
|
||||
"""
|
||||
Add an account as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -173,21 +178,13 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AccountUpdateResponse],
|
||||
await self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
body=await async_maybe_transform(body, account_update_params.AccountUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AccountUpdateResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -201,14 +198,14 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AccountDeleteResponse]:
|
||||
) -> AccountDeleteResponse:
|
||||
"""
|
||||
Remove an account as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -222,26 +219,17 @@ class AsyncAccounts(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AccountDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AccountDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AccountDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class AccountsWithRawResponse:
|
||||
def __init__(self, accounts: Accounts) -> None:
|
||||
class AccountsResourceWithRawResponse:
|
||||
def __init__(self, accounts: AccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.update = to_raw_response_wrapper(
|
||||
|
|
@ -252,8 +240,8 @@ class AccountsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncAccountsWithRawResponse:
|
||||
def __init__(self, accounts: AsyncAccounts) -> None:
|
||||
class AsyncAccountsResourceWithRawResponse:
|
||||
def __init__(self, accounts: AsyncAccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
|
|
@ -264,8 +252,8 @@ class AsyncAccountsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AccountsWithStreamingResponse:
|
||||
def __init__(self, accounts: Accounts) -> None:
|
||||
class AccountsResourceWithStreamingResponse:
|
||||
def __init__(self, accounts: AccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.update = to_streamed_response_wrapper(
|
||||
|
|
@ -276,8 +264,8 @@ class AccountsWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncAccountsWithStreamingResponse:
|
||||
def __init__(self, accounts: AsyncAccounts) -> None:
|
||||
class AsyncAccountsResourceWithStreamingResponse:
|
||||
def __init__(self, accounts: AsyncAccountsResource) -> None:
|
||||
self._accounts = accounts
|
||||
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -2,39 +2,36 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import List, Type, Iterable, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from .ips import (
|
||||
IPs,
|
||||
AsyncIPs,
|
||||
IPsWithRawResponse,
|
||||
AsyncIPsWithRawResponse,
|
||||
IPsWithStreamingResponse,
|
||||
AsyncIPsWithStreamingResponse,
|
||||
IPsResource,
|
||||
AsyncIPsResource,
|
||||
IPsResourceWithRawResponse,
|
||||
AsyncIPsResourceWithRawResponse,
|
||||
IPsResourceWithStreamingResponse,
|
||||
AsyncIPsResourceWithStreamingResponse,
|
||||
)
|
||||
from .zones import (
|
||||
Zones,
|
||||
AsyncZones,
|
||||
ZonesWithRawResponse,
|
||||
AsyncZonesWithRawResponse,
|
||||
ZonesWithStreamingResponse,
|
||||
AsyncZonesWithStreamingResponse,
|
||||
ZonesResource,
|
||||
AsyncZonesResource,
|
||||
ZonesResourceWithRawResponse,
|
||||
AsyncZonesResourceWithRawResponse,
|
||||
ZonesResourceWithStreamingResponse,
|
||||
AsyncZonesResourceWithStreamingResponse,
|
||||
)
|
||||
from .accounts import (
|
||||
Accounts,
|
||||
AsyncAccounts,
|
||||
AccountsWithRawResponse,
|
||||
AsyncAccountsWithRawResponse,
|
||||
AccountsWithStreamingResponse,
|
||||
AsyncAccountsWithStreamingResponse,
|
||||
AccountsResource,
|
||||
AsyncAccountsResource,
|
||||
AccountsResourceWithRawResponse,
|
||||
AsyncAccountsResourceWithRawResponse,
|
||||
AccountsResourceWithStreamingResponse,
|
||||
AsyncAccountsResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -44,42 +41,48 @@ from ...._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing import (
|
||||
AddressingAddressMaps,
|
||||
AddressMapGetResponse,
|
||||
AddressMapListResponse,
|
||||
AddressMapCreateResponse,
|
||||
AddressMapDeleteResponse,
|
||||
address_map_edit_params,
|
||||
address_map_create_params,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing import address_map_edit_params, address_map_create_params
|
||||
from ....types.addressing.address_map import AddressMap
|
||||
from ....types.addressing.address_map_get_response import AddressMapGetResponse
|
||||
from ....types.addressing.address_map_create_response import AddressMapCreateResponse
|
||||
from ....types.addressing.address_map_delete_response import AddressMapDeleteResponse
|
||||
|
||||
__all__ = ["AddressMaps", "AsyncAddressMaps"]
|
||||
__all__ = ["AddressMapsResource", "AsyncAddressMapsResource"]
|
||||
|
||||
|
||||
class AddressMaps(SyncAPIResource):
|
||||
class AddressMapsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def accounts(self) -> Accounts:
|
||||
return Accounts(self._client)
|
||||
def accounts(self) -> AccountsResource:
|
||||
return AccountsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> IPs:
|
||||
return IPs(self._client)
|
||||
def ips(self) -> IPsResource:
|
||||
return IPsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> Zones:
|
||||
return Zones(self._client)
|
||||
def zones(self) -> ZonesResource:
|
||||
return ZonesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AddressMapsWithRawResponse:
|
||||
return AddressMapsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AddressMapsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AddressMapsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AddressMapsWithStreamingResponse:
|
||||
return AddressMapsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AddressMapsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AddressMapsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
|
|
@ -87,18 +90,20 @@ class AddressMaps(SyncAPIResource):
|
|||
account_id: str,
|
||||
description: Optional[str] | NotGiven = NOT_GIVEN,
|
||||
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
||||
ips: List[str] | NotGiven = NOT_GIVEN,
|
||||
memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressMapCreateResponse:
|
||||
) -> Optional[AddressMapCreateResponse]:
|
||||
"""
|
||||
Create a new address map under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
description: An optional description field which may be used to describe the types of IPs or
|
||||
zones on the map.
|
||||
|
|
@ -106,6 +111,9 @@ class AddressMaps(SyncAPIResource):
|
|||
enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
|
||||
with IP addresses on an Address Map until the map is enabled.
|
||||
|
||||
memberships: Zones and Accounts which will be assigned IPs on this Address Map. A zone
|
||||
membership will take priority over an account membership.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -122,6 +130,8 @@ class AddressMaps(SyncAPIResource):
|
|||
{
|
||||
"description": description,
|
||||
"enabled": enabled,
|
||||
"ips": ips,
|
||||
"memberships": memberships,
|
||||
},
|
||||
address_map_create_params.AddressMapCreateParams,
|
||||
),
|
||||
|
|
@ -130,9 +140,9 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMapCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressMapCreateResponse], ResultWrapper[AddressMapCreateResponse]),
|
||||
cast_to=cast(Type[Optional[AddressMapCreateResponse]], ResultWrapper[AddressMapCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -145,12 +155,12 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AddressMapListResponse]:
|
||||
) -> SyncSinglePage[AddressMap]:
|
||||
"""
|
||||
List all address maps owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -162,16 +172,13 @@ class AddressMaps(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/address_maps",
|
||||
page=SyncSinglePage[AddressMap],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[AddressMapListResponse]], ResultWrapper[AddressMapListResponse]),
|
||||
model=AddressMap,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -185,16 +192,16 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AddressMapDeleteResponse]:
|
||||
) -> AddressMapDeleteResponse:
|
||||
"""Delete a particular address map owned by the account.
|
||||
|
||||
An Address Map must be
|
||||
disabled before it can be deleted.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -208,21 +215,12 @@ class AddressMaps(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AddressMapDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AddressMapDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AddressMapDeleteResponse,
|
||||
)
|
||||
|
||||
def edit(
|
||||
|
|
@ -239,14 +237,14 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingAddressMaps:
|
||||
) -> Optional[AddressMap]:
|
||||
"""
|
||||
Modify properties of an address map owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
default_sni: If you have legacy TLS clients which do not send the TLS server name indicator,
|
||||
then you can specify one default SNI on the map. If Cloudflare receives a TLS
|
||||
|
|
@ -287,9 +285,9 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMap]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]),
|
||||
cast_to=cast(Type[Optional[AddressMap]], ResultWrapper[AddressMap]),
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -303,14 +301,14 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressMapGetResponse:
|
||||
) -> Optional[AddressMapGetResponse]:
|
||||
"""
|
||||
Show a particular address map owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -331,32 +329,43 @@ class AddressMaps(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMapGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressMapGetResponse], ResultWrapper[AddressMapGetResponse]),
|
||||
cast_to=cast(Type[Optional[AddressMapGetResponse]], ResultWrapper[AddressMapGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAddressMaps(AsyncAPIResource):
|
||||
class AsyncAddressMapsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def accounts(self) -> AsyncAccounts:
|
||||
return AsyncAccounts(self._client)
|
||||
def accounts(self) -> AsyncAccountsResource:
|
||||
return AsyncAccountsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> AsyncIPs:
|
||||
return AsyncIPs(self._client)
|
||||
def ips(self) -> AsyncIPsResource:
|
||||
return AsyncIPsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> AsyncZones:
|
||||
return AsyncZones(self._client)
|
||||
def zones(self) -> AsyncZonesResource:
|
||||
return AsyncZonesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAddressMapsWithRawResponse:
|
||||
return AsyncAddressMapsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncAddressMapsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAddressMapsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAddressMapsWithStreamingResponse:
|
||||
return AsyncAddressMapsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncAddressMapsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAddressMapsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
|
|
@ -364,18 +373,20 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
account_id: str,
|
||||
description: Optional[str] | NotGiven = NOT_GIVEN,
|
||||
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
||||
ips: List[str] | NotGiven = NOT_GIVEN,
|
||||
memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressMapCreateResponse:
|
||||
) -> Optional[AddressMapCreateResponse]:
|
||||
"""
|
||||
Create a new address map under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
description: An optional description field which may be used to describe the types of IPs or
|
||||
zones on the map.
|
||||
|
|
@ -383,6 +394,9 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
|
||||
with IP addresses on an Address Map until the map is enabled.
|
||||
|
||||
memberships: Zones and Accounts which will be assigned IPs on this Address Map. A zone
|
||||
membership will take priority over an account membership.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -399,6 +413,8 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
{
|
||||
"description": description,
|
||||
"enabled": enabled,
|
||||
"ips": ips,
|
||||
"memberships": memberships,
|
||||
},
|
||||
address_map_create_params.AddressMapCreateParams,
|
||||
),
|
||||
|
|
@ -407,12 +423,12 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMapCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressMapCreateResponse], ResultWrapper[AddressMapCreateResponse]),
|
||||
cast_to=cast(Type[Optional[AddressMapCreateResponse]], ResultWrapper[AddressMapCreateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
|
|
@ -422,12 +438,12 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AddressMapListResponse]:
|
||||
) -> AsyncPaginator[AddressMap, AsyncSinglePage[AddressMap]]:
|
||||
"""
|
||||
List all address maps owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -439,16 +455,13 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/address_maps",
|
||||
page=AsyncSinglePage[AddressMap],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[AddressMapListResponse]], ResultWrapper[AddressMapListResponse]),
|
||||
model=AddressMap,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -462,16 +475,16 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AddressMapDeleteResponse]:
|
||||
) -> AddressMapDeleteResponse:
|
||||
"""Delete a particular address map owned by the account.
|
||||
|
||||
An Address Map must be
|
||||
disabled before it can be deleted.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -485,21 +498,12 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
return cast(
|
||||
Optional[AddressMapDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AddressMapDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AddressMapDeleteResponse,
|
||||
)
|
||||
|
||||
async def edit(
|
||||
|
|
@ -516,14 +520,14 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingAddressMaps:
|
||||
) -> Optional[AddressMap]:
|
||||
"""
|
||||
Modify properties of an address map owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
default_sni: If you have legacy TLS clients which do not send the TLS server name indicator,
|
||||
then you can specify one default SNI on the map. If Cloudflare receives a TLS
|
||||
|
|
@ -564,9 +568,9 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMap]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]),
|
||||
cast_to=cast(Type[Optional[AddressMap]], ResultWrapper[AddressMap]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -580,14 +584,14 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressMapGetResponse:
|
||||
) -> Optional[AddressMapGetResponse]:
|
||||
"""
|
||||
Show a particular address map owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -608,14 +612,14 @@ class AsyncAddressMaps(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[AddressMapGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressMapGetResponse], ResultWrapper[AddressMapGetResponse]),
|
||||
cast_to=cast(Type[Optional[AddressMapGetResponse]], ResultWrapper[AddressMapGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AddressMapsWithRawResponse:
|
||||
def __init__(self, address_maps: AddressMaps) -> None:
|
||||
class AddressMapsResourceWithRawResponse:
|
||||
def __init__(self, address_maps: AddressMapsResource) -> None:
|
||||
self._address_maps = address_maps
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
|
|
@ -635,20 +639,20 @@ class AddressMapsWithRawResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def accounts(self) -> AccountsWithRawResponse:
|
||||
return AccountsWithRawResponse(self._address_maps.accounts)
|
||||
def accounts(self) -> AccountsResourceWithRawResponse:
|
||||
return AccountsResourceWithRawResponse(self._address_maps.accounts)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> IPsWithRawResponse:
|
||||
return IPsWithRawResponse(self._address_maps.ips)
|
||||
def ips(self) -> IPsResourceWithRawResponse:
|
||||
return IPsResourceWithRawResponse(self._address_maps.ips)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> ZonesWithRawResponse:
|
||||
return ZonesWithRawResponse(self._address_maps.zones)
|
||||
def zones(self) -> ZonesResourceWithRawResponse:
|
||||
return ZonesResourceWithRawResponse(self._address_maps.zones)
|
||||
|
||||
|
||||
class AsyncAddressMapsWithRawResponse:
|
||||
def __init__(self, address_maps: AsyncAddressMaps) -> None:
|
||||
class AsyncAddressMapsResourceWithRawResponse:
|
||||
def __init__(self, address_maps: AsyncAddressMapsResource) -> None:
|
||||
self._address_maps = address_maps
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
|
|
@ -668,20 +672,20 @@ class AsyncAddressMapsWithRawResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def accounts(self) -> AsyncAccountsWithRawResponse:
|
||||
return AsyncAccountsWithRawResponse(self._address_maps.accounts)
|
||||
def accounts(self) -> AsyncAccountsResourceWithRawResponse:
|
||||
return AsyncAccountsResourceWithRawResponse(self._address_maps.accounts)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> AsyncIPsWithRawResponse:
|
||||
return AsyncIPsWithRawResponse(self._address_maps.ips)
|
||||
def ips(self) -> AsyncIPsResourceWithRawResponse:
|
||||
return AsyncIPsResourceWithRawResponse(self._address_maps.ips)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> AsyncZonesWithRawResponse:
|
||||
return AsyncZonesWithRawResponse(self._address_maps.zones)
|
||||
def zones(self) -> AsyncZonesResourceWithRawResponse:
|
||||
return AsyncZonesResourceWithRawResponse(self._address_maps.zones)
|
||||
|
||||
|
||||
class AddressMapsWithStreamingResponse:
|
||||
def __init__(self, address_maps: AddressMaps) -> None:
|
||||
class AddressMapsResourceWithStreamingResponse:
|
||||
def __init__(self, address_maps: AddressMapsResource) -> None:
|
||||
self._address_maps = address_maps
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
|
|
@ -701,20 +705,20 @@ class AddressMapsWithStreamingResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def accounts(self) -> AccountsWithStreamingResponse:
|
||||
return AccountsWithStreamingResponse(self._address_maps.accounts)
|
||||
def accounts(self) -> AccountsResourceWithStreamingResponse:
|
||||
return AccountsResourceWithStreamingResponse(self._address_maps.accounts)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> IPsWithStreamingResponse:
|
||||
return IPsWithStreamingResponse(self._address_maps.ips)
|
||||
def ips(self) -> IPsResourceWithStreamingResponse:
|
||||
return IPsResourceWithStreamingResponse(self._address_maps.ips)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> ZonesWithStreamingResponse:
|
||||
return ZonesWithStreamingResponse(self._address_maps.zones)
|
||||
def zones(self) -> ZonesResourceWithStreamingResponse:
|
||||
return ZonesResourceWithStreamingResponse(self._address_maps.zones)
|
||||
|
||||
|
||||
class AsyncAddressMapsWithStreamingResponse:
|
||||
def __init__(self, address_maps: AsyncAddressMaps) -> None:
|
||||
class AsyncAddressMapsResourceWithStreamingResponse:
|
||||
def __init__(self, address_maps: AsyncAddressMapsResource) -> None:
|
||||
self._address_maps = address_maps
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
|
|
@ -734,13 +738,13 @@ class AsyncAddressMapsWithStreamingResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def accounts(self) -> AsyncAccountsWithStreamingResponse:
|
||||
return AsyncAccountsWithStreamingResponse(self._address_maps.accounts)
|
||||
def accounts(self) -> AsyncAccountsResourceWithStreamingResponse:
|
||||
return AsyncAccountsResourceWithStreamingResponse(self._address_maps.accounts)
|
||||
|
||||
@cached_property
|
||||
def ips(self) -> AsyncIPsWithStreamingResponse:
|
||||
return AsyncIPsWithStreamingResponse(self._address_maps.ips)
|
||||
def ips(self) -> AsyncIPsResourceWithStreamingResponse:
|
||||
return AsyncIPsResourceWithStreamingResponse(self._address_maps.ips)
|
||||
|
||||
@cached_property
|
||||
def zones(self) -> AsyncZonesWithStreamingResponse:
|
||||
return AsyncZonesWithStreamingResponse(self._address_maps.zones)
|
||||
def zones(self) -> AsyncZonesResourceWithStreamingResponse:
|
||||
return AsyncZonesResourceWithStreamingResponse(self._address_maps.zones)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -15,23 +14,33 @@ from ...._response import (
|
|||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing.address_maps import IPDeleteResponse, IPUpdateResponse
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.addressing.address_maps import ip_update_params
|
||||
from ....types.addressing.address_maps.ip_delete_response import IPDeleteResponse
|
||||
from ....types.addressing.address_maps.ip_update_response import IPUpdateResponse
|
||||
|
||||
__all__ = ["IPs", "AsyncIPs"]
|
||||
__all__ = ["IPsResource", "AsyncIPsResource"]
|
||||
|
||||
|
||||
class IPs(SyncAPIResource):
|
||||
class IPsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> IPsWithRawResponse:
|
||||
return IPsWithRawResponse(self)
|
||||
def with_raw_response(self) -> IPsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return IPsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> IPsWithStreamingResponse:
|
||||
return IPsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> IPsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return IPsResourceWithStreamingResponse(self)
|
||||
|
||||
def update(
|
||||
self,
|
||||
|
|
@ -39,20 +48,21 @@ class IPs(SyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
address_map_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPUpdateResponse]:
|
||||
) -> IPUpdateResponse:
|
||||
"""
|
||||
Add an IP from a prefix owned by the account to a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
ip_address: An IPv4 or IPv6 address.
|
||||
|
||||
|
|
@ -70,21 +80,13 @@ class IPs(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not ip_address:
|
||||
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
|
||||
return cast(
|
||||
Optional[IPUpdateResponse],
|
||||
self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[IPUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
body=maybe_transform(body, ip_update_params.IPUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=IPUpdateResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -99,14 +101,14 @@ class IPs(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPDeleteResponse]:
|
||||
) -> IPDeleteResponse:
|
||||
"""
|
||||
Remove an IP from a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
ip_address: An IPv4 or IPv6 address.
|
||||
|
||||
|
|
@ -124,32 +126,34 @@ class IPs(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not ip_address:
|
||||
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
|
||||
return cast(
|
||||
Optional[IPDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[IPDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=IPDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPs(AsyncAPIResource):
|
||||
class AsyncIPsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncIPsWithRawResponse:
|
||||
return AsyncIPsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncIPsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncIPsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncIPsWithStreamingResponse:
|
||||
return AsyncIPsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncIPsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncIPsResourceWithStreamingResponse(self)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
|
|
@ -157,20 +161,21 @@ class AsyncIPs(AsyncAPIResource):
|
|||
*,
|
||||
account_id: str,
|
||||
address_map_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPUpdateResponse]:
|
||||
) -> IPUpdateResponse:
|
||||
"""
|
||||
Add an IP from a prefix owned by the account to a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
ip_address: An IPv4 or IPv6 address.
|
||||
|
||||
|
|
@ -188,21 +193,13 @@ class AsyncIPs(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not ip_address:
|
||||
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
|
||||
return cast(
|
||||
Optional[IPUpdateResponse],
|
||||
await self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[IPUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
body=await async_maybe_transform(body, ip_update_params.IPUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=IPUpdateResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -217,14 +214,14 @@ class AsyncIPs(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPDeleteResponse]:
|
||||
) -> IPDeleteResponse:
|
||||
"""
|
||||
Remove an IP from a particular address map.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
ip_address: An IPv4 or IPv6 address.
|
||||
|
||||
|
|
@ -242,26 +239,17 @@ class AsyncIPs(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not ip_address:
|
||||
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
|
||||
return cast(
|
||||
Optional[IPDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[IPDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=IPDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class IPsWithRawResponse:
|
||||
def __init__(self, ips: IPs) -> None:
|
||||
class IPsResourceWithRawResponse:
|
||||
def __init__(self, ips: IPsResource) -> None:
|
||||
self._ips = ips
|
||||
|
||||
self.update = to_raw_response_wrapper(
|
||||
|
|
@ -272,8 +260,8 @@ class IPsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncIPsWithRawResponse:
|
||||
def __init__(self, ips: AsyncIPs) -> None:
|
||||
class AsyncIPsResourceWithRawResponse:
|
||||
def __init__(self, ips: AsyncIPsResource) -> None:
|
||||
self._ips = ips
|
||||
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
|
|
@ -284,8 +272,8 @@ class AsyncIPsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class IPsWithStreamingResponse:
|
||||
def __init__(self, ips: IPs) -> None:
|
||||
class IPsResourceWithStreamingResponse:
|
||||
def __init__(self, ips: IPsResource) -> None:
|
||||
self._ips = ips
|
||||
|
||||
self.update = to_streamed_response_wrapper(
|
||||
|
|
@ -296,8 +284,8 @@ class IPsWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncIPsWithStreamingResponse:
|
||||
def __init__(self, ips: AsyncIPs) -> None:
|
||||
class AsyncIPsResourceWithStreamingResponse:
|
||||
def __init__(self, ips: AsyncIPsResource) -> None:
|
||||
self._ips = ips
|
||||
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -15,23 +14,33 @@ from ...._response import (
|
|||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing.address_maps import ZoneDeleteResponse, ZoneUpdateResponse
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.addressing.address_maps import zone_update_params
|
||||
from ....types.addressing.address_maps.zone_delete_response import ZoneDeleteResponse
|
||||
from ....types.addressing.address_maps.zone_update_response import ZoneUpdateResponse
|
||||
|
||||
__all__ = ["Zones", "AsyncZones"]
|
||||
__all__ = ["ZonesResource", "AsyncZonesResource"]
|
||||
|
||||
|
||||
class Zones(SyncAPIResource):
|
||||
class ZonesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ZonesWithRawResponse:
|
||||
return ZonesWithRawResponse(self)
|
||||
def with_raw_response(self) -> ZonesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ZonesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ZonesWithStreamingResponse:
|
||||
return ZonesWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> ZonesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ZonesResourceWithStreamingResponse(self)
|
||||
|
||||
def update(
|
||||
self,
|
||||
|
|
@ -39,22 +48,23 @@ class Zones(SyncAPIResource):
|
|||
*,
|
||||
zone_id: str,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZoneUpdateResponse]:
|
||||
) -> ZoneUpdateResponse:
|
||||
"""
|
||||
Add a zone as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier of a zone.
|
||||
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -70,32 +80,13 @@ class Zones(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not account_id and not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return cast(
|
||||
Optional[ZoneUpdateResponse],
|
||||
self._put(
|
||||
f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[ZoneUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
|
||||
body=maybe_transform(body, zone_update_params.ZoneUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ZoneUpdateResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -110,16 +101,16 @@ class Zones(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZoneDeleteResponse]:
|
||||
) -> ZoneDeleteResponse:
|
||||
"""
|
||||
Remove a zone as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier of a zone.
|
||||
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -135,43 +126,34 @@ class Zones(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not account_id and not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return cast(
|
||||
Optional[ZoneDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[ZoneDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ZoneDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncZones(AsyncAPIResource):
|
||||
class AsyncZonesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncZonesWithRawResponse:
|
||||
return AsyncZonesWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncZonesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncZonesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncZonesWithStreamingResponse:
|
||||
return AsyncZonesWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncZonesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncZonesResourceWithStreamingResponse(self)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
|
|
@ -179,22 +161,23 @@ class AsyncZones(AsyncAPIResource):
|
|||
*,
|
||||
zone_id: str,
|
||||
account_id: str,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZoneUpdateResponse]:
|
||||
) -> ZoneUpdateResponse:
|
||||
"""
|
||||
Add a zone as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier of a zone.
|
||||
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -210,32 +193,13 @@ class AsyncZones(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not account_id and not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return cast(
|
||||
Optional[ZoneUpdateResponse],
|
||||
await self._put(
|
||||
f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[ZoneUpdateResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._put(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
|
||||
body=await async_maybe_transform(body, zone_update_params.ZoneUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ZoneUpdateResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -250,16 +214,16 @@ class AsyncZones(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZoneDeleteResponse]:
|
||||
) -> ZoneDeleteResponse:
|
||||
"""
|
||||
Remove a zone as a member of a particular address map.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
zone_id: Identifier of a zone.
|
||||
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
address_map_id: Identifier
|
||||
address_map_id: Identifier of an Address Map.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -275,37 +239,17 @@ class AsyncZones(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not address_map_id:
|
||||
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
|
||||
if not account_id and not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return cast(
|
||||
Optional[ZoneDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_or_zone}/addressing/address_maps/{address_map_id}/zones/{account_or_zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[ZoneDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ZoneDeleteResponse,
|
||||
)
|
||||
|
||||
|
||||
class ZonesWithRawResponse:
|
||||
def __init__(self, zones: Zones) -> None:
|
||||
class ZonesResourceWithRawResponse:
|
||||
def __init__(self, zones: ZonesResource) -> None:
|
||||
self._zones = zones
|
||||
|
||||
self.update = to_raw_response_wrapper(
|
||||
|
|
@ -316,8 +260,8 @@ class ZonesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncZonesWithRawResponse:
|
||||
def __init__(self, zones: AsyncZones) -> None:
|
||||
class AsyncZonesResourceWithRawResponse:
|
||||
def __init__(self, zones: AsyncZonesResource) -> None:
|
||||
self._zones = zones
|
||||
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
|
|
@ -328,8 +272,8 @@ class AsyncZonesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class ZonesWithStreamingResponse:
|
||||
def __init__(self, zones: Zones) -> None:
|
||||
class ZonesResourceWithStreamingResponse:
|
||||
def __init__(self, zones: ZonesResource) -> None:
|
||||
self._zones = zones
|
||||
|
||||
self.update = to_streamed_response_wrapper(
|
||||
|
|
@ -340,8 +284,8 @@ class ZonesWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncZonesWithStreamingResponse:
|
||||
def __init__(self, zones: AsyncZones) -> None:
|
||||
class AsyncZonesResourceWithStreamingResponse:
|
||||
def __init__(self, zones: AsyncZonesResource) -> None:
|
||||
self._zones = zones
|
||||
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -2,178 +2,229 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from .prefixes import (
|
||||
Prefixes,
|
||||
AsyncPrefixes,
|
||||
PrefixesWithRawResponse,
|
||||
AsyncPrefixesWithRawResponse,
|
||||
PrefixesWithStreamingResponse,
|
||||
AsyncPrefixesWithStreamingResponse,
|
||||
)
|
||||
from .services import (
|
||||
Services,
|
||||
AsyncServices,
|
||||
ServicesWithRawResponse,
|
||||
AsyncServicesWithRawResponse,
|
||||
ServicesWithStreamingResponse,
|
||||
AsyncServicesWithStreamingResponse,
|
||||
ServicesResource,
|
||||
AsyncServicesResource,
|
||||
ServicesResourceWithRawResponse,
|
||||
AsyncServicesResourceWithRawResponse,
|
||||
ServicesResourceWithStreamingResponse,
|
||||
AsyncServicesResourceWithStreamingResponse,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from .address_maps import (
|
||||
AddressMaps,
|
||||
AsyncAddressMaps,
|
||||
AddressMapsWithRawResponse,
|
||||
AsyncAddressMapsWithRawResponse,
|
||||
AddressMapsWithStreamingResponse,
|
||||
AsyncAddressMapsWithStreamingResponse,
|
||||
)
|
||||
from .loa_documents import (
|
||||
LOADocuments,
|
||||
AsyncLOADocuments,
|
||||
LOADocumentsWithRawResponse,
|
||||
AsyncLOADocumentsWithRawResponse,
|
||||
LOADocumentsWithStreamingResponse,
|
||||
AsyncLOADocumentsWithStreamingResponse,
|
||||
LOADocumentsResource,
|
||||
AsyncLOADocumentsResource,
|
||||
LOADocumentsResourceWithRawResponse,
|
||||
AsyncLOADocumentsResourceWithRawResponse,
|
||||
LOADocumentsResourceWithStreamingResponse,
|
||||
AsyncLOADocumentsResourceWithStreamingResponse,
|
||||
)
|
||||
from .prefixes.prefixes import (
|
||||
PrefixesResource,
|
||||
AsyncPrefixesResource,
|
||||
PrefixesResourceWithRawResponse,
|
||||
AsyncPrefixesResourceWithRawResponse,
|
||||
PrefixesResourceWithStreamingResponse,
|
||||
AsyncPrefixesResourceWithStreamingResponse,
|
||||
)
|
||||
from .address_maps.address_maps import (
|
||||
AddressMapsResource,
|
||||
AsyncAddressMapsResource,
|
||||
AddressMapsResourceWithRawResponse,
|
||||
AsyncAddressMapsResourceWithRawResponse,
|
||||
AddressMapsResourceWithStreamingResponse,
|
||||
AsyncAddressMapsResourceWithStreamingResponse,
|
||||
)
|
||||
from .regional_hostnames.regional_hostnames import (
|
||||
RegionalHostnamesResource,
|
||||
AsyncRegionalHostnamesResource,
|
||||
RegionalHostnamesResourceWithRawResponse,
|
||||
AsyncRegionalHostnamesResourceWithRawResponse,
|
||||
RegionalHostnamesResourceWithStreamingResponse,
|
||||
AsyncRegionalHostnamesResourceWithStreamingResponse,
|
||||
)
|
||||
from .prefixes.prefixes import Prefixes, AsyncPrefixes
|
||||
from .address_maps.address_maps import AddressMaps, AsyncAddressMaps
|
||||
from .loa_documents.loa_documents import LOADocuments, AsyncLOADocuments
|
||||
|
||||
__all__ = ["Addressing", "AsyncAddressing"]
|
||||
__all__ = ["AddressingResource", "AsyncAddressingResource"]
|
||||
|
||||
|
||||
class Addressing(SyncAPIResource):
|
||||
class AddressingResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def services(self) -> Services:
|
||||
return Services(self._client)
|
||||
def regional_hostnames(self) -> RegionalHostnamesResource:
|
||||
return RegionalHostnamesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AddressMaps:
|
||||
return AddressMaps(self._client)
|
||||
def services(self) -> ServicesResource:
|
||||
return ServicesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> LOADocuments:
|
||||
return LOADocuments(self._client)
|
||||
def address_maps(self) -> AddressMapsResource:
|
||||
return AddressMapsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> Prefixes:
|
||||
return Prefixes(self._client)
|
||||
def loa_documents(self) -> LOADocumentsResource:
|
||||
return LOADocumentsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AddressingWithRawResponse:
|
||||
return AddressingWithRawResponse(self)
|
||||
def prefixes(self) -> PrefixesResource:
|
||||
return PrefixesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AddressingWithStreamingResponse:
|
||||
return AddressingWithStreamingResponse(self)
|
||||
def with_raw_response(self) -> AddressingResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
|
||||
class AsyncAddressing(AsyncAPIResource):
|
||||
@cached_property
|
||||
def services(self) -> AsyncServices:
|
||||
return AsyncServices(self._client)
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AddressingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AsyncAddressMaps:
|
||||
return AsyncAddressMaps(self._client)
|
||||
def with_streaming_response(self) -> AddressingResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AddressingResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncAddressingResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def regional_hostnames(self) -> AsyncRegionalHostnamesResource:
|
||||
return AsyncRegionalHostnamesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> AsyncLOADocuments:
|
||||
return AsyncLOADocuments(self._client)
|
||||
def services(self) -> AsyncServicesResource:
|
||||
return AsyncServicesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixes:
|
||||
return AsyncPrefixes(self._client)
|
||||
def address_maps(self) -> AsyncAddressMapsResource:
|
||||
return AsyncAddressMapsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAddressingWithRawResponse:
|
||||
return AsyncAddressingWithRawResponse(self)
|
||||
def loa_documents(self) -> AsyncLOADocumentsResource:
|
||||
return AsyncLOADocumentsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAddressingWithStreamingResponse:
|
||||
return AsyncAddressingWithStreamingResponse(self)
|
||||
def prefixes(self) -> AsyncPrefixesResource:
|
||||
return AsyncPrefixesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAddressingResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAddressingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAddressingResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAddressingResourceWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AddressingWithRawResponse:
|
||||
def __init__(self, addressing: Addressing) -> None:
|
||||
class AddressingResourceWithRawResponse:
|
||||
def __init__(self, addressing: AddressingResource) -> None:
|
||||
self._addressing = addressing
|
||||
|
||||
@cached_property
|
||||
def services(self) -> ServicesWithRawResponse:
|
||||
return ServicesWithRawResponse(self._addressing.services)
|
||||
def regional_hostnames(self) -> RegionalHostnamesResourceWithRawResponse:
|
||||
return RegionalHostnamesResourceWithRawResponse(self._addressing.regional_hostnames)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AddressMapsWithRawResponse:
|
||||
return AddressMapsWithRawResponse(self._addressing.address_maps)
|
||||
def services(self) -> ServicesResourceWithRawResponse:
|
||||
return ServicesResourceWithRawResponse(self._addressing.services)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> LOADocumentsWithRawResponse:
|
||||
return LOADocumentsWithRawResponse(self._addressing.loa_documents)
|
||||
def address_maps(self) -> AddressMapsResourceWithRawResponse:
|
||||
return AddressMapsResourceWithRawResponse(self._addressing.address_maps)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesWithRawResponse:
|
||||
return PrefixesWithRawResponse(self._addressing.prefixes)
|
||||
def loa_documents(self) -> LOADocumentsResourceWithRawResponse:
|
||||
return LOADocumentsResourceWithRawResponse(self._addressing.loa_documents)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesResourceWithRawResponse:
|
||||
return PrefixesResourceWithRawResponse(self._addressing.prefixes)
|
||||
|
||||
|
||||
class AsyncAddressingWithRawResponse:
|
||||
def __init__(self, addressing: AsyncAddressing) -> None:
|
||||
class AsyncAddressingResourceWithRawResponse:
|
||||
def __init__(self, addressing: AsyncAddressingResource) -> None:
|
||||
self._addressing = addressing
|
||||
|
||||
@cached_property
|
||||
def services(self) -> AsyncServicesWithRawResponse:
|
||||
return AsyncServicesWithRawResponse(self._addressing.services)
|
||||
def regional_hostnames(self) -> AsyncRegionalHostnamesResourceWithRawResponse:
|
||||
return AsyncRegionalHostnamesResourceWithRawResponse(self._addressing.regional_hostnames)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AsyncAddressMapsWithRawResponse:
|
||||
return AsyncAddressMapsWithRawResponse(self._addressing.address_maps)
|
||||
def services(self) -> AsyncServicesResourceWithRawResponse:
|
||||
return AsyncServicesResourceWithRawResponse(self._addressing.services)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> AsyncLOADocumentsWithRawResponse:
|
||||
return AsyncLOADocumentsWithRawResponse(self._addressing.loa_documents)
|
||||
def address_maps(self) -> AsyncAddressMapsResourceWithRawResponse:
|
||||
return AsyncAddressMapsResourceWithRawResponse(self._addressing.address_maps)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesWithRawResponse:
|
||||
return AsyncPrefixesWithRawResponse(self._addressing.prefixes)
|
||||
def loa_documents(self) -> AsyncLOADocumentsResourceWithRawResponse:
|
||||
return AsyncLOADocumentsResourceWithRawResponse(self._addressing.loa_documents)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesResourceWithRawResponse:
|
||||
return AsyncPrefixesResourceWithRawResponse(self._addressing.prefixes)
|
||||
|
||||
|
||||
class AddressingWithStreamingResponse:
|
||||
def __init__(self, addressing: Addressing) -> None:
|
||||
class AddressingResourceWithStreamingResponse:
|
||||
def __init__(self, addressing: AddressingResource) -> None:
|
||||
self._addressing = addressing
|
||||
|
||||
@cached_property
|
||||
def services(self) -> ServicesWithStreamingResponse:
|
||||
return ServicesWithStreamingResponse(self._addressing.services)
|
||||
def regional_hostnames(self) -> RegionalHostnamesResourceWithStreamingResponse:
|
||||
return RegionalHostnamesResourceWithStreamingResponse(self._addressing.regional_hostnames)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AddressMapsWithStreamingResponse:
|
||||
return AddressMapsWithStreamingResponse(self._addressing.address_maps)
|
||||
def services(self) -> ServicesResourceWithStreamingResponse:
|
||||
return ServicesResourceWithStreamingResponse(self._addressing.services)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> LOADocumentsWithStreamingResponse:
|
||||
return LOADocumentsWithStreamingResponse(self._addressing.loa_documents)
|
||||
def address_maps(self) -> AddressMapsResourceWithStreamingResponse:
|
||||
return AddressMapsResourceWithStreamingResponse(self._addressing.address_maps)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesWithStreamingResponse:
|
||||
return PrefixesWithStreamingResponse(self._addressing.prefixes)
|
||||
def loa_documents(self) -> LOADocumentsResourceWithStreamingResponse:
|
||||
return LOADocumentsResourceWithStreamingResponse(self._addressing.loa_documents)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesResourceWithStreamingResponse:
|
||||
return PrefixesResourceWithStreamingResponse(self._addressing.prefixes)
|
||||
|
||||
|
||||
class AsyncAddressingWithStreamingResponse:
|
||||
def __init__(self, addressing: AsyncAddressing) -> None:
|
||||
class AsyncAddressingResourceWithStreamingResponse:
|
||||
def __init__(self, addressing: AsyncAddressingResource) -> None:
|
||||
self._addressing = addressing
|
||||
|
||||
@cached_property
|
||||
def services(self) -> AsyncServicesWithStreamingResponse:
|
||||
return AsyncServicesWithStreamingResponse(self._addressing.services)
|
||||
def regional_hostnames(self) -> AsyncRegionalHostnamesResourceWithStreamingResponse:
|
||||
return AsyncRegionalHostnamesResourceWithStreamingResponse(self._addressing.regional_hostnames)
|
||||
|
||||
@cached_property
|
||||
def address_maps(self) -> AsyncAddressMapsWithStreamingResponse:
|
||||
return AsyncAddressMapsWithStreamingResponse(self._addressing.address_maps)
|
||||
def services(self) -> AsyncServicesResourceWithStreamingResponse:
|
||||
return AsyncServicesResourceWithStreamingResponse(self._addressing.services)
|
||||
|
||||
@cached_property
|
||||
def loa_documents(self) -> AsyncLOADocumentsWithStreamingResponse:
|
||||
return AsyncLOADocumentsWithStreamingResponse(self._addressing.loa_documents)
|
||||
def address_maps(self) -> AsyncAddressMapsResourceWithStreamingResponse:
|
||||
return AsyncAddressMapsResourceWithStreamingResponse(self._addressing.address_maps)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesWithStreamingResponse:
|
||||
return AsyncPrefixesWithStreamingResponse(self._addressing.prefixes)
|
||||
def loa_documents(self) -> AsyncLOADocumentsResourceWithStreamingResponse:
|
||||
return AsyncLOADocumentsResourceWithStreamingResponse(self._addressing.loa_documents)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesResourceWithStreamingResponse:
|
||||
return AsyncPrefixesResourceWithStreamingResponse(self._addressing.prefixes)
|
||||
|
|
|
|||
304
src/cloudflare/resources/addressing/loa_documents.py
Normal file
304
src/cloudflare/resources/addressing/loa_documents.py
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import maybe_transform, async_maybe_transform
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
BinaryAPIResponse,
|
||||
AsyncBinaryAPIResponse,
|
||||
StreamedBinaryAPIResponse,
|
||||
AsyncStreamedBinaryAPIResponse,
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
to_custom_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
to_custom_streamed_response_wrapper,
|
||||
async_to_custom_raw_response_wrapper,
|
||||
async_to_custom_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import make_request_options
|
||||
from ...types.addressing import loa_document_create_params
|
||||
from ...types.addressing.loa_document_create_response import LOADocumentCreateResponse
|
||||
|
||||
__all__ = ["LOADocumentsResource", "AsyncLOADocumentsResource"]
|
||||
|
||||
|
||||
class LOADocumentsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> LOADocumentsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return LOADocumentsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> LOADocumentsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return LOADocumentsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
loa_document: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[LOADocumentCreateResponse]:
|
||||
"""
|
||||
Submit LOA document (pdf format) under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
loa_document: LOA document to upload.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
# It should be noted that the actual Content-Type header that will be
|
||||
# sent to the server will contain a `boundary` parameter, e.g.
|
||||
# multipart/form-data; boundary=---abc--
|
||||
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/addressing/loa_documents",
|
||||
body=maybe_transform({"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[LOADocumentCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
loa_document_id: Optional[str],
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> BinaryAPIResponse:
|
||||
"""
|
||||
Download specified LOA document under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
loa_document_id: Identifier for the uploaded LOA document.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not loa_document_id:
|
||||
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
|
||||
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=BinaryAPIResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncLOADocumentsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncLOADocumentsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncLOADocumentsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncLOADocumentsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncLOADocumentsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
loa_document: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[LOADocumentCreateResponse]:
|
||||
"""
|
||||
Submit LOA document (pdf format) under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
loa_document: LOA document to upload.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
# It should be noted that the actual Content-Type header that will be
|
||||
# sent to the server will contain a `boundary` parameter, e.g.
|
||||
# multipart/form-data; boundary=---abc--
|
||||
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/addressing/loa_documents",
|
||||
body=await async_maybe_transform(
|
||||
{"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[LOADocumentCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
loa_document_id: Optional[str],
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncBinaryAPIResponse:
|
||||
"""
|
||||
Download specified LOA document under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
loa_document_id: Identifier for the uploaded LOA document.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not loa_document_id:
|
||||
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
|
||||
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=AsyncBinaryAPIResponse,
|
||||
)
|
||||
|
||||
|
||||
class LOADocumentsResourceWithRawResponse:
|
||||
def __init__(self, loa_documents: LOADocumentsResource) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
self.get = to_custom_raw_response_wrapper(
|
||||
loa_documents.get,
|
||||
BinaryAPIResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncLOADocumentsResourceWithRawResponse:
|
||||
def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
self.get = async_to_custom_raw_response_wrapper(
|
||||
loa_documents.get,
|
||||
AsyncBinaryAPIResponse,
|
||||
)
|
||||
|
||||
|
||||
class LOADocumentsResourceWithStreamingResponse:
|
||||
def __init__(self, loa_documents: LOADocumentsResource) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
self.get = to_custom_streamed_response_wrapper(
|
||||
loa_documents.get,
|
||||
StreamedBinaryAPIResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncLOADocumentsResourceWithStreamingResponse:
|
||||
def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
self.get = async_to_custom_streamed_response_wrapper(
|
||||
loa_documents.get,
|
||||
AsyncStreamedBinaryAPIResponse,
|
||||
)
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .downloads import (
|
||||
Downloads,
|
||||
AsyncDownloads,
|
||||
DownloadsWithRawResponse,
|
||||
AsyncDownloadsWithRawResponse,
|
||||
DownloadsWithStreamingResponse,
|
||||
AsyncDownloadsWithStreamingResponse,
|
||||
)
|
||||
from .loa_documents import (
|
||||
LOADocuments,
|
||||
AsyncLOADocuments,
|
||||
LOADocumentsWithRawResponse,
|
||||
AsyncLOADocumentsWithRawResponse,
|
||||
LOADocumentsWithStreamingResponse,
|
||||
AsyncLOADocumentsWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Downloads",
|
||||
"AsyncDownloads",
|
||||
"DownloadsWithRawResponse",
|
||||
"AsyncDownloadsWithRawResponse",
|
||||
"DownloadsWithStreamingResponse",
|
||||
"AsyncDownloadsWithStreamingResponse",
|
||||
"LOADocuments",
|
||||
"AsyncLOADocuments",
|
||||
"LOADocumentsWithRawResponse",
|
||||
"AsyncLOADocumentsWithRawResponse",
|
||||
"LOADocumentsWithStreamingResponse",
|
||||
"AsyncLOADocumentsWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
|
||||
__all__ = ["Downloads", "AsyncDownloads"]
|
||||
|
||||
|
||||
class Downloads(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> DownloadsWithRawResponse:
|
||||
return DownloadsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> DownloadsWithStreamingResponse:
|
||||
return DownloadsWithStreamingResponse(self)
|
||||
|
||||
def get(
|
||||
self,
|
||||
loa_document_id: Optional[str],
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> object:
|
||||
"""
|
||||
Download specified LOA document under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
loa_document_id: Identifier for the uploaded LOA document.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not loa_document_id:
|
||||
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=object,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDownloads(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncDownloadsWithRawResponse:
|
||||
return AsyncDownloadsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncDownloadsWithStreamingResponse:
|
||||
return AsyncDownloadsWithStreamingResponse(self)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
loa_document_id: Optional[str],
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> object:
|
||||
"""
|
||||
Download specified LOA document under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
loa_document_id: Identifier for the uploaded LOA document.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not loa_document_id:
|
||||
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=object,
|
||||
)
|
||||
|
||||
|
||||
class DownloadsWithRawResponse:
|
||||
def __init__(self, downloads: Downloads) -> None:
|
||||
self._downloads = downloads
|
||||
|
||||
self.get = to_raw_response_wrapper(
|
||||
downloads.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDownloadsWithRawResponse:
|
||||
def __init__(self, downloads: AsyncDownloads) -> None:
|
||||
self._downloads = downloads
|
||||
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
downloads.get,
|
||||
)
|
||||
|
||||
|
||||
class DownloadsWithStreamingResponse:
|
||||
def __init__(self, downloads: Downloads) -> None:
|
||||
self._downloads = downloads
|
||||
|
||||
self.get = to_streamed_response_wrapper(
|
||||
downloads.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDownloadsWithStreamingResponse:
|
||||
def __init__(self, downloads: AsyncDownloads) -> None:
|
||||
self._downloads = downloads
|
||||
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
downloads.get,
|
||||
)
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from .downloads import (
|
||||
Downloads,
|
||||
AsyncDownloads,
|
||||
DownloadsWithRawResponse,
|
||||
AsyncDownloadsWithRawResponse,
|
||||
DownloadsWithStreamingResponse,
|
||||
AsyncDownloadsWithStreamingResponse,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing import LOADocumentCreateResponse, loa_document_create_params
|
||||
|
||||
__all__ = ["LOADocuments", "AsyncLOADocuments"]
|
||||
|
||||
|
||||
class LOADocuments(SyncAPIResource):
|
||||
@cached_property
|
||||
def downloads(self) -> Downloads:
|
||||
return Downloads(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> LOADocumentsWithRawResponse:
|
||||
return LOADocumentsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> LOADocumentsWithStreamingResponse:
|
||||
return LOADocumentsWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
loa_document: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LOADocumentCreateResponse:
|
||||
"""
|
||||
Submit LOA document (pdf format) under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
loa_document: LOA document to upload.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/addressing/loa_documents",
|
||||
body=maybe_transform({"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LOADocumentCreateResponse], ResultWrapper[LOADocumentCreateResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncLOADocuments(AsyncAPIResource):
|
||||
@cached_property
|
||||
def downloads(self) -> AsyncDownloads:
|
||||
return AsyncDownloads(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncLOADocumentsWithRawResponse:
|
||||
return AsyncLOADocumentsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncLOADocumentsWithStreamingResponse:
|
||||
return AsyncLOADocumentsWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
loa_document: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LOADocumentCreateResponse:
|
||||
"""
|
||||
Submit LOA document (pdf format) under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
loa_document: LOA document to upload.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/addressing/loa_documents",
|
||||
body=await async_maybe_transform(
|
||||
{"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LOADocumentCreateResponse], ResultWrapper[LOADocumentCreateResponse]),
|
||||
)
|
||||
|
||||
|
||||
class LOADocumentsWithRawResponse:
|
||||
def __init__(self, loa_documents: LOADocuments) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def downloads(self) -> DownloadsWithRawResponse:
|
||||
return DownloadsWithRawResponse(self._loa_documents.downloads)
|
||||
|
||||
|
||||
class AsyncLOADocumentsWithRawResponse:
|
||||
def __init__(self, loa_documents: AsyncLOADocuments) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def downloads(self) -> AsyncDownloadsWithRawResponse:
|
||||
return AsyncDownloadsWithRawResponse(self._loa_documents.downloads)
|
||||
|
||||
|
||||
class LOADocumentsWithStreamingResponse:
|
||||
def __init__(self, loa_documents: LOADocuments) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def downloads(self) -> DownloadsWithStreamingResponse:
|
||||
return DownloadsWithStreamingResponse(self._loa_documents.downloads)
|
||||
|
||||
|
||||
class AsyncLOADocumentsWithStreamingResponse:
|
||||
def __init__(self, loa_documents: AsyncLOADocuments) -> None:
|
||||
self._loa_documents = loa_documents
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
loa_documents.create,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def downloads(self) -> AsyncDownloadsWithStreamingResponse:
|
||||
return AsyncDownloadsWithStreamingResponse(self._loa_documents.downloads)
|
||||
|
|
@ -1,47 +1,75 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .bgp import (
|
||||
BGP,
|
||||
AsyncBGP,
|
||||
BGPWithRawResponse,
|
||||
AsyncBGPWithRawResponse,
|
||||
BGPWithStreamingResponse,
|
||||
AsyncBGPWithStreamingResponse,
|
||||
)
|
||||
from .prefixes import (
|
||||
Prefixes,
|
||||
AsyncPrefixes,
|
||||
PrefixesWithRawResponse,
|
||||
AsyncPrefixesWithRawResponse,
|
||||
PrefixesWithStreamingResponse,
|
||||
AsyncPrefixesWithStreamingResponse,
|
||||
PrefixesResource,
|
||||
AsyncPrefixesResource,
|
||||
PrefixesResourceWithRawResponse,
|
||||
AsyncPrefixesResourceWithRawResponse,
|
||||
PrefixesResourceWithStreamingResponse,
|
||||
AsyncPrefixesResourceWithStreamingResponse,
|
||||
)
|
||||
from .delegations import (
|
||||
Delegations,
|
||||
AsyncDelegations,
|
||||
DelegationsWithRawResponse,
|
||||
AsyncDelegationsWithRawResponse,
|
||||
DelegationsWithStreamingResponse,
|
||||
AsyncDelegationsWithStreamingResponse,
|
||||
DelegationsResource,
|
||||
AsyncDelegationsResource,
|
||||
DelegationsResourceWithRawResponse,
|
||||
AsyncDelegationsResourceWithRawResponse,
|
||||
DelegationsResourceWithStreamingResponse,
|
||||
AsyncDelegationsResourceWithStreamingResponse,
|
||||
)
|
||||
from .bgp_prefixes import (
|
||||
BGPPrefixesResource,
|
||||
AsyncBGPPrefixesResource,
|
||||
BGPPrefixesResourceWithRawResponse,
|
||||
AsyncBGPPrefixesResourceWithRawResponse,
|
||||
BGPPrefixesResourceWithStreamingResponse,
|
||||
AsyncBGPPrefixesResourceWithStreamingResponse,
|
||||
)
|
||||
from .service_bindings import (
|
||||
ServiceBindingsResource,
|
||||
AsyncServiceBindingsResource,
|
||||
ServiceBindingsResourceWithRawResponse,
|
||||
AsyncServiceBindingsResourceWithRawResponse,
|
||||
ServiceBindingsResourceWithStreamingResponse,
|
||||
AsyncServiceBindingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .advertisement_status import (
|
||||
AdvertisementStatusResource,
|
||||
AsyncAdvertisementStatusResource,
|
||||
AdvertisementStatusResourceWithRawResponse,
|
||||
AsyncAdvertisementStatusResourceWithRawResponse,
|
||||
AdvertisementStatusResourceWithStreamingResponse,
|
||||
AsyncAdvertisementStatusResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"BGP",
|
||||
"AsyncBGP",
|
||||
"BGPWithRawResponse",
|
||||
"AsyncBGPWithRawResponse",
|
||||
"BGPWithStreamingResponse",
|
||||
"AsyncBGPWithStreamingResponse",
|
||||
"Delegations",
|
||||
"AsyncDelegations",
|
||||
"DelegationsWithRawResponse",
|
||||
"AsyncDelegationsWithRawResponse",
|
||||
"DelegationsWithStreamingResponse",
|
||||
"AsyncDelegationsWithStreamingResponse",
|
||||
"Prefixes",
|
||||
"AsyncPrefixes",
|
||||
"PrefixesWithRawResponse",
|
||||
"AsyncPrefixesWithRawResponse",
|
||||
"PrefixesWithStreamingResponse",
|
||||
"AsyncPrefixesWithStreamingResponse",
|
||||
"ServiceBindingsResource",
|
||||
"AsyncServiceBindingsResource",
|
||||
"ServiceBindingsResourceWithRawResponse",
|
||||
"AsyncServiceBindingsResourceWithRawResponse",
|
||||
"ServiceBindingsResourceWithStreamingResponse",
|
||||
"AsyncServiceBindingsResourceWithStreamingResponse",
|
||||
"BGPPrefixesResource",
|
||||
"AsyncBGPPrefixesResource",
|
||||
"BGPPrefixesResourceWithRawResponse",
|
||||
"AsyncBGPPrefixesResourceWithRawResponse",
|
||||
"BGPPrefixesResourceWithStreamingResponse",
|
||||
"AsyncBGPPrefixesResourceWithStreamingResponse",
|
||||
"AdvertisementStatusResource",
|
||||
"AsyncAdvertisementStatusResource",
|
||||
"AdvertisementStatusResourceWithRawResponse",
|
||||
"AsyncAdvertisementStatusResourceWithRawResponse",
|
||||
"AdvertisementStatusResourceWithStreamingResponse",
|
||||
"AsyncAdvertisementStatusResourceWithStreamingResponse",
|
||||
"DelegationsResource",
|
||||
"AsyncDelegationsResource",
|
||||
"DelegationsResourceWithRawResponse",
|
||||
"AsyncDelegationsResourceWithRawResponse",
|
||||
"DelegationsResourceWithStreamingResponse",
|
||||
"AsyncDelegationsResourceWithStreamingResponse",
|
||||
"PrefixesResource",
|
||||
"AsyncPrefixesResource",
|
||||
"PrefixesResourceWithRawResponse",
|
||||
"AsyncPrefixesResourceWithRawResponse",
|
||||
"PrefixesResourceWithStreamingResponse",
|
||||
"AsyncPrefixesResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,342 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing_extensions
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.addressing.prefixes import advertisement_status_edit_params
|
||||
from ....types.addressing.prefixes.advertisement_status_get_response import AdvertisementStatusGetResponse
|
||||
from ....types.addressing.prefixes.advertisement_status_edit_response import AdvertisementStatusEditResponse
|
||||
|
||||
__all__ = ["AdvertisementStatusResource", "AsyncAdvertisementStatusResource"]
|
||||
|
||||
|
||||
class AdvertisementStatusResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AdvertisementStatusResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AdvertisementStatusResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AdvertisementStatusResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AdvertisementStatusResourceWithStreamingResponse(self)
|
||||
|
||||
@typing_extensions.deprecated("deprecated")
|
||||
def edit(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
advertised: bool,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvertisementStatusEditResponse]:
|
||||
"""
|
||||
Advertise or withdraw the BGP route for a prefix.
|
||||
|
||||
**Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
|
||||
advertising and withdrawing subnets of an IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is
|
||||
advertised to the Internet. If `false`, the BGP route is withdrawn.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
body=maybe_transform(
|
||||
{"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse]
|
||||
),
|
||||
)
|
||||
|
||||
@typing_extensions.deprecated("deprecated")
|
||||
def get(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvertisementStatusGetResponse]:
|
||||
"""
|
||||
View the current advertisement state for a prefix.
|
||||
|
||||
**Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
|
||||
advertising and withdrawing subnets of an IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvertisementStatusResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAdvertisementStatusResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAdvertisementStatusResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAdvertisementStatusResourceWithStreamingResponse(self)
|
||||
|
||||
@typing_extensions.deprecated("deprecated")
|
||||
async def edit(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
advertised: bool,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvertisementStatusEditResponse]:
|
||||
"""
|
||||
Advertise or withdraw the BGP route for a prefix.
|
||||
|
||||
**Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
|
||||
advertising and withdrawing subnets of an IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is
|
||||
advertised to the Internet. If `false`, the BGP route is withdrawn.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
body=await async_maybe_transform(
|
||||
{"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse]
|
||||
),
|
||||
)
|
||||
|
||||
@typing_extensions.deprecated("deprecated")
|
||||
async def get(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvertisementStatusGetResponse]:
|
||||
"""
|
||||
View the current advertisement state for a prefix.
|
||||
|
||||
**Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
|
||||
advertising and withdrawing subnets of an IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AdvertisementStatusResourceWithRawResponse:
|
||||
def __init__(self, advertisement_status: AdvertisementStatusResource) -> None:
|
||||
self._advertisement_status = advertisement_status
|
||||
|
||||
self.edit = ( # pyright: ignore[reportDeprecated]
|
||||
to_raw_response_wrapper(
|
||||
advertisement_status.edit # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
self.get = ( # pyright: ignore[reportDeprecated]
|
||||
to_raw_response_wrapper(
|
||||
advertisement_status.get # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvertisementStatusResourceWithRawResponse:
|
||||
def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None:
|
||||
self._advertisement_status = advertisement_status
|
||||
|
||||
self.edit = ( # pyright: ignore[reportDeprecated]
|
||||
async_to_raw_response_wrapper(
|
||||
advertisement_status.edit # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
self.get = ( # pyright: ignore[reportDeprecated]
|
||||
async_to_raw_response_wrapper(
|
||||
advertisement_status.get # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class AdvertisementStatusResourceWithStreamingResponse:
|
||||
def __init__(self, advertisement_status: AdvertisementStatusResource) -> None:
|
||||
self._advertisement_status = advertisement_status
|
||||
|
||||
self.edit = ( # pyright: ignore[reportDeprecated]
|
||||
to_streamed_response_wrapper(
|
||||
advertisement_status.edit # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
self.get = ( # pyright: ignore[reportDeprecated]
|
||||
to_streamed_response_wrapper(
|
||||
advertisement_status.get # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvertisementStatusResourceWithStreamingResponse:
|
||||
def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None:
|
||||
self._advertisement_status = advertisement_status
|
||||
|
||||
self.edit = ( # pyright: ignore[reportDeprecated]
|
||||
async_to_streamed_response_wrapper(
|
||||
advertisement_status.edit # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
self.get = ( # pyright: ignore[reportDeprecated]
|
||||
async_to_streamed_response_wrapper(
|
||||
advertisement_status.get # pyright: ignore[reportDeprecated],
|
||||
)
|
||||
)
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .bgp import (
|
||||
BGP,
|
||||
AsyncBGP,
|
||||
BGPWithRawResponse,
|
||||
AsyncBGPWithRawResponse,
|
||||
BGPWithStreamingResponse,
|
||||
AsyncBGPWithStreamingResponse,
|
||||
)
|
||||
from .bindings import (
|
||||
Bindings,
|
||||
AsyncBindings,
|
||||
BindingsWithRawResponse,
|
||||
AsyncBindingsWithRawResponse,
|
||||
BindingsWithStreamingResponse,
|
||||
AsyncBindingsWithStreamingResponse,
|
||||
)
|
||||
from .prefixes import (
|
||||
Prefixes,
|
||||
AsyncPrefixes,
|
||||
PrefixesWithRawResponse,
|
||||
AsyncPrefixesWithRawResponse,
|
||||
PrefixesWithStreamingResponse,
|
||||
AsyncPrefixesWithStreamingResponse,
|
||||
)
|
||||
from .statuses import (
|
||||
Statuses,
|
||||
AsyncStatuses,
|
||||
StatusesWithRawResponse,
|
||||
AsyncStatusesWithRawResponse,
|
||||
StatusesWithStreamingResponse,
|
||||
AsyncStatusesWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Bindings",
|
||||
"AsyncBindings",
|
||||
"BindingsWithRawResponse",
|
||||
"AsyncBindingsWithRawResponse",
|
||||
"BindingsWithStreamingResponse",
|
||||
"AsyncBindingsWithStreamingResponse",
|
||||
"Prefixes",
|
||||
"AsyncPrefixes",
|
||||
"PrefixesWithRawResponse",
|
||||
"AsyncPrefixesWithRawResponse",
|
||||
"PrefixesWithStreamingResponse",
|
||||
"AsyncPrefixesWithStreamingResponse",
|
||||
"Statuses",
|
||||
"AsyncStatuses",
|
||||
"StatusesWithRawResponse",
|
||||
"AsyncStatusesWithRawResponse",
|
||||
"StatusesWithStreamingResponse",
|
||||
"AsyncStatusesWithStreamingResponse",
|
||||
"BGP",
|
||||
"AsyncBGP",
|
||||
"BGPWithRawResponse",
|
||||
"AsyncBGPWithRawResponse",
|
||||
"BGPWithStreamingResponse",
|
||||
"AsyncBGPWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .bindings import (
|
||||
Bindings,
|
||||
AsyncBindings,
|
||||
BindingsWithRawResponse,
|
||||
AsyncBindingsWithRawResponse,
|
||||
BindingsWithStreamingResponse,
|
||||
AsyncBindingsWithStreamingResponse,
|
||||
)
|
||||
from .prefixes import (
|
||||
Prefixes,
|
||||
AsyncPrefixes,
|
||||
PrefixesWithRawResponse,
|
||||
AsyncPrefixesWithRawResponse,
|
||||
PrefixesWithStreamingResponse,
|
||||
AsyncPrefixesWithStreamingResponse,
|
||||
)
|
||||
from .statuses import (
|
||||
Statuses,
|
||||
AsyncStatuses,
|
||||
StatusesWithRawResponse,
|
||||
AsyncStatusesWithRawResponse,
|
||||
StatusesWithStreamingResponse,
|
||||
AsyncStatusesWithStreamingResponse,
|
||||
)
|
||||
from ....._compat import cached_property
|
||||
from ....._resource import SyncAPIResource, AsyncAPIResource
|
||||
|
||||
__all__ = ["BGP", "AsyncBGP"]
|
||||
|
||||
|
||||
class BGP(SyncAPIResource):
|
||||
@cached_property
|
||||
def bindings(self) -> Bindings:
|
||||
return Bindings(self._client)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> Prefixes:
|
||||
return Prefixes(self._client)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> Statuses:
|
||||
return Statuses(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BGPWithRawResponse:
|
||||
return BGPWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BGPWithStreamingResponse:
|
||||
return BGPWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncBGP(AsyncAPIResource):
|
||||
@cached_property
|
||||
def bindings(self) -> AsyncBindings:
|
||||
return AsyncBindings(self._client)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixes:
|
||||
return AsyncPrefixes(self._client)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> AsyncStatuses:
|
||||
return AsyncStatuses(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBGPWithRawResponse:
|
||||
return AsyncBGPWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBGPWithStreamingResponse:
|
||||
return AsyncBGPWithStreamingResponse(self)
|
||||
|
||||
|
||||
class BGPWithRawResponse:
|
||||
def __init__(self, bgp: BGP) -> None:
|
||||
self._bgp = bgp
|
||||
|
||||
@cached_property
|
||||
def bindings(self) -> BindingsWithRawResponse:
|
||||
return BindingsWithRawResponse(self._bgp.bindings)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesWithRawResponse:
|
||||
return PrefixesWithRawResponse(self._bgp.prefixes)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> StatusesWithRawResponse:
|
||||
return StatusesWithRawResponse(self._bgp.statuses)
|
||||
|
||||
|
||||
class AsyncBGPWithRawResponse:
|
||||
def __init__(self, bgp: AsyncBGP) -> None:
|
||||
self._bgp = bgp
|
||||
|
||||
@cached_property
|
||||
def bindings(self) -> AsyncBindingsWithRawResponse:
|
||||
return AsyncBindingsWithRawResponse(self._bgp.bindings)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesWithRawResponse:
|
||||
return AsyncPrefixesWithRawResponse(self._bgp.prefixes)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> AsyncStatusesWithRawResponse:
|
||||
return AsyncStatusesWithRawResponse(self._bgp.statuses)
|
||||
|
||||
|
||||
class BGPWithStreamingResponse:
|
||||
def __init__(self, bgp: BGP) -> None:
|
||||
self._bgp = bgp
|
||||
|
||||
@cached_property
|
||||
def bindings(self) -> BindingsWithStreamingResponse:
|
||||
return BindingsWithStreamingResponse(self._bgp.bindings)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> PrefixesWithStreamingResponse:
|
||||
return PrefixesWithStreamingResponse(self._bgp.prefixes)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> StatusesWithStreamingResponse:
|
||||
return StatusesWithStreamingResponse(self._bgp.statuses)
|
||||
|
||||
|
||||
class AsyncBGPWithStreamingResponse:
|
||||
def __init__(self, bgp: AsyncBGP) -> None:
|
||||
self._bgp = bgp
|
||||
|
||||
@cached_property
|
||||
def bindings(self) -> AsyncBindingsWithStreamingResponse:
|
||||
return AsyncBindingsWithStreamingResponse(self._bgp.bindings)
|
||||
|
||||
@cached_property
|
||||
def prefixes(self) -> AsyncPrefixesWithStreamingResponse:
|
||||
return AsyncPrefixesWithStreamingResponse(self._bgp.prefixes)
|
||||
|
||||
@cached_property
|
||||
def statuses(self) -> AsyncStatusesWithStreamingResponse:
|
||||
return AsyncStatusesWithStreamingResponse(self._bgp.statuses)
|
||||
|
|
@ -1,551 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ....._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ....._compat import cached_property
|
||||
from ....._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ....._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from .....types.addressing.prefixes.bgp import (
|
||||
BindingListResponse,
|
||||
BindingDeleteResponse,
|
||||
AddressingServiceBinding,
|
||||
binding_create_params,
|
||||
)
|
||||
|
||||
__all__ = ["Bindings", "AsyncBindings"]
|
||||
|
||||
|
||||
class Bindings(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BindingsWithRawResponse:
|
||||
return BindingsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BindingsWithStreamingResponse:
|
||||
return BindingsWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
service_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingServiceBinding:
|
||||
"""
|
||||
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
|
||||
service running on Cloudflare's network. **Note:** This API may only be used on
|
||||
prefixes currently configured with a Magic Transit service binding, and only
|
||||
allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
service_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"cidr": cidr,
|
||||
"service_id": service_id,
|
||||
},
|
||||
binding_create_params.BindingCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> BindingListResponse:
|
||||
"""List the Cloudflare services this prefix is currently bound to.
|
||||
|
||||
Traffic sent to
|
||||
an address within an IP prefix will be routed to the Cloudflare service of the
|
||||
most-specific Service Binding matching the address. **Example:** binding
|
||||
`192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
|
||||
CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
|
||||
IPs in the prefix to Cloudflare Magic Transit.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> BindingDeleteResponse:
|
||||
"""
|
||||
Delete a Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
binding_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return cast(
|
||||
BindingDeleteResponse,
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[BindingDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingServiceBinding:
|
||||
"""
|
||||
Fetch a single Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
binding_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBindings(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBindingsWithRawResponse:
|
||||
return AsyncBindingsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBindingsWithStreamingResponse:
|
||||
return AsyncBindingsWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
service_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingServiceBinding:
|
||||
"""
|
||||
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
|
||||
service running on Cloudflare's network. **Note:** This API may only be used on
|
||||
prefixes currently configured with a Magic Transit service binding, and only
|
||||
allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
service_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"cidr": cidr,
|
||||
"service_id": service_id,
|
||||
},
|
||||
binding_create_params.BindingCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> BindingListResponse:
|
||||
"""List the Cloudflare services this prefix is currently bound to.
|
||||
|
||||
Traffic sent to
|
||||
an address within an IP prefix will be routed to the Cloudflare service of the
|
||||
most-specific Service Binding matching the address. **Example:** binding
|
||||
`192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
|
||||
CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
|
||||
IPs in the prefix to Cloudflare Magic Transit.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> BindingDeleteResponse:
|
||||
"""
|
||||
Delete a Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
binding_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return cast(
|
||||
BindingDeleteResponse,
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[BindingDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingServiceBinding:
|
||||
"""
|
||||
Fetch a single Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
binding_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
|
||||
)
|
||||
|
||||
|
||||
class BindingsWithRawResponse:
|
||||
def __init__(self, bindings: Bindings) -> None:
|
||||
self._bindings = bindings
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
bindings.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
bindings.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
bindings.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBindingsWithRawResponse:
|
||||
def __init__(self, bindings: AsyncBindings) -> None:
|
||||
self._bindings = bindings
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
bindings.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
bindings.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
bindings.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class BindingsWithStreamingResponse:
|
||||
def __init__(self, bindings: Bindings) -> None:
|
||||
self._bindings = bindings
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
bindings.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
bindings.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
bindings.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBindingsWithStreamingResponse:
|
||||
def __init__(self, bindings: AsyncBindings) -> None:
|
||||
self._bindings = bindings
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
bindings.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
bindings.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
bindings.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
bindings.get,
|
||||
)
|
||||
|
|
@ -1,406 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ....._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ....._compat import cached_property
|
||||
from ....._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ....._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from .....types.addressing.prefixes.bgp import PrefixListResponse, AddressingIpamBGPPrefixes, prefix_edit_params
|
||||
|
||||
__all__ = ["Prefixes", "AsyncPrefixes"]
|
||||
|
||||
|
||||
class Prefixes(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PrefixesWithRawResponse:
|
||||
return PrefixesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PrefixesWithStreamingResponse:
|
||||
return PrefixesWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixListResponse]:
|
||||
"""List all BGP Prefixes within the specified IP Prefix.
|
||||
|
||||
BGP Prefixes are used to
|
||||
control which specific subnets are advertised to the Internet. It is possible to
|
||||
advertise subnets more specific than an IP Prefix by creating more specific BGP
|
||||
Prefixes.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefixListResponse]], ResultWrapper[PrefixListResponse]),
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamBGPPrefixes:
|
||||
"""
|
||||
Update the properties of a BGP Prefix, such as the on demand advertisement
|
||||
status (advertised or withdrawn).
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
bgp_prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
body=maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamBGPPrefixes:
|
||||
"""
|
||||
Retrieve a single BGP Prefix according to its identifier
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
bgp_prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefixes(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPrefixesWithRawResponse:
|
||||
return AsyncPrefixesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPrefixesWithStreamingResponse:
|
||||
return AsyncPrefixesWithStreamingResponse(self)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixListResponse]:
|
||||
"""List all BGP Prefixes within the specified IP Prefix.
|
||||
|
||||
BGP Prefixes are used to
|
||||
control which specific subnets are advertised to the Internet. It is possible to
|
||||
advertise subnets more specific than an IP Prefix by creating more specific BGP
|
||||
Prefixes.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefixListResponse]], ResultWrapper[PrefixListResponse]),
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamBGPPrefixes:
|
||||
"""
|
||||
Update the properties of a BGP Prefix, such as the on demand advertisement
|
||||
status (advertised or withdrawn).
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
bgp_prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
body=await async_maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamBGPPrefixes:
|
||||
"""
|
||||
Retrieve a single BGP Prefix according to its identifier
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
bgp_prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
|
||||
)
|
||||
|
||||
|
||||
class PrefixesWithRawResponse:
|
||||
def __init__(self, prefixes: Prefixes) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
prefixes.list,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
prefixes.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefixesWithRawResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixes) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
prefixes.list,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
prefixes.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class PrefixesWithStreamingResponse:
|
||||
def __init__(self, prefixes: Prefixes) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
prefixes.list,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
prefixes.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefixesWithStreamingResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixes) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
prefixes.list,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
prefixes.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
prefixes.get,
|
||||
)
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ....._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ....._compat import cached_property
|
||||
from ....._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ....._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from ....._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from .....types.addressing.prefixes.bgp import StatusGetResponse, StatusEditResponse, status_edit_params
|
||||
|
||||
__all__ = ["Statuses", "AsyncStatuses"]
|
||||
|
||||
|
||||
class Statuses(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> StatusesWithRawResponse:
|
||||
return StatusesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> StatusesWithStreamingResponse:
|
||||
return StatusesWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
advertised: bool,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> StatusEditResponse:
|
||||
"""
|
||||
Advertise or withdraw BGP route for a prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
advertised: Enablement of prefix advertisement to the Internet.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
body=maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[StatusEditResponse], ResultWrapper[StatusEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> StatusGetResponse:
|
||||
"""
|
||||
List the current advertisement state for a prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[StatusGetResponse], ResultWrapper[StatusGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncStatuses(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncStatusesWithRawResponse:
|
||||
return AsyncStatusesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncStatusesWithStreamingResponse:
|
||||
return AsyncStatusesWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
advertised: bool,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> StatusEditResponse:
|
||||
"""
|
||||
Advertise or withdraw BGP route for a prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
advertised: Enablement of prefix advertisement to the Internet.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
body=await async_maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[StatusEditResponse], ResultWrapper[StatusEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> StatusGetResponse:
|
||||
"""
|
||||
List the current advertisement state for a prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
prefix_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[StatusGetResponse], ResultWrapper[StatusGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class StatusesWithRawResponse:
|
||||
def __init__(self, statuses: Statuses) -> None:
|
||||
self._statuses = statuses
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
statuses.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
statuses.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncStatusesWithRawResponse:
|
||||
def __init__(self, statuses: AsyncStatuses) -> None:
|
||||
self._statuses = statuses
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
statuses.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
statuses.get,
|
||||
)
|
||||
|
||||
|
||||
class StatusesWithStreamingResponse:
|
||||
def __init__(self, statuses: Statuses) -> None:
|
||||
self._statuses = statuses
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
statuses.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
statuses.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncStatusesWithStreamingResponse:
|
||||
def __init__(self, statuses: AsyncStatuses) -> None:
|
||||
self._statuses = statuses
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
statuses.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
statuses.get,
|
||||
)
|
||||
561
src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py
Normal file
561
src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py
Normal file
|
|
@ -0,0 +1,561 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing.prefixes import bgp_prefix_edit_params, bgp_prefix_create_params
|
||||
from ....types.addressing.prefixes.bgp_prefix import BGPPrefix
|
||||
|
||||
__all__ = ["BGPPrefixesResource", "AsyncBGPPrefixesResource"]
|
||||
|
||||
|
||||
class BGPPrefixesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BGPPrefixesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return BGPPrefixesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BGPPrefixesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return BGPPrefixesResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Create a BGP prefix, controlling the BGP advertisement status of a specific
|
||||
subnet. When created, BGP prefixes are initially withdrawn, and can be
|
||||
advertised with the Update BGP Prefix API.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
body=maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[BGPPrefix]:
|
||||
"""List all BGP Prefixes within the specified IP Prefix.
|
||||
|
||||
BGP Prefixes are used to
|
||||
control which specific subnets are advertised to the Internet. It is possible to
|
||||
advertise subnets more specific than an IP Prefix by creating more specific BGP
|
||||
Prefixes.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
page=SyncSinglePage[BGPPrefix],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=BGPPrefix,
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
asn_prepend_count: int | NotGiven = NOT_GIVEN,
|
||||
on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
|
||||
withdraw_if_no_route: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Update the properties of a BGP Prefix, such as the on demand advertisement
|
||||
status (advertised or withdrawn).
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
bgp_prefix_id: Identifier of BGP Prefix.
|
||||
|
||||
asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute
|
||||
|
||||
withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is
|
||||
withdrawn from Magic routing table (for Magic Transit customers using Direct
|
||||
CNI)
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"asn_prepend_count": asn_prepend_count,
|
||||
"on_demand": on_demand,
|
||||
"withdraw_if_no_route": withdraw_if_no_route,
|
||||
},
|
||||
bgp_prefix_edit_params.BGPPrefixEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Retrieve a single BGP Prefix according to its identifier
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
bgp_prefix_id: Identifier of BGP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBGPPrefixesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBGPPrefixesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncBGPPrefixesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBGPPrefixesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncBGPPrefixesResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Create a BGP prefix, controlling the BGP advertisement status of a specific
|
||||
subnet. When created, BGP prefixes are initially withdrawn, and can be
|
||||
advertised with the Update BGP Prefix API.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
body=await async_maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[BGPPrefix, AsyncSinglePage[BGPPrefix]]:
|
||||
"""List all BGP Prefixes within the specified IP Prefix.
|
||||
|
||||
BGP Prefixes are used to
|
||||
control which specific subnets are advertised to the Internet. It is possible to
|
||||
advertise subnets more specific than an IP Prefix by creating more specific BGP
|
||||
Prefixes.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
|
||||
page=AsyncSinglePage[BGPPrefix],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=BGPPrefix,
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
asn_prepend_count: int | NotGiven = NOT_GIVEN,
|
||||
on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
|
||||
withdraw_if_no_route: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Update the properties of a BGP Prefix, such as the on demand advertisement
|
||||
status (advertised or withdrawn).
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
bgp_prefix_id: Identifier of BGP Prefix.
|
||||
|
||||
asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute
|
||||
|
||||
withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is
|
||||
withdrawn from Magic routing table (for Magic Transit customers using Direct
|
||||
CNI)
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return await self._patch(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"asn_prepend_count": asn_prepend_count,
|
||||
"on_demand": on_demand,
|
||||
"withdraw_if_no_route": withdraw_if_no_route,
|
||||
},
|
||||
bgp_prefix_edit_params.BGPPrefixEditParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
bgp_prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BGPPrefix]:
|
||||
"""
|
||||
Retrieve a single BGP Prefix according to its identifier
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
bgp_prefix_id: Identifier of BGP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not bgp_prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]),
|
||||
)
|
||||
|
||||
|
||||
class BGPPrefixesResourceWithRawResponse:
|
||||
def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None:
|
||||
self._bgp_prefixes = bgp_prefixes
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
bgp_prefixes.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
bgp_prefixes.list,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
bgp_prefixes.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
bgp_prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBGPPrefixesResourceWithRawResponse:
|
||||
def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None:
|
||||
self._bgp_prefixes = bgp_prefixes
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
bgp_prefixes.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
bgp_prefixes.list,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
bgp_prefixes.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
bgp_prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class BGPPrefixesResourceWithStreamingResponse:
|
||||
def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None:
|
||||
self._bgp_prefixes = bgp_prefixes
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
bgp_prefixes.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
bgp_prefixes.list,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
bgp_prefixes.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
bgp_prefixes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBGPPrefixesResourceWithStreamingResponse:
|
||||
def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None:
|
||||
self._bgp_prefixes = bgp_prefixes
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
bgp_prefixes.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
bgp_prefixes.list,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
bgp_prefixes.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
bgp_prefixes.get,
|
||||
)
|
||||
|
|
@ -7,10 +7,7 @@ from typing import Type, Optional, cast
|
|||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -20,27 +17,34 @@ from ...._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.addressing.prefixes import (
|
||||
DelegationListResponse,
|
||||
DelegationDeleteResponse,
|
||||
AddressingIpamDelegations,
|
||||
delegation_create_params,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing.prefixes import delegation_create_params
|
||||
from ....types.addressing.prefixes.delegations import Delegations
|
||||
from ....types.addressing.prefixes.delegation_delete_response import DelegationDeleteResponse
|
||||
|
||||
__all__ = ["Delegations", "AsyncDelegations"]
|
||||
__all__ = ["DelegationsResource", "AsyncDelegationsResource"]
|
||||
|
||||
|
||||
class Delegations(SyncAPIResource):
|
||||
class DelegationsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> DelegationsWithRawResponse:
|
||||
return DelegationsWithRawResponse(self)
|
||||
def with_raw_response(self) -> DelegationsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return DelegationsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> DelegationsWithStreamingResponse:
|
||||
return DelegationsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> DelegationsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return DelegationsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
|
|
@ -55,14 +59,14 @@ class Delegations(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamDelegations:
|
||||
) -> Optional[Delegations]:
|
||||
"""
|
||||
Create a new account delegation for a given IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
|
|
@ -94,9 +98,9 @@ class Delegations(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Delegations]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]),
|
||||
cast_to=cast(Type[Optional[Delegations]], ResultWrapper[Delegations]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -110,14 +114,14 @@ class Delegations(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DelegationListResponse]:
|
||||
) -> SyncSinglePage[Delegations]:
|
||||
"""
|
||||
List all delegations for a given account IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -131,16 +135,13 @@ class Delegations(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
|
||||
page=SyncSinglePage[Delegations],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[DelegationListResponse]], ResultWrapper[DelegationListResponse]),
|
||||
model=Delegations,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -155,16 +156,16 @@ class Delegations(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> DelegationDeleteResponse:
|
||||
) -> Optional[DelegationDeleteResponse]:
|
||||
"""
|
||||
Delete an account delegation for a given IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
delegation_id: Delegation identifier tag.
|
||||
delegation_id: Identifier of a Delegation.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -187,20 +188,31 @@ class Delegations(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DelegationDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DelegationDeleteResponse], ResultWrapper[DelegationDeleteResponse]),
|
||||
cast_to=cast(Type[Optional[DelegationDeleteResponse]], ResultWrapper[DelegationDeleteResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncDelegations(AsyncAPIResource):
|
||||
class AsyncDelegationsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncDelegationsWithRawResponse:
|
||||
return AsyncDelegationsWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncDelegationsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncDelegationsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncDelegationsWithStreamingResponse:
|
||||
return AsyncDelegationsWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncDelegationsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncDelegationsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
|
|
@ -215,14 +227,14 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamDelegations:
|
||||
) -> Optional[Delegations]:
|
||||
"""
|
||||
Create a new account delegation for a given IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
|
|
@ -254,12 +266,12 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Delegations]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]),
|
||||
cast_to=cast(Type[Optional[Delegations]], ResultWrapper[Delegations]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
|
|
@ -270,14 +282,14 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DelegationListResponse]:
|
||||
) -> AsyncPaginator[Delegations, AsyncSinglePage[Delegations]]:
|
||||
"""
|
||||
List all delegations for a given account IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -291,16 +303,13 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
|
||||
page=AsyncSinglePage[Delegations],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[DelegationListResponse]], ResultWrapper[DelegationListResponse]),
|
||||
model=Delegations,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -315,16 +324,16 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> DelegationDeleteResponse:
|
||||
) -> Optional[DelegationDeleteResponse]:
|
||||
"""
|
||||
Delete an account delegation for a given IP prefix.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
delegation_id: Delegation identifier tag.
|
||||
delegation_id: Identifier of a Delegation.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -347,14 +356,14 @@ class AsyncDelegations(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[DelegationDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[DelegationDeleteResponse], ResultWrapper[DelegationDeleteResponse]),
|
||||
cast_to=cast(Type[Optional[DelegationDeleteResponse]], ResultWrapper[DelegationDeleteResponse]),
|
||||
)
|
||||
|
||||
|
||||
class DelegationsWithRawResponse:
|
||||
def __init__(self, delegations: Delegations) -> None:
|
||||
class DelegationsResourceWithRawResponse:
|
||||
def __init__(self, delegations: DelegationsResource) -> None:
|
||||
self._delegations = delegations
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
|
|
@ -368,8 +377,8 @@ class DelegationsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncDelegationsWithRawResponse:
|
||||
def __init__(self, delegations: AsyncDelegations) -> None:
|
||||
class AsyncDelegationsResourceWithRawResponse:
|
||||
def __init__(self, delegations: AsyncDelegationsResource) -> None:
|
||||
self._delegations = delegations
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
|
|
@ -383,8 +392,8 @@ class AsyncDelegationsWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class DelegationsWithStreamingResponse:
|
||||
def __init__(self, delegations: Delegations) -> None:
|
||||
class DelegationsResourceWithStreamingResponse:
|
||||
def __init__(self, delegations: DelegationsResource) -> None:
|
||||
self._delegations = delegations
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
|
|
@ -398,8 +407,8 @@ class DelegationsWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncDelegationsWithStreamingResponse:
|
||||
def __init__(self, delegations: AsyncDelegations) -> None:
|
||||
class AsyncDelegationsResourceWithStreamingResponse:
|
||||
def __init__(self, delegations: AsyncDelegationsResource) -> None:
|
||||
self._delegations = delegations
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
|
|
@ -2,32 +2,20 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from .bgp import (
|
||||
BGP,
|
||||
AsyncBGP,
|
||||
BGPWithRawResponse,
|
||||
AsyncBGPWithRawResponse,
|
||||
BGPWithStreamingResponse,
|
||||
AsyncBGPWithStreamingResponse,
|
||||
)
|
||||
from .bgp.bgp import BGP, AsyncBGP
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from .delegations import (
|
||||
Delegations,
|
||||
AsyncDelegations,
|
||||
DelegationsWithRawResponse,
|
||||
AsyncDelegationsWithRawResponse,
|
||||
DelegationsWithStreamingResponse,
|
||||
AsyncDelegationsWithStreamingResponse,
|
||||
DelegationsResource,
|
||||
AsyncDelegationsResource,
|
||||
DelegationsResourceWithRawResponse,
|
||||
AsyncDelegationsResourceWithRawResponse,
|
||||
DelegationsResourceWithStreamingResponse,
|
||||
AsyncDelegationsResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
|
|
@ -37,36 +25,74 @@ from ...._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
from .bgp_prefixes import (
|
||||
BGPPrefixesResource,
|
||||
AsyncBGPPrefixesResource,
|
||||
BGPPrefixesResourceWithRawResponse,
|
||||
AsyncBGPPrefixesResourceWithRawResponse,
|
||||
BGPPrefixesResourceWithStreamingResponse,
|
||||
AsyncBGPPrefixesResourceWithStreamingResponse,
|
||||
)
|
||||
from ....types.addressing import (
|
||||
PrefixListResponse,
|
||||
PrefixDeleteResponse,
|
||||
AddressingIpamPrefixes,
|
||||
prefix_edit_params,
|
||||
prefix_create_params,
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from .service_bindings import (
|
||||
ServiceBindingsResource,
|
||||
AsyncServiceBindingsResource,
|
||||
ServiceBindingsResourceWithRawResponse,
|
||||
AsyncServiceBindingsResourceWithRawResponse,
|
||||
ServiceBindingsResourceWithStreamingResponse,
|
||||
AsyncServiceBindingsResourceWithStreamingResponse,
|
||||
)
|
||||
from ....types.addressing import prefix_edit_params, prefix_create_params
|
||||
from .advertisement_status import (
|
||||
AdvertisementStatusResource,
|
||||
AsyncAdvertisementStatusResource,
|
||||
AdvertisementStatusResourceWithRawResponse,
|
||||
AsyncAdvertisementStatusResourceWithRawResponse,
|
||||
AdvertisementStatusResourceWithStreamingResponse,
|
||||
AsyncAdvertisementStatusResourceWithStreamingResponse,
|
||||
)
|
||||
from ....types.addressing.prefix import Prefix
|
||||
from ....types.addressing.prefix_delete_response import PrefixDeleteResponse
|
||||
|
||||
__all__ = ["Prefixes", "AsyncPrefixes"]
|
||||
__all__ = ["PrefixesResource", "AsyncPrefixesResource"]
|
||||
|
||||
|
||||
class Prefixes(SyncAPIResource):
|
||||
class PrefixesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def bgp(self) -> BGP:
|
||||
return BGP(self._client)
|
||||
def service_bindings(self) -> ServiceBindingsResource:
|
||||
return ServiceBindingsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> Delegations:
|
||||
return Delegations(self._client)
|
||||
def bgp_prefixes(self) -> BGPPrefixesResource:
|
||||
return BGPPrefixesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PrefixesWithRawResponse:
|
||||
return PrefixesWithRawResponse(self)
|
||||
def advertisement_status(self) -> AdvertisementStatusResource:
|
||||
return AdvertisementStatusResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PrefixesWithStreamingResponse:
|
||||
return PrefixesWithStreamingResponse(self)
|
||||
def delegations(self) -> DelegationsResource:
|
||||
return DelegationsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PrefixesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return PrefixesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PrefixesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return PrefixesResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
|
|
@ -81,12 +107,12 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
Add a new prefix under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
asn: Autonomous System Number (ASN) the prefix will be advertised under.
|
||||
|
||||
|
|
@ -119,9 +145,9 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -134,12 +160,12 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixListResponse]:
|
||||
) -> SyncSinglePage[Prefix]:
|
||||
"""
|
||||
List all prefixes owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -151,16 +177,13 @@ class Prefixes(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes",
|
||||
page=SyncSinglePage[Prefix],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefixListResponse]], ResultWrapper[PrefixListResponse]),
|
||||
model=Prefix,
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -174,14 +197,14 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixDeleteResponse]:
|
||||
) -> PrefixDeleteResponse:
|
||||
"""
|
||||
Delete an unapproved prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -195,21 +218,12 @@ class Prefixes(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return cast(
|
||||
Optional[PrefixDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PrefixDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PrefixDeleteResponse,
|
||||
)
|
||||
|
||||
def edit(
|
||||
|
|
@ -224,14 +238,14 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
Modify the description for a prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
description: Description of the prefix.
|
||||
|
||||
|
|
@ -255,9 +269,9 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -271,14 +285,14 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
List a particular prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -299,28 +313,47 @@ class Prefixes(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefixes(AsyncAPIResource):
|
||||
class AsyncPrefixesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def bgp(self) -> AsyncBGP:
|
||||
return AsyncBGP(self._client)
|
||||
def service_bindings(self) -> AsyncServiceBindingsResource:
|
||||
return AsyncServiceBindingsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> AsyncDelegations:
|
||||
return AsyncDelegations(self._client)
|
||||
def bgp_prefixes(self) -> AsyncBGPPrefixesResource:
|
||||
return AsyncBGPPrefixesResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPrefixesWithRawResponse:
|
||||
return AsyncPrefixesWithRawResponse(self)
|
||||
def advertisement_status(self) -> AsyncAdvertisementStatusResource:
|
||||
return AsyncAdvertisementStatusResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPrefixesWithStreamingResponse:
|
||||
return AsyncPrefixesWithStreamingResponse(self)
|
||||
def delegations(self) -> AsyncDelegationsResource:
|
||||
return AsyncDelegationsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPrefixesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncPrefixesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPrefixesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncPrefixesResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
|
|
@ -335,12 +368,12 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
Add a new prefix under the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
asn: Autonomous System Number (ASN) the prefix will be advertised under.
|
||||
|
||||
|
|
@ -373,12 +406,12 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
|
|
@ -388,12 +421,12 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixListResponse]:
|
||||
) -> AsyncPaginator[Prefix, AsyncSinglePage[Prefix]]:
|
||||
"""
|
||||
List all prefixes owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -405,16 +438,13 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes",
|
||||
page=AsyncSinglePage[Prefix],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefixListResponse]], ResultWrapper[PrefixListResponse]),
|
||||
model=Prefix,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -428,14 +458,14 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefixDeleteResponse]:
|
||||
) -> PrefixDeleteResponse:
|
||||
"""
|
||||
Delete an unapproved prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -449,21 +479,12 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return cast(
|
||||
Optional[PrefixDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PrefixDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PrefixDeleteResponse,
|
||||
)
|
||||
|
||||
async def edit(
|
||||
|
|
@ -478,14 +499,14 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
Modify the description for a prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
description: Description of the prefix.
|
||||
|
||||
|
|
@ -509,9 +530,9 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -525,14 +546,14 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AddressingIpamPrefixes:
|
||||
) -> Optional[Prefix]:
|
||||
"""
|
||||
List a particular prefix owned by the account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -553,14 +574,14 @@ class AsyncPrefixes(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Prefix]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]),
|
||||
cast_to=cast(Type[Optional[Prefix]], ResultWrapper[Prefix]),
|
||||
)
|
||||
|
||||
|
||||
class PrefixesWithRawResponse:
|
||||
def __init__(self, prefixes: Prefixes) -> None:
|
||||
class PrefixesResourceWithRawResponse:
|
||||
def __init__(self, prefixes: PrefixesResource) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
|
|
@ -580,16 +601,24 @@ class PrefixesWithRawResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def bgp(self) -> BGPWithRawResponse:
|
||||
return BGPWithRawResponse(self._prefixes.bgp)
|
||||
def service_bindings(self) -> ServiceBindingsResourceWithRawResponse:
|
||||
return ServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> DelegationsWithRawResponse:
|
||||
return DelegationsWithRawResponse(self._prefixes.delegations)
|
||||
def bgp_prefixes(self) -> BGPPrefixesResourceWithRawResponse:
|
||||
return BGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes)
|
||||
|
||||
@cached_property
|
||||
def advertisement_status(self) -> AdvertisementStatusResourceWithRawResponse:
|
||||
return AdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> DelegationsResourceWithRawResponse:
|
||||
return DelegationsResourceWithRawResponse(self._prefixes.delegations)
|
||||
|
||||
|
||||
class AsyncPrefixesWithRawResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixes) -> None:
|
||||
class AsyncPrefixesResourceWithRawResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixesResource) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
|
|
@ -609,16 +638,24 @@ class AsyncPrefixesWithRawResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def bgp(self) -> AsyncBGPWithRawResponse:
|
||||
return AsyncBGPWithRawResponse(self._prefixes.bgp)
|
||||
def service_bindings(self) -> AsyncServiceBindingsResourceWithRawResponse:
|
||||
return AsyncServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> AsyncDelegationsWithRawResponse:
|
||||
return AsyncDelegationsWithRawResponse(self._prefixes.delegations)
|
||||
def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithRawResponse:
|
||||
return AsyncBGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes)
|
||||
|
||||
@cached_property
|
||||
def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithRawResponse:
|
||||
return AsyncAdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> AsyncDelegationsResourceWithRawResponse:
|
||||
return AsyncDelegationsResourceWithRawResponse(self._prefixes.delegations)
|
||||
|
||||
|
||||
class PrefixesWithStreamingResponse:
|
||||
def __init__(self, prefixes: Prefixes) -> None:
|
||||
class PrefixesResourceWithStreamingResponse:
|
||||
def __init__(self, prefixes: PrefixesResource) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
|
|
@ -638,16 +675,24 @@ class PrefixesWithStreamingResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def bgp(self) -> BGPWithStreamingResponse:
|
||||
return BGPWithStreamingResponse(self._prefixes.bgp)
|
||||
def service_bindings(self) -> ServiceBindingsResourceWithStreamingResponse:
|
||||
return ServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> DelegationsWithStreamingResponse:
|
||||
return DelegationsWithStreamingResponse(self._prefixes.delegations)
|
||||
def bgp_prefixes(self) -> BGPPrefixesResourceWithStreamingResponse:
|
||||
return BGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes)
|
||||
|
||||
@cached_property
|
||||
def advertisement_status(self) -> AdvertisementStatusResourceWithStreamingResponse:
|
||||
return AdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> DelegationsResourceWithStreamingResponse:
|
||||
return DelegationsResourceWithStreamingResponse(self._prefixes.delegations)
|
||||
|
||||
|
||||
class AsyncPrefixesWithStreamingResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixes) -> None:
|
||||
class AsyncPrefixesResourceWithStreamingResponse:
|
||||
def __init__(self, prefixes: AsyncPrefixesResource) -> None:
|
||||
self._prefixes = prefixes
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
|
|
@ -667,9 +712,17 @@ class AsyncPrefixesWithStreamingResponse:
|
|||
)
|
||||
|
||||
@cached_property
|
||||
def bgp(self) -> AsyncBGPWithStreamingResponse:
|
||||
return AsyncBGPWithStreamingResponse(self._prefixes.bgp)
|
||||
def service_bindings(self) -> AsyncServiceBindingsResourceWithStreamingResponse:
|
||||
return AsyncServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> AsyncDelegationsWithStreamingResponse:
|
||||
return AsyncDelegationsWithStreamingResponse(self._prefixes.delegations)
|
||||
def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithStreamingResponse:
|
||||
return AsyncBGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes)
|
||||
|
||||
@cached_property
|
||||
def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse:
|
||||
return AsyncAdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status)
|
||||
|
||||
@cached_property
|
||||
def delegations(self) -> AsyncDelegationsResourceWithStreamingResponse:
|
||||
return AsyncDelegationsResourceWithStreamingResponse(self._prefixes.delegations)
|
||||
|
|
|
|||
546
src/cloudflare/resources/addressing/prefixes/service_bindings.py
Normal file
546
src/cloudflare/resources/addressing/prefixes/service_bindings.py
Normal file
|
|
@ -0,0 +1,546 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing.prefixes import service_binding_create_params
|
||||
from ....types.addressing.prefixes.service_binding import ServiceBinding
|
||||
from ....types.addressing.prefixes.service_binding_delete_response import ServiceBindingDeleteResponse
|
||||
|
||||
__all__ = ["ServiceBindingsResource", "AsyncServiceBindingsResource"]
|
||||
|
||||
|
||||
class ServiceBindingsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ServiceBindingsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ServiceBindingsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ServiceBindingsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ServiceBindingsResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
service_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServiceBinding]:
|
||||
"""
|
||||
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
|
||||
service running on Cloudflare's network. **Note:** This API may only be used on
|
||||
prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare
|
||||
Spectrum service binding, and only allows creating upgrade service bindings for
|
||||
the Cloudflare CDN or Cloudflare Spectrum.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
service_id: Identifier of a Service on the Cloudflare network. Available services and their
|
||||
IDs may be found in the **List Services** endpoint.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"cidr": cidr,
|
||||
"service_id": service_id,
|
||||
},
|
||||
service_binding_create_params.ServiceBindingCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServiceBinding]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServiceBinding]], ResultWrapper[ServiceBinding]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[ServiceBinding]:
|
||||
"""List the Cloudflare services this prefix is currently bound to.
|
||||
|
||||
Traffic sent to
|
||||
an address within an IP prefix will be routed to the Cloudflare service of the
|
||||
most-specific Service Binding matching the address. **Example:** binding
|
||||
`192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
|
||||
CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
|
||||
IPs in the prefix to Cloudflare Magic Transit.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
page=SyncSinglePage[ServiceBinding],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=ServiceBinding,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ServiceBindingDeleteResponse:
|
||||
"""
|
||||
Delete a Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
binding_id: Identifier of a Service Binding.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ServiceBindingDeleteResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServiceBinding]:
|
||||
"""
|
||||
Fetch a single Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
binding_id: Identifier of a Service Binding.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServiceBinding]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServiceBinding]], ResultWrapper[ServiceBinding]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncServiceBindingsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncServiceBindingsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncServiceBindingsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncServiceBindingsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncServiceBindingsResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
cidr: str | NotGiven = NOT_GIVEN,
|
||||
service_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServiceBinding]:
|
||||
"""
|
||||
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
|
||||
service running on Cloudflare's network. **Note:** This API may only be used on
|
||||
prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare
|
||||
Spectrum service binding, and only allows creating upgrade service bindings for
|
||||
the Cloudflare CDN or Cloudflare Spectrum.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
cidr: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
service_id: Identifier of a Service on the Cloudflare network. Available services and their
|
||||
IDs may be found in the **List Services** endpoint.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"cidr": cidr,
|
||||
"service_id": service_id,
|
||||
},
|
||||
service_binding_create_params.ServiceBindingCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServiceBinding]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServiceBinding]], ResultWrapper[ServiceBinding]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
prefix_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[ServiceBinding, AsyncSinglePage[ServiceBinding]]:
|
||||
"""List the Cloudflare services this prefix is currently bound to.
|
||||
|
||||
Traffic sent to
|
||||
an address within an IP prefix will be routed to the Cloudflare service of the
|
||||
most-specific Service Binding matching the address. **Example:** binding
|
||||
`192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
|
||||
CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
|
||||
IPs in the prefix to Cloudflare Magic Transit.
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
|
||||
page=AsyncSinglePage[ServiceBinding],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=ServiceBinding,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ServiceBindingDeleteResponse:
|
||||
"""
|
||||
Delete a Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
binding_id: Identifier of a Service Binding.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=ServiceBindingDeleteResponse,
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
binding_id: str,
|
||||
*,
|
||||
account_id: str,
|
||||
prefix_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServiceBinding]:
|
||||
"""
|
||||
Fetch a single Service Binding
|
||||
|
||||
Args:
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
prefix_id: Identifier of an IP Prefix.
|
||||
|
||||
binding_id: Identifier of a Service Binding.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not prefix_id:
|
||||
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
|
||||
if not binding_id:
|
||||
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServiceBinding]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServiceBinding]], ResultWrapper[ServiceBinding]),
|
||||
)
|
||||
|
||||
|
||||
class ServiceBindingsResourceWithRawResponse:
|
||||
def __init__(self, service_bindings: ServiceBindingsResource) -> None:
|
||||
self._service_bindings = service_bindings
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
service_bindings.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
service_bindings.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
service_bindings.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
service_bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncServiceBindingsResourceWithRawResponse:
|
||||
def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None:
|
||||
self._service_bindings = service_bindings
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
service_bindings.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
service_bindings.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
service_bindings.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
service_bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class ServiceBindingsResourceWithStreamingResponse:
|
||||
def __init__(self, service_bindings: ServiceBindingsResource) -> None:
|
||||
self._service_bindings = service_bindings
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
service_bindings.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
service_bindings.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
service_bindings.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
service_bindings.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncServiceBindingsResourceWithStreamingResponse:
|
||||
def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None:
|
||||
self._service_bindings = service_bindings
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
service_bindings.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
service_bindings.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
service_bindings.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
service_bindings.get,
|
||||
)
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .regions import (
|
||||
RegionsResource,
|
||||
AsyncRegionsResource,
|
||||
RegionsResourceWithRawResponse,
|
||||
AsyncRegionsResourceWithRawResponse,
|
||||
RegionsResourceWithStreamingResponse,
|
||||
AsyncRegionsResourceWithStreamingResponse,
|
||||
)
|
||||
from .regional_hostnames import (
|
||||
RegionalHostnamesResource,
|
||||
AsyncRegionalHostnamesResource,
|
||||
RegionalHostnamesResourceWithRawResponse,
|
||||
AsyncRegionalHostnamesResourceWithRawResponse,
|
||||
RegionalHostnamesResourceWithStreamingResponse,
|
||||
AsyncRegionalHostnamesResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"RegionsResource",
|
||||
"AsyncRegionsResource",
|
||||
"RegionsResourceWithRawResponse",
|
||||
"AsyncRegionsResourceWithRawResponse",
|
||||
"RegionsResourceWithStreamingResponse",
|
||||
"AsyncRegionsResourceWithStreamingResponse",
|
||||
"RegionalHostnamesResource",
|
||||
"AsyncRegionalHostnamesResource",
|
||||
"RegionalHostnamesResourceWithRawResponse",
|
||||
"AsyncRegionalHostnamesResourceWithRawResponse",
|
||||
"RegionalHostnamesResourceWithStreamingResponse",
|
||||
"AsyncRegionalHostnamesResourceWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -0,0 +1,657 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from .regions import (
|
||||
RegionsResource,
|
||||
AsyncRegionsResource,
|
||||
RegionsResourceWithRawResponse,
|
||||
AsyncRegionsResourceWithRawResponse,
|
||||
RegionsResourceWithStreamingResponse,
|
||||
AsyncRegionsResourceWithStreamingResponse,
|
||||
)
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing import regional_hostname_edit_params, regional_hostname_create_params
|
||||
from ....types.addressing.regional_hostname_get_response import RegionalHostnameGetResponse
|
||||
from ....types.addressing.regional_hostname_edit_response import RegionalHostnameEditResponse
|
||||
from ....types.addressing.regional_hostname_list_response import RegionalHostnameListResponse
|
||||
from ....types.addressing.regional_hostname_create_response import RegionalHostnameCreateResponse
|
||||
from ....types.addressing.regional_hostname_delete_response import RegionalHostnameDeleteResponse
|
||||
|
||||
__all__ = ["RegionalHostnamesResource", "AsyncRegionalHostnamesResource"]
|
||||
|
||||
|
||||
class RegionalHostnamesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def regions(self) -> RegionsResource:
|
||||
return RegionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RegionalHostnamesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return RegionalHostnamesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RegionalHostnamesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return RegionalHostnamesResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
hostname: str,
|
||||
region_key: str,
|
||||
routing: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameCreateResponse]:
|
||||
"""Create a new Regional Hostname entry.
|
||||
|
||||
Cloudflare will only use data centers that
|
||||
are physically located within the chosen region to decrypt and service HTTPS
|
||||
traffic. Learn more about
|
||||
[Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
region_key: Identifying key for the region
|
||||
|
||||
routing: Configure which routing method to use for the regional hostname
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._post(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"hostname": hostname,
|
||||
"region_key": region_key,
|
||||
"routing": routing,
|
||||
},
|
||||
regional_hostname_create_params.RegionalHostnameCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameCreateResponse]], ResultWrapper[RegionalHostnameCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[RegionalHostnameListResponse]:
|
||||
"""
|
||||
List all Regional Hostnames within a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames",
|
||||
page=SyncSinglePage[RegionalHostnameListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=RegionalHostnameListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RegionalHostnameDeleteResponse:
|
||||
"""
|
||||
Delete the region configuration for a specific Regional Hostname.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return self._delete(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=RegionalHostnameDeleteResponse,
|
||||
)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
region_key: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameEditResponse]:
|
||||
"""Update the configuration for a specific Regional Hostname.
|
||||
|
||||
Only the region_key
|
||||
of a hostname is mutable.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
region_key: Identifying key for the region
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
body=maybe_transform({"region_key": region_key}, regional_hostname_edit_params.RegionalHostnameEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameEditResponse]], ResultWrapper[RegionalHostnameEditResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameGetResponse]:
|
||||
"""
|
||||
Fetch the configuration for a specific Regional Hostname, within a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameGetResponse]], ResultWrapper[RegionalHostnameGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncRegionalHostnamesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def regions(self) -> AsyncRegionsResource:
|
||||
return AsyncRegionsResource(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRegionalHostnamesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncRegionalHostnamesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRegionalHostnamesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncRegionalHostnamesResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
hostname: str,
|
||||
region_key: str,
|
||||
routing: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameCreateResponse]:
|
||||
"""Create a new Regional Hostname entry.
|
||||
|
||||
Cloudflare will only use data centers that
|
||||
are physically located within the chosen region to decrypt and service HTTPS
|
||||
traffic. Learn more about
|
||||
[Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
region_key: Identifying key for the region
|
||||
|
||||
routing: Configure which routing method to use for the regional hostname
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._post(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"hostname": hostname,
|
||||
"region_key": region_key,
|
||||
"routing": routing,
|
||||
},
|
||||
regional_hostname_create_params.RegionalHostnameCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameCreateResponse]], ResultWrapper[RegionalHostnameCreateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[RegionalHostnameListResponse, AsyncSinglePage[RegionalHostnameListResponse]]:
|
||||
"""
|
||||
List all Regional Hostnames within a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames",
|
||||
page=AsyncSinglePage[RegionalHostnameListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=RegionalHostnameListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RegionalHostnameDeleteResponse:
|
||||
"""
|
||||
Delete the region configuration for a specific Regional Hostname.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return await self._delete(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=RegionalHostnameDeleteResponse,
|
||||
)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
region_key: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameEditResponse]:
|
||||
"""Update the configuration for a specific Regional Hostname.
|
||||
|
||||
Only the region_key
|
||||
of a hostname is mutable.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
region_key: Identifying key for the region
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
body=await async_maybe_transform(
|
||||
{"region_key": region_key}, regional_hostname_edit_params.RegionalHostnameEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameEditResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameEditResponse]], ResultWrapper[RegionalHostnameEditResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
hostname: str,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RegionalHostnameGetResponse]:
|
||||
"""
|
||||
Fetch the configuration for a specific Regional Hostname, within a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier.
|
||||
|
||||
hostname: DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are
|
||||
supported for one level, e.g `*.example.com`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
if not hostname:
|
||||
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RegionalHostnameGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RegionalHostnameGetResponse]], ResultWrapper[RegionalHostnameGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class RegionalHostnamesResourceWithRawResponse:
|
||||
def __init__(self, regional_hostnames: RegionalHostnamesResource) -> None:
|
||||
self._regional_hostnames = regional_hostnames
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
regional_hostnames.create,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
regional_hostnames.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
regional_hostnames.delete,
|
||||
)
|
||||
self.edit = to_raw_response_wrapper(
|
||||
regional_hostnames.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
regional_hostnames.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def regions(self) -> RegionsResourceWithRawResponse:
|
||||
return RegionsResourceWithRawResponse(self._regional_hostnames.regions)
|
||||
|
||||
|
||||
class AsyncRegionalHostnamesResourceWithRawResponse:
|
||||
def __init__(self, regional_hostnames: AsyncRegionalHostnamesResource) -> None:
|
||||
self._regional_hostnames = regional_hostnames
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
regional_hostnames.create,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
regional_hostnames.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
regional_hostnames.delete,
|
||||
)
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
regional_hostnames.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
regional_hostnames.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def regions(self) -> AsyncRegionsResourceWithRawResponse:
|
||||
return AsyncRegionsResourceWithRawResponse(self._regional_hostnames.regions)
|
||||
|
||||
|
||||
class RegionalHostnamesResourceWithStreamingResponse:
|
||||
def __init__(self, regional_hostnames: RegionalHostnamesResource) -> None:
|
||||
self._regional_hostnames = regional_hostnames
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
regional_hostnames.create,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
regional_hostnames.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
regional_hostnames.delete,
|
||||
)
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
regional_hostnames.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
regional_hostnames.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def regions(self) -> RegionsResourceWithStreamingResponse:
|
||||
return RegionsResourceWithStreamingResponse(self._regional_hostnames.regions)
|
||||
|
||||
|
||||
class AsyncRegionalHostnamesResourceWithStreamingResponse:
|
||||
def __init__(self, regional_hostnames: AsyncRegionalHostnamesResource) -> None:
|
||||
self._regional_hostnames = regional_hostnames
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
regional_hostnames.create,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
regional_hostnames.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
regional_hostnames.delete,
|
||||
)
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
regional_hostnames.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
regional_hostnames.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def regions(self) -> AsyncRegionsResourceWithStreamingResponse:
|
||||
return AsyncRegionsResourceWithStreamingResponse(self._regional_hostnames.regions)
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ...._base_client import AsyncPaginator, make_request_options
|
||||
from ....types.addressing.regional_hostnames.region_list_response import RegionListResponse
|
||||
|
||||
__all__ = ["RegionsResource", "AsyncRegionsResource"]
|
||||
|
||||
|
||||
class RegionsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RegionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return RegionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RegionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return RegionsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[RegionListResponse]:
|
||||
"""
|
||||
List all Regional Services regions available for use by this account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/regional_hostnames/regions",
|
||||
page=SyncSinglePage[RegionListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=RegionListResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRegionsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRegionsResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncRegionsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncRegionsResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[RegionListResponse, AsyncSinglePage[RegionListResponse]]:
|
||||
"""
|
||||
List all Regional Services regions available for use by this account.
|
||||
|
||||
Args:
|
||||
account_id: Identifier.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/regional_hostnames/regions",
|
||||
page=AsyncSinglePage[RegionListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=RegionListResponse,
|
||||
)
|
||||
|
||||
|
||||
class RegionsResourceWithRawResponse:
|
||||
def __init__(self, regions: RegionsResource) -> None:
|
||||
self._regions = regions
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
regions.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRegionsResourceWithRawResponse:
|
||||
def __init__(self, regions: AsyncRegionsResource) -> None:
|
||||
self._regions = regions
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
regions.list,
|
||||
)
|
||||
|
||||
|
||||
class RegionsResourceWithStreamingResponse:
|
||||
def __init__(self, regions: RegionsResource) -> None:
|
||||
self._regions = regions
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
regions.list,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRegionsResourceWithStreamingResponse:
|
||||
def __init__(self, regions: AsyncRegionsResource) -> None:
|
||||
self._regions = regions
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
regions.list,
|
||||
)
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
|
|
@ -15,23 +13,32 @@ from ..._response import (
|
|||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.addressing import ServiceListResponse
|
||||
from ...pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ..._base_client import AsyncPaginator, make_request_options
|
||||
from ...types.addressing.service_list_response import ServiceListResponse
|
||||
|
||||
__all__ = ["Services", "AsyncServices"]
|
||||
__all__ = ["ServicesResource", "AsyncServicesResource"]
|
||||
|
||||
|
||||
class Services(SyncAPIResource):
|
||||
class ServicesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ServicesWithRawResponse:
|
||||
return ServicesWithRawResponse(self)
|
||||
def with_raw_response(self) -> ServicesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return ServicesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ServicesWithStreamingResponse:
|
||||
return ServicesWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> ServicesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return ServicesResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
|
|
@ -43,7 +50,7 @@ class Services(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ServiceListResponse:
|
||||
) -> SyncSinglePage[ServiceListResponse]:
|
||||
"""
|
||||
Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
|
||||
service running on the Cloudflare network to enable a Cloudflare product on the
|
||||
|
|
@ -51,7 +58,7 @@ class Services(SyncAPIResource):
|
|||
the Cloudflare network, and their service IDs.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -63,29 +70,37 @@ class Services(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/services",
|
||||
page=SyncSinglePage[ServiceListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[ServiceListResponse], ResultWrapper[ServiceListResponse]),
|
||||
model=ServiceListResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncServices(AsyncAPIResource):
|
||||
class AsyncServicesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncServicesWithRawResponse:
|
||||
return AsyncServicesWithRawResponse(self)
|
||||
def with_raw_response(self) -> AsyncServicesResourceWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncServicesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncServicesWithStreamingResponse:
|
||||
return AsyncServicesWithStreamingResponse(self)
|
||||
def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
async def list(
|
||||
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
|
||||
"""
|
||||
return AsyncServicesResourceWithStreamingResponse(self)
|
||||
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
account_id: str,
|
||||
|
|
@ -95,7 +110,7 @@ class AsyncServices(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ServiceListResponse:
|
||||
) -> AsyncPaginator[ServiceListResponse, AsyncSinglePage[ServiceListResponse]]:
|
||||
"""
|
||||
Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
|
||||
service running on the Cloudflare network to enable a Cloudflare product on the
|
||||
|
|
@ -103,7 +118,7 @@ class AsyncServices(AsyncAPIResource):
|
|||
the Cloudflare network, and their service IDs.
|
||||
|
||||
Args:
|
||||
account_id: Identifier
|
||||
account_id: Identifier of a Cloudflare account.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
|
|
@ -115,21 +130,18 @@ class AsyncServices(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return await self._get(
|
||||
return self._get_api_list(
|
||||
f"/accounts/{account_id}/addressing/services",
|
||||
page=AsyncSinglePage[ServiceListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=cast(Type[ServiceListResponse], ResultWrapper[ServiceListResponse]),
|
||||
model=ServiceListResponse,
|
||||
)
|
||||
|
||||
|
||||
class ServicesWithRawResponse:
|
||||
def __init__(self, services: Services) -> None:
|
||||
class ServicesResourceWithRawResponse:
|
||||
def __init__(self, services: ServicesResource) -> None:
|
||||
self._services = services
|
||||
|
||||
self.list = to_raw_response_wrapper(
|
||||
|
|
@ -137,8 +149,8 @@ class ServicesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncServicesWithRawResponse:
|
||||
def __init__(self, services: AsyncServices) -> None:
|
||||
class AsyncServicesResourceWithRawResponse:
|
||||
def __init__(self, services: AsyncServicesResource) -> None:
|
||||
self._services = services
|
||||
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
|
|
@ -146,8 +158,8 @@ class AsyncServicesWithRawResponse:
|
|||
)
|
||||
|
||||
|
||||
class ServicesWithStreamingResponse:
|
||||
def __init__(self, services: Services) -> None:
|
||||
class ServicesResourceWithStreamingResponse:
|
||||
def __init__(self, services: ServicesResource) -> None:
|
||||
self._services = services
|
||||
|
||||
self.list = to_streamed_response_wrapper(
|
||||
|
|
@ -155,8 +167,8 @@ class ServicesWithStreamingResponse:
|
|||
)
|
||||
|
||||
|
||||
class AsyncServicesWithStreamingResponse:
|
||||
def __init__(self, services: AsyncServices) -> None:
|
||||
class AsyncServicesResourceWithStreamingResponse:
|
||||
def __init__(self, services: AsyncServicesResource) -> None:
|
||||
self._services = services
|
||||
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue