@aws-sdk/client-kafka 3.43.0 → 3.47.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist-cjs/Kafka.js +45 -0
  3. package/dist-cjs/commands/CreateClusterV2Command.js +36 -0
  4. package/dist-cjs/commands/DescribeClusterV2Command.js +36 -0
  5. package/dist-cjs/commands/ListClustersV2Command.js +36 -0
  6. package/dist-cjs/commands/index.js +3 -0
  7. package/dist-cjs/endpoints.js +1 -0
  8. package/dist-cjs/models/models_0.js +132 -91
  9. package/dist-cjs/pagination/ListClustersV2Paginator.js +35 -0
  10. package/dist-cjs/pagination/index.js +1 -0
  11. package/dist-cjs/protocols/Aws_restJson1.js +546 -2
  12. package/dist-cjs/runtimeConfig.browser.js +7 -2
  13. package/dist-cjs/runtimeConfig.js +9 -3
  14. package/dist-es/Kafka.js +45 -0
  15. package/dist-es/commands/CreateClusterV2Command.js +39 -0
  16. package/dist-es/commands/DescribeClusterV2Command.js +39 -0
  17. package/dist-es/commands/ListClustersV2Command.js +39 -0
  18. package/dist-es/commands/index.js +3 -0
  19. package/dist-es/endpoints.js +1 -0
  20. package/dist-es/models/models_0.js +92 -63
  21. package/dist-es/pagination/ListClustersV2Paginator.js +74 -0
  22. package/dist-es/pagination/index.js +1 -0
  23. package/dist-es/protocols/Aws_restJson1.js +571 -0
  24. package/dist-es/runtimeConfig.browser.js +12 -3
  25. package/dist-es/runtimeConfig.js +13 -6
  26. package/dist-types/Kafka.d.ts +21 -0
  27. package/dist-types/KafkaClient.d.ts +10 -3
  28. package/dist-types/commands/CreateClusterV2Command.d.ts +35 -0
  29. package/dist-types/commands/DescribeClusterV2Command.d.ts +35 -0
  30. package/dist-types/commands/ListClustersV2Command.d.ts +35 -0
  31. package/dist-types/commands/index.d.ts +3 -0
  32. package/dist-types/models/models_0.d.ts +430 -116
  33. package/dist-types/pagination/ListClustersV2Paginator.d.ts +4 -0
  34. package/dist-types/pagination/index.d.ts +1 -0
  35. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  36. package/dist-types/runtimeConfig.browser.d.ts +3 -2
  37. package/dist-types/runtimeConfig.d.ts +4 -3
  38. package/dist-types/runtimeConfig.native.d.ts +1 -0
  39. package/dist-types/ts3.4/Kafka.d.ts +15 -0
  40. package/dist-types/ts3.4/KafkaClient.d.ts +8 -3
  41. package/dist-types/ts3.4/commands/CreateClusterV2Command.d.ts +17 -0
  42. package/dist-types/ts3.4/commands/DescribeClusterV2Command.d.ts +17 -0
  43. package/dist-types/ts3.4/commands/ListClustersV2Command.d.ts +17 -0
  44. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  45. package/dist-types/ts3.4/models/models_0.d.ts +255 -79
  46. package/dist-types/ts3.4/pagination/ListClustersV2Paginator.d.ts +4 -0
  47. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  48. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +9 -0
  49. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -2
  50. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -3
  51. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
  52. package/package.json +38 -45
@@ -118,6 +118,35 @@ export var serializeAws_restJson1CreateClusterCommand = function (input, context
118
118
  }
119
119
  });
120
120
  }); };
121
+ export var serializeAws_restJson1CreateClusterV2Command = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
122
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
123
+ return __generator(this, function (_c) {
124
+ switch (_c.label) {
125
+ case 0: return [4, context.endpoint()];
126
+ case 1:
127
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
128
+ headers = {
129
+ "content-type": "application/json",
130
+ };
131
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/api/v2/clusters";
132
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.ClusterName !== undefined && input.ClusterName !== null && { clusterName: input.ClusterName })), (input.Provisioned !== undefined &&
133
+ input.Provisioned !== null && {
134
+ provisioned: serializeAws_restJson1ProvisionedRequest(input.Provisioned, context),
135
+ })), (input.Serverless !== undefined &&
136
+ input.Serverless !== null && { serverless: serializeAws_restJson1ServerlessRequest(input.Serverless, context) })), (input.Tags !== undefined &&
137
+ input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
138
+ return [2, new __HttpRequest({
139
+ protocol: protocol,
140
+ hostname: hostname,
141
+ port: port,
142
+ method: "POST",
143
+ headers: headers,
144
+ path: resolvedPath,
145
+ body: body,
146
+ })];
147
+ }
148
+ });
149
+ }); };
121
150
  export var serializeAws_restJson1CreateConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
122
151
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
123
152
  return __generator(this, function (_c) {
@@ -272,6 +301,37 @@ export var serializeAws_restJson1DescribeClusterOperationCommand = function (inp
272
301
  }
273
302
  });
274
303
  }); };
304
+ export var serializeAws_restJson1DescribeClusterV2Command = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
305
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
306
+ return __generator(this, function (_c) {
307
+ switch (_c.label) {
308
+ case 0: return [4, context.endpoint()];
309
+ case 1:
310
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
311
+ headers = {};
312
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/api/v2/clusters/{ClusterArn}";
313
+ if (input.ClusterArn !== undefined) {
314
+ labelValue = input.ClusterArn;
315
+ if (labelValue.length <= 0) {
316
+ throw new Error("Empty value provided for input HTTP label: ClusterArn.");
317
+ }
318
+ resolvedPath = resolvedPath.replace("{ClusterArn}", __extendedEncodeURIComponent(labelValue));
319
+ }
320
+ else {
321
+ throw new Error("No value provided for input HTTP label: ClusterArn.");
322
+ }
323
+ return [2, new __HttpRequest({
324
+ protocol: protocol,
325
+ hostname: hostname,
326
+ port: port,
327
+ method: "GET",
328
+ headers: headers,
329
+ path: resolvedPath,
330
+ body: body,
331
+ })];
332
+ }
333
+ });
334
+ }); };
275
335
  export var serializeAws_restJson1DescribeConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
276
336
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
277
337
  return __generator(this, function (_c) {
@@ -456,6 +516,29 @@ export var serializeAws_restJson1ListClustersCommand = function (input, context)
456
516
  }
457
517
  });
458
518
  }); };
519
+ export var serializeAws_restJson1ListClustersV2Command = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
520
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
521
+ return __generator(this, function (_c) {
522
+ switch (_c.label) {
523
+ case 0: return [4, context.endpoint()];
524
+ case 1:
525
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
526
+ headers = {};
527
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/api/v2/clusters";
528
+ query = __assign(__assign(__assign(__assign({}, (input.ClusterNameFilter !== undefined && { clusterNameFilter: input.ClusterNameFilter })), (input.ClusterTypeFilter !== undefined && { clusterTypeFilter: input.ClusterTypeFilter })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
529
+ return [2, new __HttpRequest({
530
+ protocol: protocol,
531
+ hostname: hostname,
532
+ port: port,
533
+ method: "GET",
534
+ headers: headers,
535
+ path: resolvedPath,
536
+ query: query,
537
+ body: body,
538
+ })];
539
+ }
540
+ });
541
+ }); };
459
542
  export var serializeAws_restJson1ListConfigurationRevisionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
460
543
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
461
544
  return __generator(this, function (_c) {
@@ -1422,6 +1505,128 @@ var deserializeAws_restJson1CreateClusterCommandError = function (output, contex
1422
1505
  }
1423
1506
  });
1424
1507
  }); };
1508
+ export var deserializeAws_restJson1CreateClusterV2Command = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1509
+ var contents, data, _a, _b;
1510
+ return __generator(this, function (_c) {
1511
+ switch (_c.label) {
1512
+ case 0:
1513
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1514
+ return [2, deserializeAws_restJson1CreateClusterV2CommandError(output, context)];
1515
+ }
1516
+ contents = {
1517
+ $metadata: deserializeMetadata(output),
1518
+ ClusterArn: undefined,
1519
+ ClusterName: undefined,
1520
+ ClusterType: undefined,
1521
+ State: undefined,
1522
+ };
1523
+ _a = __expectNonNull;
1524
+ _b = __expectObject;
1525
+ return [4, parseBody(output.body, context)];
1526
+ case 1:
1527
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1528
+ if (data.clusterArn !== undefined && data.clusterArn !== null) {
1529
+ contents.ClusterArn = __expectString(data.clusterArn);
1530
+ }
1531
+ if (data.clusterName !== undefined && data.clusterName !== null) {
1532
+ contents.ClusterName = __expectString(data.clusterName);
1533
+ }
1534
+ if (data.clusterType !== undefined && data.clusterType !== null) {
1535
+ contents.ClusterType = __expectString(data.clusterType);
1536
+ }
1537
+ if (data.state !== undefined && data.state !== null) {
1538
+ contents.State = __expectString(data.state);
1539
+ }
1540
+ return [2, Promise.resolve(contents)];
1541
+ }
1542
+ });
1543
+ }); };
1544
+ var deserializeAws_restJson1CreateClusterV2CommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1545
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
1546
+ var _k;
1547
+ return __generator(this, function (_l) {
1548
+ switch (_l.label) {
1549
+ case 0:
1550
+ _a = [__assign({}, output)];
1551
+ _k = {};
1552
+ return [4, parseBody(output.body, context)];
1553
+ case 1:
1554
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
1555
+ errorCode = "UnknownError";
1556
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1557
+ _b = errorCode;
1558
+ switch (_b) {
1559
+ case "BadRequestException": return [3, 2];
1560
+ case "com.amazonaws.kafka#BadRequestException": return [3, 2];
1561
+ case "ConflictException": return [3, 4];
1562
+ case "com.amazonaws.kafka#ConflictException": return [3, 4];
1563
+ case "ForbiddenException": return [3, 6];
1564
+ case "com.amazonaws.kafka#ForbiddenException": return [3, 6];
1565
+ case "InternalServerErrorException": return [3, 8];
1566
+ case "com.amazonaws.kafka#InternalServerErrorException": return [3, 8];
1567
+ case "ServiceUnavailableException": return [3, 10];
1568
+ case "com.amazonaws.kafka#ServiceUnavailableException": return [3, 10];
1569
+ case "TooManyRequestsException": return [3, 12];
1570
+ case "com.amazonaws.kafka#TooManyRequestsException": return [3, 12];
1571
+ case "UnauthorizedException": return [3, 14];
1572
+ case "com.amazonaws.kafka#UnauthorizedException": return [3, 14];
1573
+ }
1574
+ return [3, 16];
1575
+ case 2:
1576
+ _c = [{}];
1577
+ return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1578
+ case 3:
1579
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1580
+ return [3, 17];
1581
+ case 4:
1582
+ _d = [{}];
1583
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1584
+ case 5:
1585
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1586
+ return [3, 17];
1587
+ case 6:
1588
+ _e = [{}];
1589
+ return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1590
+ case 7:
1591
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1592
+ return [3, 17];
1593
+ case 8:
1594
+ _f = [{}];
1595
+ return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1596
+ case 9:
1597
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1598
+ return [3, 17];
1599
+ case 10:
1600
+ _g = [{}];
1601
+ return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1602
+ case 11:
1603
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1604
+ return [3, 17];
1605
+ case 12:
1606
+ _h = [{}];
1607
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1608
+ case 13:
1609
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1610
+ return [3, 17];
1611
+ case 14:
1612
+ _j = [{}];
1613
+ return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
1614
+ case 15:
1615
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1616
+ return [3, 17];
1617
+ case 16:
1618
+ parsedBody = parsedOutput.body;
1619
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1620
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1621
+ _l.label = 17;
1622
+ case 17:
1623
+ message = response.message || response.Message || errorCode;
1624
+ response.message = message;
1625
+ delete response.Message;
1626
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1627
+ }
1628
+ });
1629
+ }); };
1425
1630
  export var deserializeAws_restJson1CreateConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1426
1631
  var contents, data, _a, _b;
1427
1632
  return __generator(this, function (_c) {
@@ -1916,6 +2121,100 @@ var deserializeAws_restJson1DescribeClusterOperationCommandError = function (out
1916
2121
  }
1917
2122
  });
1918
2123
  }); };
2124
+ export var deserializeAws_restJson1DescribeClusterV2Command = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2125
+ var contents, data, _a, _b;
2126
+ return __generator(this, function (_c) {
2127
+ switch (_c.label) {
2128
+ case 0:
2129
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2130
+ return [2, deserializeAws_restJson1DescribeClusterV2CommandError(output, context)];
2131
+ }
2132
+ contents = {
2133
+ $metadata: deserializeMetadata(output),
2134
+ ClusterInfo: undefined,
2135
+ };
2136
+ _a = __expectNonNull;
2137
+ _b = __expectObject;
2138
+ return [4, parseBody(output.body, context)];
2139
+ case 1:
2140
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2141
+ if (data.clusterInfo !== undefined && data.clusterInfo !== null) {
2142
+ contents.ClusterInfo = deserializeAws_restJson1Cluster(data.clusterInfo, context);
2143
+ }
2144
+ return [2, Promise.resolve(contents)];
2145
+ }
2146
+ });
2147
+ }); };
2148
+ var deserializeAws_restJson1DescribeClusterV2CommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2149
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2150
+ var _h;
2151
+ return __generator(this, function (_j) {
2152
+ switch (_j.label) {
2153
+ case 0:
2154
+ _a = [__assign({}, output)];
2155
+ _h = {};
2156
+ return [4, parseBody(output.body, context)];
2157
+ case 1:
2158
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2159
+ errorCode = "UnknownError";
2160
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2161
+ _b = errorCode;
2162
+ switch (_b) {
2163
+ case "BadRequestException": return [3, 2];
2164
+ case "com.amazonaws.kafka#BadRequestException": return [3, 2];
2165
+ case "ForbiddenException": return [3, 4];
2166
+ case "com.amazonaws.kafka#ForbiddenException": return [3, 4];
2167
+ case "InternalServerErrorException": return [3, 6];
2168
+ case "com.amazonaws.kafka#InternalServerErrorException": return [3, 6];
2169
+ case "NotFoundException": return [3, 8];
2170
+ case "com.amazonaws.kafka#NotFoundException": return [3, 8];
2171
+ case "UnauthorizedException": return [3, 10];
2172
+ case "com.amazonaws.kafka#UnauthorizedException": return [3, 10];
2173
+ }
2174
+ return [3, 12];
2175
+ case 2:
2176
+ _c = [{}];
2177
+ return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2178
+ case 3:
2179
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2180
+ return [3, 13];
2181
+ case 4:
2182
+ _d = [{}];
2183
+ return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2184
+ case 5:
2185
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2186
+ return [3, 13];
2187
+ case 6:
2188
+ _e = [{}];
2189
+ return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2190
+ case 7:
2191
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2192
+ return [3, 13];
2193
+ case 8:
2194
+ _f = [{}];
2195
+ return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2196
+ case 9:
2197
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2198
+ return [3, 13];
2199
+ case 10:
2200
+ _g = [{}];
2201
+ return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
2202
+ case 11:
2203
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2204
+ return [3, 13];
2205
+ case 12:
2206
+ parsedBody = parsedOutput.body;
2207
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2208
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2209
+ _j.label = 13;
2210
+ case 13:
2211
+ message = response.message || response.Message || errorCode;
2212
+ response.message = message;
2213
+ delete response.Message;
2214
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2215
+ }
2216
+ });
2217
+ }); };
1919
2218
  export var deserializeAws_restJson1DescribeConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1920
2219
  var contents, data, _a, _b;
1921
2220
  return __generator(this, function (_c) {
@@ -2568,6 +2867,96 @@ var deserializeAws_restJson1ListClustersCommandError = function (output, context
2568
2867
  }
2569
2868
  });
2570
2869
  }); };
2870
+ export var deserializeAws_restJson1ListClustersV2Command = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2871
+ var contents, data, _a, _b;
2872
+ return __generator(this, function (_c) {
2873
+ switch (_c.label) {
2874
+ case 0:
2875
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2876
+ return [2, deserializeAws_restJson1ListClustersV2CommandError(output, context)];
2877
+ }
2878
+ contents = {
2879
+ $metadata: deserializeMetadata(output),
2880
+ ClusterInfoList: undefined,
2881
+ NextToken: undefined,
2882
+ };
2883
+ _a = __expectNonNull;
2884
+ _b = __expectObject;
2885
+ return [4, parseBody(output.body, context)];
2886
+ case 1:
2887
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2888
+ if (data.clusterInfoList !== undefined && data.clusterInfoList !== null) {
2889
+ contents.ClusterInfoList = deserializeAws_restJson1__listOfCluster(data.clusterInfoList, context);
2890
+ }
2891
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2892
+ contents.NextToken = __expectString(data.nextToken);
2893
+ }
2894
+ return [2, Promise.resolve(contents)];
2895
+ }
2896
+ });
2897
+ }); };
2898
+ var deserializeAws_restJson1ListClustersV2CommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2899
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
2900
+ var _g;
2901
+ return __generator(this, function (_h) {
2902
+ switch (_h.label) {
2903
+ case 0:
2904
+ _a = [__assign({}, output)];
2905
+ _g = {};
2906
+ return [4, parseBody(output.body, context)];
2907
+ case 1:
2908
+ parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
2909
+ errorCode = "UnknownError";
2910
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2911
+ _b = errorCode;
2912
+ switch (_b) {
2913
+ case "BadRequestException": return [3, 2];
2914
+ case "com.amazonaws.kafka#BadRequestException": return [3, 2];
2915
+ case "ForbiddenException": return [3, 4];
2916
+ case "com.amazonaws.kafka#ForbiddenException": return [3, 4];
2917
+ case "InternalServerErrorException": return [3, 6];
2918
+ case "com.amazonaws.kafka#InternalServerErrorException": return [3, 6];
2919
+ case "UnauthorizedException": return [3, 8];
2920
+ case "com.amazonaws.kafka#UnauthorizedException": return [3, 8];
2921
+ }
2922
+ return [3, 10];
2923
+ case 2:
2924
+ _c = [{}];
2925
+ return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2926
+ case 3:
2927
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2928
+ return [3, 11];
2929
+ case 4:
2930
+ _d = [{}];
2931
+ return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2932
+ case 5:
2933
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2934
+ return [3, 11];
2935
+ case 6:
2936
+ _e = [{}];
2937
+ return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2938
+ case 7:
2939
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2940
+ return [3, 11];
2941
+ case 8:
2942
+ _f = [{}];
2943
+ return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
2944
+ case 9:
2945
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2946
+ return [3, 11];
2947
+ case 10:
2948
+ parsedBody = parsedOutput.body;
2949
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2950
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2951
+ _h.label = 11;
2952
+ case 11:
2953
+ message = response.message || response.Message || errorCode;
2954
+ response.message = message;
2955
+ delete response.Message;
2956
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2957
+ }
2958
+ });
2959
+ }); };
2571
2960
  export var deserializeAws_restJson1ListConfigurationRevisionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2572
2961
  var contents, data, _a, _b;
2573
2962
  return __generator(this, function (_c) {
@@ -4536,6 +4925,16 @@ var serializeAws_restJson1__listOfBrokerEBSVolumeInfo = function (input, context
4536
4925
  return serializeAws_restJson1BrokerEBSVolumeInfo(entry, context);
4537
4926
  });
4538
4927
  };
4928
+ var serializeAws_restJson1__listOfVpcConfig = function (input, context) {
4929
+ return input
4930
+ .filter(function (e) { return e != null; })
4931
+ .map(function (entry) {
4932
+ if (entry === null) {
4933
+ return null;
4934
+ }
4935
+ return serializeAws_restJson1VpcConfig(entry, context);
4936
+ });
4937
+ };
4539
4938
  var serializeAws_restJson1__mapOf__string = function (input, context) {
4540
4939
  return Object.entries(input).reduce(function (acc, _a) {
4541
4940
  var _b;
@@ -4636,6 +5035,27 @@ var serializeAws_restJson1PrometheusInfo = function (input, context) {
4636
5035
  nodeExporter: serializeAws_restJson1NodeExporterInfo(input.NodeExporter, context),
4637
5036
  }));
4638
5037
  };
5038
+ var serializeAws_restJson1ProvisionedRequest = function (input, context) {
5039
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.BrokerNodeGroupInfo !== undefined &&
5040
+ input.BrokerNodeGroupInfo !== null && {
5041
+ brokerNodeGroupInfo: serializeAws_restJson1BrokerNodeGroupInfo(input.BrokerNodeGroupInfo, context),
5042
+ })), (input.ClientAuthentication !== undefined &&
5043
+ input.ClientAuthentication !== null && {
5044
+ clientAuthentication: serializeAws_restJson1ClientAuthentication(input.ClientAuthentication, context),
5045
+ })), (input.ConfigurationInfo !== undefined &&
5046
+ input.ConfigurationInfo !== null && {
5047
+ configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context),
5048
+ })), (input.EncryptionInfo !== undefined &&
5049
+ input.EncryptionInfo !== null && {
5050
+ encryptionInfo: serializeAws_restJson1EncryptionInfo(input.EncryptionInfo, context),
5051
+ })), (input.EnhancedMonitoring !== undefined &&
5052
+ input.EnhancedMonitoring !== null && { enhancedMonitoring: input.EnhancedMonitoring })), (input.KafkaVersion !== undefined && input.KafkaVersion !== null && { kafkaVersion: input.KafkaVersion })), (input.LoggingInfo !== undefined &&
5053
+ input.LoggingInfo !== null && { loggingInfo: serializeAws_restJson1LoggingInfo(input.LoggingInfo, context) })), (input.NumberOfBrokerNodes !== undefined &&
5054
+ input.NumberOfBrokerNodes !== null && { numberOfBrokerNodes: input.NumberOfBrokerNodes })), (input.OpenMonitoring !== undefined &&
5055
+ input.OpenMonitoring !== null && {
5056
+ openMonitoring: serializeAws_restJson1OpenMonitoringInfo(input.OpenMonitoring, context),
5057
+ }));
5058
+ };
4639
5059
  var serializeAws_restJson1PublicAccess = function (input, context) {
4640
5060
  return __assign({}, (input.Type !== undefined && input.Type !== null && { type: input.Type }));
4641
5061
  };
@@ -4649,6 +5069,20 @@ var serializeAws_restJson1Sasl = function (input, context) {
4649
5069
  var serializeAws_restJson1Scram = function (input, context) {
4650
5070
  return __assign({}, (input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }));
4651
5071
  };
5072
+ var serializeAws_restJson1ServerlessClientAuthentication = function (input, context) {
5073
+ return __assign({}, (input.Sasl !== undefined &&
5074
+ input.Sasl !== null && { sasl: serializeAws_restJson1ServerlessSasl(input.Sasl, context) }));
5075
+ };
5076
+ var serializeAws_restJson1ServerlessRequest = function (input, context) {
5077
+ return __assign(__assign({}, (input.ClientAuthentication !== undefined &&
5078
+ input.ClientAuthentication !== null && {
5079
+ clientAuthentication: serializeAws_restJson1ServerlessClientAuthentication(input.ClientAuthentication, context),
5080
+ })), (input.VpcConfigs !== undefined &&
5081
+ input.VpcConfigs !== null && { vpcConfigs: serializeAws_restJson1__listOfVpcConfig(input.VpcConfigs, context) }));
5082
+ };
5083
+ var serializeAws_restJson1ServerlessSasl = function (input, context) {
5084
+ return __assign({}, (input.Iam !== undefined && input.Iam !== null && { iam: serializeAws_restJson1Iam(input.Iam, context) }));
5085
+ };
4652
5086
  var serializeAws_restJson1StorageInfo = function (input, context) {
4653
5087
  return __assign({}, (input.EbsStorageInfo !== undefined &&
4654
5088
  input.EbsStorageInfo !== null && {
@@ -4664,6 +5098,13 @@ var serializeAws_restJson1Tls = function (input, context) {
4664
5098
  var serializeAws_restJson1Unauthenticated = function (input, context) {
4665
5099
  return __assign({}, (input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }));
4666
5100
  };
5101
+ var serializeAws_restJson1VpcConfig = function (input, context) {
5102
+ return __assign(__assign({}, (input.SecurityGroupIds !== undefined &&
5103
+ input.SecurityGroupIds !== null && {
5104
+ securityGroupIds: serializeAws_restJson1__listOf__string(input.SecurityGroupIds, context),
5105
+ })), (input.SubnetIds !== undefined &&
5106
+ input.SubnetIds !== null && { subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context) }));
5107
+ };
4667
5108
  var deserializeAws_restJson1__listOf__string = function (output, context) {
4668
5109
  return (output || [])
4669
5110
  .filter(function (e) { return e != null; })
@@ -4684,6 +5125,16 @@ var deserializeAws_restJson1__listOfBrokerEBSVolumeInfo = function (output, cont
4684
5125
  return deserializeAws_restJson1BrokerEBSVolumeInfo(entry, context);
4685
5126
  });
4686
5127
  };
5128
+ var deserializeAws_restJson1__listOfCluster = function (output, context) {
5129
+ return (output || [])
5130
+ .filter(function (e) { return e != null; })
5131
+ .map(function (entry) {
5132
+ if (entry === null) {
5133
+ return null;
5134
+ }
5135
+ return deserializeAws_restJson1Cluster(entry, context);
5136
+ });
5137
+ };
4687
5138
  var deserializeAws_restJson1__listOfClusterInfo = function (output, context) {
4688
5139
  return (output || [])
4689
5140
  .filter(function (e) { return e != null; })
@@ -4774,6 +5225,16 @@ var deserializeAws_restJson1__listOfUnprocessedScramSecret = function (output, c
4774
5225
  return deserializeAws_restJson1UnprocessedScramSecret(entry, context);
4775
5226
  });
4776
5227
  };
5228
+ var deserializeAws_restJson1__listOfVpcConfig = function (output, context) {
5229
+ return (output || [])
5230
+ .filter(function (e) { return e != null; })
5231
+ .map(function (entry) {
5232
+ if (entry === null) {
5233
+ return null;
5234
+ }
5235
+ return deserializeAws_restJson1VpcConfig(entry, context);
5236
+ });
5237
+ };
4777
5238
  var deserializeAws_restJson1__mapOf__string = function (output, context) {
4778
5239
  return Object.entries(output).reduce(function (acc, _a) {
4779
5240
  var _b;
@@ -4857,6 +5318,31 @@ var deserializeAws_restJson1CloudWatchLogs = function (output, context) {
4857
5318
  LogGroup: __expectString(output.logGroup),
4858
5319
  };
4859
5320
  };
5321
+ var deserializeAws_restJson1Cluster = function (output, context) {
5322
+ return {
5323
+ ActiveOperationArn: __expectString(output.activeOperationArn),
5324
+ ClusterArn: __expectString(output.clusterArn),
5325
+ ClusterName: __expectString(output.clusterName),
5326
+ ClusterType: __expectString(output.clusterType),
5327
+ CreationTime: output.creationTime !== undefined && output.creationTime !== null
5328
+ ? __expectNonNull(__parseRfc3339DateTime(output.creationTime))
5329
+ : undefined,
5330
+ CurrentVersion: __expectString(output.currentVersion),
5331
+ Provisioned: output.provisioned !== undefined && output.provisioned !== null
5332
+ ? deserializeAws_restJson1Provisioned(output.provisioned, context)
5333
+ : undefined,
5334
+ Serverless: output.serverless !== undefined && output.serverless !== null
5335
+ ? deserializeAws_restJson1Serverless(output.serverless, context)
5336
+ : undefined,
5337
+ State: __expectString(output.state),
5338
+ StateInfo: output.stateInfo !== undefined && output.stateInfo !== null
5339
+ ? deserializeAws_restJson1StateInfo(output.stateInfo, context)
5340
+ : undefined,
5341
+ Tags: output.tags !== undefined && output.tags !== null
5342
+ ? deserializeAws_restJson1__mapOf__string(output.tags, context)
5343
+ : undefined,
5344
+ };
5345
+ };
4860
5346
  var deserializeAws_restJson1ClusterInfo = function (output, context) {
4861
5347
  return {
4862
5348
  ActiveOperationArn: __expectString(output.activeOperationArn),
@@ -5032,6 +5518,11 @@ var deserializeAws_restJson1JmxExporter = function (output, context) {
5032
5518
  EnabledInBroker: __expectBoolean(output.enabledInBroker),
5033
5519
  };
5034
5520
  };
5521
+ var deserializeAws_restJson1JmxExporterInfo = function (output, context) {
5522
+ return {
5523
+ EnabledInBroker: __expectBoolean(output.enabledInBroker),
5524
+ };
5525
+ };
5035
5526
  var deserializeAws_restJson1KafkaVersion = function (output, context) {
5036
5527
  return {
5037
5528
  Status: __expectString(output.status),
@@ -5079,6 +5570,11 @@ var deserializeAws_restJson1NodeExporter = function (output, context) {
5079
5570
  EnabledInBroker: __expectBoolean(output.enabledInBroker),
5080
5571
  };
5081
5572
  };
5573
+ var deserializeAws_restJson1NodeExporterInfo = function (output, context) {
5574
+ return {
5575
+ EnabledInBroker: __expectBoolean(output.enabledInBroker),
5576
+ };
5577
+ };
5082
5578
  var deserializeAws_restJson1NodeInfo = function (output, context) {
5083
5579
  return {
5084
5580
  AddedToClusterTime: __expectString(output.addedToClusterTime),
@@ -5100,6 +5596,13 @@ var deserializeAws_restJson1OpenMonitoring = function (output, context) {
5100
5596
  : undefined,
5101
5597
  };
5102
5598
  };
5599
+ var deserializeAws_restJson1OpenMonitoringInfo = function (output, context) {
5600
+ return {
5601
+ Prometheus: output.prometheus !== undefined && output.prometheus !== null
5602
+ ? deserializeAws_restJson1PrometheusInfo(output.prometheus, context)
5603
+ : undefined,
5604
+ };
5605
+ };
5103
5606
  var deserializeAws_restJson1Prometheus = function (output, context) {
5104
5607
  return {
5105
5608
  JmxExporter: output.jmxExporter !== undefined && output.jmxExporter !== null
@@ -5110,6 +5613,42 @@ var deserializeAws_restJson1Prometheus = function (output, context) {
5110
5613
  : undefined,
5111
5614
  };
5112
5615
  };
5616
+ var deserializeAws_restJson1PrometheusInfo = function (output, context) {
5617
+ return {
5618
+ JmxExporter: output.jmxExporter !== undefined && output.jmxExporter !== null
5619
+ ? deserializeAws_restJson1JmxExporterInfo(output.jmxExporter, context)
5620
+ : undefined,
5621
+ NodeExporter: output.nodeExporter !== undefined && output.nodeExporter !== null
5622
+ ? deserializeAws_restJson1NodeExporterInfo(output.nodeExporter, context)
5623
+ : undefined,
5624
+ };
5625
+ };
5626
+ var deserializeAws_restJson1Provisioned = function (output, context) {
5627
+ return {
5628
+ BrokerNodeGroupInfo: output.brokerNodeGroupInfo !== undefined && output.brokerNodeGroupInfo !== null
5629
+ ? deserializeAws_restJson1BrokerNodeGroupInfo(output.brokerNodeGroupInfo, context)
5630
+ : undefined,
5631
+ ClientAuthentication: output.clientAuthentication !== undefined && output.clientAuthentication !== null
5632
+ ? deserializeAws_restJson1ClientAuthentication(output.clientAuthentication, context)
5633
+ : undefined,
5634
+ CurrentBrokerSoftwareInfo: output.currentBrokerSoftwareInfo !== undefined && output.currentBrokerSoftwareInfo !== null
5635
+ ? deserializeAws_restJson1BrokerSoftwareInfo(output.currentBrokerSoftwareInfo, context)
5636
+ : undefined,
5637
+ EncryptionInfo: output.encryptionInfo !== undefined && output.encryptionInfo !== null
5638
+ ? deserializeAws_restJson1EncryptionInfo(output.encryptionInfo, context)
5639
+ : undefined,
5640
+ EnhancedMonitoring: __expectString(output.enhancedMonitoring),
5641
+ LoggingInfo: output.loggingInfo !== undefined && output.loggingInfo !== null
5642
+ ? deserializeAws_restJson1LoggingInfo(output.loggingInfo, context)
5643
+ : undefined,
5644
+ NumberOfBrokerNodes: __expectInt32(output.numberOfBrokerNodes),
5645
+ OpenMonitoring: output.openMonitoring !== undefined && output.openMonitoring !== null
5646
+ ? deserializeAws_restJson1OpenMonitoringInfo(output.openMonitoring, context)
5647
+ : undefined,
5648
+ ZookeeperConnectString: __expectString(output.zookeeperConnectString),
5649
+ ZookeeperConnectStringTls: __expectString(output.zookeeperConnectStringTls),
5650
+ };
5651
+ };
5113
5652
  var deserializeAws_restJson1PublicAccess = function (output, context) {
5114
5653
  return {
5115
5654
  Type: __expectString(output.type),
@@ -5135,6 +5674,28 @@ var deserializeAws_restJson1Scram = function (output, context) {
5135
5674
  Enabled: __expectBoolean(output.enabled),
5136
5675
  };
5137
5676
  };
5677
+ var deserializeAws_restJson1Serverless = function (output, context) {
5678
+ return {
5679
+ ClientAuthentication: output.clientAuthentication !== undefined && output.clientAuthentication !== null
5680
+ ? deserializeAws_restJson1ServerlessClientAuthentication(output.clientAuthentication, context)
5681
+ : undefined,
5682
+ VpcConfigs: output.vpcConfigs !== undefined && output.vpcConfigs !== null
5683
+ ? deserializeAws_restJson1__listOfVpcConfig(output.vpcConfigs, context)
5684
+ : undefined,
5685
+ };
5686
+ };
5687
+ var deserializeAws_restJson1ServerlessClientAuthentication = function (output, context) {
5688
+ return {
5689
+ Sasl: output.sasl !== undefined && output.sasl !== null
5690
+ ? deserializeAws_restJson1ServerlessSasl(output.sasl, context)
5691
+ : undefined,
5692
+ };
5693
+ };
5694
+ var deserializeAws_restJson1ServerlessSasl = function (output, context) {
5695
+ return {
5696
+ Iam: output.iam !== undefined && output.iam !== null ? deserializeAws_restJson1Iam(output.iam, context) : undefined,
5697
+ };
5698
+ };
5138
5699
  var deserializeAws_restJson1StateInfo = function (output, context) {
5139
5700
  return {
5140
5701
  Code: __expectString(output.code),
@@ -5168,6 +5729,16 @@ var deserializeAws_restJson1UnprocessedScramSecret = function (output, context)
5168
5729
  SecretArn: __expectString(output.secretArn),
5169
5730
  };
5170
5731
  };
5732
+ var deserializeAws_restJson1VpcConfig = function (output, context) {
5733
+ return {
5734
+ SecurityGroupIds: output.securityGroupIds !== undefined && output.securityGroupIds !== null
5735
+ ? deserializeAws_restJson1__listOf__string(output.securityGroupIds, context)
5736
+ : undefined,
5737
+ SubnetIds: output.subnetIds !== undefined && output.subnetIds !== null
5738
+ ? deserializeAws_restJson1__listOf__string(output.subnetIds, context)
5739
+ : undefined,
5740
+ };
5741
+ };
5171
5742
  var deserializeAws_restJson1ZookeeperNodeInfo = function (output, context) {
5172
5743
  return {
5173
5744
  AttachedENIId: __expectString(output.attachedENIId),