feat(api): update via SDK Studio (#133)

This commit is contained in:
stainless-app[bot] 2024-03-15 02:58:35 +00:00
parent 2c0fa4a62c
commit cac9284a7b
9 changed files with 96 additions and 96 deletions

8
api.md
View file

@ -5101,14 +5101,14 @@ Types:
from cloudflare.types.zero_trust.access.certificates import (
AccessSettings,
SettingUpdateResponse,
SettingListResponse,
SettingGetResponse,
)
```
Methods:
- <code title="put /{account_or_zone}/{account_or_zone_id}/access/certificates/settings">client.zero_trust.access.certificates.settings.<a href="./src/cloudflare/resources/zero_trust/access/certificates/settings.py">update</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/certificates/setting_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py">Optional</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/certificates/settings">client.zero_trust.access.certificates.settings.<a href="./src/cloudflare/resources/zero_trust/access/certificates/settings.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/certificates/setting_list_response.py">Optional</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/certificates/settings">client.zero_trust.access.certificates.settings.<a href="./src/cloudflare/resources/zero_trust/access/certificates/settings.py">get</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py">Optional</a></code>
### Groups
@ -5173,13 +5173,13 @@ Methods:
Types:
```python
from cloudflare.types.zero_trust.access import KeyUpdateResponse, KeyListResponse, KeyRotateResponse
from cloudflare.types.zero_trust.access import KeyUpdateResponse, KeyGetResponse, KeyRotateResponse
```
Methods:
- <code title="put /accounts/{identifier}/access/keys">client.zero_trust.access.keys.<a href="./src/cloudflare/resources/zero_trust/access/keys.py">update</a>(identifier, \*\*<a href="src/cloudflare/types/zero_trust/access/key_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/key_update_response.py">KeyUpdateResponse</a></code>
- <code title="get /accounts/{identifier}/access/keys">client.zero_trust.access.keys.<a href="./src/cloudflare/resources/zero_trust/access/keys.py">list</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/key_list_response.py">KeyListResponse</a></code>
- <code title="get /accounts/{identifier}/access/keys">client.zero_trust.access.keys.<a href="./src/cloudflare/resources/zero_trust/access/keys.py">get</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/key_get_response.py">KeyGetResponse</a></code>
- <code title="post /accounts/{identifier}/access/keys/rotate">client.zero_trust.access.keys.<a href="./src/cloudflare/resources/zero_trust/access/keys.py">rotate</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/key_rotate_response.py">KeyRotateResponse</a></code>
### Logs

View file

@ -24,8 +24,8 @@ from ....._base_client import (
make_request_options,
)
from .....types.zero_trust.access.certificates import (
SettingGetResponse,
AccessSettingsParam,
SettingListResponse,
SettingUpdateResponse,
setting_update_params,
)
@ -99,7 +99,7 @@ class Settings(SyncAPIResource):
cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]),
)
def list(
def get(
self,
*,
account_id: str | NotGiven = NOT_GIVEN,
@ -110,7 +110,7 @@ class Settings(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[SettingListResponse]:
) -> Optional[SettingGetResponse]:
"""
List all mTLS hostname settings for this account or zone.
@ -151,7 +151,7 @@ class Settings(SyncAPIResource):
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[SettingListResponse]], ResultWrapper[SettingListResponse]),
cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]),
)
@ -221,7 +221,7 @@ class AsyncSettings(AsyncAPIResource):
cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]),
)
async def list(
async def get(
self,
*,
account_id: str | NotGiven = NOT_GIVEN,
@ -232,7 +232,7 @@ class AsyncSettings(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[SettingListResponse]:
) -> Optional[SettingGetResponse]:
"""
List all mTLS hostname settings for this account or zone.
@ -273,7 +273,7 @@ class AsyncSettings(AsyncAPIResource):
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[SettingListResponse]], ResultWrapper[SettingListResponse]),
cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]),
)
@ -284,8 +284,8 @@ class SettingsWithRawResponse:
self.update = to_raw_response_wrapper(
settings.update,
)
self.list = to_raw_response_wrapper(
settings.list,
self.get = to_raw_response_wrapper(
settings.get,
)
@ -296,8 +296,8 @@ class AsyncSettingsWithRawResponse:
self.update = async_to_raw_response_wrapper(
settings.update,
)
self.list = async_to_raw_response_wrapper(
settings.list,
self.get = async_to_raw_response_wrapper(
settings.get,
)
@ -308,8 +308,8 @@ class SettingsWithStreamingResponse:
self.update = to_streamed_response_wrapper(
settings.update,
)
self.list = to_streamed_response_wrapper(
settings.list,
self.get = to_streamed_response_wrapper(
settings.get,
)
@ -320,6 +320,6 @@ class AsyncSettingsWithStreamingResponse:
self.update = async_to_streamed_response_wrapper(
settings.update,
)
self.list = async_to_streamed_response_wrapper(
settings.list,
self.get = async_to_streamed_response_wrapper(
settings.get,
)

View file

@ -23,7 +23,7 @@ from ...._wrappers import ResultWrapper
from ...._base_client import (
make_request_options,
)
from ....types.zero_trust.access import KeyListResponse, KeyRotateResponse, KeyUpdateResponse, key_update_params
from ....types.zero_trust.access import KeyGetResponse, KeyRotateResponse, KeyUpdateResponse, key_update_params
__all__ = ["Keys", "AsyncKeys"]
@ -87,7 +87,7 @@ class Keys(SyncAPIResource):
),
)
def list(
def get(
self,
identifier: str,
*,
@ -97,7 +97,7 @@ class Keys(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> KeyListResponse:
) -> KeyGetResponse:
"""
Gets the Access key rotation settings for an account.
@ -115,7 +115,7 @@ class Keys(SyncAPIResource):
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return cast(
KeyListResponse,
KeyGetResponse,
self._get(
f"/accounts/{identifier}/access/keys",
options=make_request_options(
@ -126,7 +126,7 @@ class Keys(SyncAPIResource):
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[KeyListResponse]
Any, ResultWrapper[KeyGetResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
@ -235,7 +235,7 @@ class AsyncKeys(AsyncAPIResource):
),
)
async def list(
async def get(
self,
identifier: str,
*,
@ -245,7 +245,7 @@ class AsyncKeys(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> KeyListResponse:
) -> KeyGetResponse:
"""
Gets the Access key rotation settings for an account.
@ -263,7 +263,7 @@ class AsyncKeys(AsyncAPIResource):
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
return cast(
KeyListResponse,
KeyGetResponse,
await self._get(
f"/accounts/{identifier}/access/keys",
options=make_request_options(
@ -274,7 +274,7 @@ class AsyncKeys(AsyncAPIResource):
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[KeyListResponse]
Any, ResultWrapper[KeyGetResponse]
), # Union types cannot be passed in as arguments in the type system
),
)
@ -331,8 +331,8 @@ class KeysWithRawResponse:
self.update = to_raw_response_wrapper(
keys.update,
)
self.list = to_raw_response_wrapper(
keys.list,
self.get = to_raw_response_wrapper(
keys.get,
)
self.rotate = to_raw_response_wrapper(
keys.rotate,
@ -346,8 +346,8 @@ class AsyncKeysWithRawResponse:
self.update = async_to_raw_response_wrapper(
keys.update,
)
self.list = async_to_raw_response_wrapper(
keys.list,
self.get = async_to_raw_response_wrapper(
keys.get,
)
self.rotate = async_to_raw_response_wrapper(
keys.rotate,
@ -361,8 +361,8 @@ class KeysWithStreamingResponse:
self.update = to_streamed_response_wrapper(
keys.update,
)
self.list = to_streamed_response_wrapper(
keys.list,
self.get = to_streamed_response_wrapper(
keys.get,
)
self.rotate = to_streamed_response_wrapper(
keys.rotate,
@ -376,8 +376,8 @@ class AsyncKeysWithStreamingResponse:
self.update = async_to_streamed_response_wrapper(
keys.update,
)
self.list = async_to_streamed_response_wrapper(
keys.list,
self.get = async_to_streamed_response_wrapper(
keys.get,
)
self.rotate = async_to_streamed_response_wrapper(
keys.rotate,

View file

@ -7,7 +7,7 @@ from .access_apps import AccessApps as AccessApps
from .access_users import AccessUsers as AccessUsers
from .access_groups import AccessGroups as AccessGroups
from .access_bookmarks import AccessBookmarks as AccessBookmarks
from .key_list_response import KeyListResponse as KeyListResponse
from .key_get_response import KeyGetResponse as KeyGetResponse
from .key_update_params import KeyUpdateParams as KeyUpdateParams
from .tag_create_params import TagCreateParams as TagCreateParams
from .tag_list_response import TagListResponse as TagListResponse

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from .access_settings import AccessSettings as AccessSettings
from .setting_get_response import SettingGetResponse as SettingGetResponse
from .access_settings_param import AccessSettingsParam as AccessSettingsParam
from .setting_list_response import SettingListResponse as SettingListResponse
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse

View file

@ -4,6 +4,6 @@ from typing import List
from .access_settings import AccessSettings
__all__ = ["SettingListResponse"]
__all__ = ["SettingGetResponse"]
SettingListResponse = List[AccessSettings]
SettingGetResponse = List[AccessSettings]

View file

@ -2,6 +2,6 @@
from typing import Union
__all__ = ["KeyListResponse"]
__all__ = ["KeyGetResponse"]
KeyListResponse = Union[object, str]
KeyGetResponse = Union[object, str]

View file

@ -10,7 +10,7 @@ import pytest
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.types.zero_trust.access.certificates import (
SettingListResponse,
SettingGetResponse,
SettingUpdateResponse,
)
@ -185,26 +185,26 @@ class TestSettings:
@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.list(
def test_method_get(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.list(
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
setting = client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.certificates.settings.with_raw_response.list(
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="string",
)
@ -212,12 +212,12 @@ class TestSettings:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = response.parse()
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.certificates.settings.with_streaming_response.list(
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.zero_trust.access.certificates.settings.with_streaming_response.get(
account_id="string",
zone_id="string",
) as response:
@ -225,21 +225,21 @@ class TestSettings:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = response.parse()
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
client.zero_trust.access.certificates.settings.with_raw_response.list(
client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
client.zero_trust.access.certificates.settings.with_raw_response.list(
client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="",
)
@ -413,26 +413,26 @@ class TestAsyncSettings:
@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.list(
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.list(
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zero_trust.access.certificates.settings.get(
account_id="string",
zone_id="string",
)
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.certificates.settings.with_raw_response.list(
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="string",
)
@ -440,12 +440,12 @@ class TestAsyncSettings:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = await response.parse()
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.certificates.settings.with_streaming_response.list(
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.certificates.settings.with_streaming_response.get(
account_id="string",
zone_id="string",
) as response:
@ -453,21 +453,21 @@ class TestAsyncSettings:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = await response.parse()
assert_matches_type(Optional[SettingListResponse], setting, path=["response"])
assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
await async_client.zero_trust.access.certificates.settings.with_raw_response.list(
await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="",
zone_id="string",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zero_trust.access.certificates.settings.with_raw_response.list(
await async_client.zero_trust.access.certificates.settings.with_raw_response.get(
account_id="string",
zone_id="",
)

View file

@ -9,7 +9,7 @@ import pytest
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.types.zero_trust.access import KeyListResponse, KeyRotateResponse, KeyUpdateResponse
from cloudflare.types.zero_trust.access import KeyGetResponse, KeyRotateResponse, KeyUpdateResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@ -65,43 +65,43 @@ class TestKeys:
@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
key = client.zero_trust.access.keys.list(
def test_method_get(self, client: Cloudflare) -> None:
key = client.zero_trust.access.keys.get(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.zero_trust.access.keys.with_raw_response.list(
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.zero_trust.access.keys.with_raw_response.get(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
key = response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
@pytest.mark.skip()
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.zero_trust.access.keys.with_streaming_response.list(
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.zero_trust.access.keys.with_streaming_response.get(
"023e105f4ecef8ad9ca31a8372d0c353",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
key = response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"):
client.zero_trust.access.keys.with_raw_response.list(
client.zero_trust.access.keys.with_raw_response.get(
"",
)
@ -199,43 +199,43 @@ class TestAsyncKeys:
@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
key = await async_client.zero_trust.access.keys.list(
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
key = await async_client.zero_trust.access.keys.get(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.keys.with_raw_response.list(
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.access.keys.with_raw_response.get(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.keys.with_streaming_response.list(
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.access.keys.with_streaming_response.get(
"023e105f4ecef8ad9ca31a8372d0c353",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
assert_matches_type(KeyGetResponse, key, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"):
await async_client.zero_trust.access.keys.with_raw_response.list(
await async_client.zero_trust.access.keys.with_raw_response.get(
"",
)