Skip to content

Commit 34bd6f9

Browse files
feat: update via SDK Studio (#87)
1 parent 35e1097 commit 34bd6f9

File tree

5 files changed

+42
-50
lines changed

5 files changed

+42
-50
lines changed

api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4871,12 +4871,12 @@ Methods:
48714871
Types:
48724872

48734873
```python
4874-
from cloudflare.types.zero_trust import DeviceDevicesListDevicesResponse, DeviceGetResponse
4874+
from cloudflare.types.zero_trust import DeviceListResponse, DeviceGetResponse
48754875
```
48764876

48774877
Methods:
48784878

4879-
- <code title="get /accounts/{account_id}/devices">client.zero_trust.devices.<a href="./src/cloudflare/resources/zero_trust/devices/devices.py">devices_list_devices</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/device_devices_list_devices_response.py">Optional</a></code>
4879+
- <code title="get /accounts/{account_id}/devices">client.zero_trust.devices.<a href="./src/cloudflare/resources/zero_trust/devices/devices.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/device_list_response.py">Optional</a></code>
48804880
- <code title="get /accounts/{account_id}/devices/{device_id}">client.zero_trust.devices.<a href="./src/cloudflare/resources/zero_trust/devices/devices.py">get</a>(device_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/device_get_response.py">Optional</a></code>
48814881

48824882
### DEXTests

src/cloudflare/resources/zero_trust/devices/devices.py

+15-19
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
)
8686
from .policies.policies import Policies, AsyncPolicies
8787
from .postures.postures import Postures, AsyncPostures
88-
from ....types.zero_trust import DeviceGetResponse, DeviceDevicesListDevicesResponse
88+
from ....types.zero_trust import DeviceGetResponse, DeviceListResponse
8989

9090
__all__ = ["Devices", "AsyncDevices"]
9191

@@ -131,7 +131,7 @@ def with_raw_response(self) -> DevicesWithRawResponse:
131131
def with_streaming_response(self) -> DevicesWithStreamingResponse:
132132
return DevicesWithStreamingResponse(self)
133133

134-
def devices_list_devices(
134+
def list(
135135
self,
136136
*,
137137
account_id: object,
@@ -141,7 +141,7 @@ def devices_list_devices(
141141
extra_query: Query | None = None,
142142
extra_body: Body | None = None,
143143
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
144-
) -> Optional[DeviceDevicesListDevicesResponse]:
144+
) -> Optional[DeviceListResponse]:
145145
"""
146146
Fetches a list of enrolled devices.
147147
@@ -163,9 +163,7 @@ def devices_list_devices(
163163
timeout=timeout,
164164
post_parser=ResultWrapper._unwrapper,
165165
),
166-
cast_to=cast(
167-
Type[Optional[DeviceDevicesListDevicesResponse]], ResultWrapper[DeviceDevicesListDevicesResponse]
168-
),
166+
cast_to=cast(Type[Optional[DeviceListResponse]], ResultWrapper[DeviceListResponse]),
169167
)
170168

171169
def get(
@@ -255,7 +253,7 @@ def with_raw_response(self) -> AsyncDevicesWithRawResponse:
255253
def with_streaming_response(self) -> AsyncDevicesWithStreamingResponse:
256254
return AsyncDevicesWithStreamingResponse(self)
257255

258-
async def devices_list_devices(
256+
async def list(
259257
self,
260258
*,
261259
account_id: object,
@@ -265,7 +263,7 @@ async def devices_list_devices(
265263
extra_query: Query | None = None,
266264
extra_body: Body | None = None,
267265
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
268-
) -> Optional[DeviceDevicesListDevicesResponse]:
266+
) -> Optional[DeviceListResponse]:
269267
"""
270268
Fetches a list of enrolled devices.
271269
@@ -287,9 +285,7 @@ async def devices_list_devices(
287285
timeout=timeout,
288286
post_parser=ResultWrapper._unwrapper,
289287
),
290-
cast_to=cast(
291-
Type[Optional[DeviceDevicesListDevicesResponse]], ResultWrapper[DeviceDevicesListDevicesResponse]
292-
),
288+
cast_to=cast(Type[Optional[DeviceListResponse]], ResultWrapper[DeviceListResponse]),
293289
)
294290

295291
async def get(
@@ -342,8 +338,8 @@ class DevicesWithRawResponse:
342338
def __init__(self, devices: Devices) -> None:
343339
self._devices = devices
344340

345-
self.devices_list_devices = to_raw_response_wrapper(
346-
devices.devices_list_devices,
341+
self.list = to_raw_response_wrapper(
342+
devices.list,
347343
)
348344
self.get = to_raw_response_wrapper(
349345
devices.get,
@@ -386,8 +382,8 @@ class AsyncDevicesWithRawResponse:
386382
def __init__(self, devices: AsyncDevices) -> None:
387383
self._devices = devices
388384

389-
self.devices_list_devices = async_to_raw_response_wrapper(
390-
devices.devices_list_devices,
385+
self.list = async_to_raw_response_wrapper(
386+
devices.list,
391387
)
392388
self.get = async_to_raw_response_wrapper(
393389
devices.get,
@@ -430,8 +426,8 @@ class DevicesWithStreamingResponse:
430426
def __init__(self, devices: Devices) -> None:
431427
self._devices = devices
432428

433-
self.devices_list_devices = to_streamed_response_wrapper(
434-
devices.devices_list_devices,
429+
self.list = to_streamed_response_wrapper(
430+
devices.list,
435431
)
436432
self.get = to_streamed_response_wrapper(
437433
devices.get,
@@ -474,8 +470,8 @@ class AsyncDevicesWithStreamingResponse:
474470
def __init__(self, devices: AsyncDevices) -> None:
475471
self._devices = devices
476472

477-
self.devices_list_devices = async_to_streamed_response_wrapper(
478-
devices.devices_list_devices,
473+
self.list = async_to_streamed_response_wrapper(
474+
devices.list,
479475
)
480476
self.get = async_to_streamed_response_wrapper(
481477
devices.get,

src/cloudflare/types/zero_trust/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .tunnel_list_params import TunnelListParams as TunnelListParams
99
from .device_get_response import DeviceGetResponse as DeviceGetResponse
1010
from .tunnel_get_response import TunnelGetResponse as TunnelGetResponse
11+
from .device_list_response import DeviceListResponse as DeviceListResponse
1112
from .tunnel_create_params import TunnelCreateParams as TunnelCreateParams
1213
from .tunnel_delete_params import TunnelDeleteParams as TunnelDeleteParams
1314
from .tunnel_edit_response import TunnelEditResponse as TunnelEditResponse
@@ -33,4 +34,3 @@
3334
from .identity_provider_update_response import IdentityProviderUpdateResponse as IdentityProviderUpdateResponse
3435
from .connectivity_setting_edit_response import ConnectivitySettingEditResponse as ConnectivitySettingEditResponse
3536
from .organization_revoke_users_response import OrganizationRevokeUsersResponse as OrganizationRevokeUsersResponse
36-
from .device_devices_list_devices_response import DeviceDevicesListDevicesResponse as DeviceDevicesListDevicesResponse

src/cloudflare/types/zero_trust/device_devices_list_devices_response.py renamed to src/cloudflare/types/zero_trust/device_list_response.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66

77
from ..._models import BaseModel
88

9-
__all__ = [
10-
"DeviceDevicesListDevicesResponse",
11-
"DeviceDevicesListDevicesResponseItem",
12-
"DeviceDevicesListDevicesResponseItemUser",
13-
]
9+
__all__ = ["DeviceListResponse", "DeviceListResponseItem", "DeviceListResponseItemUser"]
1410

1511

16-
class DeviceDevicesListDevicesResponseItemUser(BaseModel):
12+
class DeviceListResponseItemUser(BaseModel):
1713
id: Optional[str] = None
1814
"""UUID"""
1915

@@ -24,7 +20,7 @@ class DeviceDevicesListDevicesResponseItemUser(BaseModel):
2420
"""The enrolled device user's name."""
2521

2622

27-
class DeviceDevicesListDevicesResponseItem(BaseModel):
23+
class DeviceListResponseItem(BaseModel):
2824
id: Optional[str] = None
2925
"""Device ID."""
3026

@@ -78,10 +74,10 @@ class DeviceDevicesListDevicesResponseItem(BaseModel):
7874
updated: Optional[datetime] = None
7975
"""When the device was updated."""
8076

81-
user: Optional[DeviceDevicesListDevicesResponseItemUser] = None
77+
user: Optional[DeviceListResponseItemUser] = None
8278

8379
version: Optional[str] = None
8480
"""The WARP client version."""
8581

8682

87-
DeviceDevicesListDevicesResponse = List[DeviceDevicesListDevicesResponseItem]
83+
DeviceListResponse = List[DeviceListResponseItem]

tests/api_resources/zero_trust/test_devices.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
12-
from cloudflare.types.zero_trust import DeviceGetResponse, DeviceDevicesListDevicesResponse
12+
from cloudflare.types.zero_trust import DeviceGetResponse, DeviceListResponse
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -19,35 +19,35 @@ class TestDevices:
1919

2020
@pytest.mark.skip()
2121
@parametrize
22-
def test_method_devices_list_devices(self, client: Cloudflare) -> None:
23-
device = client.zero_trust.devices.devices_list_devices(
22+
def test_method_list(self, client: Cloudflare) -> None:
23+
device = client.zero_trust.devices.list(
2424
account_id="699d98642c564d2e855e9661899b7252",
2525
)
26-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
26+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
2727

2828
@pytest.mark.skip()
2929
@parametrize
30-
def test_raw_response_devices_list_devices(self, client: Cloudflare) -> None:
31-
response = client.zero_trust.devices.with_raw_response.devices_list_devices(
30+
def test_raw_response_list(self, client: Cloudflare) -> None:
31+
response = client.zero_trust.devices.with_raw_response.list(
3232
account_id="699d98642c564d2e855e9661899b7252",
3333
)
3434

3535
assert response.is_closed is True
3636
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3737
device = response.parse()
38-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
38+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
3939

4040
@pytest.mark.skip()
4141
@parametrize
42-
def test_streaming_response_devices_list_devices(self, client: Cloudflare) -> None:
43-
with client.zero_trust.devices.with_streaming_response.devices_list_devices(
42+
def test_streaming_response_list(self, client: Cloudflare) -> None:
43+
with client.zero_trust.devices.with_streaming_response.list(
4444
account_id="699d98642c564d2e855e9661899b7252",
4545
) as response:
4646
assert not response.is_closed
4747
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4848

4949
device = response.parse()
50-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
50+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
5151

5252
assert cast(Any, response.is_closed) is True
5353

@@ -103,35 +103,35 @@ class TestAsyncDevices:
103103

104104
@pytest.mark.skip()
105105
@parametrize
106-
async def test_method_devices_list_devices(self, async_client: AsyncCloudflare) -> None:
107-
device = await async_client.zero_trust.devices.devices_list_devices(
106+
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
107+
device = await async_client.zero_trust.devices.list(
108108
account_id="699d98642c564d2e855e9661899b7252",
109109
)
110-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
110+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
111111

112112
@pytest.mark.skip()
113113
@parametrize
114-
async def test_raw_response_devices_list_devices(self, async_client: AsyncCloudflare) -> None:
115-
response = await async_client.zero_trust.devices.with_raw_response.devices_list_devices(
114+
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
115+
response = await async_client.zero_trust.devices.with_raw_response.list(
116116
account_id="699d98642c564d2e855e9661899b7252",
117117
)
118118

119119
assert response.is_closed is True
120120
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
121121
device = await response.parse()
122-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
122+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
123123

124124
@pytest.mark.skip()
125125
@parametrize
126-
async def test_streaming_response_devices_list_devices(self, async_client: AsyncCloudflare) -> None:
127-
async with async_client.zero_trust.devices.with_streaming_response.devices_list_devices(
126+
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
127+
async with async_client.zero_trust.devices.with_streaming_response.list(
128128
account_id="699d98642c564d2e855e9661899b7252",
129129
) as response:
130130
assert not response.is_closed
131131
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
132132

133133
device = await response.parse()
134-
assert_matches_type(Optional[DeviceDevicesListDevicesResponse], device, path=["response"])
134+
assert_matches_type(Optional[DeviceListResponse], device, path=["response"])
135135

136136
assert cast(Any, response.is_closed) is True
137137

0 commit comments

Comments
 (0)