-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceCommandExecution.ts
More file actions
70 lines (63 loc) · 2.18 KB
/
Copy pathDeviceCommandExecution.ts
File metadata and controls
70 lines (63 loc) · 2.18 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
export type DeviceCommandExecutionUpdateType = "create" | "update";
export interface DeviceCommandExecutionStatusReason {
reasonCode?: string;
reasonDescription?: string;
}
export class DeviceCommandExecution {
executionId: string;
commandArn: string;
commandId: string;
targetArn: string;
deviceId: string;
status: string;
statusReason?: DeviceCommandExecutionStatusReason;
result?: Record<string, any>;
parameters?: Record<string, any>;
executionTimeoutSeconds?: number;
createdAt?: string;
lastUpdatedAt?: string;
startedAt?: string;
completedAt?: string;
timeToLive?: string;
timestamp?: number;
[key: string]: any;
constructor(initObj: Partial<DeviceCommandExecution> & Pick<
DeviceCommandExecution,
"executionId" | "commandArn" | "commandId" | "targetArn" | "deviceId" | "status"
> & Record<string, any>) {
this.executionId = initObj.executionId;
this.commandArn = initObj.commandArn;
this.commandId = initObj.commandId;
this.targetArn = initObj.targetArn;
this.deviceId = initObj.deviceId;
this.status = initObj.status;
this.statusReason = initObj.statusReason;
this.result = initObj.result;
this.parameters = initObj.parameters;
this.executionTimeoutSeconds = initObj.executionTimeoutSeconds;
this.createdAt = initObj.createdAt;
this.lastUpdatedAt = initObj.lastUpdatedAt;
this.startedAt = initObj.startedAt;
this.completedAt = initObj.completedAt;
this.timeToLive = initObj.timeToLive;
this.timestamp = initObj.timestamp;
for (const key in initObj) {
if (initObj.hasOwnProperty(key) && !this.hasOwnProperty(key)) {
this[key] = initObj[key];
}
}
}
}
export interface DeviceCommandExecutionList {
commandExecutions: DeviceCommandExecution[];
nextToken?: string;
}
export interface DeviceCommandExecutionUpdate {
type: DeviceCommandExecutionUpdateType;
deviceId: string;
executionId: string;
commandId: string;
commandArn: string;
targetArn: string;
body: Partial<DeviceCommandExecution>;
}