Skip to content

Commit 66d6d48

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(fleet_status): update path placeholders to match conventions (#2153)
1 parent 0ac8d45 commit 66d6d48

File tree

9 files changed

+719
-1
lines changed

9 files changed

+719
-1
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1416
1+
configured_endpoints: 1417
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc1685d89cdcb1a8b9f5eada60808601470876a497be8898010890736c20e77f.yml

api.md

+12
Original file line numberDiff line numberDiff line change
@@ -4812,6 +4812,18 @@ Methods:
48124812
- <code title="delete /accounts/{account_id}/devices/networks/{network_id}">client.zero_trust.devices.networks.<a href="./src/cloudflare/resources/zero_trust/devices/networks.py">delete</a>(network_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/network_delete_response.py">Optional</a></code>
48134813
- <code title="get /accounts/{account_id}/devices/networks/{network_id}">client.zero_trust.devices.networks.<a href="./src/cloudflare/resources/zero_trust/devices/networks.py">get</a>(network_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_network.py">Optional</a></code>
48144814

4815+
### FleetStatus
4816+
4817+
Types:
4818+
4819+
```python
4820+
from cloudflare.types.zero_trust.devices import FleetStatusGetResponse
4821+
```
4822+
4823+
Methods:
4824+
4825+
- <code title="get /accounts/{account_id}/devices/{device_id}/fleet-status/live">client.zero_trust.devices.fleet_status.<a href="./src/cloudflare/resources/zero_trust/devices/fleet_status.py">get</a>(device_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/fleet_status_get_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/fleet_status_get_response.py">FleetStatusGetResponse</a></code>
4826+
48154827
### Policies
48164828

48174829
Types:

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

+14
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
DEXTestsResourceWithStreamingResponse,
6565
AsyncDEXTestsResourceWithStreamingResponse,
6666
)
67+
from .fleet_status import (
68+
FleetStatusResource,
69+
AsyncFleetStatusResource,
70+
FleetStatusResourceWithRawResponse,
71+
AsyncFleetStatusResourceWithRawResponse,
72+
FleetStatusResourceWithStreamingResponse,
73+
AsyncFleetStatusResourceWithStreamingResponse,
74+
)
6775
from .override_codes import (
6876
OverrideCodesResource,
6977
AsyncOverrideCodesResource,
@@ -86,6 +94,12 @@
8694
"AsyncNetworksResourceWithRawResponse",
8795
"NetworksResourceWithStreamingResponse",
8896
"AsyncNetworksResourceWithStreamingResponse",
97+
"FleetStatusResource",
98+
"AsyncFleetStatusResource",
99+
"FleetStatusResourceWithRawResponse",
100+
"AsyncFleetStatusResourceWithRawResponse",
101+
"FleetStatusResourceWithStreamingResponse",
102+
"AsyncFleetStatusResourceWithStreamingResponse",
89103
"PoliciesResource",
90104
"AsyncPoliciesResource",
91105
"PoliciesResourceWithRawResponse",

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

+32
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
async_to_streamed_response_wrapper,
7373
)
7474
from ...._wrappers import ResultWrapper
75+
from .fleet_status import (
76+
FleetStatusResource,
77+
AsyncFleetStatusResource,
78+
FleetStatusResourceWithRawResponse,
79+
AsyncFleetStatusResourceWithRawResponse,
80+
FleetStatusResourceWithStreamingResponse,
81+
AsyncFleetStatusResourceWithStreamingResponse,
82+
)
7583
from ....pagination import SyncSinglePage, AsyncSinglePage
7684
from .override_codes import (
7785
OverrideCodesResource,
@@ -99,6 +107,10 @@ def dex_tests(self) -> DEXTestsResource:
99107
def networks(self) -> NetworksResource:
100108
return NetworksResource(self._client)
101109

110+
@cached_property
111+
def fleet_status(self) -> FleetStatusResource:
112+
return FleetStatusResource(self._client)
113+
102114
@cached_property
103115
def policies(self) -> PoliciesResource:
104116
return PoliciesResource(self._client)
@@ -233,6 +245,10 @@ def dex_tests(self) -> AsyncDEXTestsResource:
233245
def networks(self) -> AsyncNetworksResource:
234246
return AsyncNetworksResource(self._client)
235247

248+
@cached_property
249+
def fleet_status(self) -> AsyncFleetStatusResource:
250+
return AsyncFleetStatusResource(self._client)
251+
236252
@cached_property
237253
def policies(self) -> AsyncPoliciesResource:
238254
return AsyncPoliciesResource(self._client)
@@ -377,6 +393,10 @@ def dex_tests(self) -> DEXTestsResourceWithRawResponse:
377393
def networks(self) -> NetworksResourceWithRawResponse:
378394
return NetworksResourceWithRawResponse(self._devices.networks)
379395

396+
@cached_property
397+
def fleet_status(self) -> FleetStatusResourceWithRawResponse:
398+
return FleetStatusResourceWithRawResponse(self._devices.fleet_status)
399+
380400
@cached_property
381401
def policies(self) -> PoliciesResourceWithRawResponse:
382402
return PoliciesResourceWithRawResponse(self._devices.policies)
@@ -421,6 +441,10 @@ def dex_tests(self) -> AsyncDEXTestsResourceWithRawResponse:
421441
def networks(self) -> AsyncNetworksResourceWithRawResponse:
422442
return AsyncNetworksResourceWithRawResponse(self._devices.networks)
423443

444+
@cached_property
445+
def fleet_status(self) -> AsyncFleetStatusResourceWithRawResponse:
446+
return AsyncFleetStatusResourceWithRawResponse(self._devices.fleet_status)
447+
424448
@cached_property
425449
def policies(self) -> AsyncPoliciesResourceWithRawResponse:
426450
return AsyncPoliciesResourceWithRawResponse(self._devices.policies)
@@ -465,6 +489,10 @@ def dex_tests(self) -> DEXTestsResourceWithStreamingResponse:
465489
def networks(self) -> NetworksResourceWithStreamingResponse:
466490
return NetworksResourceWithStreamingResponse(self._devices.networks)
467491

492+
@cached_property
493+
def fleet_status(self) -> FleetStatusResourceWithStreamingResponse:
494+
return FleetStatusResourceWithStreamingResponse(self._devices.fleet_status)
495+
468496
@cached_property
469497
def policies(self) -> PoliciesResourceWithStreamingResponse:
470498
return PoliciesResourceWithStreamingResponse(self._devices.policies)
@@ -509,6 +537,10 @@ def dex_tests(self) -> AsyncDEXTestsResourceWithStreamingResponse:
509537
def networks(self) -> AsyncNetworksResourceWithStreamingResponse:
510538
return AsyncNetworksResourceWithStreamingResponse(self._devices.networks)
511539

540+
@cached_property
541+
def fleet_status(self) -> AsyncFleetStatusResourceWithStreamingResponse:
542+
return AsyncFleetStatusResourceWithStreamingResponse(self._devices.fleet_status)
543+
512544
@cached_property
513545
def policies(self) -> AsyncPoliciesResourceWithStreamingResponse:
514546
return AsyncPoliciesResourceWithStreamingResponse(self._devices.policies)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from ...._utils import (
9+
maybe_transform,
10+
async_maybe_transform,
11+
)
12+
from ...._compat import cached_property
13+
from ...._resource import SyncAPIResource, AsyncAPIResource
14+
from ...._response import (
15+
to_raw_response_wrapper,
16+
to_streamed_response_wrapper,
17+
async_to_raw_response_wrapper,
18+
async_to_streamed_response_wrapper,
19+
)
20+
from ...._base_client import make_request_options
21+
from ....types.zero_trust.devices import fleet_status_get_params
22+
from ....types.zero_trust.devices.fleet_status_get_response import FleetStatusGetResponse
23+
24+
__all__ = ["FleetStatusResource", "AsyncFleetStatusResource"]
25+
26+
27+
class FleetStatusResource(SyncAPIResource):
28+
@cached_property
29+
def with_raw_response(self) -> FleetStatusResourceWithRawResponse:
30+
"""
31+
This property can be used as a prefix for any HTTP method call to return the
32+
the raw response object instead of the parsed content.
33+
34+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
35+
"""
36+
return FleetStatusResourceWithRawResponse(self)
37+
38+
@cached_property
39+
def with_streaming_response(self) -> FleetStatusResourceWithStreamingResponse:
40+
"""
41+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42+
43+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
44+
"""
45+
return FleetStatusResourceWithStreamingResponse(self)
46+
47+
def get(
48+
self,
49+
device_id: str,
50+
*,
51+
account_id: str,
52+
since_minutes: float,
53+
colo: str | NotGiven = NOT_GIVEN,
54+
time_now: str | NotGiven = NOT_GIVEN,
55+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56+
# The extra values given here take precedence over values defined on the client or passed to this method.
57+
extra_headers: Headers | None = None,
58+
extra_query: Query | None = None,
59+
extra_body: Body | None = None,
60+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61+
) -> FleetStatusGetResponse:
62+
"""
63+
Get the live status of a latest device given device_id from the device_state
64+
table
65+
66+
Args:
67+
device_id: Device-specific ID, given as UUID v4
68+
69+
since_minutes: Number of minutes before current time
70+
71+
colo: List of data centers to filter results
72+
73+
time_now: Number of minutes before current time
74+
75+
extra_headers: Send extra headers
76+
77+
extra_query: Add additional query parameters to the request
78+
79+
extra_body: Add additional JSON properties to the request
80+
81+
timeout: Override the client-level default timeout for this request, in seconds
82+
"""
83+
if not account_id:
84+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
85+
if not device_id:
86+
raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}")
87+
return self._get(
88+
f"/accounts/{account_id}/devices/{device_id}/fleet-status/live",
89+
options=make_request_options(
90+
extra_headers=extra_headers,
91+
extra_query=extra_query,
92+
extra_body=extra_body,
93+
timeout=timeout,
94+
query=maybe_transform(
95+
{
96+
"since_minutes": since_minutes,
97+
"colo": colo,
98+
"time_now": time_now,
99+
},
100+
fleet_status_get_params.FleetStatusGetParams,
101+
),
102+
),
103+
cast_to=FleetStatusGetResponse,
104+
)
105+
106+
107+
class AsyncFleetStatusResource(AsyncAPIResource):
108+
@cached_property
109+
def with_raw_response(self) -> AsyncFleetStatusResourceWithRawResponse:
110+
"""
111+
This property can be used as a prefix for any HTTP method call to return the
112+
the raw response object instead of the parsed content.
113+
114+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
115+
"""
116+
return AsyncFleetStatusResourceWithRawResponse(self)
117+
118+
@cached_property
119+
def with_streaming_response(self) -> AsyncFleetStatusResourceWithStreamingResponse:
120+
"""
121+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
122+
123+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
124+
"""
125+
return AsyncFleetStatusResourceWithStreamingResponse(self)
126+
127+
async def get(
128+
self,
129+
device_id: str,
130+
*,
131+
account_id: str,
132+
since_minutes: float,
133+
colo: str | NotGiven = NOT_GIVEN,
134+
time_now: str | NotGiven = NOT_GIVEN,
135+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136+
# The extra values given here take precedence over values defined on the client or passed to this method.
137+
extra_headers: Headers | None = None,
138+
extra_query: Query | None = None,
139+
extra_body: Body | None = None,
140+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
141+
) -> FleetStatusGetResponse:
142+
"""
143+
Get the live status of a latest device given device_id from the device_state
144+
table
145+
146+
Args:
147+
device_id: Device-specific ID, given as UUID v4
148+
149+
since_minutes: Number of minutes before current time
150+
151+
colo: List of data centers to filter results
152+
153+
time_now: Number of minutes before current time
154+
155+
extra_headers: Send extra headers
156+
157+
extra_query: Add additional query parameters to the request
158+
159+
extra_body: Add additional JSON properties to the request
160+
161+
timeout: Override the client-level default timeout for this request, in seconds
162+
"""
163+
if not account_id:
164+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
165+
if not device_id:
166+
raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}")
167+
return await self._get(
168+
f"/accounts/{account_id}/devices/{device_id}/fleet-status/live",
169+
options=make_request_options(
170+
extra_headers=extra_headers,
171+
extra_query=extra_query,
172+
extra_body=extra_body,
173+
timeout=timeout,
174+
query=await async_maybe_transform(
175+
{
176+
"since_minutes": since_minutes,
177+
"colo": colo,
178+
"time_now": time_now,
179+
},
180+
fleet_status_get_params.FleetStatusGetParams,
181+
),
182+
),
183+
cast_to=FleetStatusGetResponse,
184+
)
185+
186+
187+
class FleetStatusResourceWithRawResponse:
188+
def __init__(self, fleet_status: FleetStatusResource) -> None:
189+
self._fleet_status = fleet_status
190+
191+
self.get = to_raw_response_wrapper(
192+
fleet_status.get,
193+
)
194+
195+
196+
class AsyncFleetStatusResourceWithRawResponse:
197+
def __init__(self, fleet_status: AsyncFleetStatusResource) -> None:
198+
self._fleet_status = fleet_status
199+
200+
self.get = async_to_raw_response_wrapper(
201+
fleet_status.get,
202+
)
203+
204+
205+
class FleetStatusResourceWithStreamingResponse:
206+
def __init__(self, fleet_status: FleetStatusResource) -> None:
207+
self._fleet_status = fleet_status
208+
209+
self.get = to_streamed_response_wrapper(
210+
fleet_status.get,
211+
)
212+
213+
214+
class AsyncFleetStatusResourceWithStreamingResponse:
215+
def __init__(self, fleet_status: AsyncFleetStatusResource) -> None:
216+
self._fleet_status = fleet_status
217+
218+
self.get = async_to_streamed_response_wrapper(
219+
fleet_status.get,
220+
)

src/cloudflare/types/zero_trust/devices/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@
4949
from .unique_client_id_input import UniqueClientIDInput as UniqueClientIDInput
5050
from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams
5151
from .crowdstrike_input_param import CrowdstrikeInputParam as CrowdstrikeInputParam
52+
from .fleet_status_get_params import FleetStatusGetParams as FleetStatusGetParams
5253
from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse
5354
from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse
5455
from .sentinelone_input_param import SentineloneInputParam as SentineloneInputParam
5556
from .client_certificate_input import ClientCertificateInput as ClientCertificateInput
5657
from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse
5758
from .unrevoke_create_response import UnrevokeCreateResponse as UnrevokeCreateResponse
5859
from .domain_joined_input_param import DomainJoinedInputParam as DomainJoinedInputParam
60+
from .fleet_status_get_response import FleetStatusGetResponse as FleetStatusGetResponse
5961
from .workspace_one_input_param import WorkspaceOneInputParam as WorkspaceOneInputParam
6062
from .split_tunnel_exclude_param import SplitTunnelExcludeParam as SplitTunnelExcludeParam
6163
from .split_tunnel_include_param import SplitTunnelIncludeParam as SplitTunnelIncludeParam
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["FleetStatusGetParams"]
8+
9+
10+
class FleetStatusGetParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
13+
since_minutes: Required[float]
14+
"""Number of minutes before current time"""
15+
16+
colo: str
17+
"""List of data centers to filter results"""
18+
19+
time_now: str
20+
"""Number of minutes before current time"""

0 commit comments

Comments
 (0)