Skip to content

Commit bcbde3c

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1170)
1 parent a9193f3 commit bcbde3c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1254
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4709b7dee8b6c80c4c2f928152e248b95ba884602bcaed42c646d0e982cafc6a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-705f4e474ef9306d04d07ae04f559a20a888bdb98813ec16734a072080874e74.yml

src/cloudflare/_base_client.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,11 @@ def _request(
955955
stream: bool,
956956
stream_cls: type[_StreamT] | None,
957957
) -> ResponseT | _StreamT:
958+
# create a copy of the options we were given so that if the
959+
# options are mutated later & we then retry, the retries are
960+
# given the original options
961+
input_options = model_copy(options)
962+
958963
cast_to = self._maybe_override_cast_to(cast_to, options)
959964
self._prepare_options(options)
960965

@@ -979,7 +984,7 @@ def _request(
979984

980985
if retries > 0:
981986
return self._retry_request(
982-
options,
987+
input_options,
983988
cast_to,
984989
retries,
985990
stream=stream,
@@ -994,7 +999,7 @@ def _request(
994999

9951000
if retries > 0:
9961001
return self._retry_request(
997-
options,
1002+
input_options,
9981003
cast_to,
9991004
retries,
10001005
stream=stream,
@@ -1022,7 +1027,7 @@ def _request(
10221027
if retries > 0 and self._should_retry(err.response):
10231028
err.response.close()
10241029
return self._retry_request(
1025-
options,
1030+
input_options,
10261031
cast_to,
10271032
retries,
10281033
err.response.headers,
@@ -1518,6 +1523,11 @@ async def _request(
15181523
# execute it earlier while we are in an async context
15191524
self._platform = await asyncify(get_platform)()
15201525

1526+
# create a copy of the options we were given so that if the
1527+
# options are mutated later & we then retry, the retries are
1528+
# given the original options
1529+
input_options = model_copy(options)
1530+
15211531
cast_to = self._maybe_override_cast_to(cast_to, options)
15221532
await self._prepare_options(options)
15231533

@@ -1540,7 +1550,7 @@ async def _request(
15401550

15411551
if retries > 0:
15421552
return await self._retry_request(
1543-
options,
1553+
input_options,
15441554
cast_to,
15451555
retries,
15461556
stream=stream,
@@ -1555,7 +1565,7 @@ async def _request(
15551565

15561566
if retries > 0:
15571567
return await self._retry_request(
1558-
options,
1568+
input_options,
15591569
cast_to,
15601570
retries,
15611571
stream=stream,
@@ -1578,7 +1588,7 @@ async def _request(
15781588
if retries > 0 and self._should_retry(err.response):
15791589
await err.response.aclose()
15801590
return await self._retry_request(
1581-
options,
1591+
input_options,
15821592
cast_to,
15831593
retries,
15841594
err.response.headers,

0 commit comments

Comments
 (0)