@aws-sdk/client-sagemaker-edge 3.137.0 → 3.145.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 CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-sagemaker-edge
9
+
10
+
11
+
12
+
13
+
14
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
15
+
16
+
17
+ ### Features
18
+
19
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
20
+
21
+
22
+
23
+
24
+
25
+ # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
26
+
27
+
28
+ ### Features
29
+
30
+ * **clients:** update client endpoints as of 2022-08-01 ([aaf49f2](https://github.com/aws/aws-sdk-js-v3/commit/aaf49f21b371412e6ea7e00890b71a7b31991b66))
31
+
32
+
33
+
34
+
35
+
6
36
  # [3.137.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.136.1...v3.137.0) (2022-07-26)
7
37
 
8
38
 
package/README.md CHANGED
@@ -165,7 +165,7 @@ try {
165
165
  const data = await client.send(command);
166
166
  // process data.
167
167
  } catch (error) {
168
- const { requestId, cfId, extendedRequestId } = error.$metadata;
168
+ const { requestId, cfId, extendedRequestId } = error.$$metadata;
169
169
  console.log({ requestId, cfId, extendedRequestId });
170
170
  /**
171
171
  * The keys within exceptions are also parsed.
@@ -81,15 +81,14 @@ const deserializeAws_restJson1GetDeploymentsCommand = async (output, context) =>
81
81
  if (output.statusCode !== 200 && output.statusCode >= 300) {
82
82
  return deserializeAws_restJson1GetDeploymentsCommandError(output, context);
83
83
  }
84
- const contents = {
84
+ const contents = map({
85
85
  $metadata: deserializeMetadata(output),
86
- Deployments: undefined,
87
- };
86
+ });
88
87
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
89
- if (data.Deployments !== undefined && data.Deployments !== null) {
88
+ if (data.Deployments != null) {
90
89
  contents.Deployments = deserializeAws_restJson1EdgeDeployments(data.Deployments, context);
91
90
  }
92
- return Promise.resolve(contents);
91
+ return contents;
93
92
  };
94
93
  exports.deserializeAws_restJson1GetDeploymentsCommand = deserializeAws_restJson1GetDeploymentsCommand;
95
94
  const deserializeAws_restJson1GetDeploymentsCommandError = async (output, context) => {
@@ -97,7 +96,6 @@ const deserializeAws_restJson1GetDeploymentsCommandError = async (output, contex
97
96
  ...output,
98
97
  body: await parseBody(output.body, context),
99
98
  };
100
- let response;
101
99
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
102
100
  switch (errorCode) {
103
101
  case "InternalServiceException":
@@ -105,33 +103,29 @@ const deserializeAws_restJson1GetDeploymentsCommandError = async (output, contex
105
103
  throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
106
104
  default:
107
105
  const parsedBody = parsedOutput.body;
108
- const $metadata = deserializeMetadata(output);
109
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
110
- response = new SagemakerEdgeServiceException_1.SagemakerEdgeServiceException({
111
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
112
- $fault: "client",
113
- $metadata,
106
+ (0, smithy_client_1.throwDefaultError)({
107
+ output,
108
+ parsedBody,
109
+ exceptionCtor: SagemakerEdgeServiceException_1.SagemakerEdgeServiceException,
110
+ errorCode,
114
111
  });
115
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
116
112
  }
117
113
  };
118
114
  const deserializeAws_restJson1GetDeviceRegistrationCommand = async (output, context) => {
119
115
  if (output.statusCode !== 200 && output.statusCode >= 300) {
120
116
  return deserializeAws_restJson1GetDeviceRegistrationCommandError(output, context);
121
117
  }
122
- const contents = {
118
+ const contents = map({
123
119
  $metadata: deserializeMetadata(output),
124
- CacheTTL: undefined,
125
- DeviceRegistration: undefined,
126
- };
120
+ });
127
121
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
128
- if (data.CacheTTL !== undefined && data.CacheTTL !== null) {
122
+ if (data.CacheTTL != null) {
129
123
  contents.CacheTTL = (0, smithy_client_1.expectString)(data.CacheTTL);
130
124
  }
131
- if (data.DeviceRegistration !== undefined && data.DeviceRegistration !== null) {
125
+ if (data.DeviceRegistration != null) {
132
126
  contents.DeviceRegistration = (0, smithy_client_1.expectString)(data.DeviceRegistration);
133
127
  }
134
- return Promise.resolve(contents);
128
+ return contents;
135
129
  };
136
130
  exports.deserializeAws_restJson1GetDeviceRegistrationCommand = deserializeAws_restJson1GetDeviceRegistrationCommand;
137
131
  const deserializeAws_restJson1GetDeviceRegistrationCommandError = async (output, context) => {
@@ -139,7 +133,6 @@ const deserializeAws_restJson1GetDeviceRegistrationCommandError = async (output,
139
133
  ...output,
140
134
  body: await parseBody(output.body, context),
141
135
  };
142
- let response;
143
136
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
144
137
  switch (errorCode) {
145
138
  case "InternalServiceException":
@@ -147,25 +140,23 @@ const deserializeAws_restJson1GetDeviceRegistrationCommandError = async (output,
147
140
  throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
148
141
  default:
149
142
  const parsedBody = parsedOutput.body;
150
- const $metadata = deserializeMetadata(output);
151
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
152
- response = new SagemakerEdgeServiceException_1.SagemakerEdgeServiceException({
153
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
154
- $fault: "client",
155
- $metadata,
143
+ (0, smithy_client_1.throwDefaultError)({
144
+ output,
145
+ parsedBody,
146
+ exceptionCtor: SagemakerEdgeServiceException_1.SagemakerEdgeServiceException,
147
+ errorCode,
156
148
  });
157
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
158
149
  }
159
150
  };
160
151
  const deserializeAws_restJson1SendHeartbeatCommand = async (output, context) => {
161
152
  if (output.statusCode !== 200 && output.statusCode >= 300) {
162
153
  return deserializeAws_restJson1SendHeartbeatCommandError(output, context);
163
154
  }
164
- const contents = {
155
+ const contents = map({
165
156
  $metadata: deserializeMetadata(output),
166
- };
157
+ });
167
158
  await collectBody(output.body, context);
168
- return Promise.resolve(contents);
159
+ return contents;
169
160
  };
170
161
  exports.deserializeAws_restJson1SendHeartbeatCommand = deserializeAws_restJson1SendHeartbeatCommand;
171
162
  const deserializeAws_restJson1SendHeartbeatCommandError = async (output, context) => {
@@ -173,7 +164,6 @@ const deserializeAws_restJson1SendHeartbeatCommandError = async (output, context
173
164
  ...output,
174
165
  body: await parseBody(output.body, context),
175
166
  };
176
- let response;
177
167
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
178
168
  switch (errorCode) {
179
169
  case "InternalServiceException":
@@ -181,20 +171,19 @@ const deserializeAws_restJson1SendHeartbeatCommandError = async (output, context
181
171
  throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
182
172
  default:
183
173
  const parsedBody = parsedOutput.body;
184
- const $metadata = deserializeMetadata(output);
185
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
186
- response = new SagemakerEdgeServiceException_1.SagemakerEdgeServiceException({
187
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
188
- $fault: "client",
189
- $metadata,
174
+ (0, smithy_client_1.throwDefaultError)({
175
+ output,
176
+ parsedBody,
177
+ exceptionCtor: SagemakerEdgeServiceException_1.SagemakerEdgeServiceException,
178
+ errorCode,
190
179
  });
191
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
192
180
  }
193
181
  };
182
+ const map = smithy_client_1.map;
194
183
  const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
195
- const contents = {};
184
+ const contents = map({});
196
185
  const data = parsedOutput.body;
197
- if (data.Message !== undefined && data.Message !== null) {
186
+ if (data.Message != null) {
198
187
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
199
188
  }
200
189
  const exception = new models_0_1.InternalServiceException({
@@ -219,9 +208,6 @@ const serializeAws_restJson1DeploymentModels = (input, context) => {
219
208
  return input
220
209
  .filter((e) => e != null)
221
210
  .map((entry) => {
222
- if (entry === null) {
223
- return null;
224
- }
225
211
  return serializeAws_restJson1DeploymentModel(entry, context);
226
212
  });
227
213
  };
@@ -251,9 +237,6 @@ const serializeAws_restJson1EdgeMetrics = (input, context) => {
251
237
  return input
252
238
  .filter((e) => e != null)
253
239
  .map((entry) => {
254
- if (entry === null) {
255
- return null;
256
- }
257
240
  return serializeAws_restJson1EdgeMetric(entry, context);
258
241
  });
259
242
  };
@@ -270,9 +253,6 @@ const serializeAws_restJson1Models = (input, context) => {
270
253
  return input
271
254
  .filter((e) => e != null)
272
255
  .map((entry) => {
273
- if (entry === null) {
274
- return null;
275
- }
276
256
  return serializeAws_restJson1Model(entry, context);
277
257
  });
278
258
  };
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, serializeFloat as __serializeFloat, } from "@aws-sdk/smithy-client";
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";
4
4
  import { InternalServiceException, } from "../models/models_0";
5
5
  import { SagemakerEdgeServiceException as __BaseException } from "../models/SagemakerEdgeServiceException";
6
6
  export var serializeAws_restJson1GetDeploymentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -85,24 +85,23 @@ export var deserializeAws_restJson1GetDeploymentsCommand = function (output, con
85
85
  if (output.statusCode !== 200 && output.statusCode >= 300) {
86
86
  return [2, deserializeAws_restJson1GetDeploymentsCommandError(output, context)];
87
87
  }
88
- contents = {
88
+ contents = map({
89
89
  $metadata: deserializeMetadata(output),
90
- Deployments: undefined,
91
- };
90
+ });
92
91
  _a = __expectNonNull;
93
92
  _b = __expectObject;
94
93
  return [4, parseBody(output.body, context)];
95
94
  case 1:
96
95
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
97
- if (data.Deployments !== undefined && data.Deployments !== null) {
96
+ if (data.Deployments != null) {
98
97
  contents.Deployments = deserializeAws_restJson1EdgeDeployments(data.Deployments, context);
99
98
  }
100
- return [2, Promise.resolve(contents)];
99
+ return [2, contents];
101
100
  }
102
101
  });
103
102
  }); };
104
103
  var deserializeAws_restJson1GetDeploymentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
105
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
104
+ var parsedOutput, _a, errorCode, _b, parsedBody;
106
105
  var _c;
107
106
  return __generator(this, function (_d) {
108
107
  switch (_d.label) {
@@ -123,14 +122,14 @@ var deserializeAws_restJson1GetDeploymentsCommandError = function (output, conte
123
122
  case 3: throw _d.sent();
124
123
  case 4:
125
124
  parsedBody = parsedOutput.body;
126
- $metadata = deserializeMetadata(output);
127
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
128
- response = new __BaseException({
129
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
130
- $fault: "client",
131
- $metadata: $metadata,
125
+ throwDefaultError({
126
+ output: output,
127
+ parsedBody: parsedBody,
128
+ exceptionCtor: __BaseException,
129
+ errorCode: errorCode,
132
130
  });
133
- throw __decorateServiceException(response, parsedBody);
131
+ _d.label = 5;
132
+ case 5: return [2];
134
133
  }
135
134
  });
136
135
  }); };
@@ -142,28 +141,26 @@ export var deserializeAws_restJson1GetDeviceRegistrationCommand = function (outp
142
141
  if (output.statusCode !== 200 && output.statusCode >= 300) {
143
142
  return [2, deserializeAws_restJson1GetDeviceRegistrationCommandError(output, context)];
144
143
  }
145
- contents = {
144
+ contents = map({
146
145
  $metadata: deserializeMetadata(output),
147
- CacheTTL: undefined,
148
- DeviceRegistration: undefined,
149
- };
146
+ });
150
147
  _a = __expectNonNull;
151
148
  _b = __expectObject;
152
149
  return [4, parseBody(output.body, context)];
153
150
  case 1:
154
151
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
155
- if (data.CacheTTL !== undefined && data.CacheTTL !== null) {
152
+ if (data.CacheTTL != null) {
156
153
  contents.CacheTTL = __expectString(data.CacheTTL);
157
154
  }
158
- if (data.DeviceRegistration !== undefined && data.DeviceRegistration !== null) {
155
+ if (data.DeviceRegistration != null) {
159
156
  contents.DeviceRegistration = __expectString(data.DeviceRegistration);
160
157
  }
161
- return [2, Promise.resolve(contents)];
158
+ return [2, contents];
162
159
  }
163
160
  });
164
161
  }); };
165
162
  var deserializeAws_restJson1GetDeviceRegistrationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
163
+ var parsedOutput, _a, errorCode, _b, parsedBody;
167
164
  var _c;
168
165
  return __generator(this, function (_d) {
169
166
  switch (_d.label) {
@@ -184,14 +181,14 @@ var deserializeAws_restJson1GetDeviceRegistrationCommandError = function (output
184
181
  case 3: throw _d.sent();
185
182
  case 4:
186
183
  parsedBody = parsedOutput.body;
187
- $metadata = deserializeMetadata(output);
188
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
189
- response = new __BaseException({
190
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
191
- $fault: "client",
192
- $metadata: $metadata,
184
+ throwDefaultError({
185
+ output: output,
186
+ parsedBody: parsedBody,
187
+ exceptionCtor: __BaseException,
188
+ errorCode: errorCode,
193
189
  });
194
- throw __decorateServiceException(response, parsedBody);
190
+ _d.label = 5;
191
+ case 5: return [2];
195
192
  }
196
193
  });
197
194
  }); };
@@ -203,18 +200,18 @@ export var deserializeAws_restJson1SendHeartbeatCommand = function (output, cont
203
200
  if (output.statusCode !== 200 && output.statusCode >= 300) {
204
201
  return [2, deserializeAws_restJson1SendHeartbeatCommandError(output, context)];
205
202
  }
206
- contents = {
203
+ contents = map({
207
204
  $metadata: deserializeMetadata(output),
208
- };
205
+ });
209
206
  return [4, collectBody(output.body, context)];
210
207
  case 1:
211
208
  _a.sent();
212
- return [2, Promise.resolve(contents)];
209
+ return [2, contents];
213
210
  }
214
211
  });
215
212
  }); };
216
213
  var deserializeAws_restJson1SendHeartbeatCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
217
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
214
+ var parsedOutput, _a, errorCode, _b, parsedBody;
218
215
  var _c;
219
216
  return __generator(this, function (_d) {
220
217
  switch (_d.label) {
@@ -235,23 +232,24 @@ var deserializeAws_restJson1SendHeartbeatCommandError = function (output, contex
235
232
  case 3: throw _d.sent();
236
233
  case 4:
237
234
  parsedBody = parsedOutput.body;
238
- $metadata = deserializeMetadata(output);
239
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
240
- response = new __BaseException({
241
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
242
- $fault: "client",
243
- $metadata: $metadata,
235
+ throwDefaultError({
236
+ output: output,
237
+ parsedBody: parsedBody,
238
+ exceptionCtor: __BaseException,
239
+ errorCode: errorCode,
244
240
  });
245
- throw __decorateServiceException(response, parsedBody);
241
+ _d.label = 5;
242
+ case 5: return [2];
246
243
  }
247
244
  });
248
245
  }); };
246
+ var map = __map;
249
247
  var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
250
248
  var contents, data, exception;
251
249
  return __generator(this, function (_a) {
252
- contents = {};
250
+ contents = map({});
253
251
  data = parsedOutput.body;
254
- if (data.Message !== undefined && data.Message !== null) {
252
+ if (data.Message != null) {
255
253
  contents.Message = __expectString(data.Message);
256
254
  }
257
255
  exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -265,9 +263,6 @@ var serializeAws_restJson1DeploymentModels = function (input, context) {
265
263
  return input
266
264
  .filter(function (e) { return e != null; })
267
265
  .map(function (entry) {
268
- if (entry === null) {
269
- return null;
270
- }
271
266
  return serializeAws_restJson1DeploymentModel(entry, context);
272
267
  });
273
268
  };
@@ -285,9 +280,6 @@ var serializeAws_restJson1EdgeMetrics = function (input, context) {
285
280
  return input
286
281
  .filter(function (e) { return e != null; })
287
282
  .map(function (entry) {
288
- if (entry === null) {
289
- return null;
290
- }
291
283
  return serializeAws_restJson1EdgeMetric(entry, context);
292
284
  });
293
285
  };
@@ -298,9 +290,6 @@ var serializeAws_restJson1Models = function (input, context) {
298
290
  return input
299
291
  .filter(function (e) { return e != null; })
300
292
  .map(function (entry) {
301
- if (entry === null) {
302
- return null;
303
- }
304
293
  return serializeAws_restJson1Model(entry, context);
305
294
  });
306
295
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-edge",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Edge Client for Node.js, Browser and React Native",
4
- "version": "3.137.0",
4
+ "version": "3.145.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.137.0",
21
+ "@aws-sdk/client-sts": "3.145.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.137.0",
23
+ "@aws-sdk/credential-provider-node": "3.145.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.131.0",
25
25
  "@aws-sdk/hash-node": "3.127.0",
26
26
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -36,15 +36,15 @@
36
36
  "@aws-sdk/node-config-provider": "3.127.0",
37
37
  "@aws-sdk/node-http-handler": "3.127.0",
38
38
  "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.137.0",
39
+ "@aws-sdk/smithy-client": "3.142.0",
40
40
  "@aws-sdk/types": "3.127.0",
41
41
  "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
48
  "@aws-sdk/util-user-agent-browser": "3.127.0",
49
49
  "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",
@@ -61,6 +61,11 @@
61
61
  "typedoc": "0.19.2",
62
62
  "typescript": "~4.6.2"
63
63
  },
64
+ "overrides": {
65
+ "typedoc": {
66
+ "typescript": "~4.6.2"
67
+ }
68
+ },
64
69
  "engines": {
65
70
  "node": ">=12.0.0"
66
71
  },