Skip to content

Commit fd63955

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

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
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-d7f8b3901624cc79465181c32dea2901c658e382a5ed3acada4692760b77f9c0.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e1196991f4ef4ff059b3c665a34ec0b270d84b2f786f6a1c0ff43e5974e4c50.yml

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

+6-10
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def list(
184184
order: Literal["name"] | NotGiven = NOT_GIVEN,
185185
per_page: float | NotGiven = NOT_GIVEN,
186186
start_after: str | NotGiven = NOT_GIVEN,
187-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
187+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
188188
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
189189
# The extra values given here take precedence over values defined on the client or passed to this method.
190190
extra_headers: Headers | None = None,
@@ -212,7 +212,7 @@ def list(
212212
213213
start_after: Bucket name to start searching after. Buckets are ordered lexicographically.
214214
215-
cf_r2_jurisdiction: Lists buckets in the provided jurisdiction
215+
jurisdiction: Lists buckets in the provided jurisdiction
216216
217217
extra_headers: Send extra headers
218218
@@ -225,9 +225,7 @@ def list(
225225
if not account_id:
226226
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
227227
extra_headers = {
228-
**strip_not_given(
229-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
230-
),
228+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
231229
**(extra_headers or {}),
232230
}
233231
return self._get(
@@ -473,7 +471,7 @@ async def list(
473471
order: Literal["name"] | NotGiven = NOT_GIVEN,
474472
per_page: float | NotGiven = NOT_GIVEN,
475473
start_after: str | NotGiven = NOT_GIVEN,
476-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
474+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
477475
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
478476
# The extra values given here take precedence over values defined on the client or passed to this method.
479477
extra_headers: Headers | None = None,
@@ -501,7 +499,7 @@ async def list(
501499
502500
start_after: Bucket name to start searching after. Buckets are ordered lexicographically.
503501
504-
cf_r2_jurisdiction: Lists buckets in the provided jurisdiction
502+
jurisdiction: Lists buckets in the provided jurisdiction
505503
506504
extra_headers: Send extra headers
507505
@@ -514,9 +512,7 @@ async def list(
514512
if not account_id:
515513
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
516514
extra_headers = {
517-
**strip_not_given(
518-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
519-
),
515+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
520516
**(extra_headers or {}),
521517
}
522518
return await self._get(

src/cloudflare/types/r2/bucket_list_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ class BucketListParams(TypedDict, total=False):
3737
start_after: str
3838
"""Bucket name to start searching after. Buckets are ordered lexicographically."""
3939

40-
cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
40+
jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
4141
"""Lists buckets in the provided jurisdiction"""

tests/api_resources/r2/test_buckets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
9494
order="name",
9595
per_page=1,
9696
start_after="my-bucket",
97-
cf_r2_jurisdiction="default",
97+
jurisdiction="default",
9898
)
9999
assert_matches_type(BucketListResponse, bucket, path=["response"])
100100

@@ -337,7 +337,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
337337
order="name",
338338
per_page=1,
339339
start_after="my-bucket",
340-
cf_r2_jurisdiction="default",
340+
jurisdiction="default",
341341
)
342342
assert_matches_type(BucketListResponse, bucket, path=["response"])
343343

0 commit comments

Comments
 (0)