Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 28, 2024
1 parent 54b6344 commit b705bb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/cloudflare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ._models import BaseModel
from ._version import __title__, __version__
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
from ._exceptions import (
APIError,
ConflictError,
Expand Down Expand Up @@ -68,6 +69,9 @@
"AsyncCloudflare",
"file_from_path",
"BaseModel",
"DEFAULT_TIMEOUT",
"DEFAULT_MAX_RETRIES",
"DEFAULT_CONNECTION_LIMITS",
]

_setup_logging()
Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
extract_response_type,
)
from ._constants import (
DEFAULT_LIMITS,
DEFAULT_TIMEOUT,
MAX_RETRY_DELAY,
DEFAULT_MAX_RETRIES,
INITIAL_RETRY_DELAY,
RAW_RESPONSE_HEADER,
OVERRIDE_CAST_TO_HEADER,
DEFAULT_CONNECTION_LIMITS,
)
from ._streaming import Stream, SSEDecoder, AsyncStream, SSEBytesDecoder
from ._exceptions import (
Expand Down Expand Up @@ -746,7 +746,7 @@ def __init__(
if http_client is not None:
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
else:
limits = DEFAULT_LIMITS
limits = DEFAULT_CONNECTION_LIMITS

if transport is not None:
warnings.warn(
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def __init__(
if http_client is not None:
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
else:
limits = DEFAULT_LIMITS
limits = DEFAULT_CONNECTION_LIMITS

if transport is not None:
warnings.warn(
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# default timeout is 1 minute
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0)
DEFAULT_MAX_RETRIES = 2
DEFAULT_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)

INITIAL_RETRY_DELAY = 0.5
MAX_RETRY_DELAY = 8.0

0 comments on commit b705bb6

Please sign in to comment.