Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 3.0.0-beta.7 #181

Merged
merged 16 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.0.0-beta.6"
".": "3.0.0-beta.7"
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 3.0.0-beta.7 (2024-04-01)

Full Changelog: [v3.0.0-beta.6...v3.0.0-beta.7](https://github.com/cloudflare/cloudflare-python/compare/v3.0.0-beta.6...v3.0.0-beta.7)

### Features

* **api:** OpenAPI spec update via Stainless API ([#189](https://github.com/cloudflare/cloudflare-python/issues/189)) ([4058dbb](https://github.com/cloudflare/cloudflare-python/commit/4058dbb8f270873b49bb12bd5c56186c9a74b380))
* **api:** OpenAPI spec update via Stainless API ([#191](https://github.com/cloudflare/cloudflare-python/issues/191)) ([b705bb6](https://github.com/cloudflare/cloudflare-python/commit/b705bb679ef127492d0eac9abc54669c4c4263b0))
* **api:** OpenAPI spec update via Stainless API ([#193](https://github.com/cloudflare/cloudflare-python/issues/193)) ([d19970f](https://github.com/cloudflare/cloudflare-python/commit/d19970f8a9bc6ae9bbd30b59b8406007a79a3401))
* **api:** OpenAPI spec update via Stainless API ([#194](https://github.com/cloudflare/cloudflare-python/issues/194)) ([d2bad01](https://github.com/cloudflare/cloudflare-python/commit/d2bad015a9a95405d4f770bdd579a2de821e835f))
* **api:** OpenAPI spec update via Stainless API ([#195](https://github.com/cloudflare/cloudflare-python/issues/195)) ([7b2beb3](https://github.com/cloudflare/cloudflare-python/commit/7b2beb3e0cf0bf5415b3cf434ab36cf54546c864))
* **api:** update via SDK Studio ([#180](https://github.com/cloudflare/cloudflare-python/issues/180)) ([0ad46e1](https://github.com/cloudflare/cloudflare-python/commit/0ad46e17772a799cd8a3be894f5a81da0d055ad0))
* **api:** update via SDK Studio ([#182](https://github.com/cloudflare/cloudflare-python/issues/182)) ([5fd3378](https://github.com/cloudflare/cloudflare-python/commit/5fd33784fbb92a0ac2b98f6835287cc6397cb955))
* **api:** update via SDK Studio ([#183](https://github.com/cloudflare/cloudflare-python/issues/183)) ([1fecb6d](https://github.com/cloudflare/cloudflare-python/commit/1fecb6d96a53f2139d152e0374b08c2eb068592b))
* **api:** update via SDK Studio ([#184](https://github.com/cloudflare/cloudflare-python/issues/184)) ([f0b4983](https://github.com/cloudflare/cloudflare-python/commit/f0b49831d42186dc6b187b274e23f2f03907070f))
* **api:** update via SDK Studio ([#185](https://github.com/cloudflare/cloudflare-python/issues/185)) ([2df49c1](https://github.com/cloudflare/cloudflare-python/commit/2df49c12d18c610d41497c56013f4e4eb9e0124b))
* **api:** update via SDK Studio ([#186](https://github.com/cloudflare/cloudflare-python/issues/186)) ([c2435a8](https://github.com/cloudflare/cloudflare-python/commit/c2435a8988667dbfb08810f26507cd2f21a7faf2))
* **api:** update via SDK Studio ([#187](https://github.com/cloudflare/cloudflare-python/issues/187)) ([16b6e68](https://github.com/cloudflare/cloudflare-python/commit/16b6e68d27670f443c9cd01c65a6006e839db8a9))
* **api:** update via SDK Studio ([#188](https://github.com/cloudflare/cloudflare-python/issues/188)) ([71da3ed](https://github.com/cloudflare/cloudflare-python/commit/71da3ed76c65bcb5e14bb964c98327f797ad1c1c))
* **api:** update via SDK Studio ([#190](https://github.com/cloudflare/cloudflare-python/issues/190)) ([54b6344](https://github.com/cloudflare/cloudflare-python/commit/54b63444f5d4492dbb12c4736936f82e66ef07c2))
* **api:** update via SDK Studio ([#192](https://github.com/cloudflare/cloudflare-python/issues/192)) ([5d528fc](https://github.com/cloudflare/cloudflare-python/commit/5d528fcf8a7f45e7b5394bed02997a0c91b2d55d))

## 3.0.0-beta.6 (2024-03-27)

Full Changelog: [v3.0.0-beta.5...v3.0.0-beta.6](https://github.com/cloudflare/cloudflare-python/compare/v3.0.0-beta.5...v3.0.0-beta.6)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ response = client.post(
print(response.headers.get("x-foo"))
```

#### Undocumented params
#### Undocumented request params

If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
options.

#### Undocumented properties
#### Undocumented response properties

To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
can also get all the extra fields on the Pydantic model as a dict with
Expand Down
1,304 changes: 606 additions & 698 deletions api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ show_error_codes = True
# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/workers/ai\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py)$
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py)$

strict_equality = True
implicit_reexport = True
Expand Down
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[project]
name = "cloudflare"
version = "3.0.0-beta.6"
version = "3.0.0-beta.7"
description = "The official Python library for the cloudflare API"
readme = "README.md"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Cloudflare", email = "[email protected]" },
Expand Down Expand Up @@ -88,7 +88,7 @@ typecheck = { chain = [
"typecheck:mypy" = "mypy ."

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"

[tool.hatch.build]
Expand All @@ -99,6 +99,17 @@ include = [
[tool.hatch.build.targets.wheel]
packages = ["src/cloudflare"]

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# replace relative links with absolute links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/cloudflare/cloudflare-python/tree/main/\g<2>)'

[tool.black]
line-length = 120
target-version = ["py37"]
Expand Down
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
11 changes: 8 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 @@ -360,6 +360,11 @@ def __init__(
self._strict_response_validation = _strict_response_validation
self._idempotency_header = None

if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
raise TypeError(
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `cloudflare.DEFAULT_MAX_RETRIES`"
)

def _enforce_trailing_slash(self, url: URL) -> URL:
if url.raw_path.endswith(b"/"):
return url
Expand Down Expand Up @@ -746,7 +751,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 +1285,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
32 changes: 16 additions & 16 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Cloudflare(SyncAPIClient):
custom_hostnames: resources.CustomHostnames
custom_nameservers: resources.CustomNameservers
dns: resources.DNS
dnssec: resources.DNSSEC
dnssec: resources.DNSSECResource
email_routing: resources.EmailRouting
filters: resources.Filters
firewall: resources.Firewall
Expand Down Expand Up @@ -114,7 +114,7 @@ class Cloudflare(SyncAPIClient):
workers_for_platforms: resources.WorkersForPlatforms
zero_trust: resources.ZeroTrust
challenges: resources.Challenges
hyperdrive: resources.Hyperdrive
hyperdrive: resources.HyperdriveResource
rum: resources.RUM
vectorize: resources.Vectorize
url_scanner: resources.URLScanner
Expand Down Expand Up @@ -220,7 +220,7 @@ def __init__(
self.custom_hostnames = resources.CustomHostnames(self)
self.custom_nameservers = resources.CustomNameservers(self)
self.dns = resources.DNS(self)
self.dnssec = resources.DNSSEC(self)
self.dnssec = resources.DNSSECResource(self)
self.email_routing = resources.EmailRouting(self)
self.filters = resources.Filters(self)
self.firewall = resources.Firewall(self)
Expand Down Expand Up @@ -267,7 +267,7 @@ def __init__(
self.workers_for_platforms = resources.WorkersForPlatforms(self)
self.zero_trust = resources.ZeroTrust(self)
self.challenges = resources.Challenges(self)
self.hyperdrive = resources.Hyperdrive(self)
self.hyperdrive = resources.HyperdriveResource(self)
self.rum = resources.RUM(self)
self.vectorize = resources.Vectorize(self)
self.url_scanner = resources.URLScanner(self)
Expand Down Expand Up @@ -478,7 +478,7 @@ class AsyncCloudflare(AsyncAPIClient):
custom_hostnames: resources.AsyncCustomHostnames
custom_nameservers: resources.AsyncCustomNameservers
dns: resources.AsyncDNS
dnssec: resources.AsyncDNSSEC
dnssec: resources.AsyncDNSSECResource
email_routing: resources.AsyncEmailRouting
filters: resources.AsyncFilters
firewall: resources.AsyncFirewall
Expand Down Expand Up @@ -525,7 +525,7 @@ class AsyncCloudflare(AsyncAPIClient):
workers_for_platforms: resources.AsyncWorkersForPlatforms
zero_trust: resources.AsyncZeroTrust
challenges: resources.AsyncChallenges
hyperdrive: resources.AsyncHyperdrive
hyperdrive: resources.AsyncHyperdriveResource
rum: resources.AsyncRUM
vectorize: resources.AsyncVectorize
url_scanner: resources.AsyncURLScanner
Expand Down Expand Up @@ -631,7 +631,7 @@ def __init__(
self.custom_hostnames = resources.AsyncCustomHostnames(self)
self.custom_nameservers = resources.AsyncCustomNameservers(self)
self.dns = resources.AsyncDNS(self)
self.dnssec = resources.AsyncDNSSEC(self)
self.dnssec = resources.AsyncDNSSECResource(self)
self.email_routing = resources.AsyncEmailRouting(self)
self.filters = resources.AsyncFilters(self)
self.firewall = resources.AsyncFirewall(self)
Expand Down Expand Up @@ -678,7 +678,7 @@ def __init__(
self.workers_for_platforms = resources.AsyncWorkersForPlatforms(self)
self.zero_trust = resources.AsyncZeroTrust(self)
self.challenges = resources.AsyncChallenges(self)
self.hyperdrive = resources.AsyncHyperdrive(self)
self.hyperdrive = resources.AsyncHyperdriveResource(self)
self.rum = resources.AsyncRUM(self)
self.vectorize = resources.AsyncVectorize(self)
self.url_scanner = resources.AsyncURLScanner(self)
Expand Down Expand Up @@ -890,7 +890,7 @@ def __init__(self, client: Cloudflare) -> None:
self.custom_hostnames = resources.CustomHostnamesWithRawResponse(client.custom_hostnames)
self.custom_nameservers = resources.CustomNameserversWithRawResponse(client.custom_nameservers)
self.dns = resources.DNSWithRawResponse(client.dns)
self.dnssec = resources.DNSSECWithRawResponse(client.dnssec)
self.dnssec = resources.DNSSECResourceWithRawResponse(client.dnssec)
self.email_routing = resources.EmailRoutingWithRawResponse(client.email_routing)
self.filters = resources.FiltersWithRawResponse(client.filters)
self.firewall = resources.FirewallWithRawResponse(client.firewall)
Expand Down Expand Up @@ -937,7 +937,7 @@ def __init__(self, client: Cloudflare) -> None:
self.workers_for_platforms = resources.WorkersForPlatformsWithRawResponse(client.workers_for_platforms)
self.zero_trust = resources.ZeroTrustWithRawResponse(client.zero_trust)
self.challenges = resources.ChallengesWithRawResponse(client.challenges)
self.hyperdrive = resources.HyperdriveWithRawResponse(client.hyperdrive)
self.hyperdrive = resources.HyperdriveResourceWithRawResponse(client.hyperdrive)
self.rum = resources.RUMWithRawResponse(client.rum)
self.vectorize = resources.VectorizeWithRawResponse(client.vectorize)
self.url_scanner = resources.URLScannerWithRawResponse(client.url_scanner)
Expand Down Expand Up @@ -978,7 +978,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.custom_hostnames = resources.AsyncCustomHostnamesWithRawResponse(client.custom_hostnames)
self.custom_nameservers = resources.AsyncCustomNameserversWithRawResponse(client.custom_nameservers)
self.dns = resources.AsyncDNSWithRawResponse(client.dns)
self.dnssec = resources.AsyncDNSSECWithRawResponse(client.dnssec)
self.dnssec = resources.AsyncDNSSECResourceWithRawResponse(client.dnssec)
self.email_routing = resources.AsyncEmailRoutingWithRawResponse(client.email_routing)
self.filters = resources.AsyncFiltersWithRawResponse(client.filters)
self.firewall = resources.AsyncFirewallWithRawResponse(client.firewall)
Expand Down Expand Up @@ -1027,7 +1027,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithRawResponse(client.workers_for_platforms)
self.zero_trust = resources.AsyncZeroTrustWithRawResponse(client.zero_trust)
self.challenges = resources.AsyncChallengesWithRawResponse(client.challenges)
self.hyperdrive = resources.AsyncHyperdriveWithRawResponse(client.hyperdrive)
self.hyperdrive = resources.AsyncHyperdriveResourceWithRawResponse(client.hyperdrive)
self.rum = resources.AsyncRUMWithRawResponse(client.rum)
self.vectorize = resources.AsyncVectorizeWithRawResponse(client.vectorize)
self.url_scanner = resources.AsyncURLScannerWithRawResponse(client.url_scanner)
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def __init__(self, client: Cloudflare) -> None:
self.custom_hostnames = resources.CustomHostnamesWithStreamingResponse(client.custom_hostnames)
self.custom_nameservers = resources.CustomNameserversWithStreamingResponse(client.custom_nameservers)
self.dns = resources.DNSWithStreamingResponse(client.dns)
self.dnssec = resources.DNSSECWithStreamingResponse(client.dnssec)
self.dnssec = resources.DNSSECResourceWithStreamingResponse(client.dnssec)
self.email_routing = resources.EmailRoutingWithStreamingResponse(client.email_routing)
self.filters = resources.FiltersWithStreamingResponse(client.filters)
self.firewall = resources.FirewallWithStreamingResponse(client.firewall)
Expand Down Expand Up @@ -1117,7 +1117,7 @@ def __init__(self, client: Cloudflare) -> None:
self.workers_for_platforms = resources.WorkersForPlatformsWithStreamingResponse(client.workers_for_platforms)
self.zero_trust = resources.ZeroTrustWithStreamingResponse(client.zero_trust)
self.challenges = resources.ChallengesWithStreamingResponse(client.challenges)
self.hyperdrive = resources.HyperdriveWithStreamingResponse(client.hyperdrive)
self.hyperdrive = resources.HyperdriveResourceWithStreamingResponse(client.hyperdrive)
self.rum = resources.RUMWithStreamingResponse(client.rum)
self.vectorize = resources.VectorizeWithStreamingResponse(client.vectorize)
self.url_scanner = resources.URLScannerWithStreamingResponse(client.url_scanner)
Expand Down Expand Up @@ -1160,7 +1160,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.custom_hostnames = resources.AsyncCustomHostnamesWithStreamingResponse(client.custom_hostnames)
self.custom_nameservers = resources.AsyncCustomNameserversWithStreamingResponse(client.custom_nameservers)
self.dns = resources.AsyncDNSWithStreamingResponse(client.dns)
self.dnssec = resources.AsyncDNSSECWithStreamingResponse(client.dnssec)
self.dnssec = resources.AsyncDNSSECResourceWithStreamingResponse(client.dnssec)
self.email_routing = resources.AsyncEmailRoutingWithStreamingResponse(client.email_routing)
self.filters = resources.AsyncFiltersWithStreamingResponse(client.filters)
self.firewall = resources.AsyncFirewallWithStreamingResponse(client.firewall)
Expand Down Expand Up @@ -1213,7 +1213,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
)
self.zero_trust = resources.AsyncZeroTrustWithStreamingResponse(client.zero_trust)
self.challenges = resources.AsyncChallengesWithStreamingResponse(client.challenges)
self.hyperdrive = resources.AsyncHyperdriveWithStreamingResponse(client.hyperdrive)
self.hyperdrive = resources.AsyncHyperdriveResourceWithStreamingResponse(client.hyperdrive)
self.rum = resources.AsyncRUMWithStreamingResponse(client.rum)
self.vectorize = resources.AsyncVectorizeWithStreamingResponse(client.vectorize)
self.url_scanner = resources.AsyncURLScannerWithStreamingResponse(client.url_scanner)
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
2 changes: 1 addition & 1 deletion src/cloudflare/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "cloudflare"
__version__ = "3.0.0-beta.6" # x-release-please-version
__version__ = "3.0.0-beta.7" # x-release-please-version
Loading
Loading