-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91f8b66
commit 7740992
Showing
17 changed files
with
213 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 142 additions & 9 deletions
151
src/resources/zero-trust/dex/fleet-status/fleet-status.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,157 @@ | ||
// File generated from our OpenAPI spec by Stainless. | ||
|
||
import * as Core from 'cloudflare/core'; | ||
import { APIResource } from 'cloudflare/resource'; | ||
import * as FleetStatusAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/fleet-status'; | ||
import * as DevicesAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/devices'; | ||
import * as LiveAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/live'; | ||
import * as OverTimeAPI from 'cloudflare/resources/zero-trust/dex/fleet-status/over-time'; | ||
|
||
export class FleetStatus extends APIResource { | ||
devices: DevicesAPI.Devices = new DevicesAPI.Devices(this._client); | ||
live: LiveAPI.Live = new LiveAPI.Live(this._client); | ||
overTime: OverTimeAPI.OverTime = new OverTimeAPI.OverTime(this._client); | ||
|
||
/** | ||
* List details for live (up to 60 minutes) devices using WARP | ||
*/ | ||
live( | ||
params: FleetStatusLiveParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<FleetStatusLiveResponse> { | ||
const { account_id, ...query } = params; | ||
return ( | ||
this._client.get(`/accounts/${account_id}/dex/fleet-status/live`, { | ||
query, | ||
...options, | ||
}) as Core.APIPromise<{ result: FleetStatusLiveResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* List details for devices using WARP, up to 7 days | ||
*/ | ||
overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise<void> { | ||
const { account_id, ...query } = params; | ||
return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { | ||
query, | ||
...options, | ||
headers: { Accept: '*/*', ...options?.headers }, | ||
}); | ||
} | ||
} | ||
|
||
export interface FleetStatusLiveResponse { | ||
deviceStats?: FleetStatusLiveResponse.DeviceStats; | ||
} | ||
|
||
export namespace FleetStatusLiveResponse { | ||
export interface DeviceStats { | ||
byColo?: Array<DeviceStats.ByColo> | null; | ||
|
||
byMode?: Array<DeviceStats.ByMode> | null; | ||
|
||
byPlatform?: Array<DeviceStats.ByPlatform> | null; | ||
|
||
byStatus?: Array<DeviceStats.ByStatus> | null; | ||
|
||
byVersion?: Array<DeviceStats.ByVersion> | null; | ||
|
||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
} | ||
|
||
export namespace DeviceStats { | ||
export interface ByColo { | ||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
|
||
value?: string; | ||
} | ||
|
||
export interface ByMode { | ||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
|
||
value?: string; | ||
} | ||
|
||
export interface ByPlatform { | ||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
|
||
value?: string; | ||
} | ||
|
||
export interface ByStatus { | ||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
|
||
value?: string; | ||
} | ||
|
||
export interface ByVersion { | ||
/** | ||
* Number of unique devices | ||
*/ | ||
uniqueDevicesTotal?: number; | ||
|
||
value?: string; | ||
} | ||
} | ||
} | ||
|
||
export interface FleetStatusLiveParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: string; | ||
|
||
/** | ||
* Query param: Number of minutes before current time | ||
*/ | ||
since_minutes: number; | ||
} | ||
|
||
export interface FleetStatusOverTimeParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: string; | ||
|
||
/** | ||
* Query param: Timestamp in ISO format | ||
*/ | ||
time_end: string; | ||
|
||
/** | ||
* Query param: Timestamp in ISO format | ||
*/ | ||
time_start: string; | ||
|
||
/** | ||
* Query param: Cloudflare colo | ||
*/ | ||
colo?: string; | ||
|
||
/** | ||
* Query param: Device-specific ID, given as UUID v4 | ||
*/ | ||
device_id?: string; | ||
} | ||
|
||
export namespace FleetStatus { | ||
export import FleetStatusLiveResponse = FleetStatusAPI.FleetStatusLiveResponse; | ||
export import FleetStatusLiveParams = FleetStatusAPI.FleetStatusLiveParams; | ||
export import FleetStatusOverTimeParams = FleetStatusAPI.FleetStatusOverTimeParams; | ||
export import Devices = DevicesAPI.Devices; | ||
export import DigitalExperienceMonitoringDevice = DevicesAPI.DigitalExperienceMonitoringDevice; | ||
export import DigitalExperienceMonitoringDevicesV4PagePaginationArray = DevicesAPI.DigitalExperienceMonitoringDevicesV4PagePaginationArray; | ||
export import DeviceListParams = DevicesAPI.DeviceListParams; | ||
export import Live = LiveAPI.Live; | ||
export import LiveListResponse = LiveAPI.LiveListResponse; | ||
export import LiveListParams = LiveAPI.LiveListParams; | ||
export import OverTime = OverTimeAPI.OverTime; | ||
export import OverTimeListParams = OverTimeAPI.OverTimeListParams; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.