Skip to content

Commit 8aa19d4

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#338)
1 parent 0b41651 commit 8aa19d4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ from cloudflare import Cloudflare
3030
client = Cloudflare(
3131
# This is the default and can be omitted
3232
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
33+
# This is the default and can be omitted
34+
api_key=os.environ.get("CLOUDFLARE_API_KEY"),
3335
)
3436

3537
zone = client.zones.create(
@@ -57,6 +59,8 @@ from cloudflare import AsyncCloudflare
5759
client = AsyncCloudflare(
5860
# This is the default and can be omitted
5961
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
62+
# This is the default and can be omitted
63+
api_key=os.environ.get("CLOUDFLARE_API_KEY"),
6064
)
6165

6266

src/cloudflare/_utils/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
is_list as is_list,
77
is_given as is_given,
88
is_tuple as is_tuple,
9+
lru_cache as lru_cache,
910
is_mapping as is_mapping,
1011
is_tuple_t as is_tuple_t,
1112
parse_date as parse_date,

src/cloudflare/_utils/_utils.py

+8
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,11 @@ def get_async_library() -> str:
389389
return sniffio.current_async_library()
390390
except Exception:
391391
return "false"
392+
393+
394+
def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
395+
"""A version of functools.lru_cache that retains the type signature
396+
for the wrapped function arguments.
397+
"""
398+
wrapper = functools.lru_cache(maxsize=maxsize)
399+
return cast(Any, wrapper) # type: ignore[no-any-return]

0 commit comments

Comments
 (0)