@aws-sdk/client-sagemaker-edge 3.186.0 → 3.190.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist-es/SagemakerEdge.js +14 -21
- package/dist-es/SagemakerEdgeClient.js +22 -28
- package/dist-es/commands/GetDeploymentsCommand.js +21 -28
- package/dist-es/commands/GetDeviceRegistrationCommand.js +21 -28
- package/dist-es/commands/SendHeartbeatCommand.js +22 -29
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SagemakerEdgeServiceException.js +5 -10
- package/dist-es/models/models_0.js +48 -25
- package/dist-es/protocols/Aws_restJson1.js +258 -322
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,305 +1,259 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { InternalServiceException, } from "../models/models_0";
|
|
5
4
|
import { SagemakerEdgeServiceException as __BaseException } from "../models/SagemakerEdgeServiceException";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/GetDeployments";
|
|
17
|
-
body = JSON.stringify(__assign(__assign({}, (input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName })), (input.DeviceName != null && { DeviceName: input.DeviceName })));
|
|
18
|
-
return [2, new __HttpRequest({
|
|
19
|
-
protocol: protocol,
|
|
20
|
-
hostname: hostname,
|
|
21
|
-
port: port,
|
|
22
|
-
method: "POST",
|
|
23
|
-
headers: headers,
|
|
24
|
-
path: resolvedPath,
|
|
25
|
-
body: body,
|
|
26
|
-
})];
|
|
27
|
-
}
|
|
5
|
+
export const serializeAws_restJson1GetDeploymentsCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/json",
|
|
9
|
+
};
|
|
10
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetDeployments";
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify({
|
|
13
|
+
...(input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName }),
|
|
14
|
+
...(input.DeviceName != null && { DeviceName: input.DeviceName }),
|
|
28
15
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
headers = {
|
|
38
|
-
"content-type": "application/json",
|
|
39
|
-
};
|
|
40
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/GetDeviceRegistration";
|
|
41
|
-
body = JSON.stringify(__assign(__assign({}, (input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName })), (input.DeviceName != null && { DeviceName: input.DeviceName })));
|
|
42
|
-
return [2, new __HttpRequest({
|
|
43
|
-
protocol: protocol,
|
|
44
|
-
hostname: hostname,
|
|
45
|
-
port: port,
|
|
46
|
-
method: "POST",
|
|
47
|
-
headers: headers,
|
|
48
|
-
path: resolvedPath,
|
|
49
|
-
body: body,
|
|
50
|
-
})];
|
|
51
|
-
}
|
|
16
|
+
return new __HttpRequest({
|
|
17
|
+
protocol,
|
|
18
|
+
hostname,
|
|
19
|
+
port,
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers,
|
|
22
|
+
path: resolvedPath,
|
|
23
|
+
body,
|
|
52
24
|
});
|
|
53
|
-
}
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/SendHeartbeat";
|
|
65
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AgentMetrics != null && { AgentMetrics: serializeAws_restJson1EdgeMetrics(input.AgentMetrics, context) })), (input.AgentVersion != null && { AgentVersion: input.AgentVersion })), (input.DeploymentResult != null && {
|
|
66
|
-
DeploymentResult: serializeAws_restJson1DeploymentResult(input.DeploymentResult, context),
|
|
67
|
-
})), (input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName })), (input.DeviceName != null && { DeviceName: input.DeviceName })), (input.Models != null && { Models: serializeAws_restJson1Models(input.Models, context) })));
|
|
68
|
-
return [2, new __HttpRequest({
|
|
69
|
-
protocol: protocol,
|
|
70
|
-
hostname: hostname,
|
|
71
|
-
port: port,
|
|
72
|
-
method: "POST",
|
|
73
|
-
headers: headers,
|
|
74
|
-
path: resolvedPath,
|
|
75
|
-
body: body,
|
|
76
|
-
})];
|
|
77
|
-
}
|
|
25
|
+
};
|
|
26
|
+
export const serializeAws_restJson1GetDeviceRegistrationCommand = async (input, context) => {
|
|
27
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
28
|
+
const headers = {
|
|
29
|
+
"content-type": "application/json",
|
|
30
|
+
};
|
|
31
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetDeviceRegistration";
|
|
32
|
+
let body;
|
|
33
|
+
body = JSON.stringify({
|
|
34
|
+
...(input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName }),
|
|
35
|
+
...(input.DeviceName != null && { DeviceName: input.DeviceName }),
|
|
78
36
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
contents = map({
|
|
89
|
-
$metadata: deserializeMetadata(output),
|
|
90
|
-
});
|
|
91
|
-
_a = __expectNonNull;
|
|
92
|
-
_b = __expectObject;
|
|
93
|
-
return [4, parseBody(output.body, context)];
|
|
94
|
-
case 1:
|
|
95
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
96
|
-
if (data.Deployments != null) {
|
|
97
|
-
contents.Deployments = deserializeAws_restJson1EdgeDeployments(data.Deployments, context);
|
|
98
|
-
}
|
|
99
|
-
return [2, contents];
|
|
100
|
-
}
|
|
37
|
+
return new __HttpRequest({
|
|
38
|
+
protocol,
|
|
39
|
+
hostname,
|
|
40
|
+
port,
|
|
41
|
+
method: "POST",
|
|
42
|
+
headers,
|
|
43
|
+
path: resolvedPath,
|
|
44
|
+
body,
|
|
101
45
|
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
return [3, 4];
|
|
121
|
-
case 2: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
|
|
122
|
-
case 3: throw _d.sent();
|
|
123
|
-
case 4:
|
|
124
|
-
parsedBody = parsedOutput.body;
|
|
125
|
-
throwDefaultError({
|
|
126
|
-
output: output,
|
|
127
|
-
parsedBody: parsedBody,
|
|
128
|
-
exceptionCtor: __BaseException,
|
|
129
|
-
errorCode: errorCode,
|
|
130
|
-
});
|
|
131
|
-
_d.label = 5;
|
|
132
|
-
case 5: return [2];
|
|
133
|
-
}
|
|
46
|
+
};
|
|
47
|
+
export const serializeAws_restJson1SendHeartbeatCommand = async (input, context) => {
|
|
48
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
49
|
+
const headers = {
|
|
50
|
+
"content-type": "application/json",
|
|
51
|
+
};
|
|
52
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/SendHeartbeat";
|
|
53
|
+
let body;
|
|
54
|
+
body = JSON.stringify({
|
|
55
|
+
...(input.AgentMetrics != null && { AgentMetrics: serializeAws_restJson1EdgeMetrics(input.AgentMetrics, context) }),
|
|
56
|
+
...(input.AgentVersion != null && { AgentVersion: input.AgentVersion }),
|
|
57
|
+
...(input.DeploymentResult != null && {
|
|
58
|
+
DeploymentResult: serializeAws_restJson1DeploymentResult(input.DeploymentResult, context),
|
|
59
|
+
}),
|
|
60
|
+
...(input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName }),
|
|
61
|
+
...(input.DeviceName != null && { DeviceName: input.DeviceName }),
|
|
62
|
+
...(input.Models != null && { Models: serializeAws_restJson1Models(input.Models, context) }),
|
|
134
63
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
contents = map({
|
|
145
|
-
$metadata: deserializeMetadata(output),
|
|
146
|
-
});
|
|
147
|
-
_a = __expectNonNull;
|
|
148
|
-
_b = __expectObject;
|
|
149
|
-
return [4, parseBody(output.body, context)];
|
|
150
|
-
case 1:
|
|
151
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
152
|
-
if (data.CacheTTL != null) {
|
|
153
|
-
contents.CacheTTL = __expectString(data.CacheTTL);
|
|
154
|
-
}
|
|
155
|
-
if (data.DeviceRegistration != null) {
|
|
156
|
-
contents.DeviceRegistration = __expectString(data.DeviceRegistration);
|
|
157
|
-
}
|
|
158
|
-
return [2, contents];
|
|
159
|
-
}
|
|
64
|
+
return new __HttpRequest({
|
|
65
|
+
protocol,
|
|
66
|
+
hostname,
|
|
67
|
+
port,
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers,
|
|
70
|
+
path: resolvedPath,
|
|
71
|
+
body,
|
|
160
72
|
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
_a = [__assign({}, output)];
|
|
169
|
-
_c = {};
|
|
170
|
-
return [4, parseErrorBody(output.body, context)];
|
|
171
|
-
case 1:
|
|
172
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
173
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
174
|
-
_b = errorCode;
|
|
175
|
-
switch (_b) {
|
|
176
|
-
case "InternalServiceException": return [3, 2];
|
|
177
|
-
case "com.amazonaws.sagemakeredge#InternalServiceException": return [3, 2];
|
|
178
|
-
}
|
|
179
|
-
return [3, 4];
|
|
180
|
-
case 2: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
|
|
181
|
-
case 3: throw _d.sent();
|
|
182
|
-
case 4:
|
|
183
|
-
parsedBody = parsedOutput.body;
|
|
184
|
-
throwDefaultError({
|
|
185
|
-
output: output,
|
|
186
|
-
parsedBody: parsedBody,
|
|
187
|
-
exceptionCtor: __BaseException,
|
|
188
|
-
errorCode: errorCode,
|
|
189
|
-
});
|
|
190
|
-
_d.label = 5;
|
|
191
|
-
case 5: return [2];
|
|
192
|
-
}
|
|
73
|
+
};
|
|
74
|
+
export const deserializeAws_restJson1GetDeploymentsCommand = async (output, context) => {
|
|
75
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
76
|
+
return deserializeAws_restJson1GetDeploymentsCommandError(output, context);
|
|
77
|
+
}
|
|
78
|
+
const contents = map({
|
|
79
|
+
$metadata: deserializeMetadata(output),
|
|
193
80
|
});
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
81
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
82
|
+
if (data.Deployments != null) {
|
|
83
|
+
contents.Deployments = deserializeAws_restJson1EdgeDeployments(data.Deployments, context);
|
|
84
|
+
}
|
|
85
|
+
return contents;
|
|
86
|
+
};
|
|
87
|
+
const deserializeAws_restJson1GetDeploymentsCommandError = async (output, context) => {
|
|
88
|
+
const parsedOutput = {
|
|
89
|
+
...output,
|
|
90
|
+
body: await parseErrorBody(output.body, context),
|
|
91
|
+
};
|
|
92
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
93
|
+
switch (errorCode) {
|
|
94
|
+
case "InternalServiceException":
|
|
95
|
+
case "com.amazonaws.sagemakeredge#InternalServiceException":
|
|
96
|
+
throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
|
|
97
|
+
default:
|
|
98
|
+
const parsedBody = parsedOutput.body;
|
|
99
|
+
throwDefaultError({
|
|
100
|
+
output,
|
|
101
|
+
parsedBody,
|
|
102
|
+
exceptionCtor: __BaseException,
|
|
103
|
+
errorCode,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
export const deserializeAws_restJson1GetDeviceRegistrationCommand = async (output, context) => {
|
|
108
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
109
|
+
return deserializeAws_restJson1GetDeviceRegistrationCommandError(output, context);
|
|
110
|
+
}
|
|
111
|
+
const contents = map({
|
|
112
|
+
$metadata: deserializeMetadata(output),
|
|
211
113
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
114
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
115
|
+
if (data.CacheTTL != null) {
|
|
116
|
+
contents.CacheTTL = __expectString(data.CacheTTL);
|
|
117
|
+
}
|
|
118
|
+
if (data.DeviceRegistration != null) {
|
|
119
|
+
contents.DeviceRegistration = __expectString(data.DeviceRegistration);
|
|
120
|
+
}
|
|
121
|
+
return contents;
|
|
122
|
+
};
|
|
123
|
+
const deserializeAws_restJson1GetDeviceRegistrationCommandError = async (output, context) => {
|
|
124
|
+
const parsedOutput = {
|
|
125
|
+
...output,
|
|
126
|
+
body: await parseErrorBody(output.body, context),
|
|
127
|
+
};
|
|
128
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
129
|
+
switch (errorCode) {
|
|
130
|
+
case "InternalServiceException":
|
|
131
|
+
case "com.amazonaws.sagemakeredge#InternalServiceException":
|
|
132
|
+
throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
|
|
133
|
+
default:
|
|
134
|
+
const parsedBody = parsedOutput.body;
|
|
135
|
+
throwDefaultError({
|
|
136
|
+
output,
|
|
137
|
+
parsedBody,
|
|
138
|
+
exceptionCtor: __BaseException,
|
|
139
|
+
errorCode,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
export const deserializeAws_restJson1SendHeartbeatCommand = async (output, context) => {
|
|
144
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
145
|
+
return deserializeAws_restJson1SendHeartbeatCommandError(output, context);
|
|
146
|
+
}
|
|
147
|
+
const contents = map({
|
|
148
|
+
$metadata: deserializeMetadata(output),
|
|
244
149
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
150
|
+
await collectBody(output.body, context);
|
|
151
|
+
return contents;
|
|
152
|
+
};
|
|
153
|
+
const deserializeAws_restJson1SendHeartbeatCommandError = async (output, context) => {
|
|
154
|
+
const parsedOutput = {
|
|
155
|
+
...output,
|
|
156
|
+
body: await parseErrorBody(output.body, context),
|
|
157
|
+
};
|
|
158
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
159
|
+
switch (errorCode) {
|
|
160
|
+
case "InternalServiceException":
|
|
161
|
+
case "com.amazonaws.sagemakeredge#InternalServiceException":
|
|
162
|
+
throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
|
|
163
|
+
default:
|
|
164
|
+
const parsedBody = parsedOutput.body;
|
|
165
|
+
throwDefaultError({
|
|
166
|
+
output,
|
|
167
|
+
parsedBody,
|
|
168
|
+
exceptionCtor: __BaseException,
|
|
169
|
+
errorCode,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const map = __map;
|
|
174
|
+
const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
|
|
175
|
+
const contents = map({});
|
|
176
|
+
const data = parsedOutput.body;
|
|
177
|
+
if (data.Message != null) {
|
|
178
|
+
contents.Message = __expectString(data.Message);
|
|
179
|
+
}
|
|
180
|
+
const exception = new InternalServiceException({
|
|
181
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
182
|
+
...contents,
|
|
257
183
|
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
184
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
185
|
+
};
|
|
186
|
+
const serializeAws_restJson1DeploymentModel = (input, context) => {
|
|
187
|
+
return {
|
|
188
|
+
...(input.DesiredState != null && { DesiredState: input.DesiredState }),
|
|
189
|
+
...(input.ModelHandle != null && { ModelHandle: input.ModelHandle }),
|
|
190
|
+
...(input.ModelName != null && { ModelName: input.ModelName }),
|
|
191
|
+
...(input.ModelVersion != null && { ModelVersion: input.ModelVersion }),
|
|
192
|
+
...(input.RollbackFailureReason != null && { RollbackFailureReason: input.RollbackFailureReason }),
|
|
193
|
+
...(input.State != null && { State: input.State }),
|
|
194
|
+
...(input.Status != null && { Status: input.Status }),
|
|
195
|
+
...(input.StatusReason != null && { StatusReason: input.StatusReason }),
|
|
196
|
+
};
|
|
261
197
|
};
|
|
262
|
-
|
|
198
|
+
const serializeAws_restJson1DeploymentModels = (input, context) => {
|
|
263
199
|
return input
|
|
264
|
-
.filter(
|
|
265
|
-
.map(
|
|
200
|
+
.filter((e) => e != null)
|
|
201
|
+
.map((entry) => {
|
|
266
202
|
return serializeAws_restJson1DeploymentModel(entry, context);
|
|
267
203
|
});
|
|
268
204
|
};
|
|
269
|
-
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
205
|
+
const serializeAws_restJson1DeploymentResult = (input, context) => {
|
|
206
|
+
return {
|
|
207
|
+
...(input.DeploymentEndTime != null && { DeploymentEndTime: Math.round(input.DeploymentEndTime.getTime() / 1000) }),
|
|
208
|
+
...(input.DeploymentModels != null && {
|
|
209
|
+
DeploymentModels: serializeAws_restJson1DeploymentModels(input.DeploymentModels, context),
|
|
210
|
+
}),
|
|
211
|
+
...(input.DeploymentName != null && { DeploymentName: input.DeploymentName }),
|
|
212
|
+
...(input.DeploymentStartTime != null && {
|
|
213
|
+
DeploymentStartTime: Math.round(input.DeploymentStartTime.getTime() / 1000),
|
|
214
|
+
}),
|
|
215
|
+
...(input.DeploymentStatus != null && { DeploymentStatus: input.DeploymentStatus }),
|
|
216
|
+
...(input.DeploymentStatusMessage != null && { DeploymentStatusMessage: input.DeploymentStatusMessage }),
|
|
217
|
+
};
|
|
275
218
|
};
|
|
276
|
-
|
|
277
|
-
return
|
|
219
|
+
const serializeAws_restJson1EdgeMetric = (input, context) => {
|
|
220
|
+
return {
|
|
221
|
+
...(input.Dimension != null && { Dimension: input.Dimension }),
|
|
222
|
+
...(input.MetricName != null && { MetricName: input.MetricName }),
|
|
223
|
+
...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
|
|
224
|
+
...(input.Value != null && { Value: __serializeFloat(input.Value) }),
|
|
225
|
+
};
|
|
278
226
|
};
|
|
279
|
-
|
|
227
|
+
const serializeAws_restJson1EdgeMetrics = (input, context) => {
|
|
280
228
|
return input
|
|
281
|
-
.filter(
|
|
282
|
-
.map(
|
|
229
|
+
.filter((e) => e != null)
|
|
230
|
+
.map((entry) => {
|
|
283
231
|
return serializeAws_restJson1EdgeMetric(entry, context);
|
|
284
232
|
});
|
|
285
233
|
};
|
|
286
|
-
|
|
287
|
-
return
|
|
234
|
+
const serializeAws_restJson1Model = (input, context) => {
|
|
235
|
+
return {
|
|
236
|
+
...(input.LatestInference != null && { LatestInference: Math.round(input.LatestInference.getTime() / 1000) }),
|
|
237
|
+
...(input.LatestSampleTime != null && { LatestSampleTime: Math.round(input.LatestSampleTime.getTime() / 1000) }),
|
|
238
|
+
...(input.ModelMetrics != null && { ModelMetrics: serializeAws_restJson1EdgeMetrics(input.ModelMetrics, context) }),
|
|
239
|
+
...(input.ModelName != null && { ModelName: input.ModelName }),
|
|
240
|
+
...(input.ModelVersion != null && { ModelVersion: input.ModelVersion }),
|
|
241
|
+
};
|
|
288
242
|
};
|
|
289
|
-
|
|
243
|
+
const serializeAws_restJson1Models = (input, context) => {
|
|
290
244
|
return input
|
|
291
|
-
.filter(
|
|
292
|
-
.map(
|
|
245
|
+
.filter((e) => e != null)
|
|
246
|
+
.map((entry) => {
|
|
293
247
|
return serializeAws_restJson1Model(entry, context);
|
|
294
248
|
});
|
|
295
249
|
};
|
|
296
|
-
|
|
250
|
+
const deserializeAws_restJson1Checksum = (output, context) => {
|
|
297
251
|
return {
|
|
298
252
|
Sum: __expectString(output.Sum),
|
|
299
253
|
Type: __expectString(output.Type),
|
|
300
254
|
};
|
|
301
255
|
};
|
|
302
|
-
|
|
256
|
+
const deserializeAws_restJson1Definition = (output, context) => {
|
|
303
257
|
return {
|
|
304
258
|
Checksum: output.Checksum != null ? deserializeAws_restJson1Checksum(output.Checksum, context) : undefined,
|
|
305
259
|
ModelHandle: __expectString(output.ModelHandle),
|
|
@@ -307,10 +261,10 @@ var deserializeAws_restJson1Definition = function (output, context) {
|
|
|
307
261
|
State: __expectString(output.State),
|
|
308
262
|
};
|
|
309
263
|
};
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
.filter(
|
|
313
|
-
.map(
|
|
264
|
+
const deserializeAws_restJson1Definitions = (output, context) => {
|
|
265
|
+
const retVal = (output || [])
|
|
266
|
+
.filter((e) => e != null)
|
|
267
|
+
.map((entry) => {
|
|
314
268
|
if (entry === null) {
|
|
315
269
|
return null;
|
|
316
270
|
}
|
|
@@ -318,7 +272,7 @@ var deserializeAws_restJson1Definitions = function (output, context) {
|
|
|
318
272
|
});
|
|
319
273
|
return retVal;
|
|
320
274
|
};
|
|
321
|
-
|
|
275
|
+
const deserializeAws_restJson1EdgeDeployment = (output, context) => {
|
|
322
276
|
return {
|
|
323
277
|
Definitions: output.Definitions != null ? deserializeAws_restJson1Definitions(output.Definitions, context) : undefined,
|
|
324
278
|
DeploymentName: __expectString(output.DeploymentName),
|
|
@@ -326,10 +280,10 @@ var deserializeAws_restJson1EdgeDeployment = function (output, context) {
|
|
|
326
280
|
Type: __expectString(output.Type),
|
|
327
281
|
};
|
|
328
282
|
};
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
.filter(
|
|
332
|
-
.map(
|
|
283
|
+
const deserializeAws_restJson1EdgeDeployments = (output, context) => {
|
|
284
|
+
const retVal = (output || [])
|
|
285
|
+
.filter((e) => e != null)
|
|
286
|
+
.map((entry) => {
|
|
333
287
|
if (entry === null) {
|
|
334
288
|
return null;
|
|
335
289
|
}
|
|
@@ -337,57 +291,39 @@ var deserializeAws_restJson1EdgeDeployments = function (output, context) {
|
|
|
337
291
|
});
|
|
338
292
|
return retVal;
|
|
339
293
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
var collectBody = function (streamBody, context) {
|
|
350
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
294
|
+
const deserializeMetadata = (output) => ({
|
|
295
|
+
httpStatusCode: output.statusCode,
|
|
296
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
297
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
298
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
299
|
+
});
|
|
300
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
351
301
|
if (streamBody instanceof Uint8Array) {
|
|
352
302
|
return Promise.resolve(streamBody);
|
|
353
303
|
}
|
|
354
304
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
355
305
|
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
});
|
|
306
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
307
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
308
|
+
value !== null &&
|
|
309
|
+
value !== "" &&
|
|
310
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
311
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
312
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
313
|
+
if (encoded.length) {
|
|
314
|
+
return JSON.parse(encoded);
|
|
315
|
+
}
|
|
316
|
+
return {};
|
|
317
|
+
});
|
|
318
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
319
|
+
const value = await parseBody(errorBody, context);
|
|
320
|
+
value.message = value.message ?? value.Message;
|
|
321
|
+
return value;
|
|
373
322
|
};
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
switch (_b.label) {
|
|
379
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
380
|
-
case 1:
|
|
381
|
-
value = _b.sent();
|
|
382
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
383
|
-
return [2, value];
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
}); };
|
|
387
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
388
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
389
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
390
|
-
var cleanValue = rawValue;
|
|
323
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
324
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
325
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
326
|
+
let cleanValue = rawValue;
|
|
391
327
|
if (typeof cleanValue === "number") {
|
|
392
328
|
cleanValue = cleanValue.toString();
|
|
393
329
|
}
|
|
@@ -402,7 +338,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
402
338
|
}
|
|
403
339
|
return cleanValue;
|
|
404
340
|
};
|
|
405
|
-
|
|
341
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
406
342
|
if (headerKey !== undefined) {
|
|
407
343
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
408
344
|
}
|