Skip to content

Commit 5dfdcbd

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

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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-f9dc65d353b377858f3d63d594de47559ed3a9d562295719690867315b8ec2fe.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7f8b3901624cc79465181c32dea2901c658e382a5ed3acada4692760b77f9c0.yml

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def create(
118118
name: str,
119119
location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN,
120120
storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN,
121-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
121+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
122122
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123123
# The extra values given here take precedence over values defined on the client or passed to this method.
124124
extra_headers: Headers | None = None,
@@ -138,7 +138,7 @@ def create(
138138
139139
storage_class: Storage class for newly uploaded objects, unless specified otherwise.
140140
141-
cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction
141+
jurisdiction: Creates the bucket in the provided jurisdiction
142142
143143
extra_headers: Send extra headers
144144
@@ -151,9 +151,7 @@ def create(
151151
if not account_id:
152152
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
153153
extra_headers = {
154-
**strip_not_given(
155-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
156-
),
154+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
157155
**(extra_headers or {}),
158156
}
159157
return self._post(
@@ -409,7 +407,7 @@ async def create(
409407
name: str,
410408
location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN,
411409
storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN,
412-
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
410+
jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
413411
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
414412
# The extra values given here take precedence over values defined on the client or passed to this method.
415413
extra_headers: Headers | None = None,
@@ -429,7 +427,7 @@ async def create(
429427
430428
storage_class: Storage class for newly uploaded objects, unless specified otherwise.
431429
432-
cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction
430+
jurisdiction: Creates the bucket in the provided jurisdiction
433431
434432
extra_headers: Send extra headers
435433
@@ -442,9 +440,7 @@ async def create(
442440
if not account_id:
443441
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
444442
extra_headers = {
445-
**strip_not_given(
446-
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
447-
),
443+
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
448444
**(extra_headers or {}),
449445
}
450446
return await self._post(

src/cloudflare/types/r2/bucket_create_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ class BucketCreateParams(TypedDict, total=False):
2222
storage_class: Annotated[Literal["Standard", "InfrequentAccess"], PropertyInfo(alias="storageClass")]
2323
"""Storage class for newly uploaded objects, unless specified otherwise."""
2424

25-
cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
25+
jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
2626
"""Creates the bucket in the provided jurisdiction"""

tests/api_resources/r2/test_buckets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3434
name="example-bucket",
3535
location_hint="apac",
3636
storage_class="Standard",
37-
cf_r2_jurisdiction="default",
37+
jurisdiction="default",
3838
)
3939
assert_matches_type(Bucket, bucket, path=["response"])
4040

@@ -277,7 +277,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
277277
name="example-bucket",
278278
location_hint="apac",
279279
storage_class="Standard",
280-
cf_r2_jurisdiction="default",
280+
jurisdiction="default",
281281
)
282282
assert_matches_type(Bucket, bucket, path=["response"])
283283

0 commit comments

Comments
 (0)