diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e0dc5001b1a..89c23bacafa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.1.0" + ".": "3.1.1" } \ No newline at end of file diff --git a/api.md b/api.md index bb1656ac39f..cfd35bf55a3 100644 --- a/api.md +++ b/api.md @@ -2519,6 +2519,19 @@ Methods: - client.kv.namespaces.bulk_update(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkUpdateResponse] - client.kv.namespaces.get(namespace_id, \*, account_id) -> Optional[Namespace] +### Analytics + +Types: + +```python +from cloudflare.types.kv.namespaces import Components, Schema +``` + +Methods: + +- client.kv.namespaces.analytics.list(\*, account_id, \*\*params) -> Optional[Schema] +- client.kv.namespaces.analytics.stored(\*, account_id, \*\*params) -> Optional[Components] + ### Keys Types: @@ -4167,21 +4180,6 @@ Methods: - client.rules.lists.items.delete(list_id, \*, account_id) -> ItemDeleteResponse - client.rules.lists.items.get(item_id, \*, account_identifier, list_id) -> ItemGetResponse -# Storage - -## Analytics - -Types: - -```python -from cloudflare.types.storage import Components, Schema -``` - -Methods: - -- client.storage.analytics.list(\*, account_id, \*\*params) -> Optional[Schema] -- client.storage.analytics.stored(\*, account_id, \*\*params) -> Optional[Components] - # Stream Types: diff --git a/pyproject.toml b/pyproject.toml index 42d74bea48b..0c830397b01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cloudflare" -version = "3.1.0" +version = "3.1.1" description = "The official Python library for the cloudflare API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 097857a110c..37df5ff4515 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -63,7 +63,6 @@ billing, filters, logpush, - storage, workers, accounts, alerting, @@ -537,12 +536,6 @@ def rules(self) -> rules.RulesResource: return RulesResource(self) - @cached_property - def storage(self) -> storage.StorageResource: - from .resources.storage import StorageResource - - return StorageResource(self) - @cached_property def stream(self) -> stream.StreamResource: from .resources.stream import StreamResource @@ -1296,12 +1289,6 @@ def rules(self) -> rules.AsyncRulesResource: return AsyncRulesResource(self) - @cached_property - def storage(self) -> storage.AsyncStorageResource: - from .resources.storage import AsyncStorageResource - - return AsyncStorageResource(self) - @cached_property def stream(self) -> stream.AsyncStreamResource: from .resources.stream import AsyncStreamResource @@ -1988,12 +1975,6 @@ def rules(self) -> rules.RulesResourceWithRawResponse: return RulesResourceWithRawResponse(self._client.rules) - @cached_property - def storage(self) -> storage.StorageResourceWithRawResponse: - from .resources.storage import StorageResourceWithRawResponse - - return StorageResourceWithRawResponse(self._client.storage) - @cached_property def stream(self) -> stream.StreamResourceWithRawResponse: from .resources.stream import StreamResourceWithRawResponse @@ -2501,12 +2482,6 @@ def rules(self) -> rules.AsyncRulesResourceWithRawResponse: return AsyncRulesResourceWithRawResponse(self._client.rules) - @cached_property - def storage(self) -> storage.AsyncStorageResourceWithRawResponse: - from .resources.storage import AsyncStorageResourceWithRawResponse - - return AsyncStorageResourceWithRawResponse(self._client.storage) - @cached_property def stream(self) -> stream.AsyncStreamResourceWithRawResponse: from .resources.stream import AsyncStreamResourceWithRawResponse @@ -3014,12 +2989,6 @@ def rules(self) -> rules.RulesResourceWithStreamingResponse: return RulesResourceWithStreamingResponse(self._client.rules) - @cached_property - def storage(self) -> storage.StorageResourceWithStreamingResponse: - from .resources.storage import StorageResourceWithStreamingResponse - - return StorageResourceWithStreamingResponse(self._client.storage) - @cached_property def stream(self) -> stream.StreamResourceWithStreamingResponse: from .resources.stream import StreamResourceWithStreamingResponse @@ -3531,12 +3500,6 @@ def rules(self) -> rules.AsyncRulesResourceWithStreamingResponse: return AsyncRulesResourceWithStreamingResponse(self._client.rules) - @cached_property - def storage(self) -> storage.AsyncStorageResourceWithStreamingResponse: - from .resources.storage import AsyncStorageResourceWithStreamingResponse - - return AsyncStorageResourceWithStreamingResponse(self._client.storage) - @cached_property def stream(self) -> stream.AsyncStreamResourceWithStreamingResponse: from .resources.stream import AsyncStreamResourceWithStreamingResponse diff --git a/src/cloudflare/_version.py b/src/cloudflare/_version.py index 8567a89a5c0..bb20a7d3b8f 100644 --- a/src/cloudflare/_version.py +++ b/src/cloudflare/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "cloudflare" -__version__ = "3.1.0" # x-release-please-version +__version__ = "3.1.1" # x-release-please-version diff --git a/src/cloudflare/resources/kv/namespaces/__init__.py b/src/cloudflare/resources/kv/namespaces/__init__.py index eaf6f601cea..d65e56636a8 100644 --- a/src/cloudflare/resources/kv/namespaces/__init__.py +++ b/src/cloudflare/resources/kv/namespaces/__init__.py @@ -24,6 +24,14 @@ MetadataResourceWithStreamingResponse, AsyncMetadataResourceWithStreamingResponse, ) +from .analytics import ( + AnalyticsResource, + AsyncAnalyticsResource, + AnalyticsResourceWithRawResponse, + AsyncAnalyticsResourceWithRawResponse, + AnalyticsResourceWithStreamingResponse, + AsyncAnalyticsResourceWithStreamingResponse, +) from .namespaces import ( NamespacesResource, AsyncNamespacesResource, @@ -34,6 +42,12 @@ ) __all__ = [ + "AnalyticsResource", + "AsyncAnalyticsResource", + "AnalyticsResourceWithRawResponse", + "AsyncAnalyticsResourceWithRawResponse", + "AnalyticsResourceWithStreamingResponse", + "AsyncAnalyticsResourceWithStreamingResponse", "KeysResource", "AsyncKeysResource", "KeysResourceWithRawResponse", diff --git a/src/cloudflare/resources/storage/analytics.py b/src/cloudflare/resources/kv/namespaces/analytics.py similarity index 95% rename from src/cloudflare/resources/storage/analytics.py rename to src/cloudflare/resources/kv/namespaces/analytics.py index 9511df2ddcb..37867f6365e 100644 --- a/src/cloudflare/resources/storage/analytics.py +++ b/src/cloudflare/resources/kv/namespaces/analytics.py @@ -6,24 +6,24 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.storage import analytics_list_params, analytics_stored_params -from ...types.storage.schema import Schema -from ...types.storage.components import Components +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.kv.namespaces import analytics_list_params, analytics_stored_params +from ....types.kv.namespaces.schema import Schema +from ....types.kv.namespaces.components import Components __all__ = ["AnalyticsResource", "AsyncAnalyticsResource"] diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index 3f47127b147..fa99d1d498c 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -36,6 +36,14 @@ maybe_transform, async_maybe_transform, ) +from .analytics import ( + AnalyticsResource, + AsyncAnalyticsResource, + AnalyticsResourceWithRawResponse, + AsyncAnalyticsResourceWithRawResponse, + AnalyticsResourceWithStreamingResponse, + AsyncAnalyticsResourceWithStreamingResponse, +) from ...._compat import cached_property from ....types.kv import ( namespace_list_params, @@ -63,6 +71,10 @@ class NamespacesResource(SyncAPIResource): + @cached_property + def analytics(self) -> AnalyticsResource: + return AnalyticsResource(self._client) + @cached_property def keys(self) -> KeysResource: return KeysResource(self._client) @@ -438,6 +450,10 @@ def get( class AsyncNamespacesResource(AsyncAPIResource): + @cached_property + def analytics(self) -> AsyncAnalyticsResource: + return AsyncAnalyticsResource(self._client) + @cached_property def keys(self) -> AsyncKeysResource: return AsyncKeysResource(self._client) @@ -838,6 +854,10 @@ def __init__(self, namespaces: NamespacesResource) -> None: namespaces.get, ) + @cached_property + def analytics(self) -> AnalyticsResourceWithRawResponse: + return AnalyticsResourceWithRawResponse(self._namespaces.analytics) + @cached_property def keys(self) -> KeysResourceWithRawResponse: return KeysResourceWithRawResponse(self._namespaces.keys) @@ -877,6 +897,10 @@ def __init__(self, namespaces: AsyncNamespacesResource) -> None: namespaces.get, ) + @cached_property + def analytics(self) -> AsyncAnalyticsResourceWithRawResponse: + return AsyncAnalyticsResourceWithRawResponse(self._namespaces.analytics) + @cached_property def keys(self) -> AsyncKeysResourceWithRawResponse: return AsyncKeysResourceWithRawResponse(self._namespaces.keys) @@ -916,6 +940,10 @@ def __init__(self, namespaces: NamespacesResource) -> None: namespaces.get, ) + @cached_property + def analytics(self) -> AnalyticsResourceWithStreamingResponse: + return AnalyticsResourceWithStreamingResponse(self._namespaces.analytics) + @cached_property def keys(self) -> KeysResourceWithStreamingResponse: return KeysResourceWithStreamingResponse(self._namespaces.keys) @@ -955,6 +983,10 @@ def __init__(self, namespaces: AsyncNamespacesResource) -> None: namespaces.get, ) + @cached_property + def analytics(self) -> AsyncAnalyticsResourceWithStreamingResponse: + return AsyncAnalyticsResourceWithStreamingResponse(self._namespaces.analytics) + @cached_property def keys(self) -> AsyncKeysResourceWithStreamingResponse: return AsyncKeysResourceWithStreamingResponse(self._namespaces.keys) diff --git a/src/cloudflare/resources/storage/__init__.py b/src/cloudflare/resources/storage/__init__.py deleted file mode 100644 index 9c22eb0dc9e..00000000000 --- a/src/cloudflare/resources/storage/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .storage import ( - StorageResource, - AsyncStorageResource, - StorageResourceWithRawResponse, - AsyncStorageResourceWithRawResponse, - StorageResourceWithStreamingResponse, - AsyncStorageResourceWithStreamingResponse, -) -from .analytics import ( - AnalyticsResource, - AsyncAnalyticsResource, - AnalyticsResourceWithRawResponse, - AsyncAnalyticsResourceWithRawResponse, - AnalyticsResourceWithStreamingResponse, - AsyncAnalyticsResourceWithStreamingResponse, -) - -__all__ = [ - "AnalyticsResource", - "AsyncAnalyticsResource", - "AnalyticsResourceWithRawResponse", - "AsyncAnalyticsResourceWithRawResponse", - "AnalyticsResourceWithStreamingResponse", - "AsyncAnalyticsResourceWithStreamingResponse", - "StorageResource", - "AsyncStorageResource", - "StorageResourceWithRawResponse", - "AsyncStorageResourceWithRawResponse", - "StorageResourceWithStreamingResponse", - "AsyncStorageResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/storage/storage.py b/src/cloudflare/resources/storage/storage.py deleted file mode 100644 index 29ee1776764..00000000000 --- a/src/cloudflare/resources/storage/storage.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from ..._compat import cached_property -from .analytics import ( - AnalyticsResource, - AsyncAnalyticsResource, - AnalyticsResourceWithRawResponse, - AsyncAnalyticsResourceWithRawResponse, - AnalyticsResourceWithStreamingResponse, - AsyncAnalyticsResourceWithStreamingResponse, -) -from ..._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["StorageResource", "AsyncStorageResource"] - - -class StorageResource(SyncAPIResource): - @cached_property - def analytics(self) -> AnalyticsResource: - return AnalyticsResource(self._client) - - @cached_property - def with_raw_response(self) -> StorageResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return StorageResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> StorageResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return StorageResourceWithStreamingResponse(self) - - -class AsyncStorageResource(AsyncAPIResource): - @cached_property - def analytics(self) -> AsyncAnalyticsResource: - return AsyncAnalyticsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncStorageResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncStorageResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncStorageResourceWithStreamingResponse(self) - - -class StorageResourceWithRawResponse: - def __init__(self, storage: StorageResource) -> None: - self._storage = storage - - @cached_property - def analytics(self) -> AnalyticsResourceWithRawResponse: - return AnalyticsResourceWithRawResponse(self._storage.analytics) - - -class AsyncStorageResourceWithRawResponse: - def __init__(self, storage: AsyncStorageResource) -> None: - self._storage = storage - - @cached_property - def analytics(self) -> AsyncAnalyticsResourceWithRawResponse: - return AsyncAnalyticsResourceWithRawResponse(self._storage.analytics) - - -class StorageResourceWithStreamingResponse: - def __init__(self, storage: StorageResource) -> None: - self._storage = storage - - @cached_property - def analytics(self) -> AnalyticsResourceWithStreamingResponse: - return AnalyticsResourceWithStreamingResponse(self._storage.analytics) - - -class AsyncStorageResourceWithStreamingResponse: - def __init__(self, storage: AsyncStorageResource) -> None: - self._storage = storage - - @cached_property - def analytics(self) -> AsyncAnalyticsResourceWithStreamingResponse: - return AsyncAnalyticsResourceWithStreamingResponse(self._storage.analytics) diff --git a/src/cloudflare/types/kv/namespaces/__init__.py b/src/cloudflare/types/kv/namespaces/__init__.py index 49140e07efe..3105ebc40af 100644 --- a/src/cloudflare/types/kv/namespaces/__init__.py +++ b/src/cloudflare/types/kv/namespaces/__init__.py @@ -3,8 +3,12 @@ from __future__ import annotations from .key import Key as Key +from .schema import Schema as Schema +from .components import Components as Components from .key_list_params import KeyListParams as KeyListParams from .value_update_params import ValueUpdateParams as ValueUpdateParams +from .analytics_list_params import AnalyticsListParams as AnalyticsListParams from .metadata_get_response import MetadataGetResponse as MetadataGetResponse from .value_delete_response import ValueDeleteResponse as ValueDeleteResponse from .value_update_response import ValueUpdateResponse as ValueUpdateResponse +from .analytics_stored_params import AnalyticsStoredParams as AnalyticsStoredParams diff --git a/src/cloudflare/types/storage/analytics_list_params.py b/src/cloudflare/types/kv/namespaces/analytics_list_params.py similarity index 98% rename from src/cloudflare/types/storage/analytics_list_params.py rename to src/cloudflare/types/kv/namespaces/analytics_list_params.py index c5357877078..bac015948be 100644 --- a/src/cloudflare/types/storage/analytics_list_params.py +++ b/src/cloudflare/types/kv/namespaces/analytics_list_params.py @@ -6,7 +6,7 @@ from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["AnalyticsListParams", "Query"] diff --git a/src/cloudflare/types/storage/analytics_stored_params.py b/src/cloudflare/types/kv/namespaces/analytics_stored_params.py similarity index 98% rename from src/cloudflare/types/storage/analytics_stored_params.py rename to src/cloudflare/types/kv/namespaces/analytics_stored_params.py index 269a0bbf39e..0b0c576986a 100644 --- a/src/cloudflare/types/storage/analytics_stored_params.py +++ b/src/cloudflare/types/kv/namespaces/analytics_stored_params.py @@ -6,7 +6,7 @@ from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["AnalyticsStoredParams", "Query"] diff --git a/src/cloudflare/types/storage/components.py b/src/cloudflare/types/kv/namespaces/components.py similarity index 98% rename from src/cloudflare/types/storage/components.py rename to src/cloudflare/types/kv/namespaces/components.py index f5b7c5a450f..4f441969953 100644 --- a/src/cloudflare/types/storage/components.py +++ b/src/cloudflare/types/kv/namespaces/components.py @@ -3,7 +3,7 @@ from typing import Dict, List, Optional from datetime import datetime -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["Components", "Data", "Query"] diff --git a/src/cloudflare/types/storage/schema.py b/src/cloudflare/types/kv/namespaces/schema.py similarity index 98% rename from src/cloudflare/types/storage/schema.py rename to src/cloudflare/types/kv/namespaces/schema.py index 86d1d620de7..142059675f8 100644 --- a/src/cloudflare/types/storage/schema.py +++ b/src/cloudflare/types/kv/namespaces/schema.py @@ -3,7 +3,7 @@ from typing import Dict, List, Optional from datetime import datetime -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["Schema", "Data", "Query"] diff --git a/src/cloudflare/types/storage/__init__.py b/src/cloudflare/types/storage/__init__.py deleted file mode 100644 index 003dd49ba66..00000000000 --- a/src/cloudflare/types/storage/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .schema import Schema as Schema -from .components import Components as Components -from .analytics_list_params import AnalyticsListParams as AnalyticsListParams -from .analytics_stored_params import AnalyticsStoredParams as AnalyticsStoredParams diff --git a/tests/api_resources/storage/test_analytics.py b/tests/api_resources/kv/namespaces/test_analytics.py similarity index 85% rename from tests/api_resources/storage/test_analytics.py rename to tests/api_resources/kv/namespaces/test_analytics.py index 77b9a32a799..d222030a30e 100644 --- a/tests/api_resources/storage/test_analytics.py +++ b/tests/api_resources/kv/namespaces/test_analytics.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.storage import Schema, Components +from cloudflare.types.kv.namespaces import Schema, Components base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,14 +20,14 @@ class TestAnalytics: @parametrize def test_method_list(self, client: Cloudflare) -> None: - analytics = client.storage.analytics.list( + analytics = client.kv.namespaces.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Schema], analytics, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - analytics = client.storage.analytics.list( + analytics = client.kv.namespaces.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", query={ "dimensions": ["accountId"], @@ -43,7 +43,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.storage.analytics.with_raw_response.list( + response = client.kv.namespaces.analytics.with_raw_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -54,7 +54,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.storage.analytics.with_streaming_response.list( + with client.kv.namespaces.analytics.with_streaming_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -68,20 +68,20 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.storage.analytics.with_raw_response.list( + client.kv.namespaces.analytics.with_raw_response.list( account_id="", ) @parametrize def test_method_stored(self, client: Cloudflare) -> None: - analytics = client.storage.analytics.stored( + analytics = client.kv.namespaces.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Components], analytics, path=["response"]) @parametrize def test_method_stored_with_all_params(self, client: Cloudflare) -> None: - analytics = client.storage.analytics.stored( + analytics = client.kv.namespaces.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", query={ "dimensions": ["namespaceId"], @@ -97,7 +97,7 @@ def test_method_stored_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_stored(self, client: Cloudflare) -> None: - response = client.storage.analytics.with_raw_response.stored( + response = client.kv.namespaces.analytics.with_raw_response.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -108,7 +108,7 @@ def test_raw_response_stored(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_stored(self, client: Cloudflare) -> None: - with client.storage.analytics.with_streaming_response.stored( + with client.kv.namespaces.analytics.with_streaming_response.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -122,7 +122,7 @@ def test_streaming_response_stored(self, client: Cloudflare) -> None: @parametrize def test_path_params_stored(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.storage.analytics.with_raw_response.stored( + client.kv.namespaces.analytics.with_raw_response.stored( account_id="", ) @@ -132,14 +132,14 @@ class TestAsyncAnalytics: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - analytics = await async_client.storage.analytics.list( + analytics = await async_client.kv.namespaces.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Schema], analytics, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - analytics = await async_client.storage.analytics.list( + analytics = await async_client.kv.namespaces.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", query={ "dimensions": ["accountId"], @@ -155,7 +155,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.storage.analytics.with_raw_response.list( + response = await async_client.kv.namespaces.analytics.with_raw_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -166,7 +166,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.storage.analytics.with_streaming_response.list( + async with async_client.kv.namespaces.analytics.with_streaming_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -180,20 +180,20 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.storage.analytics.with_raw_response.list( + await async_client.kv.namespaces.analytics.with_raw_response.list( account_id="", ) @parametrize async def test_method_stored(self, async_client: AsyncCloudflare) -> None: - analytics = await async_client.storage.analytics.stored( + analytics = await async_client.kv.namespaces.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Components], analytics, path=["response"]) @parametrize async def test_method_stored_with_all_params(self, async_client: AsyncCloudflare) -> None: - analytics = await async_client.storage.analytics.stored( + analytics = await async_client.kv.namespaces.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", query={ "dimensions": ["namespaceId"], @@ -209,7 +209,7 @@ async def test_method_stored_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_stored(self, async_client: AsyncCloudflare) -> None: - response = await async_client.storage.analytics.with_raw_response.stored( + response = await async_client.kv.namespaces.analytics.with_raw_response.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -220,7 +220,7 @@ async def test_raw_response_stored(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_stored(self, async_client: AsyncCloudflare) -> None: - async with async_client.storage.analytics.with_streaming_response.stored( + async with async_client.kv.namespaces.analytics.with_streaming_response.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -234,6 +234,6 @@ async def test_streaming_response_stored(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_stored(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.storage.analytics.with_raw_response.stored( + await async_client.kv.namespaces.analytics.with_raw_response.stored( account_id="", ) diff --git a/tests/api_resources/storage/__init__.py b/tests/api_resources/storage/__init__.py deleted file mode 100644 index fd8019a9a1a..00000000000 --- a/tests/api_resources/storage/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.