mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-05-17 21:30:39 +00:00
chore(types): change optional parameter type from NotGiven to Omit
This commit is contained in:
parent
9751764207
commit
215857f1ee
20 changed files with 272 additions and 256 deletions
|
|
@ -42,7 +42,6 @@ from . import _exceptions
|
|||
from ._qs import Querystring
|
||||
from ._files import to_httpx_files, async_to_httpx_files
|
||||
from ._types import (
|
||||
NOT_GIVEN,
|
||||
Body,
|
||||
Omit,
|
||||
Query,
|
||||
|
|
@ -57,6 +56,7 @@ from ._types import (
|
|||
RequestOptions,
|
||||
HttpxRequestFiles,
|
||||
ModelBuilderProtocol,
|
||||
not_given,
|
||||
)
|
||||
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
|
||||
from ._compat import PYDANTIC_V1, model_copy, model_dump
|
||||
|
|
@ -145,9 +145,9 @@ class PageInfo:
|
|||
def __init__(
|
||||
self,
|
||||
*,
|
||||
url: URL | NotGiven = NOT_GIVEN,
|
||||
json: Body | NotGiven = NOT_GIVEN,
|
||||
params: Query | NotGiven = NOT_GIVEN,
|
||||
url: URL | NotGiven = not_given,
|
||||
json: Body | NotGiven = not_given,
|
||||
params: Query | NotGiven = not_given,
|
||||
) -> None:
|
||||
self.url = url
|
||||
self.json = json
|
||||
|
|
@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|||
# we internally support defining a temporary header to override the
|
||||
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
|
||||
# see _response.py for implementation details
|
||||
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
|
||||
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
|
||||
if is_given(override_cast_to):
|
||||
options.headers = headers
|
||||
return cast(Type[ResponseT], override_cast_to)
|
||||
|
|
@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|||
version: str,
|
||||
base_url: str | URL,
|
||||
max_retries: int = DEFAULT_MAX_RETRIES,
|
||||
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
||||
timeout: float | Timeout | None | NotGiven = not_given,
|
||||
http_client: httpx.Client | None = None,
|
||||
custom_headers: Mapping[str, str] | None = None,
|
||||
custom_query: Mapping[str, object] | None = None,
|
||||
|
|
@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|||
base_url: str | URL,
|
||||
_strict_response_validation: bool,
|
||||
max_retries: int = DEFAULT_MAX_RETRIES,
|
||||
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
||||
timeout: float | Timeout | None | NotGiven = not_given,
|
||||
http_client: httpx.AsyncClient | None = None,
|
||||
custom_headers: Mapping[str, str] | None = None,
|
||||
custom_query: Mapping[str, object] | None = None,
|
||||
|
|
@ -1818,8 +1818,8 @@ def make_request_options(
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
idempotency_key: str | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
post_parser: PostParser | NotGiven = NOT_GIVEN,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
post_parser: PostParser | NotGiven = not_given,
|
||||
) -> RequestOptions:
|
||||
"""Create a dict of type RequestOptions without keys of NotGiven values."""
|
||||
options: RequestOptions = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue