-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyboard.ts
More file actions
123 lines (110 loc) · 2.86 KB
/
keyboard.ts
File metadata and controls
123 lines (110 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Keyboard extends APIResource {
/**
* Clear input
*/
clear(
deviceID: string,
params: KeyboardClearParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<void> {
const { 'X-Device-Display-ID': xDeviceDisplayID } = params ?? {};
return this._client.delete(path`/devices/${deviceID}/keyboard`, {
...options,
headers: buildHeaders([
{
Accept: '*/*',
...(xDeviceDisplayID?.toString() != null ?
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
: undefined),
},
options?.headers,
]),
});
}
/**
* Input key
*/
key(deviceID: string, params: KeyboardKeyParams, options?: RequestOptions): APIPromise<void> {
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
return this._client.put(path`/devices/${deviceID}/keyboard`, {
body,
...options,
headers: buildHeaders([
{
Accept: '*/*',
...(xDeviceDisplayID?.toString() != null ?
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
: undefined),
},
options?.headers,
]),
});
}
/**
* Input text
*/
write(deviceID: string, params: KeyboardWriteParams, options?: RequestOptions): APIPromise<void> {
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
return this._client.post(path`/devices/${deviceID}/keyboard`, {
body,
...options,
headers: buildHeaders([
{
Accept: '*/*',
...(xDeviceDisplayID?.toString() != null ?
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
: undefined),
},
options?.headers,
]),
});
}
}
export interface KeyboardClearParams {
'X-Device-Display-ID'?: number;
}
export interface KeyboardKeyParams {
/**
* Body param
*/
key: number;
/**
* Header param
*/
'X-Device-Display-ID'?: number;
}
export interface KeyboardWriteParams {
/**
* Body param
*/
text: string;
/**
* Body param
*/
clear?: boolean;
/**
* Body param
*/
stealth?: boolean;
/**
* Body param: Words per minute for stealth typing. 0 uses portal default.
*/
wpm?: number;
/**
* Header param
*/
'X-Device-Display-ID'?: number;
}
export declare namespace Keyboard {
export {
type KeyboardClearParams as KeyboardClearParams,
type KeyboardKeyParams as KeyboardKeyParams,
type KeyboardWriteParams as KeyboardWriteParams,
};
}