@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.
@@ -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 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
- }
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
- 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
- }
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 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
- }
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
- 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
- }
37
+ return new __HttpRequest({
38
+ protocol,
39
+ hostname,
40
+ port,
41
+ method: "POST",
42
+ headers,
43
+ path: resolvedPath,
44
+ body,
101
45
  });
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
- }
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
- 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
- }
64
+ return new __HttpRequest({
65
+ protocol,
66
+ hostname,
67
+ port,
68
+ method: "POST",
69
+ headers,
70
+ path: resolvedPath,
71
+ body,
160
72
  });
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
- }
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
- 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
- }
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
- 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
- }
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
- 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)];
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
- 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 }));
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
- var serializeAws_restJson1DeploymentModels = function (input, context) {
198
+ const serializeAws_restJson1DeploymentModels = (input, context) => {
263
199
  return input
264
- .filter(function (e) { return e != null; })
265
- .map(function (entry) {
200
+ .filter((e) => e != null)
201
+ .map((entry) => {
266
202
  return serializeAws_restJson1DeploymentModel(entry, context);
267
203
  });
268
204
  };
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 }));
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
- 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) }));
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
- var serializeAws_restJson1EdgeMetrics = function (input, context) {
227
+ const serializeAws_restJson1EdgeMetrics = (input, context) => {
280
228
  return input
281
- .filter(function (e) { return e != null; })
282
- .map(function (entry) {
229
+ .filter((e) => e != null)
230
+ .map((entry) => {
283
231
  return serializeAws_restJson1EdgeMetric(entry, context);
284
232
  });
285
233
  };
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 }));
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
- var serializeAws_restJson1Models = function (input, context) {
243
+ const serializeAws_restJson1Models = (input, context) => {
290
244
  return input
291
- .filter(function (e) { return e != null; })
292
- .map(function (entry) {
245
+ .filter((e) => e != null)
246
+ .map((entry) => {
293
247
  return serializeAws_restJson1Model(entry, context);
294
248
  });
295
249
  };
296
- var deserializeAws_restJson1Checksum = function (output, context) {
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
- var deserializeAws_restJson1Definition = function (output, context) {
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
- var deserializeAws_restJson1Definitions = function (output, context) {
311
- var retVal = (output || [])
312
- .filter(function (e) { return e != null; })
313
- .map(function (entry) {
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
- var deserializeAws_restJson1EdgeDeployment = function (output, context) {
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
- var deserializeAws_restJson1EdgeDeployments = function (output, context) {
330
- var retVal = (output || [])
331
- .filter(function (e) { return e != null; })
332
- .map(function (entry) {
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
- 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(); }
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
- var collectBodyString = function (streamBody, context) {
357
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
358
- };
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
- });
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
- 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;
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
- var headerKey = findKey(output.headers, "x-amzn-errortype");
341
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
406
342
  if (headerKey !== undefined) {
407
343
  return sanitizeErrorCode(output.headers[headerKey]);
408
344
  }