|
1 | 1 | // File generated from our OpenAPI spec by Stainless. |
2 | 2 |
|
| 3 | +import * as Core from 'cloudflare/core'; |
3 | 4 | import { APIResource } from 'cloudflare/resource'; |
| 5 | +import * as FleetStatusAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/fleet-status'; |
4 | 6 | import * as DevicesAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/devices'; |
5 | | -import * as LiveAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/live'; |
6 | | -import * as OverTimeAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/over-time'; |
7 | 7 |
|
8 | 8 | export class FleetStatus extends APIResource { |
9 | 9 | devices: DevicesAPI.Devices = new DevicesAPI.Devices(this._client); |
10 | | - live: LiveAPI.Live = new LiveAPI.Live(this._client); |
11 | | - overTime: OverTimeAPI.OverTime = new OverTimeAPI.OverTime(this._client); |
| 10 | + |
| 11 | + /** |
| 12 | + * List details for live (up to 60 minutes) devices using WARP |
| 13 | + */ |
| 14 | + live( |
| 15 | + params: FleetStatusLiveParams, |
| 16 | + options?: Core.RequestOptions, |
| 17 | + ): Core.APIPromise<FleetStatusLiveResponse> { |
| 18 | + const { account_id, ...query } = params; |
| 19 | + return ( |
| 20 | + this._client.get(`/accounts/${account_id}/dex/fleet-status/live`, { |
| 21 | + query, |
| 22 | + ...options, |
| 23 | + }) as Core.APIPromise<{ result: FleetStatusLiveResponse }> |
| 24 | + )._thenUnwrap((obj) => obj.result); |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * List details for devices using WARP, up to 7 days |
| 29 | + */ |
| 30 | + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise<void> { |
| 31 | + const { account_id, ...query } = params; |
| 32 | + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { |
| 33 | + query, |
| 34 | + ...options, |
| 35 | + headers: { Accept: '*/*', ...options?.headers }, |
| 36 | + }); |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +export interface FleetStatusLiveResponse { |
| 41 | + deviceStats?: FleetStatusLiveResponse.DeviceStats; |
| 42 | +} |
| 43 | + |
| 44 | +export namespace FleetStatusLiveResponse { |
| 45 | + export interface DeviceStats { |
| 46 | + byColo?: Array<DeviceStats.ByColo> | null; |
| 47 | + |
| 48 | + byMode?: Array<DeviceStats.ByMode> | null; |
| 49 | + |
| 50 | + byPlatform?: Array<DeviceStats.ByPlatform> | null; |
| 51 | + |
| 52 | + byStatus?: Array<DeviceStats.ByStatus> | null; |
| 53 | + |
| 54 | + byVersion?: Array<DeviceStats.ByVersion> | null; |
| 55 | + |
| 56 | + /** |
| 57 | + * Number of unique devices |
| 58 | + */ |
| 59 | + uniqueDevicesTotal?: number; |
| 60 | + } |
| 61 | + |
| 62 | + export namespace DeviceStats { |
| 63 | + export interface ByColo { |
| 64 | + /** |
| 65 | + * Number of unique devices |
| 66 | + */ |
| 67 | + uniqueDevicesTotal?: number; |
| 68 | + |
| 69 | + value?: string; |
| 70 | + } |
| 71 | + |
| 72 | + export interface ByMode { |
| 73 | + /** |
| 74 | + * Number of unique devices |
| 75 | + */ |
| 76 | + uniqueDevicesTotal?: number; |
| 77 | + |
| 78 | + value?: string; |
| 79 | + } |
| 80 | + |
| 81 | + export interface ByPlatform { |
| 82 | + /** |
| 83 | + * Number of unique devices |
| 84 | + */ |
| 85 | + uniqueDevicesTotal?: number; |
| 86 | + |
| 87 | + value?: string; |
| 88 | + } |
| 89 | + |
| 90 | + export interface ByStatus { |
| 91 | + /** |
| 92 | + * Number of unique devices |
| 93 | + */ |
| 94 | + uniqueDevicesTotal?: number; |
| 95 | + |
| 96 | + value?: string; |
| 97 | + } |
| 98 | + |
| 99 | + export interface ByVersion { |
| 100 | + /** |
| 101 | + * Number of unique devices |
| 102 | + */ |
| 103 | + uniqueDevicesTotal?: number; |
| 104 | + |
| 105 | + value?: string; |
| 106 | + } |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +export interface FleetStatusLiveParams { |
| 111 | + /** |
| 112 | + * Path param: |
| 113 | + */ |
| 114 | + account_id: string; |
| 115 | + |
| 116 | + /** |
| 117 | + * Query param: Number of minutes before current time |
| 118 | + */ |
| 119 | + since_minutes: number; |
| 120 | +} |
| 121 | + |
| 122 | +export interface FleetStatusOverTimeParams { |
| 123 | + /** |
| 124 | + * Path param: |
| 125 | + */ |
| 126 | + account_id: string; |
| 127 | + |
| 128 | + /** |
| 129 | + * Query param: Timestamp in ISO format |
| 130 | + */ |
| 131 | + time_end: string; |
| 132 | + |
| 133 | + /** |
| 134 | + * Query param: Timestamp in ISO format |
| 135 | + */ |
| 136 | + time_start: string; |
| 137 | + |
| 138 | + /** |
| 139 | + * Query param: Cloudflare colo |
| 140 | + */ |
| 141 | + colo?: string; |
| 142 | + |
| 143 | + /** |
| 144 | + * Query param: Device-specific ID, given as UUID v4 |
| 145 | + */ |
| 146 | + device_id?: string; |
12 | 147 | } |
13 | 148 |
|
14 | 149 | export namespace FleetStatus { |
| 150 | + export import FleetStatusLiveResponse = FleetStatusAPI.FleetStatusLiveResponse; |
| 151 | + export import FleetStatusLiveParams = FleetStatusAPI.FleetStatusLiveParams; |
| 152 | + export import FleetStatusOverTimeParams = FleetStatusAPI.FleetStatusOverTimeParams; |
15 | 153 | export import Devices = DevicesAPI.Devices; |
16 | 154 | export import DigitalExperienceMonitoringDevice = DevicesAPI.DigitalExperienceMonitoringDevice; |
17 | 155 | export import DigitalExperienceMonitoringDevicesV4PagePaginationArray = DevicesAPI.DigitalExperienceMonitoringDevicesV4PagePaginationArray; |
18 | 156 | export import DeviceListParams = DevicesAPI.DeviceListParams; |
19 | | - export import Live = LiveAPI.Live; |
20 | | - export import LiveListResponse = LiveAPI.LiveListResponse; |
21 | | - export import LiveListParams = LiveAPI.LiveListParams; |
22 | | - export import OverTime = OverTimeAPI.OverTime; |
23 | | - export import OverTimeListParams = OverTimeAPI.OverTimeListParams; |
24 | 157 | } |
0 commit comments