mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): OpenAPI spec update via Stainless API (#1183)
This commit is contained in:
parent
2dce4afe42
commit
8fdc3df35e
3 changed files with 10 additions and 10 deletions
|
|
@ -1,2 +1,2 @@
|
|||
configured_endpoints: 1256
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ef67d6f67b25546d096188d487750c4f93a8fe91cea032da7eea0b1fae24e00.yml
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba6989e092ceb9b2700a5005e1b79d3de9fb5a8abf6d73406bece08a7662171c.yml
|
||||
|
|
|
|||
|
|
@ -879,9 +879,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|||
def _prepare_options(
|
||||
self,
|
||||
options: FinalRequestOptions, # noqa: ARG002
|
||||
) -> None:
|
||||
) -> FinalRequestOptions:
|
||||
"""Hook for mutating the given options"""
|
||||
return None
|
||||
return options
|
||||
|
||||
def _prepare_request(
|
||||
self,
|
||||
|
|
@ -961,7 +961,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|||
input_options = model_copy(options)
|
||||
|
||||
cast_to = self._maybe_override_cast_to(cast_to, options)
|
||||
self._prepare_options(options)
|
||||
options = self._prepare_options(options)
|
||||
|
||||
retries = self._remaining_retries(remaining_retries, options)
|
||||
request = self._build_request(options)
|
||||
|
|
@ -1442,9 +1442,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|||
async def _prepare_options(
|
||||
self,
|
||||
options: FinalRequestOptions, # noqa: ARG002
|
||||
) -> None:
|
||||
) -> FinalRequestOptions:
|
||||
"""Hook for mutating the given options"""
|
||||
return None
|
||||
return options
|
||||
|
||||
async def _prepare_request(
|
||||
self,
|
||||
|
|
@ -1529,7 +1529,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|||
input_options = model_copy(options)
|
||||
|
||||
cast_to = self._maybe_override_cast_to(cast_to, options)
|
||||
await self._prepare_options(options)
|
||||
options = await self._prepare_options(options)
|
||||
|
||||
retries = self._remaining_retries(remaining_retries, options)
|
||||
request = self._build_request(options)
|
||||
|
|
|
|||
|
|
@ -118,10 +118,10 @@ def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
|
|||
return model.__fields__ # type: ignore
|
||||
|
||||
|
||||
def model_copy(model: _ModelT) -> _ModelT:
|
||||
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
|
||||
if PYDANTIC_V2:
|
||||
return model.model_copy()
|
||||
return model.copy() # type: ignore
|
||||
return model.model_copy(deep=deep)
|
||||
return model.copy(deep=deep) # type: ignore
|
||||
|
||||
|
||||
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue