Skip to content

Commit a1ef1be

Browse files
feat(r2)!: rename cf-r2-jurisdiction to more usable jurisdiction parameter (#2310)
1 parent fd63955 commit a1ef1be

File tree

24 files changed

+177
-257
lines changed

24 files changed

+177
-257
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1490
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e1196991f4ef4ff059b3c665a34ec0b270d84b2f786f6a1c0ff43e5974e4c50.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ed8629c4fef78e6fd8669578fc4d3904f20620a1ea39a40d5d2b4adbc4ecad6d.yml

src/cloudflare/resources/r2/buckets/buckets.py

+12-20
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def delete(
256256
bucket_name: str,
257257
*,
258258
account_id: str,
259-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
259+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
260260
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
261261
# The extra values given here take precedence over values defined on the client or passed to this method.
262262
extra_headers: Headers | None = None,
@@ -272,7 +272,7 @@ def delete(
272272
273273
bucket_name: Name of the bucket
274274
275-
cf_r2_jurisdiction: The bucket jurisdiction
275+
jurisdiction: The bucket jurisdiction
276276
277277
extra_headers: Send extra headers
278278
@@ -287,9 +287,7 @@ def delete(
287287
if not bucket_name:
288288
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
289289
extra_headers = {
290-
**strip_not_given(
291-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
292-
),
290+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
293291
**(extra_headers or {}),
294292
}
295293
return self._delete(
@@ -309,7 +307,7 @@ def get(
309307
bucket_name: str,
310308
*,
311309
account_id: str,
312-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
310+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
313311
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
314312
# The extra values given here take precedence over values defined on the client or passed to this method.
315313
extra_headers: Headers | None = None,
@@ -325,7 +323,7 @@ def get(
325323
326324
bucket_name: Name of the bucket
327325
328-
cf_r2_jurisdiction: The bucket jurisdiction
326+
jurisdiction: The bucket jurisdiction
329327
330328
extra_headers: Send extra headers
331329
@@ -340,9 +338,7 @@ def get(
340338
if not bucket_name:
341339
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
342340
extra_headers = {
343-
**strip_not_given(
344-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
345-
),
341+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
346342
**(extra_headers or {}),
347343
}
348344
return self._get(
@@ -543,7 +539,7 @@ async def delete(
543539
bucket_name: str,
544540
*,
545541
account_id: str,
546-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
542+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
547543
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
548544
# The extra values given here take precedence over values defined on the client or passed to this method.
549545
extra_headers: Headers | None = None,
@@ -559,7 +555,7 @@ async def delete(
559555
560556
bucket_name: Name of the bucket
561557
562-
cf_r2_jurisdiction: The bucket jurisdiction
558+
jurisdiction: The bucket jurisdiction
563559
564560
extra_headers: Send extra headers
565561
@@ -574,9 +570,7 @@ async def delete(
574570
if not bucket_name:
575571
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
576572
extra_headers = {
577-
**strip_not_given(
578-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
579-
),
573+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
580574
**(extra_headers or {}),
581575
}
582576
return await self._delete(
@@ -596,7 +590,7 @@ async def get(
596590
bucket_name: str,
597591
*,
598592
account_id: str,
599-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
593+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
600594
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
601595
# The extra values given here take precedence over values defined on the client or passed to this method.
602596
extra_headers: Headers | None = None,
@@ -612,7 +606,7 @@ async def get(
612606
613607
bucket_name: Name of the bucket
614608
615-
cf_r2_jurisdiction: The bucket jurisdiction
609+
jurisdiction: The bucket jurisdiction
616610
617611
extra_headers: Send extra headers
618612
@@ -627,9 +621,7 @@ async def get(
627621
if not bucket_name:
628622
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
629623
extra_headers = {
630-
**strip_not_given(
631-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
632-
),
624+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
633625
**(extra_headers or {}),
634626
}
635627
return await self._get(

src/cloudflare/resources/r2/buckets/cors.py

+18-30
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def update(
5656
*,
5757
account_id: str,
5858
rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN,
59-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
59+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
6060
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6161
# The extra values given here take precedence over values defined on the client or passed to this method.
6262
extra_headers: Headers | None = None,
@@ -72,7 +72,7 @@ def update(
7272
7373
bucket_name: Name of the bucket
7474
75-
cf_r2_jurisdiction: The bucket jurisdiction
75+
jurisdiction: The bucket jurisdiction
7676
7777
extra_headers: Send extra headers
7878
@@ -87,9 +87,7 @@ def update(
8787
if not bucket_name:
8888
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
8989
extra_headers = {
90-
**strip_not_given(
91-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
92-
),
90+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
9391
**(extra_headers or {}),
9492
}
9593
return self._put(
@@ -110,7 +108,7 @@ def delete(
110108
bucket_name: str,
111109
*,
112110
account_id: str,
113-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
111+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
114112
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
115113
# The extra values given here take precedence over values defined on the client or passed to this method.
116114
extra_headers: Headers | None = None,
@@ -126,7 +124,7 @@ def delete(
126124
127125
bucket_name: Name of the bucket
128126
129-
cf_r2_jurisdiction: The bucket jurisdiction
127+
jurisdiction: The bucket jurisdiction
130128
131129
extra_headers: Send extra headers
132130
@@ -141,9 +139,7 @@ def delete(
141139
if not bucket_name:
142140
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
143141
extra_headers = {
144-
**strip_not_given(
145-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
146-
),
142+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
147143
**(extra_headers or {}),
148144
}
149145
return self._delete(
@@ -163,7 +159,7 @@ def get(
163159
bucket_name: str,
164160
*,
165161
account_id: str,
166-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
162+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
167163
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168164
# The extra values given here take precedence over values defined on the client or passed to this method.
169165
extra_headers: Headers | None = None,
@@ -179,7 +175,7 @@ def get(
179175
180176
bucket_name: Name of the bucket
181177
182-
cf_r2_jurisdiction: The bucket jurisdiction
178+
jurisdiction: The bucket jurisdiction
183179
184180
extra_headers: Send extra headers
185181
@@ -194,9 +190,7 @@ def get(
194190
if not bucket_name:
195191
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
196192
extra_headers = {
197-
**strip_not_given(
198-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
199-
),
193+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
200194
**(extra_headers or {}),
201195
}
202196
return self._get(
@@ -238,7 +232,7 @@ async def update(
238232
*,
239233
account_id: str,
240234
rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN,
241-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
235+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
242236
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243237
# The extra values given here take precedence over values defined on the client or passed to this method.
244238
extra_headers: Headers | None = None,
@@ -254,7 +248,7 @@ async def update(
254248
255249
bucket_name: Name of the bucket
256250
257-
cf_r2_jurisdiction: The bucket jurisdiction
251+
jurisdiction: The bucket jurisdiction
258252
259253
extra_headers: Send extra headers
260254
@@ -269,9 +263,7 @@ async def update(
269263
if not bucket_name:
270264
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
271265
extra_headers = {
272-
**strip_not_given(
273-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
274-
),
266+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
275267
**(extra_headers or {}),
276268
}
277269
return await self._put(
@@ -292,7 +284,7 @@ async def delete(
292284
bucket_name: str,
293285
*,
294286
account_id: str,
295-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
287+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
296288
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
297289
# The extra values given here take precedence over values defined on the client or passed to this method.
298290
extra_headers: Headers | None = None,
@@ -308,7 +300,7 @@ async def delete(
308300
309301
bucket_name: Name of the bucket
310302
311-
cf_r2_jurisdiction: The bucket jurisdiction
303+
jurisdiction: The bucket jurisdiction
312304
313305
extra_headers: Send extra headers
314306
@@ -323,9 +315,7 @@ async def delete(
323315
if not bucket_name:
324316
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
325317
extra_headers = {
326-
**strip_not_given(
327-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
328-
),
318+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
329319
**(extra_headers or {}),
330320
}
331321
return await self._delete(
@@ -345,7 +335,7 @@ async def get(
345335
bucket_name: str,
346336
*,
347337
account_id: str,
348-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
338+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
349339
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
350340
# The extra values given here take precedence over values defined on the client or passed to this method.
351341
extra_headers: Headers | None = None,
@@ -361,7 +351,7 @@ async def get(
361351
362352
bucket_name: Name of the bucket
363353
364-
cf_r2_jurisdiction: The bucket jurisdiction
354+
jurisdiction: The bucket jurisdiction
365355
366356
extra_headers: Send extra headers
367357
@@ -376,9 +366,7 @@ async def get(
376366
if not bucket_name:
377367
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
378368
extra_headers = {
379-
**strip_not_given(
380-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
381-
),
369+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
382370
**(extra_headers or {}),
383371
}
384372
return await self._get(

0 commit comments

Comments
 (0)