Skip to content

Commit

Permalink
feat(r2)!: rename cf-r2-jurisdiction to more usable jurisdiction
Browse files Browse the repository at this point in the history
…parameter (#2309)
  • Loading branch information
stainless-app[bot] committed Jan 3, 2025
1 parent 5dfdcbd commit fd63955
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1490
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7f8b3901624cc79465181c32dea2901c658e382a5ed3acada4692760b77f9c0.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e1196991f4ef4ff059b3c665a34ec0b270d84b2f786f6a1c0ff43e5974e4c50.yml
16 changes: 6 additions & 10 deletions src/cloudflare/resources/r2/buckets/buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def list(
order: Literal["name"] | NotGiven = NOT_GIVEN,
per_page: float | NotGiven = NOT_GIVEN,
start_after: str | NotGiven = NOT_GIVEN,
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
jurisdiction: Literal["default", "eu", "fedramp"] | 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,
Expand Down Expand Up @@ -212,7 +212,7 @@ def list(
start_after: Bucket name to start searching after. Buckets are ordered lexicographically.
cf_r2_jurisdiction: Lists buckets in the provided jurisdiction
jurisdiction: Lists buckets in the provided jurisdiction
extra_headers: Send extra headers
Expand All @@ -225,9 +225,7 @@ def list(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {
**strip_not_given(
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
),
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
**(extra_headers or {}),
}
return self._get(
Expand Down Expand Up @@ -473,7 +471,7 @@ async def list(
order: Literal["name"] | NotGiven = NOT_GIVEN,
per_page: float | NotGiven = NOT_GIVEN,
start_after: str | NotGiven = NOT_GIVEN,
cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN,
jurisdiction: Literal["default", "eu", "fedramp"] | 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,
Expand Down Expand Up @@ -501,7 +499,7 @@ async def list(
start_after: Bucket name to start searching after. Buckets are ordered lexicographically.
cf_r2_jurisdiction: Lists buckets in the provided jurisdiction
jurisdiction: Lists buckets in the provided jurisdiction
extra_headers: Send extra headers
Expand All @@ -514,9 +512,7 @@ async def list(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {
**strip_not_given(
{"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN}
),
**strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}),
**(extra_headers or {}),
}
return await self._get(
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/r2/bucket_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ class BucketListParams(TypedDict, total=False):
start_after: str
"""Bucket name to start searching after. Buckets are ordered lexicographically."""

cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")]
"""Lists buckets in the provided jurisdiction"""
4 changes: 2 additions & 2 deletions tests/api_resources/r2/test_buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
order="name",
per_page=1,
start_after="my-bucket",
cf_r2_jurisdiction="default",
jurisdiction="default",
)
assert_matches_type(BucketListResponse, bucket, path=["response"])

Expand Down Expand Up @@ -337,7 +337,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
order="name",
per_page=1,
start_after="my-bucket",
cf_r2_jurisdiction="default",
jurisdiction="default",
)
assert_matches_type(BucketListResponse, bucket, path=["response"])

Expand Down

0 comments on commit fd63955

Please sign in to comment.