@aws-sdk/client-sagemaker-a2i-runtime 3.490.0 → 3.496.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/dist-cjs/index.js CHANGED
@@ -1,12 +1,842 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SageMakerA2IRuntimeServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./SageMakerA2IRuntimeClient"), exports);
6
- tslib_1.__exportStar(require("./SageMakerA2IRuntime"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./pagination"), exports);
9
- tslib_1.__exportStar(require("./models"), exports);
10
- require("@aws-sdk/util-endpoints");
11
- var SageMakerA2IRuntimeServiceException_1 = require("./models/SageMakerA2IRuntimeServiceException");
12
- Object.defineProperty(exports, "SageMakerA2IRuntimeServiceException", { enumerable: true, get: function () { return SageMakerA2IRuntimeServiceException_1.SageMakerA2IRuntimeServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ ConflictException: () => ConflictException,
25
+ ContentClassifier: () => ContentClassifier,
26
+ DeleteHumanLoopCommand: () => DeleteHumanLoopCommand,
27
+ DescribeHumanLoopCommand: () => DescribeHumanLoopCommand,
28
+ HumanLoopStatus: () => HumanLoopStatus,
29
+ InternalServerException: () => InternalServerException,
30
+ ListHumanLoopsCommand: () => ListHumanLoopsCommand,
31
+ ResourceNotFoundException: () => ResourceNotFoundException,
32
+ SageMakerA2IRuntime: () => SageMakerA2IRuntime,
33
+ SageMakerA2IRuntimeClient: () => SageMakerA2IRuntimeClient,
34
+ SageMakerA2IRuntimeServiceException: () => SageMakerA2IRuntimeServiceException,
35
+ ServiceQuotaExceededException: () => ServiceQuotaExceededException,
36
+ SortOrder: () => SortOrder,
37
+ StartHumanLoopCommand: () => StartHumanLoopCommand,
38
+ StopHumanLoopCommand: () => StopHumanLoopCommand,
39
+ ThrottlingException: () => ThrottlingException,
40
+ ValidationException: () => ValidationException,
41
+ __Client: () => import_smithy_client.Client,
42
+ paginateListHumanLoops: () => paginateListHumanLoops
43
+ });
44
+ module.exports = __toCommonJS(src_exports);
45
+
46
+ // src/SageMakerA2IRuntimeClient.ts
47
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
48
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
49
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
50
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
51
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
52
+ var import_config_resolver = require("@smithy/config-resolver");
53
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
54
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
55
+ var import_middleware_retry = require("@smithy/middleware-retry");
56
+
57
+
58
+ // src/endpoint/EndpointParameters.ts
59
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
60
+ return {
61
+ ...options,
62
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
63
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
64
+ defaultSigningName: "sagemaker"
65
+ };
66
+ }, "resolveClientEndpointParameters");
67
+ var commonParams = {
68
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
69
+ Endpoint: { type: "builtInParams", name: "endpoint" },
70
+ Region: { type: "builtInParams", name: "region" },
71
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
72
+ };
73
+
74
+ // src/SageMakerA2IRuntimeClient.ts
75
+ var import_runtimeConfig = require("././runtimeConfig");
76
+
77
+ // src/runtimeExtensions.ts
78
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
79
+ var import_protocol_http = require("@smithy/protocol-http");
80
+ var import_smithy_client = require("@smithy/smithy-client");
81
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
82
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
83
+ const extensionConfiguration = {
84
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
85
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
86
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
87
+ };
88
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
89
+ return {
90
+ ...runtimeConfig,
91
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
92
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
93
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
94
+ };
95
+ }, "resolveRuntimeExtensions");
96
+
97
+ // src/SageMakerA2IRuntimeClient.ts
98
+ var _SageMakerA2IRuntimeClient = class _SageMakerA2IRuntimeClient extends import_smithy_client.Client {
99
+ constructor(...[configuration]) {
100
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
101
+ const _config_1 = resolveClientEndpointParameters(_config_0);
102
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
103
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
104
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
105
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
106
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
107
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
108
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
109
+ super(_config_8);
110
+ this.config = _config_8;
111
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
112
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
113
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
114
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
115
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
116
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
117
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
118
+ }
119
+ /**
120
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
121
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
122
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
123
+ */
124
+ destroy() {
125
+ super.destroy();
126
+ }
127
+ };
128
+ __name(_SageMakerA2IRuntimeClient, "SageMakerA2IRuntimeClient");
129
+ var SageMakerA2IRuntimeClient = _SageMakerA2IRuntimeClient;
130
+
131
+ // src/SageMakerA2IRuntime.ts
132
+
133
+
134
+ // src/commands/DeleteHumanLoopCommand.ts
135
+
136
+ var import_middleware_serde = require("@smithy/middleware-serde");
137
+
138
+ var import_types = require("@smithy/types");
139
+
140
+ // src/protocols/Aws_restJson1.ts
141
+ var import_core = require("@smithy/core");
142
+
143
+
144
+ // src/models/SageMakerA2IRuntimeServiceException.ts
145
+
146
+ var _SageMakerA2IRuntimeServiceException = class _SageMakerA2IRuntimeServiceException extends import_smithy_client.ServiceException {
147
+ /**
148
+ * @internal
149
+ */
150
+ constructor(options) {
151
+ super(options);
152
+ Object.setPrototypeOf(this, _SageMakerA2IRuntimeServiceException.prototype);
153
+ }
154
+ };
155
+ __name(_SageMakerA2IRuntimeServiceException, "SageMakerA2IRuntimeServiceException");
156
+ var SageMakerA2IRuntimeServiceException = _SageMakerA2IRuntimeServiceException;
157
+
158
+ // src/models/models_0.ts
159
+ var _InternalServerException = class _InternalServerException extends SageMakerA2IRuntimeServiceException {
160
+ /**
161
+ * @internal
162
+ */
163
+ constructor(opts) {
164
+ super({
165
+ name: "InternalServerException",
166
+ $fault: "server",
167
+ ...opts
168
+ });
169
+ this.name = "InternalServerException";
170
+ this.$fault = "server";
171
+ Object.setPrototypeOf(this, _InternalServerException.prototype);
172
+ this.Message = opts.Message;
173
+ }
174
+ };
175
+ __name(_InternalServerException, "InternalServerException");
176
+ var InternalServerException = _InternalServerException;
177
+ var _ResourceNotFoundException = class _ResourceNotFoundException extends SageMakerA2IRuntimeServiceException {
178
+ /**
179
+ * @internal
180
+ */
181
+ constructor(opts) {
182
+ super({
183
+ name: "ResourceNotFoundException",
184
+ $fault: "client",
185
+ ...opts
186
+ });
187
+ this.name = "ResourceNotFoundException";
188
+ this.$fault = "client";
189
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
190
+ this.Message = opts.Message;
191
+ }
192
+ };
193
+ __name(_ResourceNotFoundException, "ResourceNotFoundException");
194
+ var ResourceNotFoundException = _ResourceNotFoundException;
195
+ var _ThrottlingException = class _ThrottlingException extends SageMakerA2IRuntimeServiceException {
196
+ /**
197
+ * @internal
198
+ */
199
+ constructor(opts) {
200
+ super({
201
+ name: "ThrottlingException",
202
+ $fault: "client",
203
+ ...opts
204
+ });
205
+ this.name = "ThrottlingException";
206
+ this.$fault = "client";
207
+ Object.setPrototypeOf(this, _ThrottlingException.prototype);
208
+ this.Message = opts.Message;
209
+ }
210
+ };
211
+ __name(_ThrottlingException, "ThrottlingException");
212
+ var ThrottlingException = _ThrottlingException;
213
+ var _ValidationException = class _ValidationException extends SageMakerA2IRuntimeServiceException {
214
+ /**
215
+ * @internal
216
+ */
217
+ constructor(opts) {
218
+ super({
219
+ name: "ValidationException",
220
+ $fault: "client",
221
+ ...opts
222
+ });
223
+ this.name = "ValidationException";
224
+ this.$fault = "client";
225
+ Object.setPrototypeOf(this, _ValidationException.prototype);
226
+ this.Message = opts.Message;
227
+ }
228
+ };
229
+ __name(_ValidationException, "ValidationException");
230
+ var ValidationException = _ValidationException;
231
+ var HumanLoopStatus = {
232
+ COMPLETED: "Completed",
233
+ FAILED: "Failed",
234
+ IN_PROGRESS: "InProgress",
235
+ STOPPED: "Stopped",
236
+ STOPPING: "Stopping"
237
+ };
238
+ var SortOrder = {
239
+ ASCENDING: "Ascending",
240
+ DESCENDING: "Descending"
241
+ };
242
+ var _ConflictException = class _ConflictException extends SageMakerA2IRuntimeServiceException {
243
+ /**
244
+ * @internal
245
+ */
246
+ constructor(opts) {
247
+ super({
248
+ name: "ConflictException",
249
+ $fault: "client",
250
+ ...opts
251
+ });
252
+ this.name = "ConflictException";
253
+ this.$fault = "client";
254
+ Object.setPrototypeOf(this, _ConflictException.prototype);
255
+ this.Message = opts.Message;
256
+ }
257
+ };
258
+ __name(_ConflictException, "ConflictException");
259
+ var ConflictException = _ConflictException;
260
+ var _ServiceQuotaExceededException = class _ServiceQuotaExceededException extends SageMakerA2IRuntimeServiceException {
261
+ /**
262
+ * @internal
263
+ */
264
+ constructor(opts) {
265
+ super({
266
+ name: "ServiceQuotaExceededException",
267
+ $fault: "client",
268
+ ...opts
269
+ });
270
+ this.name = "ServiceQuotaExceededException";
271
+ this.$fault = "client";
272
+ Object.setPrototypeOf(this, _ServiceQuotaExceededException.prototype);
273
+ this.Message = opts.Message;
274
+ }
275
+ };
276
+ __name(_ServiceQuotaExceededException, "ServiceQuotaExceededException");
277
+ var ServiceQuotaExceededException = _ServiceQuotaExceededException;
278
+ var ContentClassifier = {
279
+ FREE_OF_ADULT_CONTENT: "FreeOfAdultContent",
280
+ FREE_OF_PERSONALLY_IDENTIFIABLE_INFORMATION: "FreeOfPersonallyIdentifiableInformation"
281
+ };
282
+
283
+ // src/protocols/Aws_restJson1.ts
284
+ var se_DeleteHumanLoopCommand = /* @__PURE__ */ __name(async (input, context) => {
285
+ const b = (0, import_core.requestBuilder)(input, context);
286
+ const headers = {};
287
+ b.bp("/human-loops/{HumanLoopName}");
288
+ b.p("HumanLoopName", () => input.HumanLoopName, "{HumanLoopName}", false);
289
+ let body;
290
+ b.m("DELETE").h(headers).b(body);
291
+ return b.build();
292
+ }, "se_DeleteHumanLoopCommand");
293
+ var se_DescribeHumanLoopCommand = /* @__PURE__ */ __name(async (input, context) => {
294
+ const b = (0, import_core.requestBuilder)(input, context);
295
+ const headers = {};
296
+ b.bp("/human-loops/{HumanLoopName}");
297
+ b.p("HumanLoopName", () => input.HumanLoopName, "{HumanLoopName}", false);
298
+ let body;
299
+ b.m("GET").h(headers).b(body);
300
+ return b.build();
301
+ }, "se_DescribeHumanLoopCommand");
302
+ var se_ListHumanLoopsCommand = /* @__PURE__ */ __name(async (input, context) => {
303
+ const b = (0, import_core.requestBuilder)(input, context);
304
+ const headers = {};
305
+ b.bp("/human-loops");
306
+ const query = (0, import_smithy_client.map)({
307
+ [_CTA]: [
308
+ () => input.CreationTimeAfter !== void 0,
309
+ () => (input[_CTA].toISOString().split(".")[0] + "Z").toString()
310
+ ],
311
+ [_CTB]: [
312
+ () => input.CreationTimeBefore !== void 0,
313
+ () => (input[_CTB].toISOString().split(".")[0] + "Z").toString()
314
+ ],
315
+ [_FDA]: [, (0, import_smithy_client.expectNonNull)(input[_FDA], `FlowDefinitionArn`)],
316
+ [_SO]: [, input[_SO]],
317
+ [_NT]: [, input[_NT]],
318
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()]
319
+ });
320
+ let body;
321
+ b.m("GET").h(headers).q(query).b(body);
322
+ return b.build();
323
+ }, "se_ListHumanLoopsCommand");
324
+ var se_StartHumanLoopCommand = /* @__PURE__ */ __name(async (input, context) => {
325
+ const b = (0, import_core.requestBuilder)(input, context);
326
+ const headers = {
327
+ "content-type": "application/json"
328
+ };
329
+ b.bp("/human-loops");
330
+ let body;
331
+ body = JSON.stringify(
332
+ (0, import_smithy_client.take)(input, {
333
+ DataAttributes: (_) => (0, import_smithy_client._json)(_),
334
+ FlowDefinitionArn: [],
335
+ HumanLoopInput: (_) => (0, import_smithy_client._json)(_),
336
+ HumanLoopName: []
337
+ })
338
+ );
339
+ b.m("POST").h(headers).b(body);
340
+ return b.build();
341
+ }, "se_StartHumanLoopCommand");
342
+ var se_StopHumanLoopCommand = /* @__PURE__ */ __name(async (input, context) => {
343
+ const b = (0, import_core.requestBuilder)(input, context);
344
+ const headers = {
345
+ "content-type": "application/json"
346
+ };
347
+ b.bp("/human-loops/stop");
348
+ let body;
349
+ body = JSON.stringify(
350
+ (0, import_smithy_client.take)(input, {
351
+ HumanLoopName: []
352
+ })
353
+ );
354
+ b.m("POST").h(headers).b(body);
355
+ return b.build();
356
+ }, "se_StopHumanLoopCommand");
357
+ var de_DeleteHumanLoopCommand = /* @__PURE__ */ __name(async (output, context) => {
358
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
359
+ return de_DeleteHumanLoopCommandError(output, context);
360
+ }
361
+ const contents = (0, import_smithy_client.map)({
362
+ $metadata: deserializeMetadata(output)
363
+ });
364
+ await (0, import_smithy_client.collectBody)(output.body, context);
365
+ return contents;
366
+ }, "de_DeleteHumanLoopCommand");
367
+ var de_DeleteHumanLoopCommandError = /* @__PURE__ */ __name(async (output, context) => {
368
+ const parsedOutput = {
369
+ ...output,
370
+ body: await parseErrorBody(output.body, context)
371
+ };
372
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
373
+ switch (errorCode) {
374
+ case "InternalServerException":
375
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
376
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
377
+ case "ResourceNotFoundException":
378
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
379
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
380
+ case "ThrottlingException":
381
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
382
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
383
+ case "ValidationException":
384
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
385
+ throw await de_ValidationExceptionRes(parsedOutput, context);
386
+ default:
387
+ const parsedBody = parsedOutput.body;
388
+ return throwDefaultError({
389
+ output,
390
+ parsedBody,
391
+ errorCode
392
+ });
393
+ }
394
+ }, "de_DeleteHumanLoopCommandError");
395
+ var de_DescribeHumanLoopCommand = /* @__PURE__ */ __name(async (output, context) => {
396
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
397
+ return de_DescribeHumanLoopCommandError(output, context);
398
+ }
399
+ const contents = (0, import_smithy_client.map)({
400
+ $metadata: deserializeMetadata(output)
401
+ });
402
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
403
+ const doc = (0, import_smithy_client.take)(data, {
404
+ CreationTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
405
+ FailureCode: import_smithy_client.expectString,
406
+ FailureReason: import_smithy_client.expectString,
407
+ FlowDefinitionArn: import_smithy_client.expectString,
408
+ HumanLoopArn: import_smithy_client.expectString,
409
+ HumanLoopName: import_smithy_client.expectString,
410
+ HumanLoopOutput: import_smithy_client._json,
411
+ HumanLoopStatus: import_smithy_client.expectString
412
+ });
413
+ Object.assign(contents, doc);
414
+ return contents;
415
+ }, "de_DescribeHumanLoopCommand");
416
+ var de_DescribeHumanLoopCommandError = /* @__PURE__ */ __name(async (output, context) => {
417
+ const parsedOutput = {
418
+ ...output,
419
+ body: await parseErrorBody(output.body, context)
420
+ };
421
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ switch (errorCode) {
423
+ case "InternalServerException":
424
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
425
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
426
+ case "ResourceNotFoundException":
427
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
428
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
429
+ case "ThrottlingException":
430
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
431
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
432
+ case "ValidationException":
433
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
434
+ throw await de_ValidationExceptionRes(parsedOutput, context);
435
+ default:
436
+ const parsedBody = parsedOutput.body;
437
+ return throwDefaultError({
438
+ output,
439
+ parsedBody,
440
+ errorCode
441
+ });
442
+ }
443
+ }, "de_DescribeHumanLoopCommandError");
444
+ var de_ListHumanLoopsCommand = /* @__PURE__ */ __name(async (output, context) => {
445
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
446
+ return de_ListHumanLoopsCommandError(output, context);
447
+ }
448
+ const contents = (0, import_smithy_client.map)({
449
+ $metadata: deserializeMetadata(output)
450
+ });
451
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
452
+ const doc = (0, import_smithy_client.take)(data, {
453
+ HumanLoopSummaries: (_) => de_HumanLoopSummaries(_, context),
454
+ NextToken: import_smithy_client.expectString
455
+ });
456
+ Object.assign(contents, doc);
457
+ return contents;
458
+ }, "de_ListHumanLoopsCommand");
459
+ var de_ListHumanLoopsCommandError = /* @__PURE__ */ __name(async (output, context) => {
460
+ const parsedOutput = {
461
+ ...output,
462
+ body: await parseErrorBody(output.body, context)
463
+ };
464
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
465
+ switch (errorCode) {
466
+ case "InternalServerException":
467
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
468
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
469
+ case "ResourceNotFoundException":
470
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
471
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
472
+ case "ThrottlingException":
473
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
474
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
475
+ case "ValidationException":
476
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
477
+ throw await de_ValidationExceptionRes(parsedOutput, context);
478
+ default:
479
+ const parsedBody = parsedOutput.body;
480
+ return throwDefaultError({
481
+ output,
482
+ parsedBody,
483
+ errorCode
484
+ });
485
+ }
486
+ }, "de_ListHumanLoopsCommandError");
487
+ var de_StartHumanLoopCommand = /* @__PURE__ */ __name(async (output, context) => {
488
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
489
+ return de_StartHumanLoopCommandError(output, context);
490
+ }
491
+ const contents = (0, import_smithy_client.map)({
492
+ $metadata: deserializeMetadata(output)
493
+ });
494
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
495
+ const doc = (0, import_smithy_client.take)(data, {
496
+ HumanLoopArn: import_smithy_client.expectString
497
+ });
498
+ Object.assign(contents, doc);
499
+ return contents;
500
+ }, "de_StartHumanLoopCommand");
501
+ var de_StartHumanLoopCommandError = /* @__PURE__ */ __name(async (output, context) => {
502
+ const parsedOutput = {
503
+ ...output,
504
+ body: await parseErrorBody(output.body, context)
505
+ };
506
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
507
+ switch (errorCode) {
508
+ case "ConflictException":
509
+ case "com.amazonaws.sagemakera2iruntime#ConflictException":
510
+ throw await de_ConflictExceptionRes(parsedOutput, context);
511
+ case "InternalServerException":
512
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
513
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
514
+ case "ServiceQuotaExceededException":
515
+ case "com.amazonaws.sagemakera2iruntime#ServiceQuotaExceededException":
516
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
517
+ case "ThrottlingException":
518
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
519
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
520
+ case "ValidationException":
521
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
522
+ throw await de_ValidationExceptionRes(parsedOutput, context);
523
+ default:
524
+ const parsedBody = parsedOutput.body;
525
+ return throwDefaultError({
526
+ output,
527
+ parsedBody,
528
+ errorCode
529
+ });
530
+ }
531
+ }, "de_StartHumanLoopCommandError");
532
+ var de_StopHumanLoopCommand = /* @__PURE__ */ __name(async (output, context) => {
533
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
534
+ return de_StopHumanLoopCommandError(output, context);
535
+ }
536
+ const contents = (0, import_smithy_client.map)({
537
+ $metadata: deserializeMetadata(output)
538
+ });
539
+ await (0, import_smithy_client.collectBody)(output.body, context);
540
+ return contents;
541
+ }, "de_StopHumanLoopCommand");
542
+ var de_StopHumanLoopCommandError = /* @__PURE__ */ __name(async (output, context) => {
543
+ const parsedOutput = {
544
+ ...output,
545
+ body: await parseErrorBody(output.body, context)
546
+ };
547
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
548
+ switch (errorCode) {
549
+ case "InternalServerException":
550
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
551
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
552
+ case "ResourceNotFoundException":
553
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
554
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
555
+ case "ThrottlingException":
556
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
557
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
558
+ case "ValidationException":
559
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
560
+ throw await de_ValidationExceptionRes(parsedOutput, context);
561
+ default:
562
+ const parsedBody = parsedOutput.body;
563
+ return throwDefaultError({
564
+ output,
565
+ parsedBody,
566
+ errorCode
567
+ });
568
+ }
569
+ }, "de_StopHumanLoopCommandError");
570
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(SageMakerA2IRuntimeServiceException);
571
+ var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
572
+ const contents = (0, import_smithy_client.map)({});
573
+ const data = parsedOutput.body;
574
+ const doc = (0, import_smithy_client.take)(data, {
575
+ Message: import_smithy_client.expectString
576
+ });
577
+ Object.assign(contents, doc);
578
+ const exception = new ConflictException({
579
+ $metadata: deserializeMetadata(parsedOutput),
580
+ ...contents
581
+ });
582
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
583
+ }, "de_ConflictExceptionRes");
584
+ var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
585
+ const contents = (0, import_smithy_client.map)({});
586
+ const data = parsedOutput.body;
587
+ const doc = (0, import_smithy_client.take)(data, {
588
+ Message: import_smithy_client.expectString
589
+ });
590
+ Object.assign(contents, doc);
591
+ const exception = new InternalServerException({
592
+ $metadata: deserializeMetadata(parsedOutput),
593
+ ...contents
594
+ });
595
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
596
+ }, "de_InternalServerExceptionRes");
597
+ var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
598
+ const contents = (0, import_smithy_client.map)({});
599
+ const data = parsedOutput.body;
600
+ const doc = (0, import_smithy_client.take)(data, {
601
+ Message: import_smithy_client.expectString
602
+ });
603
+ Object.assign(contents, doc);
604
+ const exception = new ResourceNotFoundException({
605
+ $metadata: deserializeMetadata(parsedOutput),
606
+ ...contents
607
+ });
608
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
609
+ }, "de_ResourceNotFoundExceptionRes");
610
+ var de_ServiceQuotaExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
611
+ const contents = (0, import_smithy_client.map)({});
612
+ const data = parsedOutput.body;
613
+ const doc = (0, import_smithy_client.take)(data, {
614
+ Message: import_smithy_client.expectString
615
+ });
616
+ Object.assign(contents, doc);
617
+ const exception = new ServiceQuotaExceededException({
618
+ $metadata: deserializeMetadata(parsedOutput),
619
+ ...contents
620
+ });
621
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
622
+ }, "de_ServiceQuotaExceededExceptionRes");
623
+ var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
624
+ const contents = (0, import_smithy_client.map)({});
625
+ const data = parsedOutput.body;
626
+ const doc = (0, import_smithy_client.take)(data, {
627
+ Message: import_smithy_client.expectString
628
+ });
629
+ Object.assign(contents, doc);
630
+ const exception = new ThrottlingException({
631
+ $metadata: deserializeMetadata(parsedOutput),
632
+ ...contents
633
+ });
634
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
635
+ }, "de_ThrottlingExceptionRes");
636
+ var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
637
+ const contents = (0, import_smithy_client.map)({});
638
+ const data = parsedOutput.body;
639
+ const doc = (0, import_smithy_client.take)(data, {
640
+ Message: import_smithy_client.expectString
641
+ });
642
+ Object.assign(contents, doc);
643
+ const exception = new ValidationException({
644
+ $metadata: deserializeMetadata(parsedOutput),
645
+ ...contents
646
+ });
647
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
648
+ }, "de_ValidationExceptionRes");
649
+ var de_HumanLoopSummaries = /* @__PURE__ */ __name((output, context) => {
650
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
651
+ return de_HumanLoopSummary(entry, context);
652
+ });
653
+ return retVal;
654
+ }, "de_HumanLoopSummaries");
655
+ var de_HumanLoopSummary = /* @__PURE__ */ __name((output, context) => {
656
+ return (0, import_smithy_client.take)(output, {
657
+ CreationTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
658
+ FailureReason: import_smithy_client.expectString,
659
+ FlowDefinitionArn: import_smithy_client.expectString,
660
+ HumanLoopName: import_smithy_client.expectString,
661
+ HumanLoopStatus: import_smithy_client.expectString
662
+ });
663
+ }, "de_HumanLoopSummary");
664
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
665
+ httpStatusCode: output.statusCode,
666
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
667
+ extendedRequestId: output.headers["x-amz-id-2"],
668
+ cfId: output.headers["x-amz-cf-id"]
669
+ }), "deserializeMetadata");
670
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
671
+ var _CTA = "CreationTimeAfter";
672
+ var _CTB = "CreationTimeBefore";
673
+ var _FDA = "FlowDefinitionArn";
674
+ var _MR = "MaxResults";
675
+ var _NT = "NextToken";
676
+ var _SO = "SortOrder";
677
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
678
+ if (encoded.length) {
679
+ return JSON.parse(encoded);
680
+ }
681
+ return {};
682
+ }), "parseBody");
683
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
684
+ const value = await parseBody(errorBody, context);
685
+ value.message = value.message ?? value.Message;
686
+ return value;
687
+ }, "parseErrorBody");
688
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
689
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
690
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
691
+ let cleanValue = rawValue;
692
+ if (typeof cleanValue === "number") {
693
+ cleanValue = cleanValue.toString();
694
+ }
695
+ if (cleanValue.indexOf(",") >= 0) {
696
+ cleanValue = cleanValue.split(",")[0];
697
+ }
698
+ if (cleanValue.indexOf(":") >= 0) {
699
+ cleanValue = cleanValue.split(":")[0];
700
+ }
701
+ if (cleanValue.indexOf("#") >= 0) {
702
+ cleanValue = cleanValue.split("#")[1];
703
+ }
704
+ return cleanValue;
705
+ }, "sanitizeErrorCode");
706
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
707
+ if (headerKey !== void 0) {
708
+ return sanitizeErrorCode(output.headers[headerKey]);
709
+ }
710
+ if (data.code !== void 0) {
711
+ return sanitizeErrorCode(data.code);
712
+ }
713
+ if (data["__type"] !== void 0) {
714
+ return sanitizeErrorCode(data["__type"]);
715
+ }
716
+ }, "loadRestJsonErrorCode");
717
+
718
+ // src/commands/DeleteHumanLoopCommand.ts
719
+ var _DeleteHumanLoopCommand = class _DeleteHumanLoopCommand extends import_smithy_client.Command.classBuilder().ep({
720
+ ...commonParams
721
+ }).m(function(Command, cs, config, o) {
722
+ return [
723
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
724
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
725
+ ];
726
+ }).s("AmazonSageMakerA2IRuntime", "DeleteHumanLoop", {}).n("SageMakerA2IRuntimeClient", "DeleteHumanLoopCommand").f(void 0, void 0).ser(se_DeleteHumanLoopCommand).de(de_DeleteHumanLoopCommand).build() {
727
+ };
728
+ __name(_DeleteHumanLoopCommand, "DeleteHumanLoopCommand");
729
+ var DeleteHumanLoopCommand = _DeleteHumanLoopCommand;
730
+
731
+ // src/commands/DescribeHumanLoopCommand.ts
732
+
733
+
734
+
735
+
736
+ var _DescribeHumanLoopCommand = class _DescribeHumanLoopCommand extends import_smithy_client.Command.classBuilder().ep({
737
+ ...commonParams
738
+ }).m(function(Command, cs, config, o) {
739
+ return [
740
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
741
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
742
+ ];
743
+ }).s("AmazonSageMakerA2IRuntime", "DescribeHumanLoop", {}).n("SageMakerA2IRuntimeClient", "DescribeHumanLoopCommand").f(void 0, void 0).ser(se_DescribeHumanLoopCommand).de(de_DescribeHumanLoopCommand).build() {
744
+ };
745
+ __name(_DescribeHumanLoopCommand, "DescribeHumanLoopCommand");
746
+ var DescribeHumanLoopCommand = _DescribeHumanLoopCommand;
747
+
748
+ // src/commands/ListHumanLoopsCommand.ts
749
+
750
+
751
+
752
+
753
+ var _ListHumanLoopsCommand = class _ListHumanLoopsCommand extends import_smithy_client.Command.classBuilder().ep({
754
+ ...commonParams
755
+ }).m(function(Command, cs, config, o) {
756
+ return [
757
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
758
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
759
+ ];
760
+ }).s("AmazonSageMakerA2IRuntime", "ListHumanLoops", {}).n("SageMakerA2IRuntimeClient", "ListHumanLoopsCommand").f(void 0, void 0).ser(se_ListHumanLoopsCommand).de(de_ListHumanLoopsCommand).build() {
761
+ };
762
+ __name(_ListHumanLoopsCommand, "ListHumanLoopsCommand");
763
+ var ListHumanLoopsCommand = _ListHumanLoopsCommand;
764
+
765
+ // src/commands/StartHumanLoopCommand.ts
766
+
767
+
768
+
769
+
770
+ var _StartHumanLoopCommand = class _StartHumanLoopCommand extends import_smithy_client.Command.classBuilder().ep({
771
+ ...commonParams
772
+ }).m(function(Command, cs, config, o) {
773
+ return [
774
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
775
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
776
+ ];
777
+ }).s("AmazonSageMakerA2IRuntime", "StartHumanLoop", {}).n("SageMakerA2IRuntimeClient", "StartHumanLoopCommand").f(void 0, void 0).ser(se_StartHumanLoopCommand).de(de_StartHumanLoopCommand).build() {
778
+ };
779
+ __name(_StartHumanLoopCommand, "StartHumanLoopCommand");
780
+ var StartHumanLoopCommand = _StartHumanLoopCommand;
781
+
782
+ // src/commands/StopHumanLoopCommand.ts
783
+
784
+
785
+
786
+
787
+ var _StopHumanLoopCommand = class _StopHumanLoopCommand extends import_smithy_client.Command.classBuilder().ep({
788
+ ...commonParams
789
+ }).m(function(Command, cs, config, o) {
790
+ return [
791
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
792
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
793
+ ];
794
+ }).s("AmazonSageMakerA2IRuntime", "StopHumanLoop", {}).n("SageMakerA2IRuntimeClient", "StopHumanLoopCommand").f(void 0, void 0).ser(se_StopHumanLoopCommand).de(de_StopHumanLoopCommand).build() {
795
+ };
796
+ __name(_StopHumanLoopCommand, "StopHumanLoopCommand");
797
+ var StopHumanLoopCommand = _StopHumanLoopCommand;
798
+
799
+ // src/SageMakerA2IRuntime.ts
800
+ var commands = {
801
+ DeleteHumanLoopCommand,
802
+ DescribeHumanLoopCommand,
803
+ ListHumanLoopsCommand,
804
+ StartHumanLoopCommand,
805
+ StopHumanLoopCommand
806
+ };
807
+ var _SageMakerA2IRuntime = class _SageMakerA2IRuntime extends SageMakerA2IRuntimeClient {
808
+ };
809
+ __name(_SageMakerA2IRuntime, "SageMakerA2IRuntime");
810
+ var SageMakerA2IRuntime = _SageMakerA2IRuntime;
811
+ (0, import_smithy_client.createAggregatedClient)(commands, SageMakerA2IRuntime);
812
+
813
+ // src/pagination/ListHumanLoopsPaginator.ts
814
+
815
+ var paginateListHumanLoops = (0, import_core.createPaginator)(SageMakerA2IRuntimeClient, ListHumanLoopsCommand, "NextToken", "NextToken", "MaxResults");
816
+
817
+ // src/index.ts
818
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
819
+ // Annotate the CommonJS export names for ESM import in node:
820
+
821
+ 0 && (module.exports = {
822
+ ConflictException,
823
+ ContentClassifier,
824
+ DeleteHumanLoopCommand,
825
+ DescribeHumanLoopCommand,
826
+ HumanLoopStatus,
827
+ InternalServerException,
828
+ ListHumanLoopsCommand,
829
+ ResourceNotFoundException,
830
+ SageMakerA2IRuntime,
831
+ SageMakerA2IRuntimeClient,
832
+ SageMakerA2IRuntimeServiceException,
833
+ ServiceQuotaExceededException,
834
+ SortOrder,
835
+ StartHumanLoopCommand,
836
+ StopHumanLoopCommand,
837
+ ThrottlingException,
838
+ ValidationException,
839
+ __Client,
840
+ paginateListHumanLoops
841
+ });
842
+