Skip to content

Commit

Permalink
feat(api): api update (#2261)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent c0259cd commit d7bf349
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1480
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-64d4fa2d88511612fbb26659965c2b7b2d016b10e3a96a786e93066817865e4f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-405af13ac696c25ab9d54a26786eab9bf02e2c2ff817a7ec01a454056dda053c.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4207,7 +4207,7 @@ Types:
Methods:

- <code title="get /accounts/{account_id}/devices">client.zeroTrust.devices.<a href="./src/resources/zero-trust/devices/devices.ts">list</a>({ ...params }) -> DevicesSinglePage</code>
- <code title="get /accounts/{account_id}/devices/{device_id}">client.zeroTrust.devices.<a href="./src/resources/zero-trust/devices/devices.ts">get</a>(deviceId, { ...params }) -> DeviceGetResponse</code>
- <code title="get /accounts/{account_id}/devices/{device_id}">client.zeroTrust.devices.<a href="./src/resources/zero-trust/devices/devices.ts">get</a>(deviceId, { ...params }) -> DeviceGetResponse | null</code>

### DEXTests

Expand Down
128 changes: 125 additions & 3 deletions src/resources/zero-trust/devices/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ export class Devices extends APIResource {
deviceId: string,
params: DeviceGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<DeviceGetResponse> {
): Core.APIPromise<DeviceGetResponse | null> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/devices/${deviceId}`, options) as Core.APIPromise<{
result: DeviceGetResponse;
result: DeviceGetResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand Down Expand Up @@ -238,7 +238,129 @@ export namespace Device {
}
}

export type DeviceGetResponse = unknown | string | null;
export interface DeviceGetResponse {
/**
* Device ID.
*/
id?: string;

account?: DeviceGetResponse.Account;

/**
* When the device was created.
*/
created?: string;

/**
* True if the device was deleted.
*/
deleted?: boolean;

device_type?: string;

/**
* @deprecated
*/
gateway_device_id?: string;

/**
* IPv4 or IPv6 address.
*/
ip?: string;

/**
* The device's public key.
*/
key?: string;

/**
* Type of the key.
*/
key_type?: string;

/**
* When the device last connected to Cloudflare services.
*/
last_seen?: string;

/**
* The device mac address.
*/
mac_address?: string;

/**
* The device model name.
*/
model?: string;

/**
* The device name.
*/
name?: string;

/**
* The operating system version.
*/
os_version?: string;

/**
* The device serial number.
*/
serial_number?: string;

/**
* Type of the tunnel connection used.
*/
tunnel_type?: string;

/**
* When the device was updated.
*/
updated?: string;

user?: DeviceGetResponse.User;

/**
* The WARP client version.
*/
version?: string;
}

export namespace DeviceGetResponse {
export interface Account {
/**
* @deprecated
*/
id?: string;

/**
* @deprecated
*/
account_type?: string;

/**
* The name of the enrolled account.
*/
name?: string;
}

export interface User {
/**
* UUID
*/
id?: string;

/**
* The contact email address of the user.
*/
email?: string;

/**
* The enrolled device user's name.
*/
name?: string;
}
}

export interface DeviceListParams {
account_id: string;
Expand Down

0 comments on commit d7bf349

Please sign in to comment.