@aws-sdk/client-sagemaker-edge 3.128.0 → 3.133.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.133.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.132.0...v3.133.0) (2022-07-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-sagemaker-edge:** Amazon SageMaker Edge Manager provides lightweight model deployment feature to deploy machine learning models on requested devices. ([316a691](https://github.com/aws/aws-sdk-js-v3/commit/316a691491232facc572b8482f9084355702bfbf))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.131.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.130.0...v3.131.0) (2022-07-15)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-sagemaker-edge
20
+
21
+
22
+
23
+
24
+
25
+ # [3.130.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.129.0...v3.130.0) (2022-07-14)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **codegen:** fix error code parsing when it's a number ([#3371](https://github.com/aws/aws-sdk-js-v3/issues/3371)) ([c2d8522](https://github.com/aws/aws-sdk-js-v3/commit/c2d852279a3d23958521a6ceb4f4c642b0cb1848))
31
+
32
+
33
+
34
+
35
+
6
36
  # [3.128.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.127.0...v3.128.0) (2022-07-12)
7
37
 
8
38
  **Note:** Version bump only for package @aws-sdk/client-sagemaker-edge
package/README.md CHANGED
@@ -26,16 +26,16 @@ using your favorite package manager:
26
26
 
27
27
  The AWS SDK is modulized by clients and commands.
28
28
  To send a request, you only need to import the `SagemakerEdgeClient` and
29
- the commands you need, for example `GetDeviceRegistrationCommand`:
29
+ the commands you need, for example `GetDeploymentsCommand`:
30
30
 
31
31
  ```js
32
32
  // ES5 example
33
- const { SagemakerEdgeClient, GetDeviceRegistrationCommand } = require("@aws-sdk/client-sagemaker-edge");
33
+ const { SagemakerEdgeClient, GetDeploymentsCommand } = require("@aws-sdk/client-sagemaker-edge");
34
34
  ```
35
35
 
36
36
  ```ts
37
37
  // ES6+ example
38
- import { SagemakerEdgeClient, GetDeviceRegistrationCommand } from "@aws-sdk/client-sagemaker-edge";
38
+ import { SagemakerEdgeClient, GetDeploymentsCommand } from "@aws-sdk/client-sagemaker-edge";
39
39
  ```
40
40
 
41
41
  ### Usage
@@ -54,7 +54,7 @@ const client = new SagemakerEdgeClient({ region: "REGION" });
54
54
  const params = {
55
55
  /** input parameters */
56
56
  };
57
- const command = new GetDeviceRegistrationCommand(params);
57
+ const command = new GetDeploymentsCommand(params);
58
58
  ```
59
59
 
60
60
  #### Async/await
@@ -133,7 +133,7 @@ const client = new AWS.SagemakerEdge({ region: "REGION" });
133
133
 
134
134
  // async/await.
135
135
  try {
136
- const data = await client.getDeviceRegistration(params);
136
+ const data = await client.getDeployments(params);
137
137
  // process data.
138
138
  } catch (error) {
139
139
  // error handling.
@@ -141,7 +141,7 @@ try {
141
141
 
142
142
  // Promises.
143
143
  client
144
- .getDeviceRegistration(params)
144
+ .getDeployments(params)
145
145
  .then((data) => {
146
146
  // process data.
147
147
  })
@@ -150,7 +150,7 @@ client
150
150
  });
151
151
 
152
152
  // callbacks.
153
- client.getDeviceRegistration(params, (err, data) => {
153
+ client.getDeployments(params, (err, data) => {
154
154
  // process err and data.
155
155
  });
156
156
  ```
@@ -1,10 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SagemakerEdge = void 0;
4
+ const GetDeploymentsCommand_1 = require("./commands/GetDeploymentsCommand");
4
5
  const GetDeviceRegistrationCommand_1 = require("./commands/GetDeviceRegistrationCommand");
5
6
  const SendHeartbeatCommand_1 = require("./commands/SendHeartbeatCommand");
6
7
  const SagemakerEdgeClient_1 = require("./SagemakerEdgeClient");
7
8
  class SagemakerEdge extends SagemakerEdgeClient_1.SagemakerEdgeClient {
9
+ getDeployments(args, optionsOrCb, cb) {
10
+ const command = new GetDeploymentsCommand_1.GetDeploymentsCommand(args);
11
+ if (typeof optionsOrCb === "function") {
12
+ this.send(command, optionsOrCb);
13
+ }
14
+ else if (typeof cb === "function") {
15
+ if (typeof optionsOrCb !== "object")
16
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
17
+ this.send(command, optionsOrCb || {}, cb);
18
+ }
19
+ else {
20
+ return this.send(command, optionsOrCb);
21
+ }
22
+ }
8
23
  getDeviceRegistration(args, optionsOrCb, cb) {
9
24
  const command = new GetDeviceRegistrationCommand_1.GetDeviceRegistrationCommand(args);
10
25
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetDeploymentsCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class GetDeploymentsCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "SagemakerEdgeClient";
18
+ const commandName = "GetDeploymentsCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.GetDeploymentsRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.GetDeploymentsResult.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_restJson1_1.serializeAws_restJson1GetDeploymentsCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_restJson1_1.deserializeAws_restJson1GetDeploymentsCommand)(output, context);
34
+ }
35
+ }
36
+ exports.GetDeploymentsCommand = GetDeploymentsCommand;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./GetDeploymentsCommand"), exports);
4
5
  tslib_1.__exportStar(require("./GetDeviceRegistrationCommand"), exports);
5
6
  tslib_1.__exportStar(require("./SendHeartbeatCommand"), exports);
@@ -1,19 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SendHeartbeatRequest = exports.Model = exports.EdgeMetric = exports.InternalServiceException = exports.GetDeviceRegistrationResult = exports.GetDeviceRegistrationRequest = void 0;
3
+ exports.SendHeartbeatRequest = exports.Model = exports.DeploymentResult = exports.DeploymentModel = exports.DeploymentStatus = exports.EdgeMetric = exports.GetDeviceRegistrationResult = exports.GetDeviceRegistrationRequest = exports.InternalServiceException = exports.GetDeploymentsResult = exports.EdgeDeployment = exports.DeploymentType = exports.FailureHandlingPolicy = exports.Definition = exports.ModelState = exports.Checksum = exports.ChecksumType = exports.GetDeploymentsRequest = void 0;
4
4
  const SagemakerEdgeServiceException_1 = require("./SagemakerEdgeServiceException");
5
- var GetDeviceRegistrationRequest;
6
- (function (GetDeviceRegistrationRequest) {
7
- GetDeviceRegistrationRequest.filterSensitiveLog = (obj) => ({
5
+ var GetDeploymentsRequest;
6
+ (function (GetDeploymentsRequest) {
7
+ GetDeploymentsRequest.filterSensitiveLog = (obj) => ({
8
8
  ...obj,
9
9
  });
10
- })(GetDeviceRegistrationRequest = exports.GetDeviceRegistrationRequest || (exports.GetDeviceRegistrationRequest = {}));
11
- var GetDeviceRegistrationResult;
12
- (function (GetDeviceRegistrationResult) {
13
- GetDeviceRegistrationResult.filterSensitiveLog = (obj) => ({
10
+ })(GetDeploymentsRequest = exports.GetDeploymentsRequest || (exports.GetDeploymentsRequest = {}));
11
+ var ChecksumType;
12
+ (function (ChecksumType) {
13
+ ChecksumType["Sha1"] = "SHA1";
14
+ })(ChecksumType = exports.ChecksumType || (exports.ChecksumType = {}));
15
+ var Checksum;
16
+ (function (Checksum) {
17
+ Checksum.filterSensitiveLog = (obj) => ({
14
18
  ...obj,
15
19
  });
16
- })(GetDeviceRegistrationResult = exports.GetDeviceRegistrationResult || (exports.GetDeviceRegistrationResult = {}));
20
+ })(Checksum = exports.Checksum || (exports.Checksum = {}));
21
+ var ModelState;
22
+ (function (ModelState) {
23
+ ModelState["Deploy"] = "DEPLOY";
24
+ ModelState["Undeploy"] = "UNDEPLOY";
25
+ })(ModelState = exports.ModelState || (exports.ModelState = {}));
26
+ var Definition;
27
+ (function (Definition) {
28
+ Definition.filterSensitiveLog = (obj) => ({
29
+ ...obj,
30
+ });
31
+ })(Definition = exports.Definition || (exports.Definition = {}));
32
+ var FailureHandlingPolicy;
33
+ (function (FailureHandlingPolicy) {
34
+ FailureHandlingPolicy["DoNothing"] = "DO_NOTHING";
35
+ FailureHandlingPolicy["RollbackOnFailure"] = "ROLLBACK_ON_FAILURE";
36
+ })(FailureHandlingPolicy = exports.FailureHandlingPolicy || (exports.FailureHandlingPolicy = {}));
37
+ var DeploymentType;
38
+ (function (DeploymentType) {
39
+ DeploymentType["Model"] = "Model";
40
+ })(DeploymentType = exports.DeploymentType || (exports.DeploymentType = {}));
41
+ var EdgeDeployment;
42
+ (function (EdgeDeployment) {
43
+ EdgeDeployment.filterSensitiveLog = (obj) => ({
44
+ ...obj,
45
+ });
46
+ })(EdgeDeployment = exports.EdgeDeployment || (exports.EdgeDeployment = {}));
47
+ var GetDeploymentsResult;
48
+ (function (GetDeploymentsResult) {
49
+ GetDeploymentsResult.filterSensitiveLog = (obj) => ({
50
+ ...obj,
51
+ });
52
+ })(GetDeploymentsResult = exports.GetDeploymentsResult || (exports.GetDeploymentsResult = {}));
17
53
  class InternalServiceException extends SagemakerEdgeServiceException_1.SagemakerEdgeServiceException {
18
54
  constructor(opts) {
19
55
  super({
@@ -28,12 +64,41 @@ class InternalServiceException extends SagemakerEdgeServiceException_1.Sagemaker
28
64
  }
29
65
  }
30
66
  exports.InternalServiceException = InternalServiceException;
67
+ var GetDeviceRegistrationRequest;
68
+ (function (GetDeviceRegistrationRequest) {
69
+ GetDeviceRegistrationRequest.filterSensitiveLog = (obj) => ({
70
+ ...obj,
71
+ });
72
+ })(GetDeviceRegistrationRequest = exports.GetDeviceRegistrationRequest || (exports.GetDeviceRegistrationRequest = {}));
73
+ var GetDeviceRegistrationResult;
74
+ (function (GetDeviceRegistrationResult) {
75
+ GetDeviceRegistrationResult.filterSensitiveLog = (obj) => ({
76
+ ...obj,
77
+ });
78
+ })(GetDeviceRegistrationResult = exports.GetDeviceRegistrationResult || (exports.GetDeviceRegistrationResult = {}));
31
79
  var EdgeMetric;
32
80
  (function (EdgeMetric) {
33
81
  EdgeMetric.filterSensitiveLog = (obj) => ({
34
82
  ...obj,
35
83
  });
36
84
  })(EdgeMetric = exports.EdgeMetric || (exports.EdgeMetric = {}));
85
+ var DeploymentStatus;
86
+ (function (DeploymentStatus) {
87
+ DeploymentStatus["Fail"] = "FAIL";
88
+ DeploymentStatus["Success"] = "SUCCESS";
89
+ })(DeploymentStatus = exports.DeploymentStatus || (exports.DeploymentStatus = {}));
90
+ var DeploymentModel;
91
+ (function (DeploymentModel) {
92
+ DeploymentModel.filterSensitiveLog = (obj) => ({
93
+ ...obj,
94
+ });
95
+ })(DeploymentModel = exports.DeploymentModel || (exports.DeploymentModel = {}));
96
+ var DeploymentResult;
97
+ (function (DeploymentResult) {
98
+ DeploymentResult.filterSensitiveLog = (obj) => ({
99
+ ...obj,
100
+ });
101
+ })(DeploymentResult = exports.DeploymentResult || (exports.DeploymentResult = {}));
37
102
  var Model;
38
103
  (function (Model) {
39
104
  Model.filterSensitiveLog = (obj) => ({
@@ -1,10 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1SendHeartbeatCommand = exports.deserializeAws_restJson1GetDeviceRegistrationCommand = exports.serializeAws_restJson1SendHeartbeatCommand = exports.serializeAws_restJson1GetDeviceRegistrationCommand = void 0;
3
+ exports.deserializeAws_restJson1SendHeartbeatCommand = exports.deserializeAws_restJson1GetDeviceRegistrationCommand = exports.deserializeAws_restJson1GetDeploymentsCommand = exports.serializeAws_restJson1SendHeartbeatCommand = exports.serializeAws_restJson1GetDeviceRegistrationCommand = exports.serializeAws_restJson1GetDeploymentsCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const SagemakerEdgeServiceException_1 = require("../models/SagemakerEdgeServiceException");
8
+ const serializeAws_restJson1GetDeploymentsCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/GetDeployments";
14
+ let body;
15
+ body = JSON.stringify({
16
+ ...(input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName }),
17
+ ...(input.DeviceName != null && { DeviceName: input.DeviceName }),
18
+ });
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ exports.serializeAws_restJson1GetDeploymentsCommand = serializeAws_restJson1GetDeploymentsCommand;
8
30
  const serializeAws_restJson1GetDeviceRegistrationCommand = async (input, context) => {
9
31
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
32
  const headers = {
@@ -37,6 +59,9 @@ const serializeAws_restJson1SendHeartbeatCommand = async (input, context) => {
37
59
  body = JSON.stringify({
38
60
  ...(input.AgentMetrics != null && { AgentMetrics: serializeAws_restJson1EdgeMetrics(input.AgentMetrics, context) }),
39
61
  ...(input.AgentVersion != null && { AgentVersion: input.AgentVersion }),
62
+ ...(input.DeploymentResult != null && {
63
+ DeploymentResult: serializeAws_restJson1DeploymentResult(input.DeploymentResult, context),
64
+ }),
40
65
  ...(input.DeviceFleetName != null && { DeviceFleetName: input.DeviceFleetName }),
41
66
  ...(input.DeviceName != null && { DeviceName: input.DeviceName }),
42
67
  ...(input.Models != null && { Models: serializeAws_restJson1Models(input.Models, context) }),
@@ -52,6 +77,44 @@ const serializeAws_restJson1SendHeartbeatCommand = async (input, context) => {
52
77
  });
53
78
  };
54
79
  exports.serializeAws_restJson1SendHeartbeatCommand = serializeAws_restJson1SendHeartbeatCommand;
80
+ const deserializeAws_restJson1GetDeploymentsCommand = async (output, context) => {
81
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
82
+ return deserializeAws_restJson1GetDeploymentsCommandError(output, context);
83
+ }
84
+ const contents = {
85
+ $metadata: deserializeMetadata(output),
86
+ Deployments: undefined,
87
+ };
88
+ 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) {
90
+ contents.Deployments = deserializeAws_restJson1EdgeDeployments(data.Deployments, context);
91
+ }
92
+ return Promise.resolve(contents);
93
+ };
94
+ exports.deserializeAws_restJson1GetDeploymentsCommand = deserializeAws_restJson1GetDeploymentsCommand;
95
+ const deserializeAws_restJson1GetDeploymentsCommandError = async (output, context) => {
96
+ const parsedOutput = {
97
+ ...output,
98
+ body: await parseBody(output.body, context),
99
+ };
100
+ let response;
101
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
102
+ switch (errorCode) {
103
+ case "InternalServiceException":
104
+ case "com.amazonaws.sagemakeredge#InternalServiceException":
105
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
106
+ default:
107
+ 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,
114
+ });
115
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
116
+ }
117
+ };
55
118
  const deserializeAws_restJson1GetDeviceRegistrationCommand = async (output, context) => {
56
119
  if (output.statusCode !== 200 && output.statusCode >= 300) {
57
120
  return deserializeAws_restJson1GetDeviceRegistrationCommandError(output, context);
@@ -140,6 +203,42 @@ const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOu
140
203
  });
141
204
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
142
205
  };
206
+ const serializeAws_restJson1DeploymentModel = (input, context) => {
207
+ return {
208
+ ...(input.DesiredState != null && { DesiredState: input.DesiredState }),
209
+ ...(input.ModelHandle != null && { ModelHandle: input.ModelHandle }),
210
+ ...(input.ModelName != null && { ModelName: input.ModelName }),
211
+ ...(input.ModelVersion != null && { ModelVersion: input.ModelVersion }),
212
+ ...(input.RollbackFailureReason != null && { RollbackFailureReason: input.RollbackFailureReason }),
213
+ ...(input.State != null && { State: input.State }),
214
+ ...(input.Status != null && { Status: input.Status }),
215
+ ...(input.StatusReason != null && { StatusReason: input.StatusReason }),
216
+ };
217
+ };
218
+ const serializeAws_restJson1DeploymentModels = (input, context) => {
219
+ return input
220
+ .filter((e) => e != null)
221
+ .map((entry) => {
222
+ if (entry === null) {
223
+ return null;
224
+ }
225
+ return serializeAws_restJson1DeploymentModel(entry, context);
226
+ });
227
+ };
228
+ const serializeAws_restJson1DeploymentResult = (input, context) => {
229
+ return {
230
+ ...(input.DeploymentEndTime != null && { DeploymentEndTime: Math.round(input.DeploymentEndTime.getTime() / 1000) }),
231
+ ...(input.DeploymentModels != null && {
232
+ DeploymentModels: serializeAws_restJson1DeploymentModels(input.DeploymentModels, context),
233
+ }),
234
+ ...(input.DeploymentName != null && { DeploymentName: input.DeploymentName }),
235
+ ...(input.DeploymentStartTime != null && {
236
+ DeploymentStartTime: Math.round(input.DeploymentStartTime.getTime() / 1000),
237
+ }),
238
+ ...(input.DeploymentStatus != null && { DeploymentStatus: input.DeploymentStatus }),
239
+ ...(input.DeploymentStatusMessage != null && { DeploymentStatusMessage: input.DeploymentStatusMessage }),
240
+ };
241
+ };
143
242
  const serializeAws_restJson1EdgeMetric = (input, context) => {
144
243
  return {
145
244
  ...(input.Dimension != null && { Dimension: input.Dimension }),
@@ -177,6 +276,50 @@ const serializeAws_restJson1Models = (input, context) => {
177
276
  return serializeAws_restJson1Model(entry, context);
178
277
  });
179
278
  };
279
+ const deserializeAws_restJson1Checksum = (output, context) => {
280
+ return {
281
+ Sum: (0, smithy_client_1.expectString)(output.Sum),
282
+ Type: (0, smithy_client_1.expectString)(output.Type),
283
+ };
284
+ };
285
+ const deserializeAws_restJson1Definition = (output, context) => {
286
+ return {
287
+ Checksum: output.Checksum != null ? deserializeAws_restJson1Checksum(output.Checksum, context) : undefined,
288
+ ModelHandle: (0, smithy_client_1.expectString)(output.ModelHandle),
289
+ S3Url: (0, smithy_client_1.expectString)(output.S3Url),
290
+ State: (0, smithy_client_1.expectString)(output.State),
291
+ };
292
+ };
293
+ const deserializeAws_restJson1Definitions = (output, context) => {
294
+ const retVal = (output || [])
295
+ .filter((e) => e != null)
296
+ .map((entry) => {
297
+ if (entry === null) {
298
+ return null;
299
+ }
300
+ return deserializeAws_restJson1Definition(entry, context);
301
+ });
302
+ return retVal;
303
+ };
304
+ const deserializeAws_restJson1EdgeDeployment = (output, context) => {
305
+ return {
306
+ Definitions: output.Definitions != null ? deserializeAws_restJson1Definitions(output.Definitions, context) : undefined,
307
+ DeploymentName: (0, smithy_client_1.expectString)(output.DeploymentName),
308
+ FailureHandlingPolicy: (0, smithy_client_1.expectString)(output.FailureHandlingPolicy),
309
+ Type: (0, smithy_client_1.expectString)(output.Type),
310
+ };
311
+ };
312
+ const deserializeAws_restJson1EdgeDeployments = (output, context) => {
313
+ const retVal = (output || [])
314
+ .filter((e) => e != null)
315
+ .map((entry) => {
316
+ if (entry === null) {
317
+ return null;
318
+ }
319
+ return deserializeAws_restJson1EdgeDeployment(entry, context);
320
+ });
321
+ return retVal;
322
+ };
180
323
  const deserializeMetadata = (output) => {
181
324
  var _a;
182
325
  return ({
@@ -208,6 +351,9 @@ const loadRestJsonErrorCode = (output, data) => {
208
351
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
209
352
  const sanitizeErrorCode = (rawValue) => {
210
353
  let cleanValue = rawValue;
354
+ if (typeof cleanValue === "number") {
355
+ cleanValue = cleanValue.toString();
356
+ }
211
357
  if (cleanValue.indexOf(":") >= 0) {
212
358
  cleanValue = cleanValue.split(":")[0];
213
359
  }
@@ -1,4 +1,5 @@
1
1
  import { __extends } from "tslib";
2
+ import { GetDeploymentsCommand, } from "./commands/GetDeploymentsCommand";
2
3
  import { GetDeviceRegistrationCommand, } from "./commands/GetDeviceRegistrationCommand";
3
4
  import { SendHeartbeatCommand, } from "./commands/SendHeartbeatCommand";
4
5
  import { SagemakerEdgeClient } from "./SagemakerEdgeClient";
@@ -7,6 +8,20 @@ var SagemakerEdge = (function (_super) {
7
8
  function SagemakerEdge() {
8
9
  return _super !== null && _super.apply(this, arguments) || this;
9
10
  }
11
+ SagemakerEdge.prototype.getDeployments = function (args, optionsOrCb, cb) {
12
+ var command = new GetDeploymentsCommand(args);
13
+ if (typeof optionsOrCb === "function") {
14
+ this.send(command, optionsOrCb);
15
+ }
16
+ else if (typeof cb === "function") {
17
+ if (typeof optionsOrCb !== "object")
18
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
19
+ this.send(command, optionsOrCb || {}, cb);
20
+ }
21
+ else {
22
+ return this.send(command, optionsOrCb);
23
+ }
24
+ };
10
25
  SagemakerEdge.prototype.getDeviceRegistration = function (args, optionsOrCb, cb) {
11
26
  var command = new GetDeviceRegistrationCommand(args);
12
27
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { GetDeploymentsRequest, GetDeploymentsResult } from "../models/models_0";
5
+ import { deserializeAws_restJson1GetDeploymentsCommand, serializeAws_restJson1GetDeploymentsCommand, } from "../protocols/Aws_restJson1";
6
+ var GetDeploymentsCommand = (function (_super) {
7
+ __extends(GetDeploymentsCommand, _super);
8
+ function GetDeploymentsCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ GetDeploymentsCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "SagemakerEdgeClient";
18
+ var commandName = "GetDeploymentsCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: GetDeploymentsRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: GetDeploymentsResult.filterSensitiveLog,
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ GetDeploymentsCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_restJson1GetDeploymentsCommand(input, context);
33
+ };
34
+ GetDeploymentsCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_restJson1GetDeploymentsCommand(output, context);
36
+ };
37
+ return GetDeploymentsCommand;
38
+ }($Command));
39
+ export { GetDeploymentsCommand };
@@ -1,2 +1,3 @@
1
+ export * from "./GetDeploymentsCommand";
1
2
  export * from "./GetDeviceRegistrationCommand";
2
3
  export * from "./SendHeartbeatCommand";
@@ -1,13 +1,43 @@
1
1
  import { __assign, __extends } from "tslib";
2
2
  import { SagemakerEdgeServiceException as __BaseException } from "./SagemakerEdgeServiceException";
3
- export var GetDeviceRegistrationRequest;
4
- (function (GetDeviceRegistrationRequest) {
5
- GetDeviceRegistrationRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
6
- })(GetDeviceRegistrationRequest || (GetDeviceRegistrationRequest = {}));
7
- export var GetDeviceRegistrationResult;
8
- (function (GetDeviceRegistrationResult) {
9
- GetDeviceRegistrationResult.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
10
- })(GetDeviceRegistrationResult || (GetDeviceRegistrationResult = {}));
3
+ export var GetDeploymentsRequest;
4
+ (function (GetDeploymentsRequest) {
5
+ GetDeploymentsRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
6
+ })(GetDeploymentsRequest || (GetDeploymentsRequest = {}));
7
+ export var ChecksumType;
8
+ (function (ChecksumType) {
9
+ ChecksumType["Sha1"] = "SHA1";
10
+ })(ChecksumType || (ChecksumType = {}));
11
+ export var Checksum;
12
+ (function (Checksum) {
13
+ Checksum.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
14
+ })(Checksum || (Checksum = {}));
15
+ export var ModelState;
16
+ (function (ModelState) {
17
+ ModelState["Deploy"] = "DEPLOY";
18
+ ModelState["Undeploy"] = "UNDEPLOY";
19
+ })(ModelState || (ModelState = {}));
20
+ export var Definition;
21
+ (function (Definition) {
22
+ Definition.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
23
+ })(Definition || (Definition = {}));
24
+ export var FailureHandlingPolicy;
25
+ (function (FailureHandlingPolicy) {
26
+ FailureHandlingPolicy["DoNothing"] = "DO_NOTHING";
27
+ FailureHandlingPolicy["RollbackOnFailure"] = "ROLLBACK_ON_FAILURE";
28
+ })(FailureHandlingPolicy || (FailureHandlingPolicy = {}));
29
+ export var DeploymentType;
30
+ (function (DeploymentType) {
31
+ DeploymentType["Model"] = "Model";
32
+ })(DeploymentType || (DeploymentType = {}));
33
+ export var EdgeDeployment;
34
+ (function (EdgeDeployment) {
35
+ EdgeDeployment.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
36
+ })(EdgeDeployment || (EdgeDeployment = {}));
37
+ export var GetDeploymentsResult;
38
+ (function (GetDeploymentsResult) {
39
+ GetDeploymentsResult.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
40
+ })(GetDeploymentsResult || (GetDeploymentsResult = {}));
11
41
  var InternalServiceException = (function (_super) {
12
42
  __extends(InternalServiceException, _super);
13
43
  function InternalServiceException(opts) {
@@ -21,10 +51,31 @@ var InternalServiceException = (function (_super) {
21
51
  return InternalServiceException;
22
52
  }(__BaseException));
23
53
  export { InternalServiceException };
54
+ export var GetDeviceRegistrationRequest;
55
+ (function (GetDeviceRegistrationRequest) {
56
+ GetDeviceRegistrationRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
57
+ })(GetDeviceRegistrationRequest || (GetDeviceRegistrationRequest = {}));
58
+ export var GetDeviceRegistrationResult;
59
+ (function (GetDeviceRegistrationResult) {
60
+ GetDeviceRegistrationResult.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
61
+ })(GetDeviceRegistrationResult || (GetDeviceRegistrationResult = {}));
24
62
  export var EdgeMetric;
25
63
  (function (EdgeMetric) {
26
64
  EdgeMetric.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
27
65
  })(EdgeMetric || (EdgeMetric = {}));
66
+ export var DeploymentStatus;
67
+ (function (DeploymentStatus) {
68
+ DeploymentStatus["Fail"] = "FAIL";
69
+ DeploymentStatus["Success"] = "SUCCESS";
70
+ })(DeploymentStatus || (DeploymentStatus = {}));
71
+ export var DeploymentModel;
72
+ (function (DeploymentModel) {
73
+ DeploymentModel.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
74
+ })(DeploymentModel || (DeploymentModel = {}));
75
+ export var DeploymentResult;
76
+ (function (DeploymentResult) {
77
+ DeploymentResult.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
78
+ })(DeploymentResult || (DeploymentResult = {}));
28
79
  export var Model;
29
80
  (function (Model) {
30
81
  Model.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };