Skip to content

Commit e93c402

Browse files
committed
feat: api public device
1 parent 77b21b3 commit e93c402

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

api.doc.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,6 +3367,48 @@ console.log(listResponse.results);
33673367

33683368
</details>
33693369

3370+
<details>
3371+
<summary><strong>listPublic</strong></summary>
3372+
3373+
List public device spaces with optional filtering, ordering, and pagination.
3374+
3375+
**Signature:**
3376+
3377+
```typescript
3378+
listPublic(params?: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesListResponse>
3379+
```
3380+
3381+
**Parameters:**
3382+
3383+
- `params` _(ListParamsResponse, optional)_: Query parameters for filtering, ordering, and pagination:
3384+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
3385+
- `search` _(string, optional)_: A search term to filter results.
3386+
- `limit` _(integer, optional)_: Number of results to return per page.
3387+
- `offset` _(integer, optional)_: The initial index from which to return the results.
3388+
- `options` _(Core.RequestOptions, optional)_: Additional request options.
3389+
3390+
**Returns:** `Promise<DeviceSpacesListResponse>`
3391+
3392+
**Response shape:**
3393+
3394+
- `count` _(integer)_: Total number of device spaces matching the query.
3395+
- `next` _(string | null)_: URL to the next page of results, or `null`.
3396+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
3397+
- `results` _(DeviceSpacesParams[])_: Array of device space objects.
3398+
3399+
**Example:**
3400+
3401+
```typescript
3402+
const publicDeviceSpaces = await client.deviceSpaces.listPublic({
3403+
ordering: 'name',
3404+
limit: 10,
3405+
offset: 0,
3406+
});
3407+
console.log(publicDeviceSpaces.results);
3408+
```
3409+
3410+
</details>
3411+
33703412
<details>
33713413
<summary><strong>retrieveByDeviceId</strong></summary>
33723414

src/resources/device/device-spaces.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ export class DeviceSpaces extends APIResource {
2525
});
2626
}
2727

28+
listPublic(params: ListParamsResponse = {}, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesListResponse> {
29+
return this._client.get(`/public/device-spaces`, {
30+
query: params,
31+
...options,
32+
});
33+
}
34+
2835
retrieveByDeviceId(deviceId: string, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesParams> {
2936
return this._client.get(`/device-spaces/device/${deviceId}`, options);
3037
}

0 commit comments

Comments
 (0)