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