@aws-sdk/client-greengrassv2 3.45.0 → 3.46.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 +18 -0
- package/README.md +7 -7
- package/dist-cjs/GreengrassV2.js +75 -0
- package/dist-cjs/commands/AssociateServiceRoleToAccountCommand.js +36 -0
- package/dist-cjs/commands/DisassociateServiceRoleFromAccountCommand.js +36 -0
- package/dist-cjs/commands/GetConnectivityInfoCommand.js +36 -0
- package/dist-cjs/commands/GetServiceRoleForAccountCommand.js +36 -0
- package/dist-cjs/commands/UpdateConnectivityInfoCommand.js +36 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/models/models_0.js +89 -23
- package/dist-cjs/protocols/Aws_restJson1.js +435 -1
- package/dist-cjs/runtimeConfig.js +0 -2
- package/dist-es/GreengrassV2.js +75 -0
- package/dist-es/commands/AssociateServiceRoleToAccountCommand.js +39 -0
- package/dist-es/commands/DisassociateServiceRoleFromAccountCommand.js +39 -0
- package/dist-es/commands/GetConnectivityInfoCommand.js +39 -0
- package/dist-es/commands/GetServiceRoleForAccountCommand.js +39 -0
- package/dist-es/commands/UpdateConnectivityInfoCommand.js +39 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/models/models_0.js +60 -16
- package/dist-es/protocols/Aws_restJson1.js +519 -0
- package/dist-es/runtimeConfig.js +0 -2
- package/dist-types/GreengrassV2.d.ts +59 -2
- package/dist-types/GreengrassV2Client.d.ts +7 -2
- package/dist-types/commands/AssociateServiceRoleToAccountCommand.d.ts +39 -0
- package/dist-types/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.d.ts +1 -1
- package/dist-types/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.d.ts +1 -1
- package/dist-types/commands/DisassociateServiceRoleFromAccountCommand.d.ts +38 -0
- package/dist-types/commands/GetConnectivityInfoCommand.d.ts +41 -0
- package/dist-types/commands/GetServiceRoleForAccountCommand.d.ts +38 -0
- package/dist-types/commands/UpdateConnectivityInfoCommand.d.ts +41 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/models/models_0.d.ts +229 -65
- package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
- package/dist-types/ts3.4/GreengrassV2.d.ts +25 -0
- package/dist-types/ts3.4/GreengrassV2Client.d.ts +7 -2
- package/dist-types/ts3.4/commands/AssociateServiceRoleToAccountCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DisassociateServiceRoleFromAccountCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetConnectivityInfoCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetServiceRoleForAccountCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateConnectivityInfoCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +5 -0
- package/dist-types/ts3.4/models/models_0.d.ts +139 -40
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
- package/package.json +36 -43
|
@@ -2,6 +2,30 @@ import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
|
2
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
3
|
import { expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
|
|
4
4
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
|
+
export var serializeAws_restJson1AssociateServiceRoleToAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
7
|
+
return __generator(this, function (_c) {
|
|
8
|
+
switch (_c.label) {
|
|
9
|
+
case 0: return [4, context.endpoint()];
|
|
10
|
+
case 1:
|
|
11
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
12
|
+
headers = {
|
|
13
|
+
"content-type": "application/json",
|
|
14
|
+
};
|
|
15
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/greengrass/servicerole";
|
|
16
|
+
body = JSON.stringify(__assign({}, (input.roleArn !== undefined && input.roleArn !== null && { RoleArn: input.roleArn })));
|
|
17
|
+
return [2, new __HttpRequest({
|
|
18
|
+
protocol: protocol,
|
|
19
|
+
hostname: hostname,
|
|
20
|
+
port: port,
|
|
21
|
+
method: "PUT",
|
|
22
|
+
headers: headers,
|
|
23
|
+
path: resolvedPath,
|
|
24
|
+
body: body,
|
|
25
|
+
})];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}); };
|
|
5
29
|
export var serializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6
30
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
7
31
|
return __generator(this, function (_c) {
|
|
@@ -268,6 +292,30 @@ export var serializeAws_restJson1DescribeComponentCommand = function (input, con
|
|
|
268
292
|
}
|
|
269
293
|
});
|
|
270
294
|
}); };
|
|
295
|
+
export var serializeAws_restJson1DisassociateServiceRoleFromAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
296
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
297
|
+
return __generator(this, function (_c) {
|
|
298
|
+
switch (_c.label) {
|
|
299
|
+
case 0: return [4, context.endpoint()];
|
|
300
|
+
case 1:
|
|
301
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
302
|
+
headers = {
|
|
303
|
+
"content-type": "application/json",
|
|
304
|
+
};
|
|
305
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/greengrass/servicerole";
|
|
306
|
+
body = "";
|
|
307
|
+
return [2, new __HttpRequest({
|
|
308
|
+
protocol: protocol,
|
|
309
|
+
hostname: hostname,
|
|
310
|
+
port: port,
|
|
311
|
+
method: "DELETE",
|
|
312
|
+
headers: headers,
|
|
313
|
+
path: resolvedPath,
|
|
314
|
+
body: body,
|
|
315
|
+
})];
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}); };
|
|
271
319
|
export var serializeAws_restJson1GetComponentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
272
320
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
273
321
|
return __generator(this, function (_c) {
|
|
@@ -346,6 +394,38 @@ export var serializeAws_restJson1GetComponentVersionArtifactCommand = function (
|
|
|
346
394
|
}
|
|
347
395
|
});
|
|
348
396
|
}); };
|
|
397
|
+
export var serializeAws_restJson1GetConnectivityInfoCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
398
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
399
|
+
return __generator(this, function (_c) {
|
|
400
|
+
switch (_c.label) {
|
|
401
|
+
case 0: return [4, context.endpoint()];
|
|
402
|
+
case 1:
|
|
403
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
404
|
+
headers = {};
|
|
405
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
406
|
+
"/greengrass/things/{thingName}/connectivityInfo";
|
|
407
|
+
if (input.thingName !== undefined) {
|
|
408
|
+
labelValue = input.thingName;
|
|
409
|
+
if (labelValue.length <= 0) {
|
|
410
|
+
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
411
|
+
}
|
|
412
|
+
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
throw new Error("No value provided for input HTTP label: thingName.");
|
|
416
|
+
}
|
|
417
|
+
return [2, new __HttpRequest({
|
|
418
|
+
protocol: protocol,
|
|
419
|
+
hostname: hostname,
|
|
420
|
+
port: port,
|
|
421
|
+
method: "GET",
|
|
422
|
+
headers: headers,
|
|
423
|
+
path: resolvedPath,
|
|
424
|
+
body: body,
|
|
425
|
+
})];
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}); };
|
|
349
429
|
export var serializeAws_restJson1GetCoreDeviceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
350
430
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
351
431
|
return __generator(this, function (_c) {
|
|
@@ -409,6 +489,30 @@ export var serializeAws_restJson1GetDeploymentCommand = function (input, context
|
|
|
409
489
|
}
|
|
410
490
|
});
|
|
411
491
|
}); };
|
|
492
|
+
export var serializeAws_restJson1GetServiceRoleForAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
493
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
494
|
+
return __generator(this, function (_c) {
|
|
495
|
+
switch (_c.label) {
|
|
496
|
+
case 0: return [4, context.endpoint()];
|
|
497
|
+
case 1:
|
|
498
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
499
|
+
headers = {
|
|
500
|
+
"content-type": "application/json",
|
|
501
|
+
};
|
|
502
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/greengrass/servicerole";
|
|
503
|
+
body = "";
|
|
504
|
+
return [2, new __HttpRequest({
|
|
505
|
+
protocol: protocol,
|
|
506
|
+
hostname: hostname,
|
|
507
|
+
port: port,
|
|
508
|
+
method: "GET",
|
|
509
|
+
headers: headers,
|
|
510
|
+
path: resolvedPath,
|
|
511
|
+
body: body,
|
|
512
|
+
})];
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}); };
|
|
412
516
|
export var serializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
413
517
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
414
518
|
return __generator(this, function (_c) {
|
|
@@ -739,6 +843,114 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
|
|
|
739
843
|
}
|
|
740
844
|
});
|
|
741
845
|
}); };
|
|
846
|
+
export var serializeAws_restJson1UpdateConnectivityInfoCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
847
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
848
|
+
return __generator(this, function (_c) {
|
|
849
|
+
switch (_c.label) {
|
|
850
|
+
case 0: return [4, context.endpoint()];
|
|
851
|
+
case 1:
|
|
852
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
853
|
+
headers = {
|
|
854
|
+
"content-type": "application/json",
|
|
855
|
+
};
|
|
856
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
857
|
+
"/greengrass/things/{thingName}/connectivityInfo";
|
|
858
|
+
if (input.thingName !== undefined) {
|
|
859
|
+
labelValue = input.thingName;
|
|
860
|
+
if (labelValue.length <= 0) {
|
|
861
|
+
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
862
|
+
}
|
|
863
|
+
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
throw new Error("No value provided for input HTTP label: thingName.");
|
|
867
|
+
}
|
|
868
|
+
body = JSON.stringify(__assign({}, (input.connectivityInfo !== undefined &&
|
|
869
|
+
input.connectivityInfo !== null && {
|
|
870
|
+
ConnectivityInfo: serializeAws_restJson1connectivityInfoList(input.connectivityInfo, context),
|
|
871
|
+
})));
|
|
872
|
+
return [2, new __HttpRequest({
|
|
873
|
+
protocol: protocol,
|
|
874
|
+
hostname: hostname,
|
|
875
|
+
port: port,
|
|
876
|
+
method: "PUT",
|
|
877
|
+
headers: headers,
|
|
878
|
+
path: resolvedPath,
|
|
879
|
+
body: body,
|
|
880
|
+
})];
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
}); };
|
|
884
|
+
export var deserializeAws_restJson1AssociateServiceRoleToAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
885
|
+
var contents, data, _a, _b;
|
|
886
|
+
return __generator(this, function (_c) {
|
|
887
|
+
switch (_c.label) {
|
|
888
|
+
case 0:
|
|
889
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
890
|
+
return [2, deserializeAws_restJson1AssociateServiceRoleToAccountCommandError(output, context)];
|
|
891
|
+
}
|
|
892
|
+
contents = {
|
|
893
|
+
$metadata: deserializeMetadata(output),
|
|
894
|
+
associatedAt: undefined,
|
|
895
|
+
};
|
|
896
|
+
_a = __expectNonNull;
|
|
897
|
+
_b = __expectObject;
|
|
898
|
+
return [4, parseBody(output.body, context)];
|
|
899
|
+
case 1:
|
|
900
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
901
|
+
if (data.AssociatedAt !== undefined && data.AssociatedAt !== null) {
|
|
902
|
+
contents.associatedAt = __expectString(data.AssociatedAt);
|
|
903
|
+
}
|
|
904
|
+
return [2, Promise.resolve(contents)];
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
}); };
|
|
908
|
+
var deserializeAws_restJson1AssociateServiceRoleToAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
909
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, parsedBody, message;
|
|
910
|
+
var _e;
|
|
911
|
+
return __generator(this, function (_f) {
|
|
912
|
+
switch (_f.label) {
|
|
913
|
+
case 0:
|
|
914
|
+
_a = [__assign({}, output)];
|
|
915
|
+
_e = {};
|
|
916
|
+
return [4, parseBody(output.body, context)];
|
|
917
|
+
case 1:
|
|
918
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_e.body = _f.sent(), _e)]));
|
|
919
|
+
errorCode = "UnknownError";
|
|
920
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
921
|
+
_b = errorCode;
|
|
922
|
+
switch (_b) {
|
|
923
|
+
case "InternalServerException": return [3, 2];
|
|
924
|
+
case "com.amazonaws.greengrassv2#InternalServerException": return [3, 2];
|
|
925
|
+
case "ValidationException": return [3, 4];
|
|
926
|
+
case "com.amazonaws.greengrassv2#ValidationException": return [3, 4];
|
|
927
|
+
}
|
|
928
|
+
return [3, 6];
|
|
929
|
+
case 2:
|
|
930
|
+
_c = [{}];
|
|
931
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
932
|
+
case 3:
|
|
933
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
934
|
+
return [3, 7];
|
|
935
|
+
case 4:
|
|
936
|
+
_d = [{}];
|
|
937
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
938
|
+
case 5:
|
|
939
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
940
|
+
return [3, 7];
|
|
941
|
+
case 6:
|
|
942
|
+
parsedBody = parsedOutput.body;
|
|
943
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
944
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
945
|
+
_f.label = 7;
|
|
946
|
+
case 7:
|
|
947
|
+
message = response.message || response.Message || errorCode;
|
|
948
|
+
response.message = message;
|
|
949
|
+
delete response.Message;
|
|
950
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
}); };
|
|
742
954
|
export var deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
743
955
|
var contents, data, _a, _b;
|
|
744
956
|
return __generator(this, function (_c) {
|
|
@@ -1583,6 +1795,68 @@ var deserializeAws_restJson1DescribeComponentCommandError = function (output, co
|
|
|
1583
1795
|
}
|
|
1584
1796
|
});
|
|
1585
1797
|
}); };
|
|
1798
|
+
export var deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1799
|
+
var contents, data, _a, _b;
|
|
1800
|
+
return __generator(this, function (_c) {
|
|
1801
|
+
switch (_c.label) {
|
|
1802
|
+
case 0:
|
|
1803
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1804
|
+
return [2, deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError(output, context)];
|
|
1805
|
+
}
|
|
1806
|
+
contents = {
|
|
1807
|
+
$metadata: deserializeMetadata(output),
|
|
1808
|
+
disassociatedAt: undefined,
|
|
1809
|
+
};
|
|
1810
|
+
_a = __expectNonNull;
|
|
1811
|
+
_b = __expectObject;
|
|
1812
|
+
return [4, parseBody(output.body, context)];
|
|
1813
|
+
case 1:
|
|
1814
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1815
|
+
if (data.DisassociatedAt !== undefined && data.DisassociatedAt !== null) {
|
|
1816
|
+
contents.disassociatedAt = __expectString(data.DisassociatedAt);
|
|
1817
|
+
}
|
|
1818
|
+
return [2, Promise.resolve(contents)];
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
}); };
|
|
1822
|
+
var deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1823
|
+
var parsedOutput, _a, response, errorCode, _b, _c, parsedBody, message;
|
|
1824
|
+
var _d;
|
|
1825
|
+
return __generator(this, function (_e) {
|
|
1826
|
+
switch (_e.label) {
|
|
1827
|
+
case 0:
|
|
1828
|
+
_a = [__assign({}, output)];
|
|
1829
|
+
_d = {};
|
|
1830
|
+
return [4, parseBody(output.body, context)];
|
|
1831
|
+
case 1:
|
|
1832
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_d.body = _e.sent(), _d)]));
|
|
1833
|
+
errorCode = "UnknownError";
|
|
1834
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1835
|
+
_b = errorCode;
|
|
1836
|
+
switch (_b) {
|
|
1837
|
+
case "InternalServerException": return [3, 2];
|
|
1838
|
+
case "com.amazonaws.greengrassv2#InternalServerException": return [3, 2];
|
|
1839
|
+
}
|
|
1840
|
+
return [3, 4];
|
|
1841
|
+
case 2:
|
|
1842
|
+
_c = [{}];
|
|
1843
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1844
|
+
case 3:
|
|
1845
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_e.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1846
|
+
return [3, 5];
|
|
1847
|
+
case 4:
|
|
1848
|
+
parsedBody = parsedOutput.body;
|
|
1849
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1850
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1851
|
+
_e.label = 5;
|
|
1852
|
+
case 5:
|
|
1853
|
+
message = response.message || response.Message || errorCode;
|
|
1854
|
+
response.message = message;
|
|
1855
|
+
delete response.Message;
|
|
1856
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1857
|
+
}
|
|
1858
|
+
});
|
|
1859
|
+
}); };
|
|
1586
1860
|
export var deserializeAws_restJson1GetComponentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1587
1861
|
var contents, data, _a, _b;
|
|
1588
1862
|
return __generator(this, function (_c) {
|
|
@@ -1779,6 +2053,80 @@ var deserializeAws_restJson1GetComponentVersionArtifactCommandError = function (
|
|
|
1779
2053
|
}
|
|
1780
2054
|
});
|
|
1781
2055
|
}); };
|
|
2056
|
+
export var deserializeAws_restJson1GetConnectivityInfoCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2057
|
+
var contents, data, _a, _b;
|
|
2058
|
+
return __generator(this, function (_c) {
|
|
2059
|
+
switch (_c.label) {
|
|
2060
|
+
case 0:
|
|
2061
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2062
|
+
return [2, deserializeAws_restJson1GetConnectivityInfoCommandError(output, context)];
|
|
2063
|
+
}
|
|
2064
|
+
contents = {
|
|
2065
|
+
$metadata: deserializeMetadata(output),
|
|
2066
|
+
connectivityInfo: undefined,
|
|
2067
|
+
message: undefined,
|
|
2068
|
+
};
|
|
2069
|
+
_a = __expectNonNull;
|
|
2070
|
+
_b = __expectObject;
|
|
2071
|
+
return [4, parseBody(output.body, context)];
|
|
2072
|
+
case 1:
|
|
2073
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
2074
|
+
if (data.ConnectivityInfo !== undefined && data.ConnectivityInfo !== null) {
|
|
2075
|
+
contents.connectivityInfo = deserializeAws_restJson1connectivityInfoList(data.ConnectivityInfo, context);
|
|
2076
|
+
}
|
|
2077
|
+
if (data.Message !== undefined && data.Message !== null) {
|
|
2078
|
+
contents.message = __expectString(data.Message);
|
|
2079
|
+
}
|
|
2080
|
+
return [2, Promise.resolve(contents)];
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
}); };
|
|
2084
|
+
var deserializeAws_restJson1GetConnectivityInfoCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2085
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, parsedBody, message;
|
|
2086
|
+
var _e;
|
|
2087
|
+
return __generator(this, function (_f) {
|
|
2088
|
+
switch (_f.label) {
|
|
2089
|
+
case 0:
|
|
2090
|
+
_a = [__assign({}, output)];
|
|
2091
|
+
_e = {};
|
|
2092
|
+
return [4, parseBody(output.body, context)];
|
|
2093
|
+
case 1:
|
|
2094
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_e.body = _f.sent(), _e)]));
|
|
2095
|
+
errorCode = "UnknownError";
|
|
2096
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2097
|
+
_b = errorCode;
|
|
2098
|
+
switch (_b) {
|
|
2099
|
+
case "InternalServerException": return [3, 2];
|
|
2100
|
+
case "com.amazonaws.greengrassv2#InternalServerException": return [3, 2];
|
|
2101
|
+
case "ValidationException": return [3, 4];
|
|
2102
|
+
case "com.amazonaws.greengrassv2#ValidationException": return [3, 4];
|
|
2103
|
+
}
|
|
2104
|
+
return [3, 6];
|
|
2105
|
+
case 2:
|
|
2106
|
+
_c = [{}];
|
|
2107
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
2108
|
+
case 3:
|
|
2109
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2110
|
+
return [3, 7];
|
|
2111
|
+
case 4:
|
|
2112
|
+
_d = [{}];
|
|
2113
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2114
|
+
case 5:
|
|
2115
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2116
|
+
return [3, 7];
|
|
2117
|
+
case 6:
|
|
2118
|
+
parsedBody = parsedOutput.body;
|
|
2119
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2120
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2121
|
+
_f.label = 7;
|
|
2122
|
+
case 7:
|
|
2123
|
+
message = response.message || response.Message || errorCode;
|
|
2124
|
+
response.message = message;
|
|
2125
|
+
delete response.Message;
|
|
2126
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
2129
|
+
}); };
|
|
1782
2130
|
export var deserializeAws_restJson1GetCoreDeviceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1783
2131
|
var contents, data, _a, _b;
|
|
1784
2132
|
return __generator(this, function (_c) {
|
|
@@ -2039,6 +2387,72 @@ var deserializeAws_restJson1GetDeploymentCommandError = function (output, contex
|
|
|
2039
2387
|
}
|
|
2040
2388
|
});
|
|
2041
2389
|
}); };
|
|
2390
|
+
export var deserializeAws_restJson1GetServiceRoleForAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2391
|
+
var contents, data, _a, _b;
|
|
2392
|
+
return __generator(this, function (_c) {
|
|
2393
|
+
switch (_c.label) {
|
|
2394
|
+
case 0:
|
|
2395
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2396
|
+
return [2, deserializeAws_restJson1GetServiceRoleForAccountCommandError(output, context)];
|
|
2397
|
+
}
|
|
2398
|
+
contents = {
|
|
2399
|
+
$metadata: deserializeMetadata(output),
|
|
2400
|
+
associatedAt: undefined,
|
|
2401
|
+
roleArn: undefined,
|
|
2402
|
+
};
|
|
2403
|
+
_a = __expectNonNull;
|
|
2404
|
+
_b = __expectObject;
|
|
2405
|
+
return [4, parseBody(output.body, context)];
|
|
2406
|
+
case 1:
|
|
2407
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
2408
|
+
if (data.AssociatedAt !== undefined && data.AssociatedAt !== null) {
|
|
2409
|
+
contents.associatedAt = __expectString(data.AssociatedAt);
|
|
2410
|
+
}
|
|
2411
|
+
if (data.RoleArn !== undefined && data.RoleArn !== null) {
|
|
2412
|
+
contents.roleArn = __expectString(data.RoleArn);
|
|
2413
|
+
}
|
|
2414
|
+
return [2, Promise.resolve(contents)];
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
}); };
|
|
2418
|
+
var deserializeAws_restJson1GetServiceRoleForAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2419
|
+
var parsedOutput, _a, response, errorCode, _b, _c, parsedBody, message;
|
|
2420
|
+
var _d;
|
|
2421
|
+
return __generator(this, function (_e) {
|
|
2422
|
+
switch (_e.label) {
|
|
2423
|
+
case 0:
|
|
2424
|
+
_a = [__assign({}, output)];
|
|
2425
|
+
_d = {};
|
|
2426
|
+
return [4, parseBody(output.body, context)];
|
|
2427
|
+
case 1:
|
|
2428
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_d.body = _e.sent(), _d)]));
|
|
2429
|
+
errorCode = "UnknownError";
|
|
2430
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2431
|
+
_b = errorCode;
|
|
2432
|
+
switch (_b) {
|
|
2433
|
+
case "InternalServerException": return [3, 2];
|
|
2434
|
+
case "com.amazonaws.greengrassv2#InternalServerException": return [3, 2];
|
|
2435
|
+
}
|
|
2436
|
+
return [3, 4];
|
|
2437
|
+
case 2:
|
|
2438
|
+
_c = [{}];
|
|
2439
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
2440
|
+
case 3:
|
|
2441
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_e.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2442
|
+
return [3, 5];
|
|
2443
|
+
case 4:
|
|
2444
|
+
parsedBody = parsedOutput.body;
|
|
2445
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2446
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2447
|
+
_e.label = 5;
|
|
2448
|
+
case 5:
|
|
2449
|
+
message = response.message || response.Message || errorCode;
|
|
2450
|
+
response.message = message;
|
|
2451
|
+
delete response.Message;
|
|
2452
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2453
|
+
}
|
|
2454
|
+
});
|
|
2455
|
+
}); };
|
|
2042
2456
|
export var deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2043
2457
|
var contents, data, _a, _b;
|
|
2044
2458
|
return __generator(this, function (_c) {
|
|
@@ -3025,6 +3439,80 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
|
|
|
3025
3439
|
}
|
|
3026
3440
|
});
|
|
3027
3441
|
}); };
|
|
3442
|
+
export var deserializeAws_restJson1UpdateConnectivityInfoCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3443
|
+
var contents, data, _a, _b;
|
|
3444
|
+
return __generator(this, function (_c) {
|
|
3445
|
+
switch (_c.label) {
|
|
3446
|
+
case 0:
|
|
3447
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3448
|
+
return [2, deserializeAws_restJson1UpdateConnectivityInfoCommandError(output, context)];
|
|
3449
|
+
}
|
|
3450
|
+
contents = {
|
|
3451
|
+
$metadata: deserializeMetadata(output),
|
|
3452
|
+
message: undefined,
|
|
3453
|
+
version: undefined,
|
|
3454
|
+
};
|
|
3455
|
+
_a = __expectNonNull;
|
|
3456
|
+
_b = __expectObject;
|
|
3457
|
+
return [4, parseBody(output.body, context)];
|
|
3458
|
+
case 1:
|
|
3459
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
3460
|
+
if (data.Message !== undefined && data.Message !== null) {
|
|
3461
|
+
contents.message = __expectString(data.Message);
|
|
3462
|
+
}
|
|
3463
|
+
if (data.Version !== undefined && data.Version !== null) {
|
|
3464
|
+
contents.version = __expectString(data.Version);
|
|
3465
|
+
}
|
|
3466
|
+
return [2, Promise.resolve(contents)];
|
|
3467
|
+
}
|
|
3468
|
+
});
|
|
3469
|
+
}); };
|
|
3470
|
+
var deserializeAws_restJson1UpdateConnectivityInfoCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3471
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, parsedBody, message;
|
|
3472
|
+
var _e;
|
|
3473
|
+
return __generator(this, function (_f) {
|
|
3474
|
+
switch (_f.label) {
|
|
3475
|
+
case 0:
|
|
3476
|
+
_a = [__assign({}, output)];
|
|
3477
|
+
_e = {};
|
|
3478
|
+
return [4, parseBody(output.body, context)];
|
|
3479
|
+
case 1:
|
|
3480
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_e.body = _f.sent(), _e)]));
|
|
3481
|
+
errorCode = "UnknownError";
|
|
3482
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3483
|
+
_b = errorCode;
|
|
3484
|
+
switch (_b) {
|
|
3485
|
+
case "InternalServerException": return [3, 2];
|
|
3486
|
+
case "com.amazonaws.greengrassv2#InternalServerException": return [3, 2];
|
|
3487
|
+
case "ValidationException": return [3, 4];
|
|
3488
|
+
case "com.amazonaws.greengrassv2#ValidationException": return [3, 4];
|
|
3489
|
+
}
|
|
3490
|
+
return [3, 6];
|
|
3491
|
+
case 2:
|
|
3492
|
+
_c = [{}];
|
|
3493
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
3494
|
+
case 3:
|
|
3495
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
3496
|
+
return [3, 7];
|
|
3497
|
+
case 4:
|
|
3498
|
+
_d = [{}];
|
|
3499
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
3500
|
+
case 5:
|
|
3501
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_f.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
3502
|
+
return [3, 7];
|
|
3503
|
+
case 6:
|
|
3504
|
+
parsedBody = parsedOutput.body;
|
|
3505
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3506
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
3507
|
+
_f.label = 7;
|
|
3508
|
+
case 7:
|
|
3509
|
+
message = response.message || response.Message || errorCode;
|
|
3510
|
+
response.message = message;
|
|
3511
|
+
delete response.Message;
|
|
3512
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
3513
|
+
}
|
|
3514
|
+
});
|
|
3515
|
+
}); };
|
|
3028
3516
|
var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3029
3517
|
var contents, data;
|
|
3030
3518
|
return __generator(this, function (_a) {
|
|
@@ -3318,6 +3806,19 @@ var serializeAws_restJson1ComponentVersionRequirementMap = function (input, cont
|
|
|
3318
3806
|
return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
|
|
3319
3807
|
}, {});
|
|
3320
3808
|
};
|
|
3809
|
+
var serializeAws_restJson1ConnectivityInfo = function (input, context) {
|
|
3810
|
+
return __assign(__assign(__assign(__assign({}, (input.hostAddress !== undefined && input.hostAddress !== null && { HostAddress: input.hostAddress })), (input.id !== undefined && input.id !== null && { Id: input.id })), (input.metadata !== undefined && input.metadata !== null && { Metadata: input.metadata })), (input.portNumber !== undefined && input.portNumber !== null && { PortNumber: input.portNumber }));
|
|
3811
|
+
};
|
|
3812
|
+
var serializeAws_restJson1connectivityInfoList = function (input, context) {
|
|
3813
|
+
return input
|
|
3814
|
+
.filter(function (e) { return e != null; })
|
|
3815
|
+
.map(function (entry) {
|
|
3816
|
+
if (entry === null) {
|
|
3817
|
+
return null;
|
|
3818
|
+
}
|
|
3819
|
+
return serializeAws_restJson1ConnectivityInfo(entry, context);
|
|
3820
|
+
});
|
|
3821
|
+
};
|
|
3321
3822
|
var serializeAws_restJson1DeploymentComponentUpdatePolicy = function (input, context) {
|
|
3322
3823
|
return __assign(__assign({}, (input.action !== undefined && input.action !== null && { action: input.action })), (input.timeoutInSeconds !== undefined &&
|
|
3323
3824
|
input.timeoutInSeconds !== null && { timeoutInSeconds: input.timeoutInSeconds }));
|
|
@@ -3692,6 +4193,24 @@ var deserializeAws_restJson1ComponentVersionListItem = function (output, context
|
|
|
3692
4193
|
componentVersion: __expectString(output.componentVersion),
|
|
3693
4194
|
};
|
|
3694
4195
|
};
|
|
4196
|
+
var deserializeAws_restJson1ConnectivityInfo = function (output, context) {
|
|
4197
|
+
return {
|
|
4198
|
+
hostAddress: __expectString(output.HostAddress),
|
|
4199
|
+
id: __expectString(output.Id),
|
|
4200
|
+
metadata: __expectString(output.Metadata),
|
|
4201
|
+
portNumber: __expectInt32(output.PortNumber),
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
var deserializeAws_restJson1connectivityInfoList = function (output, context) {
|
|
4205
|
+
return (output || [])
|
|
4206
|
+
.filter(function (e) { return e != null; })
|
|
4207
|
+
.map(function (entry) {
|
|
4208
|
+
if (entry === null) {
|
|
4209
|
+
return null;
|
|
4210
|
+
}
|
|
4211
|
+
return deserializeAws_restJson1ConnectivityInfo(entry, context);
|
|
4212
|
+
});
|
|
4213
|
+
};
|
|
3695
4214
|
var deserializeAws_restJson1CoreDevice = function (output, context) {
|
|
3696
4215
|
return {
|
|
3697
4216
|
coreDeviceThingName: __expectString(output.coreDeviceThingName),
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -12,10 +12,8 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
|
|
|
12
12
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
13
13
|
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
|
|
14
14
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
15
|
-
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
16
15
|
export var getRuntimeConfig = function (config) {
|
|
17
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
19
17
|
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
18
|
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new NodeHttpHandler(), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "sha256"), streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
|
|
21
19
|
};
|