@aws-sdk/client-amp 3.32.0 → 3.36.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 +44 -0
- package/README.md +7 -7
- package/dist-cjs/Amp.js +265 -0
- package/{dist/cjs → dist-cjs}/AmpClient.js +8 -9
- package/dist-cjs/commands/CreateAlertManagerDefinitionCommand.js +60 -0
- package/dist-cjs/commands/CreateRuleGroupsNamespaceCommand.js +60 -0
- package/{dist/cjs → dist-cjs}/commands/CreateWorkspaceCommand.js +2 -3
- package/dist-cjs/commands/DeleteAlertManagerDefinitionCommand.js +60 -0
- package/dist-cjs/commands/DeleteRuleGroupsNamespaceCommand.js +60 -0
- package/{dist/cjs → dist-cjs}/commands/DeleteWorkspaceCommand.js +2 -3
- package/dist-cjs/commands/DescribeAlertManagerDefinitionCommand.js +60 -0
- package/dist-cjs/commands/DescribeRuleGroupsNamespaceCommand.js +60 -0
- package/{dist/cjs → dist-cjs}/commands/DescribeWorkspaceCommand.js +2 -3
- package/dist-cjs/commands/ListRuleGroupsNamespacesCommand.js +60 -0
- package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/ListWorkspacesCommand.js +2 -3
- package/dist-cjs/commands/PutAlertManagerDefinitionCommand.js +60 -0
- package/dist-cjs/commands/PutRuleGroupsNamespaceCommand.js +60 -0
- package/{dist/cjs → dist-cjs}/commands/TagResourceCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/UntagResourceCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/UpdateWorkspaceAliasCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
- package/{dist/cjs → dist-cjs}/index.js +12 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/dist-cjs/models/models_0.js +501 -0
- package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
- package/dist-cjs/pagination/ListRuleGroupsNamespacesPaginator.js +45 -0
- package/{dist/cjs → dist-cjs}/pagination/ListWorkspacesPaginator.js +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js +2393 -0
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
- package/dist-cjs/waiters/waitForWorkspaceActive.js +63 -0
- package/dist-cjs/waiters/waitForWorkspaceDeleted.js +48 -0
- package/dist-es/Amp.js +265 -0
- package/{dist/es → dist-es}/AmpClient.js +2 -11
- package/dist-es/commands/CreateAlertManagerDefinitionCommand.js +39 -0
- package/dist-es/commands/CreateRuleGroupsNamespaceCommand.js +39 -0
- package/{dist/es → dist-es}/commands/CreateWorkspaceCommand.js +4 -30
- package/dist-es/commands/DeleteAlertManagerDefinitionCommand.js +39 -0
- package/dist-es/commands/DeleteRuleGroupsNamespaceCommand.js +39 -0
- package/{dist/es → dist-es}/commands/DeleteWorkspaceCommand.js +4 -30
- package/dist-es/commands/DescribeAlertManagerDefinitionCommand.js +39 -0
- package/dist-es/commands/DescribeRuleGroupsNamespaceCommand.js +39 -0
- package/{dist/es → dist-es}/commands/DescribeWorkspaceCommand.js +4 -30
- package/dist-es/commands/ListRuleGroupsNamespacesCommand.js +39 -0
- package/{dist/es → dist-es}/commands/ListTagsForResourceCommand.js +4 -30
- package/{dist/es → dist-es}/commands/ListWorkspacesCommand.js +4 -30
- package/dist-es/commands/PutAlertManagerDefinitionCommand.js +39 -0
- package/dist-es/commands/PutRuleGroupsNamespaceCommand.js +39 -0
- package/{dist/es → dist-es}/commands/TagResourceCommand.js +4 -30
- package/{dist/es → dist-es}/commands/UntagResourceCommand.js +4 -30
- package/{dist/es → dist-es}/commands/UpdateWorkspaceAliasCommand.js +4 -30
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/dist-es/index.js +25 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/dist-es/models/models_0.js +218 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListRuleGroupsNamespacesPaginator.js +74 -0
- package/{dist/es → dist-es}/pagination/ListWorkspacesPaginator.js +16 -29
- package/dist-es/protocols/Aws_restJson1.js +2684 -0
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
- package/dist-es/waiters/waitForWorkspaceActive.js +69 -0
- package/dist-es/waiters/waitForWorkspaceDeleted.js +54 -0
- package/dist-types/Amp.d.ts +126 -0
- package/{dist/types/ts3.4 → dist-types}/AmpClient.d.ts +149 -140
- package/dist-types/commands/CreateAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/commands/CreateRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/commands/CreateWorkspaceCommand.d.ts +2 -2
- package/dist-types/commands/DeleteAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/commands/DeleteRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/commands/DeleteWorkspaceCommand.d.ts +2 -2
- package/dist-types/commands/DescribeAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/commands/DescribeRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/commands/DescribeWorkspaceCommand.d.ts +2 -2
- package/dist-types/commands/ListRuleGroupsNamespacesCommand.d.ts +35 -0
- package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListWorkspacesCommand.d.ts +2 -2
- package/dist-types/commands/PutAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/commands/PutRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/commands/TagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UntagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UpdateWorkspaceAliasCommand.d.ts +2 -2
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/dist-types/index.d.ts +25 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/dist-types/models/models_0.d.ts +1103 -0
- package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
- package/dist-types/pagination/ListRuleGroupsNamespacesPaginator.d.ts +4 -0
- package/{dist/types → dist-types}/pagination/ListWorkspacesPaginator.d.ts +1 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +53 -0
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +1 -0
- package/{dist/types/ts3.4 → dist-types}/runtimeConfig.d.ts +37 -36
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +1 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/dist-types/ts3.4/Amp.d.ts +126 -0
- package/{dist/types → dist-types/ts3.4}/AmpClient.d.ts +149 -140
- package/dist-types/ts3.4/commands/CreateAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/CreateRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/ts3.4/commands/CreateWorkspaceCommand.d.ts +2 -2
- package/dist-types/ts3.4/commands/DeleteAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/DeleteRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/ts3.4/commands/DeleteWorkspaceCommand.d.ts +2 -2
- package/dist-types/ts3.4/commands/DescribeAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/DescribeRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/ts3.4/commands/DescribeWorkspaceCommand.d.ts +2 -2
- package/dist-types/ts3.4/commands/ListRuleGroupsNamespacesCommand.d.ts +35 -0
- package/{dist/types → dist-types}/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/commands/ListWorkspacesCommand.d.ts +2 -2
- package/dist-types/ts3.4/commands/PutAlertManagerDefinitionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/PutRuleGroupsNamespaceCommand.d.ts +35 -0
- package/{dist/types → dist-types}/ts3.4/commands/TagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/commands/UntagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/commands/UpdateWorkspaceAliasCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/dist-types/ts3.4/index.d.ts +25 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/dist-types/ts3.4/models/models_0.d.ts +1103 -0
- package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
- package/dist-types/ts3.4/pagination/ListRuleGroupsNamespacesPaginator.d.ts +4 -0
- package/{dist/types → dist-types}/ts3.4/pagination/ListWorkspacesPaginator.d.ts +1 -1
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +53 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/{dist/types → dist-types/ts3.4}/runtimeConfig.d.ts +37 -36
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
- package/dist-types/ts3.4/waiters/waitForWorkspaceActive.d.ts +14 -0
- package/dist-types/ts3.4/waiters/waitForWorkspaceDeleted.d.ts +14 -0
- package/dist-types/waiters/waitForWorkspaceActive.d.ts +14 -0
- package/dist-types/waiters/waitForWorkspaceDeleted.d.ts +14 -0
- package/package.json +53 -49
- package/Amp.ts +0 -293
- package/AmpClient.ts +0 -265
- package/commands/CreateWorkspaceCommand.ts +0 -94
- package/commands/DeleteWorkspaceCommand.ts +0 -94
- package/commands/DescribeWorkspaceCommand.ts +0 -94
- package/commands/ListTagsForResourceCommand.ts +0 -94
- package/commands/ListWorkspacesCommand.ts +0 -94
- package/commands/TagResourceCommand.ts +0 -94
- package/commands/UntagResourceCommand.ts +0 -94
- package/commands/UpdateWorkspaceAliasCommand.ts +0 -94
- package/dist/cjs/Amp.js +0 -131
- package/dist/cjs/Amp.js.map +0 -1
- package/dist/cjs/AmpClient.js.map +0 -1
- package/dist/cjs/commands/CreateWorkspaceCommand.js.map +0 -1
- package/dist/cjs/commands/DeleteWorkspaceCommand.js.map +0 -1
- package/dist/cjs/commands/DescribeWorkspaceCommand.js.map +0 -1
- package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist/cjs/commands/ListWorkspacesCommand.js.map +0 -1
- package/dist/cjs/commands/TagResourceCommand.js.map +0 -1
- package/dist/cjs/commands/UntagResourceCommand.js.map +0 -1
- package/dist/cjs/commands/UpdateWorkspaceAliasCommand.js.map +0 -1
- package/dist/cjs/endpoints.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/models_0.js +0 -259
- package/dist/cjs/models/models_0.js.map +0 -1
- package/dist/cjs/package.json +0 -93
- package/dist/cjs/pagination/Interfaces.js.map +0 -1
- package/dist/cjs/pagination/ListWorkspacesPaginator.js.map +0 -1
- package/dist/cjs/protocols/Aws_restJson1.js +0 -1176
- package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist/cjs/runtimeConfig.browser.js.map +0 -1
- package/dist/cjs/runtimeConfig.js.map +0 -1
- package/dist/cjs/runtimeConfig.native.js.map +0 -1
- package/dist/cjs/runtimeConfig.shared.js.map +0 -1
- package/dist/es/Amp.js +0 -134
- package/dist/es/Amp.js.map +0 -1
- package/dist/es/AmpClient.js.map +0 -1
- package/dist/es/commands/CreateWorkspaceCommand.js.map +0 -1
- package/dist/es/commands/DeleteWorkspaceCommand.js.map +0 -1
- package/dist/es/commands/DescribeWorkspaceCommand.js.map +0 -1
- package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist/es/commands/ListWorkspacesCommand.js.map +0 -1
- package/dist/es/commands/TagResourceCommand.js.map +0 -1
- package/dist/es/commands/UntagResourceCommand.js.map +0 -1
- package/dist/es/commands/UpdateWorkspaceAliasCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -14
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js +0 -207
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -93
- package/dist/es/pagination/Interfaces.js +0 -2
- package/dist/es/pagination/Interfaces.js.map +0 -1
- package/dist/es/pagination/ListWorkspacesPaginator.js.map +0 -1
- package/dist/es/protocols/Aws_restJson1.js +0 -1327
- package/dist/es/protocols/Aws_restJson1.js.map +0 -1
- package/dist/es/runtimeConfig.browser.js.map +0 -1
- package/dist/es/runtimeConfig.js.map +0 -1
- package/dist/es/runtimeConfig.native.js.map +0 -1
- package/dist/es/runtimeConfig.shared.js.map +0 -1
- package/dist/types/Amp.d.ts +0 -63
- package/dist/types/index.d.ts +0 -13
- package/dist/types/models/models_0.d.ts +0 -562
- package/dist/types/protocols/Aws_restJson1.d.ts +0 -26
- package/dist/types/ts3.4/Amp.d.ts +0 -63
- package/dist/types/ts3.4/index.d.ts +0 -13
- package/dist/types/ts3.4/models/models_0.d.ts +0 -562
- package/dist/types/ts3.4/protocols/Aws_restJson1.d.ts +0 -26
- package/endpoints.ts +0 -57
- package/index.ts +0 -13
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -689
- package/pagination/Interfaces.ts +0 -7
- package/pagination/ListWorkspacesPaginator.ts +0 -58
- package/protocols/Aws_restJson1.ts +0 -1348
- package/runtimeConfig.browser.ts +0 -40
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -45
- package/tsconfig.es.json +0 -12
- package/tsconfig.json +0 -32
|
@@ -0,0 +1,2684 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
|
+
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
+
import { expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
|
+
export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
7
|
+
var _c;
|
|
8
|
+
return __generator(this, function (_d) {
|
|
9
|
+
switch (_d.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = {
|
|
14
|
+
"content-type": "application/json",
|
|
15
|
+
};
|
|
16
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
17
|
+
"/workspaces/{workspaceId}/alertmanager/definition";
|
|
18
|
+
if (input.workspaceId !== undefined) {
|
|
19
|
+
labelValue = input.workspaceId;
|
|
20
|
+
if (labelValue.length <= 0) {
|
|
21
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
22
|
+
}
|
|
23
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
27
|
+
}
|
|
28
|
+
body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) })));
|
|
29
|
+
return [2, new __HttpRequest({
|
|
30
|
+
protocol: protocol,
|
|
31
|
+
hostname: hostname,
|
|
32
|
+
port: port,
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: headers,
|
|
35
|
+
path: resolvedPath,
|
|
36
|
+
body: body,
|
|
37
|
+
})];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}); };
|
|
41
|
+
export var serializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
43
|
+
var _c;
|
|
44
|
+
return __generator(this, function (_d) {
|
|
45
|
+
switch (_d.label) {
|
|
46
|
+
case 0: return [4, context.endpoint()];
|
|
47
|
+
case 1:
|
|
48
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
49
|
+
headers = {
|
|
50
|
+
"content-type": "application/json",
|
|
51
|
+
};
|
|
52
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
53
|
+
"/workspaces/{workspaceId}/rulegroupsnamespaces";
|
|
54
|
+
if (input.workspaceId !== undefined) {
|
|
55
|
+
labelValue = input.workspaceId;
|
|
56
|
+
if (labelValue.length <= 0) {
|
|
57
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
58
|
+
}
|
|
59
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
63
|
+
}
|
|
64
|
+
body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) })), (input.name !== undefined && input.name !== null && { name: input.name })), (input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
|
|
65
|
+
return [2, new __HttpRequest({
|
|
66
|
+
protocol: protocol,
|
|
67
|
+
hostname: hostname,
|
|
68
|
+
port: port,
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: headers,
|
|
71
|
+
path: resolvedPath,
|
|
72
|
+
body: body,
|
|
73
|
+
})];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); };
|
|
77
|
+
export var serializeAws_restJson1CreateWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
79
|
+
var _c;
|
|
80
|
+
return __generator(this, function (_d) {
|
|
81
|
+
switch (_d.label) {
|
|
82
|
+
case 0: return [4, context.endpoint()];
|
|
83
|
+
case 1:
|
|
84
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
85
|
+
headers = {
|
|
86
|
+
"content-type": "application/json",
|
|
87
|
+
};
|
|
88
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces";
|
|
89
|
+
body = JSON.stringify(__assign(__assign(__assign({}, (input.alias !== undefined && input.alias !== null && { alias: input.alias })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
|
|
90
|
+
return [2, new __HttpRequest({
|
|
91
|
+
protocol: protocol,
|
|
92
|
+
hostname: hostname,
|
|
93
|
+
port: port,
|
|
94
|
+
method: "POST",
|
|
95
|
+
headers: headers,
|
|
96
|
+
path: resolvedPath,
|
|
97
|
+
body: body,
|
|
98
|
+
})];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}); };
|
|
102
|
+
export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
103
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
104
|
+
return __generator(this, function (_c) {
|
|
105
|
+
switch (_c.label) {
|
|
106
|
+
case 0: return [4, context.endpoint()];
|
|
107
|
+
case 1:
|
|
108
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
109
|
+
headers = {};
|
|
110
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
111
|
+
"/workspaces/{workspaceId}/alertmanager/definition";
|
|
112
|
+
if (input.workspaceId !== undefined) {
|
|
113
|
+
labelValue = input.workspaceId;
|
|
114
|
+
if (labelValue.length <= 0) {
|
|
115
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
116
|
+
}
|
|
117
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
121
|
+
}
|
|
122
|
+
query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
|
|
123
|
+
return [2, new __HttpRequest({
|
|
124
|
+
protocol: protocol,
|
|
125
|
+
hostname: hostname,
|
|
126
|
+
port: port,
|
|
127
|
+
method: "DELETE",
|
|
128
|
+
headers: headers,
|
|
129
|
+
path: resolvedPath,
|
|
130
|
+
query: query,
|
|
131
|
+
body: body,
|
|
132
|
+
})];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}); };
|
|
136
|
+
export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
137
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
|
|
138
|
+
return __generator(this, function (_c) {
|
|
139
|
+
switch (_c.label) {
|
|
140
|
+
case 0: return [4, context.endpoint()];
|
|
141
|
+
case 1:
|
|
142
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
143
|
+
headers = {};
|
|
144
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
145
|
+
"/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
|
|
146
|
+
if (input.workspaceId !== undefined) {
|
|
147
|
+
labelValue = input.workspaceId;
|
|
148
|
+
if (labelValue.length <= 0) {
|
|
149
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
150
|
+
}
|
|
151
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
155
|
+
}
|
|
156
|
+
if (input.name !== undefined) {
|
|
157
|
+
labelValue = input.name;
|
|
158
|
+
if (labelValue.length <= 0) {
|
|
159
|
+
throw new Error("Empty value provided for input HTTP label: name.");
|
|
160
|
+
}
|
|
161
|
+
resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
throw new Error("No value provided for input HTTP label: name.");
|
|
165
|
+
}
|
|
166
|
+
query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
|
|
167
|
+
return [2, new __HttpRequest({
|
|
168
|
+
protocol: protocol,
|
|
169
|
+
hostname: hostname,
|
|
170
|
+
port: port,
|
|
171
|
+
method: "DELETE",
|
|
172
|
+
headers: headers,
|
|
173
|
+
path: resolvedPath,
|
|
174
|
+
query: query,
|
|
175
|
+
body: body,
|
|
176
|
+
})];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}); };
|
|
180
|
+
export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
181
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
182
|
+
return __generator(this, function (_c) {
|
|
183
|
+
switch (_c.label) {
|
|
184
|
+
case 0: return [4, context.endpoint()];
|
|
185
|
+
case 1:
|
|
186
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
187
|
+
headers = {};
|
|
188
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
|
|
189
|
+
if (input.workspaceId !== undefined) {
|
|
190
|
+
labelValue = input.workspaceId;
|
|
191
|
+
if (labelValue.length <= 0) {
|
|
192
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
193
|
+
}
|
|
194
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
198
|
+
}
|
|
199
|
+
query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
|
|
200
|
+
return [2, new __HttpRequest({
|
|
201
|
+
protocol: protocol,
|
|
202
|
+
hostname: hostname,
|
|
203
|
+
port: port,
|
|
204
|
+
method: "DELETE",
|
|
205
|
+
headers: headers,
|
|
206
|
+
path: resolvedPath,
|
|
207
|
+
query: query,
|
|
208
|
+
body: body,
|
|
209
|
+
})];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}); };
|
|
213
|
+
export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
215
|
+
return __generator(this, function (_c) {
|
|
216
|
+
switch (_c.label) {
|
|
217
|
+
case 0: return [4, context.endpoint()];
|
|
218
|
+
case 1:
|
|
219
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
220
|
+
headers = {};
|
|
221
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
222
|
+
"/workspaces/{workspaceId}/alertmanager/definition";
|
|
223
|
+
if (input.workspaceId !== undefined) {
|
|
224
|
+
labelValue = input.workspaceId;
|
|
225
|
+
if (labelValue.length <= 0) {
|
|
226
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
227
|
+
}
|
|
228
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
232
|
+
}
|
|
233
|
+
return [2, new __HttpRequest({
|
|
234
|
+
protocol: protocol,
|
|
235
|
+
hostname: hostname,
|
|
236
|
+
port: port,
|
|
237
|
+
method: "GET",
|
|
238
|
+
headers: headers,
|
|
239
|
+
path: resolvedPath,
|
|
240
|
+
body: body,
|
|
241
|
+
})];
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}); };
|
|
245
|
+
export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
246
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
|
|
247
|
+
return __generator(this, function (_c) {
|
|
248
|
+
switch (_c.label) {
|
|
249
|
+
case 0: return [4, context.endpoint()];
|
|
250
|
+
case 1:
|
|
251
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
252
|
+
headers = {};
|
|
253
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
254
|
+
"/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
|
|
255
|
+
if (input.workspaceId !== undefined) {
|
|
256
|
+
labelValue = input.workspaceId;
|
|
257
|
+
if (labelValue.length <= 0) {
|
|
258
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
259
|
+
}
|
|
260
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
264
|
+
}
|
|
265
|
+
if (input.name !== undefined) {
|
|
266
|
+
labelValue = input.name;
|
|
267
|
+
if (labelValue.length <= 0) {
|
|
268
|
+
throw new Error("Empty value provided for input HTTP label: name.");
|
|
269
|
+
}
|
|
270
|
+
resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
throw new Error("No value provided for input HTTP label: name.");
|
|
274
|
+
}
|
|
275
|
+
return [2, new __HttpRequest({
|
|
276
|
+
protocol: protocol,
|
|
277
|
+
hostname: hostname,
|
|
278
|
+
port: port,
|
|
279
|
+
method: "GET",
|
|
280
|
+
headers: headers,
|
|
281
|
+
path: resolvedPath,
|
|
282
|
+
body: body,
|
|
283
|
+
})];
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}); };
|
|
287
|
+
export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
288
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
289
|
+
return __generator(this, function (_c) {
|
|
290
|
+
switch (_c.label) {
|
|
291
|
+
case 0: return [4, context.endpoint()];
|
|
292
|
+
case 1:
|
|
293
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
294
|
+
headers = {};
|
|
295
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
|
|
296
|
+
if (input.workspaceId !== undefined) {
|
|
297
|
+
labelValue = input.workspaceId;
|
|
298
|
+
if (labelValue.length <= 0) {
|
|
299
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
300
|
+
}
|
|
301
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
305
|
+
}
|
|
306
|
+
return [2, new __HttpRequest({
|
|
307
|
+
protocol: protocol,
|
|
308
|
+
hostname: hostname,
|
|
309
|
+
port: port,
|
|
310
|
+
method: "GET",
|
|
311
|
+
headers: headers,
|
|
312
|
+
path: resolvedPath,
|
|
313
|
+
body: body,
|
|
314
|
+
})];
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}); };
|
|
318
|
+
export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
319
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
320
|
+
return __generator(this, function (_c) {
|
|
321
|
+
switch (_c.label) {
|
|
322
|
+
case 0: return [4, context.endpoint()];
|
|
323
|
+
case 1:
|
|
324
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
325
|
+
headers = {};
|
|
326
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
327
|
+
"/workspaces/{workspaceId}/rulegroupsnamespaces";
|
|
328
|
+
if (input.workspaceId !== undefined) {
|
|
329
|
+
labelValue = input.workspaceId;
|
|
330
|
+
if (labelValue.length <= 0) {
|
|
331
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
332
|
+
}
|
|
333
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
337
|
+
}
|
|
338
|
+
query = __assign(__assign(__assign({}, (input.name !== undefined && { name: input.name })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
|
|
339
|
+
return [2, new __HttpRequest({
|
|
340
|
+
protocol: protocol,
|
|
341
|
+
hostname: hostname,
|
|
342
|
+
port: port,
|
|
343
|
+
method: "GET",
|
|
344
|
+
headers: headers,
|
|
345
|
+
path: resolvedPath,
|
|
346
|
+
query: query,
|
|
347
|
+
body: body,
|
|
348
|
+
})];
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}); };
|
|
352
|
+
export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
353
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
354
|
+
return __generator(this, function (_c) {
|
|
355
|
+
switch (_c.label) {
|
|
356
|
+
case 0: return [4, context.endpoint()];
|
|
357
|
+
case 1:
|
|
358
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
359
|
+
headers = {};
|
|
360
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
|
|
361
|
+
if (input.resourceArn !== undefined) {
|
|
362
|
+
labelValue = input.resourceArn;
|
|
363
|
+
if (labelValue.length <= 0) {
|
|
364
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
365
|
+
}
|
|
366
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
370
|
+
}
|
|
371
|
+
return [2, new __HttpRequest({
|
|
372
|
+
protocol: protocol,
|
|
373
|
+
hostname: hostname,
|
|
374
|
+
port: port,
|
|
375
|
+
method: "GET",
|
|
376
|
+
headers: headers,
|
|
377
|
+
path: resolvedPath,
|
|
378
|
+
body: body,
|
|
379
|
+
})];
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}); };
|
|
383
|
+
export var serializeAws_restJson1ListWorkspacesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
384
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
385
|
+
return __generator(this, function (_c) {
|
|
386
|
+
switch (_c.label) {
|
|
387
|
+
case 0: return [4, context.endpoint()];
|
|
388
|
+
case 1:
|
|
389
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
390
|
+
headers = {};
|
|
391
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces";
|
|
392
|
+
query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.alias !== undefined && { alias: input.alias })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
|
|
393
|
+
return [2, new __HttpRequest({
|
|
394
|
+
protocol: protocol,
|
|
395
|
+
hostname: hostname,
|
|
396
|
+
port: port,
|
|
397
|
+
method: "GET",
|
|
398
|
+
headers: headers,
|
|
399
|
+
path: resolvedPath,
|
|
400
|
+
query: query,
|
|
401
|
+
body: body,
|
|
402
|
+
})];
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}); };
|
|
406
|
+
export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
407
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
408
|
+
var _c;
|
|
409
|
+
return __generator(this, function (_d) {
|
|
410
|
+
switch (_d.label) {
|
|
411
|
+
case 0: return [4, context.endpoint()];
|
|
412
|
+
case 1:
|
|
413
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
414
|
+
headers = {
|
|
415
|
+
"content-type": "application/json",
|
|
416
|
+
};
|
|
417
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
418
|
+
"/workspaces/{workspaceId}/alertmanager/definition";
|
|
419
|
+
if (input.workspaceId !== undefined) {
|
|
420
|
+
labelValue = input.workspaceId;
|
|
421
|
+
if (labelValue.length <= 0) {
|
|
422
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
423
|
+
}
|
|
424
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
428
|
+
}
|
|
429
|
+
body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) })));
|
|
430
|
+
return [2, new __HttpRequest({
|
|
431
|
+
protocol: protocol,
|
|
432
|
+
hostname: hostname,
|
|
433
|
+
port: port,
|
|
434
|
+
method: "PUT",
|
|
435
|
+
headers: headers,
|
|
436
|
+
path: resolvedPath,
|
|
437
|
+
body: body,
|
|
438
|
+
})];
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}); };
|
|
442
|
+
export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
443
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
|
|
444
|
+
var _c;
|
|
445
|
+
return __generator(this, function (_d) {
|
|
446
|
+
switch (_d.label) {
|
|
447
|
+
case 0: return [4, context.endpoint()];
|
|
448
|
+
case 1:
|
|
449
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
450
|
+
headers = {
|
|
451
|
+
"content-type": "application/json",
|
|
452
|
+
};
|
|
453
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
454
|
+
"/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
|
|
455
|
+
if (input.workspaceId !== undefined) {
|
|
456
|
+
labelValue = input.workspaceId;
|
|
457
|
+
if (labelValue.length <= 0) {
|
|
458
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
459
|
+
}
|
|
460
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
464
|
+
}
|
|
465
|
+
if (input.name !== undefined) {
|
|
466
|
+
labelValue = input.name;
|
|
467
|
+
if (labelValue.length <= 0) {
|
|
468
|
+
throw new Error("Empty value provided for input HTTP label: name.");
|
|
469
|
+
}
|
|
470
|
+
resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
throw new Error("No value provided for input HTTP label: name.");
|
|
474
|
+
}
|
|
475
|
+
body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) })));
|
|
476
|
+
return [2, new __HttpRequest({
|
|
477
|
+
protocol: protocol,
|
|
478
|
+
hostname: hostname,
|
|
479
|
+
port: port,
|
|
480
|
+
method: "PUT",
|
|
481
|
+
headers: headers,
|
|
482
|
+
path: resolvedPath,
|
|
483
|
+
body: body,
|
|
484
|
+
})];
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}); };
|
|
488
|
+
export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
489
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
490
|
+
return __generator(this, function (_c) {
|
|
491
|
+
switch (_c.label) {
|
|
492
|
+
case 0: return [4, context.endpoint()];
|
|
493
|
+
case 1:
|
|
494
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
495
|
+
headers = {
|
|
496
|
+
"content-type": "application/json",
|
|
497
|
+
};
|
|
498
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
|
|
499
|
+
if (input.resourceArn !== undefined) {
|
|
500
|
+
labelValue = input.resourceArn;
|
|
501
|
+
if (labelValue.length <= 0) {
|
|
502
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
503
|
+
}
|
|
504
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
508
|
+
}
|
|
509
|
+
body = JSON.stringify(__assign({}, (input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
|
|
510
|
+
return [2, new __HttpRequest({
|
|
511
|
+
protocol: protocol,
|
|
512
|
+
hostname: hostname,
|
|
513
|
+
port: port,
|
|
514
|
+
method: "POST",
|
|
515
|
+
headers: headers,
|
|
516
|
+
path: resolvedPath,
|
|
517
|
+
body: body,
|
|
518
|
+
})];
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}); };
|
|
522
|
+
export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
523
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
|
|
524
|
+
return __generator(this, function (_c) {
|
|
525
|
+
switch (_c.label) {
|
|
526
|
+
case 0: return [4, context.endpoint()];
|
|
527
|
+
case 1:
|
|
528
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
529
|
+
headers = {};
|
|
530
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
|
|
531
|
+
if (input.resourceArn !== undefined) {
|
|
532
|
+
labelValue = input.resourceArn;
|
|
533
|
+
if (labelValue.length <= 0) {
|
|
534
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
535
|
+
}
|
|
536
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
540
|
+
}
|
|
541
|
+
query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
|
|
542
|
+
return [2, new __HttpRequest({
|
|
543
|
+
protocol: protocol,
|
|
544
|
+
hostname: hostname,
|
|
545
|
+
port: port,
|
|
546
|
+
method: "DELETE",
|
|
547
|
+
headers: headers,
|
|
548
|
+
path: resolvedPath,
|
|
549
|
+
query: query,
|
|
550
|
+
body: body,
|
|
551
|
+
})];
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
}); };
|
|
555
|
+
export var serializeAws_restJson1UpdateWorkspaceAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
556
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
557
|
+
var _c;
|
|
558
|
+
return __generator(this, function (_d) {
|
|
559
|
+
switch (_d.label) {
|
|
560
|
+
case 0: return [4, context.endpoint()];
|
|
561
|
+
case 1:
|
|
562
|
+
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
563
|
+
headers = {
|
|
564
|
+
"content-type": "application/json",
|
|
565
|
+
};
|
|
566
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/alias";
|
|
567
|
+
if (input.workspaceId !== undefined) {
|
|
568
|
+
labelValue = input.workspaceId;
|
|
569
|
+
if (labelValue.length <= 0) {
|
|
570
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
571
|
+
}
|
|
572
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
576
|
+
}
|
|
577
|
+
body = JSON.stringify(__assign(__assign({}, (input.alias !== undefined && input.alias !== null && { alias: input.alias })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }));
|
|
578
|
+
return [2, new __HttpRequest({
|
|
579
|
+
protocol: protocol,
|
|
580
|
+
hostname: hostname,
|
|
581
|
+
port: port,
|
|
582
|
+
method: "POST",
|
|
583
|
+
headers: headers,
|
|
584
|
+
path: resolvedPath,
|
|
585
|
+
body: body,
|
|
586
|
+
})];
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
}); };
|
|
590
|
+
export var deserializeAws_restJson1CreateAlertManagerDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
591
|
+
var contents, data, _a, _b;
|
|
592
|
+
return __generator(this, function (_c) {
|
|
593
|
+
switch (_c.label) {
|
|
594
|
+
case 0:
|
|
595
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
596
|
+
return [2, deserializeAws_restJson1CreateAlertManagerDefinitionCommandError(output, context)];
|
|
597
|
+
}
|
|
598
|
+
contents = {
|
|
599
|
+
$metadata: deserializeMetadata(output),
|
|
600
|
+
status: undefined,
|
|
601
|
+
};
|
|
602
|
+
_a = __expectNonNull;
|
|
603
|
+
_b = __expectObject;
|
|
604
|
+
return [4, parseBody(output.body, context)];
|
|
605
|
+
case 1:
|
|
606
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
607
|
+
if (data.status !== undefined && data.status !== null) {
|
|
608
|
+
contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
|
|
609
|
+
}
|
|
610
|
+
return [2, Promise.resolve(contents)];
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
}); };
|
|
614
|
+
var deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
615
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
|
|
616
|
+
var _k;
|
|
617
|
+
return __generator(this, function (_l) {
|
|
618
|
+
switch (_l.label) {
|
|
619
|
+
case 0:
|
|
620
|
+
_a = [__assign({}, output)];
|
|
621
|
+
_k = {};
|
|
622
|
+
return [4, parseBody(output.body, context)];
|
|
623
|
+
case 1:
|
|
624
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
|
|
625
|
+
errorCode = "UnknownError";
|
|
626
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
627
|
+
_b = errorCode;
|
|
628
|
+
switch (_b) {
|
|
629
|
+
case "AccessDeniedException": return [3, 2];
|
|
630
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
631
|
+
case "ConflictException": return [3, 4];
|
|
632
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
633
|
+
case "InternalServerException": return [3, 6];
|
|
634
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
635
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
636
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
637
|
+
case "ServiceQuotaExceededException": return [3, 10];
|
|
638
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 10];
|
|
639
|
+
case "ThrottlingException": return [3, 12];
|
|
640
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 12];
|
|
641
|
+
case "ValidationException": return [3, 14];
|
|
642
|
+
case "com.amazonaws.amp#ValidationException": return [3, 14];
|
|
643
|
+
}
|
|
644
|
+
return [3, 16];
|
|
645
|
+
case 2:
|
|
646
|
+
_c = [{}];
|
|
647
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
648
|
+
case 3:
|
|
649
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
650
|
+
return [3, 17];
|
|
651
|
+
case 4:
|
|
652
|
+
_d = [{}];
|
|
653
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
654
|
+
case 5:
|
|
655
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
656
|
+
return [3, 17];
|
|
657
|
+
case 6:
|
|
658
|
+
_e = [{}];
|
|
659
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
660
|
+
case 7:
|
|
661
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
662
|
+
return [3, 17];
|
|
663
|
+
case 8:
|
|
664
|
+
_f = [{}];
|
|
665
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
666
|
+
case 9:
|
|
667
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
668
|
+
return [3, 17];
|
|
669
|
+
case 10:
|
|
670
|
+
_g = [{}];
|
|
671
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
672
|
+
case 11:
|
|
673
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
674
|
+
return [3, 17];
|
|
675
|
+
case 12:
|
|
676
|
+
_h = [{}];
|
|
677
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
678
|
+
case 13:
|
|
679
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
680
|
+
return [3, 17];
|
|
681
|
+
case 14:
|
|
682
|
+
_j = [{}];
|
|
683
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
684
|
+
case 15:
|
|
685
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
686
|
+
return [3, 17];
|
|
687
|
+
case 16:
|
|
688
|
+
parsedBody = parsedOutput.body;
|
|
689
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
690
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
691
|
+
_l.label = 17;
|
|
692
|
+
case 17:
|
|
693
|
+
message = response.message || response.Message || errorCode;
|
|
694
|
+
response.message = message;
|
|
695
|
+
delete response.Message;
|
|
696
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
}); };
|
|
700
|
+
export var deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
701
|
+
var contents, data, _a, _b;
|
|
702
|
+
return __generator(this, function (_c) {
|
|
703
|
+
switch (_c.label) {
|
|
704
|
+
case 0:
|
|
705
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
706
|
+
return [2, deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError(output, context)];
|
|
707
|
+
}
|
|
708
|
+
contents = {
|
|
709
|
+
$metadata: deserializeMetadata(output),
|
|
710
|
+
arn: undefined,
|
|
711
|
+
name: undefined,
|
|
712
|
+
status: undefined,
|
|
713
|
+
tags: undefined,
|
|
714
|
+
};
|
|
715
|
+
_a = __expectNonNull;
|
|
716
|
+
_b = __expectObject;
|
|
717
|
+
return [4, parseBody(output.body, context)];
|
|
718
|
+
case 1:
|
|
719
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
720
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
721
|
+
contents.arn = __expectString(data.arn);
|
|
722
|
+
}
|
|
723
|
+
if (data.name !== undefined && data.name !== null) {
|
|
724
|
+
contents.name = __expectString(data.name);
|
|
725
|
+
}
|
|
726
|
+
if (data.status !== undefined && data.status !== null) {
|
|
727
|
+
contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
|
|
728
|
+
}
|
|
729
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
730
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
731
|
+
}
|
|
732
|
+
return [2, Promise.resolve(contents)];
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}); };
|
|
736
|
+
var deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
737
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
|
|
738
|
+
var _k;
|
|
739
|
+
return __generator(this, function (_l) {
|
|
740
|
+
switch (_l.label) {
|
|
741
|
+
case 0:
|
|
742
|
+
_a = [__assign({}, output)];
|
|
743
|
+
_k = {};
|
|
744
|
+
return [4, parseBody(output.body, context)];
|
|
745
|
+
case 1:
|
|
746
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
|
|
747
|
+
errorCode = "UnknownError";
|
|
748
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
749
|
+
_b = errorCode;
|
|
750
|
+
switch (_b) {
|
|
751
|
+
case "AccessDeniedException": return [3, 2];
|
|
752
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
753
|
+
case "ConflictException": return [3, 4];
|
|
754
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
755
|
+
case "InternalServerException": return [3, 6];
|
|
756
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
757
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
758
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
759
|
+
case "ServiceQuotaExceededException": return [3, 10];
|
|
760
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 10];
|
|
761
|
+
case "ThrottlingException": return [3, 12];
|
|
762
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 12];
|
|
763
|
+
case "ValidationException": return [3, 14];
|
|
764
|
+
case "com.amazonaws.amp#ValidationException": return [3, 14];
|
|
765
|
+
}
|
|
766
|
+
return [3, 16];
|
|
767
|
+
case 2:
|
|
768
|
+
_c = [{}];
|
|
769
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
770
|
+
case 3:
|
|
771
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
772
|
+
return [3, 17];
|
|
773
|
+
case 4:
|
|
774
|
+
_d = [{}];
|
|
775
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
776
|
+
case 5:
|
|
777
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
778
|
+
return [3, 17];
|
|
779
|
+
case 6:
|
|
780
|
+
_e = [{}];
|
|
781
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
782
|
+
case 7:
|
|
783
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
784
|
+
return [3, 17];
|
|
785
|
+
case 8:
|
|
786
|
+
_f = [{}];
|
|
787
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
788
|
+
case 9:
|
|
789
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
790
|
+
return [3, 17];
|
|
791
|
+
case 10:
|
|
792
|
+
_g = [{}];
|
|
793
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
794
|
+
case 11:
|
|
795
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
796
|
+
return [3, 17];
|
|
797
|
+
case 12:
|
|
798
|
+
_h = [{}];
|
|
799
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
800
|
+
case 13:
|
|
801
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
802
|
+
return [3, 17];
|
|
803
|
+
case 14:
|
|
804
|
+
_j = [{}];
|
|
805
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
806
|
+
case 15:
|
|
807
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
808
|
+
return [3, 17];
|
|
809
|
+
case 16:
|
|
810
|
+
parsedBody = parsedOutput.body;
|
|
811
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
812
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
813
|
+
_l.label = 17;
|
|
814
|
+
case 17:
|
|
815
|
+
message = response.message || response.Message || errorCode;
|
|
816
|
+
response.message = message;
|
|
817
|
+
delete response.Message;
|
|
818
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
}); };
|
|
822
|
+
export var deserializeAws_restJson1CreateWorkspaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
823
|
+
var contents, data, _a, _b;
|
|
824
|
+
return __generator(this, function (_c) {
|
|
825
|
+
switch (_c.label) {
|
|
826
|
+
case 0:
|
|
827
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
828
|
+
return [2, deserializeAws_restJson1CreateWorkspaceCommandError(output, context)];
|
|
829
|
+
}
|
|
830
|
+
contents = {
|
|
831
|
+
$metadata: deserializeMetadata(output),
|
|
832
|
+
arn: undefined,
|
|
833
|
+
status: undefined,
|
|
834
|
+
tags: undefined,
|
|
835
|
+
workspaceId: undefined,
|
|
836
|
+
};
|
|
837
|
+
_a = __expectNonNull;
|
|
838
|
+
_b = __expectObject;
|
|
839
|
+
return [4, parseBody(output.body, context)];
|
|
840
|
+
case 1:
|
|
841
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
842
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
843
|
+
contents.arn = __expectString(data.arn);
|
|
844
|
+
}
|
|
845
|
+
if (data.status !== undefined && data.status !== null) {
|
|
846
|
+
contents.status = deserializeAws_restJson1WorkspaceStatus(data.status, context);
|
|
847
|
+
}
|
|
848
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
849
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
850
|
+
}
|
|
851
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
852
|
+
contents.workspaceId = __expectString(data.workspaceId);
|
|
853
|
+
}
|
|
854
|
+
return [2, Promise.resolve(contents)];
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
}); };
|
|
858
|
+
var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
859
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
|
|
860
|
+
var _j;
|
|
861
|
+
return __generator(this, function (_k) {
|
|
862
|
+
switch (_k.label) {
|
|
863
|
+
case 0:
|
|
864
|
+
_a = [__assign({}, output)];
|
|
865
|
+
_j = {};
|
|
866
|
+
return [4, parseBody(output.body, context)];
|
|
867
|
+
case 1:
|
|
868
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
|
|
869
|
+
errorCode = "UnknownError";
|
|
870
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
871
|
+
_b = errorCode;
|
|
872
|
+
switch (_b) {
|
|
873
|
+
case "AccessDeniedException": return [3, 2];
|
|
874
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
875
|
+
case "ConflictException": return [3, 4];
|
|
876
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
877
|
+
case "InternalServerException": return [3, 6];
|
|
878
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
879
|
+
case "ServiceQuotaExceededException": return [3, 8];
|
|
880
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 8];
|
|
881
|
+
case "ThrottlingException": return [3, 10];
|
|
882
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 10];
|
|
883
|
+
case "ValidationException": return [3, 12];
|
|
884
|
+
case "com.amazonaws.amp#ValidationException": return [3, 12];
|
|
885
|
+
}
|
|
886
|
+
return [3, 14];
|
|
887
|
+
case 2:
|
|
888
|
+
_c = [{}];
|
|
889
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
890
|
+
case 3:
|
|
891
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
892
|
+
return [3, 15];
|
|
893
|
+
case 4:
|
|
894
|
+
_d = [{}];
|
|
895
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
896
|
+
case 5:
|
|
897
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
898
|
+
return [3, 15];
|
|
899
|
+
case 6:
|
|
900
|
+
_e = [{}];
|
|
901
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
902
|
+
case 7:
|
|
903
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
904
|
+
return [3, 15];
|
|
905
|
+
case 8:
|
|
906
|
+
_f = [{}];
|
|
907
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
908
|
+
case 9:
|
|
909
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
910
|
+
return [3, 15];
|
|
911
|
+
case 10:
|
|
912
|
+
_g = [{}];
|
|
913
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
914
|
+
case 11:
|
|
915
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
916
|
+
return [3, 15];
|
|
917
|
+
case 12:
|
|
918
|
+
_h = [{}];
|
|
919
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
920
|
+
case 13:
|
|
921
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
922
|
+
return [3, 15];
|
|
923
|
+
case 14:
|
|
924
|
+
parsedBody = parsedOutput.body;
|
|
925
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
926
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
927
|
+
_k.label = 15;
|
|
928
|
+
case 15:
|
|
929
|
+
message = response.message || response.Message || errorCode;
|
|
930
|
+
response.message = message;
|
|
931
|
+
delete response.Message;
|
|
932
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
}); };
|
|
936
|
+
export var deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
937
|
+
var contents;
|
|
938
|
+
return __generator(this, function (_a) {
|
|
939
|
+
switch (_a.label) {
|
|
940
|
+
case 0:
|
|
941
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
942
|
+
return [2, deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError(output, context)];
|
|
943
|
+
}
|
|
944
|
+
contents = {
|
|
945
|
+
$metadata: deserializeMetadata(output),
|
|
946
|
+
};
|
|
947
|
+
return [4, collectBody(output.body, context)];
|
|
948
|
+
case 1:
|
|
949
|
+
_a.sent();
|
|
950
|
+
return [2, Promise.resolve(contents)];
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
}); };
|
|
954
|
+
var deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
955
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
|
|
956
|
+
var _j;
|
|
957
|
+
return __generator(this, function (_k) {
|
|
958
|
+
switch (_k.label) {
|
|
959
|
+
case 0:
|
|
960
|
+
_a = [__assign({}, output)];
|
|
961
|
+
_j = {};
|
|
962
|
+
return [4, parseBody(output.body, context)];
|
|
963
|
+
case 1:
|
|
964
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
|
|
965
|
+
errorCode = "UnknownError";
|
|
966
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
967
|
+
_b = errorCode;
|
|
968
|
+
switch (_b) {
|
|
969
|
+
case "AccessDeniedException": return [3, 2];
|
|
970
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
971
|
+
case "ConflictException": return [3, 4];
|
|
972
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
973
|
+
case "InternalServerException": return [3, 6];
|
|
974
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
975
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
976
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
977
|
+
case "ThrottlingException": return [3, 10];
|
|
978
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 10];
|
|
979
|
+
case "ValidationException": return [3, 12];
|
|
980
|
+
case "com.amazonaws.amp#ValidationException": return [3, 12];
|
|
981
|
+
}
|
|
982
|
+
return [3, 14];
|
|
983
|
+
case 2:
|
|
984
|
+
_c = [{}];
|
|
985
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
986
|
+
case 3:
|
|
987
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
988
|
+
return [3, 15];
|
|
989
|
+
case 4:
|
|
990
|
+
_d = [{}];
|
|
991
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
992
|
+
case 5:
|
|
993
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
994
|
+
return [3, 15];
|
|
995
|
+
case 6:
|
|
996
|
+
_e = [{}];
|
|
997
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
998
|
+
case 7:
|
|
999
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1000
|
+
return [3, 15];
|
|
1001
|
+
case 8:
|
|
1002
|
+
_f = [{}];
|
|
1003
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1004
|
+
case 9:
|
|
1005
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1006
|
+
return [3, 15];
|
|
1007
|
+
case 10:
|
|
1008
|
+
_g = [{}];
|
|
1009
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1010
|
+
case 11:
|
|
1011
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1012
|
+
return [3, 15];
|
|
1013
|
+
case 12:
|
|
1014
|
+
_h = [{}];
|
|
1015
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1016
|
+
case 13:
|
|
1017
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1018
|
+
return [3, 15];
|
|
1019
|
+
case 14:
|
|
1020
|
+
parsedBody = parsedOutput.body;
|
|
1021
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1022
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1023
|
+
_k.label = 15;
|
|
1024
|
+
case 15:
|
|
1025
|
+
message = response.message || response.Message || errorCode;
|
|
1026
|
+
response.message = message;
|
|
1027
|
+
delete response.Message;
|
|
1028
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
}); };
|
|
1032
|
+
export var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1033
|
+
var contents;
|
|
1034
|
+
return __generator(this, function (_a) {
|
|
1035
|
+
switch (_a.label) {
|
|
1036
|
+
case 0:
|
|
1037
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
1038
|
+
return [2, deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError(output, context)];
|
|
1039
|
+
}
|
|
1040
|
+
contents = {
|
|
1041
|
+
$metadata: deserializeMetadata(output),
|
|
1042
|
+
};
|
|
1043
|
+
return [4, collectBody(output.body, context)];
|
|
1044
|
+
case 1:
|
|
1045
|
+
_a.sent();
|
|
1046
|
+
return [2, Promise.resolve(contents)];
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
}); };
|
|
1050
|
+
var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1051
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
|
|
1052
|
+
var _j;
|
|
1053
|
+
return __generator(this, function (_k) {
|
|
1054
|
+
switch (_k.label) {
|
|
1055
|
+
case 0:
|
|
1056
|
+
_a = [__assign({}, output)];
|
|
1057
|
+
_j = {};
|
|
1058
|
+
return [4, parseBody(output.body, context)];
|
|
1059
|
+
case 1:
|
|
1060
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
|
|
1061
|
+
errorCode = "UnknownError";
|
|
1062
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1063
|
+
_b = errorCode;
|
|
1064
|
+
switch (_b) {
|
|
1065
|
+
case "AccessDeniedException": return [3, 2];
|
|
1066
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1067
|
+
case "ConflictException": return [3, 4];
|
|
1068
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
1069
|
+
case "InternalServerException": return [3, 6];
|
|
1070
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
1071
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
1072
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
1073
|
+
case "ThrottlingException": return [3, 10];
|
|
1074
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 10];
|
|
1075
|
+
case "ValidationException": return [3, 12];
|
|
1076
|
+
case "com.amazonaws.amp#ValidationException": return [3, 12];
|
|
1077
|
+
}
|
|
1078
|
+
return [3, 14];
|
|
1079
|
+
case 2:
|
|
1080
|
+
_c = [{}];
|
|
1081
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1082
|
+
case 3:
|
|
1083
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1084
|
+
return [3, 15];
|
|
1085
|
+
case 4:
|
|
1086
|
+
_d = [{}];
|
|
1087
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
1088
|
+
case 5:
|
|
1089
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1090
|
+
return [3, 15];
|
|
1091
|
+
case 6:
|
|
1092
|
+
_e = [{}];
|
|
1093
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1094
|
+
case 7:
|
|
1095
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1096
|
+
return [3, 15];
|
|
1097
|
+
case 8:
|
|
1098
|
+
_f = [{}];
|
|
1099
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1100
|
+
case 9:
|
|
1101
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1102
|
+
return [3, 15];
|
|
1103
|
+
case 10:
|
|
1104
|
+
_g = [{}];
|
|
1105
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1106
|
+
case 11:
|
|
1107
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1108
|
+
return [3, 15];
|
|
1109
|
+
case 12:
|
|
1110
|
+
_h = [{}];
|
|
1111
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1112
|
+
case 13:
|
|
1113
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1114
|
+
return [3, 15];
|
|
1115
|
+
case 14:
|
|
1116
|
+
parsedBody = parsedOutput.body;
|
|
1117
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1118
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1119
|
+
_k.label = 15;
|
|
1120
|
+
case 15:
|
|
1121
|
+
message = response.message || response.Message || errorCode;
|
|
1122
|
+
response.message = message;
|
|
1123
|
+
delete response.Message;
|
|
1124
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
}); };
|
|
1128
|
+
export var deserializeAws_restJson1DeleteWorkspaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1129
|
+
var contents;
|
|
1130
|
+
return __generator(this, function (_a) {
|
|
1131
|
+
switch (_a.label) {
|
|
1132
|
+
case 0:
|
|
1133
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
1134
|
+
return [2, deserializeAws_restJson1DeleteWorkspaceCommandError(output, context)];
|
|
1135
|
+
}
|
|
1136
|
+
contents = {
|
|
1137
|
+
$metadata: deserializeMetadata(output),
|
|
1138
|
+
};
|
|
1139
|
+
return [4, collectBody(output.body, context)];
|
|
1140
|
+
case 1:
|
|
1141
|
+
_a.sent();
|
|
1142
|
+
return [2, Promise.resolve(contents)];
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
}); };
|
|
1146
|
+
var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1147
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
|
|
1148
|
+
var _j;
|
|
1149
|
+
return __generator(this, function (_k) {
|
|
1150
|
+
switch (_k.label) {
|
|
1151
|
+
case 0:
|
|
1152
|
+
_a = [__assign({}, output)];
|
|
1153
|
+
_j = {};
|
|
1154
|
+
return [4, parseBody(output.body, context)];
|
|
1155
|
+
case 1:
|
|
1156
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
|
|
1157
|
+
errorCode = "UnknownError";
|
|
1158
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1159
|
+
_b = errorCode;
|
|
1160
|
+
switch (_b) {
|
|
1161
|
+
case "AccessDeniedException": return [3, 2];
|
|
1162
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1163
|
+
case "ConflictException": return [3, 4];
|
|
1164
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
1165
|
+
case "InternalServerException": return [3, 6];
|
|
1166
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
1167
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
1168
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
1169
|
+
case "ThrottlingException": return [3, 10];
|
|
1170
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 10];
|
|
1171
|
+
case "ValidationException": return [3, 12];
|
|
1172
|
+
case "com.amazonaws.amp#ValidationException": return [3, 12];
|
|
1173
|
+
}
|
|
1174
|
+
return [3, 14];
|
|
1175
|
+
case 2:
|
|
1176
|
+
_c = [{}];
|
|
1177
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1178
|
+
case 3:
|
|
1179
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1180
|
+
return [3, 15];
|
|
1181
|
+
case 4:
|
|
1182
|
+
_d = [{}];
|
|
1183
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
1184
|
+
case 5:
|
|
1185
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1186
|
+
return [3, 15];
|
|
1187
|
+
case 6:
|
|
1188
|
+
_e = [{}];
|
|
1189
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1190
|
+
case 7:
|
|
1191
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1192
|
+
return [3, 15];
|
|
1193
|
+
case 8:
|
|
1194
|
+
_f = [{}];
|
|
1195
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1196
|
+
case 9:
|
|
1197
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1198
|
+
return [3, 15];
|
|
1199
|
+
case 10:
|
|
1200
|
+
_g = [{}];
|
|
1201
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1202
|
+
case 11:
|
|
1203
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1204
|
+
return [3, 15];
|
|
1205
|
+
case 12:
|
|
1206
|
+
_h = [{}];
|
|
1207
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1208
|
+
case 13:
|
|
1209
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1210
|
+
return [3, 15];
|
|
1211
|
+
case 14:
|
|
1212
|
+
parsedBody = parsedOutput.body;
|
|
1213
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1214
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1215
|
+
_k.label = 15;
|
|
1216
|
+
case 15:
|
|
1217
|
+
message = response.message || response.Message || errorCode;
|
|
1218
|
+
response.message = message;
|
|
1219
|
+
delete response.Message;
|
|
1220
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}); };
|
|
1224
|
+
export var deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1225
|
+
var contents, data, _a, _b;
|
|
1226
|
+
return __generator(this, function (_c) {
|
|
1227
|
+
switch (_c.label) {
|
|
1228
|
+
case 0:
|
|
1229
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1230
|
+
return [2, deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError(output, context)];
|
|
1231
|
+
}
|
|
1232
|
+
contents = {
|
|
1233
|
+
$metadata: deserializeMetadata(output),
|
|
1234
|
+
alertManagerDefinition: undefined,
|
|
1235
|
+
};
|
|
1236
|
+
_a = __expectNonNull;
|
|
1237
|
+
_b = __expectObject;
|
|
1238
|
+
return [4, parseBody(output.body, context)];
|
|
1239
|
+
case 1:
|
|
1240
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1241
|
+
if (data.alertManagerDefinition !== undefined && data.alertManagerDefinition !== null) {
|
|
1242
|
+
contents.alertManagerDefinition = deserializeAws_restJson1AlertManagerDefinitionDescription(data.alertManagerDefinition, context);
|
|
1243
|
+
}
|
|
1244
|
+
return [2, Promise.resolve(contents)];
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
}); };
|
|
1248
|
+
var deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1249
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
1250
|
+
var _h;
|
|
1251
|
+
return __generator(this, function (_j) {
|
|
1252
|
+
switch (_j.label) {
|
|
1253
|
+
case 0:
|
|
1254
|
+
_a = [__assign({}, output)];
|
|
1255
|
+
_h = {};
|
|
1256
|
+
return [4, parseBody(output.body, context)];
|
|
1257
|
+
case 1:
|
|
1258
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
1259
|
+
errorCode = "UnknownError";
|
|
1260
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1261
|
+
_b = errorCode;
|
|
1262
|
+
switch (_b) {
|
|
1263
|
+
case "AccessDeniedException": return [3, 2];
|
|
1264
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1265
|
+
case "InternalServerException": return [3, 4];
|
|
1266
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1267
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
1268
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
1269
|
+
case "ThrottlingException": return [3, 8];
|
|
1270
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
1271
|
+
case "ValidationException": return [3, 10];
|
|
1272
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
1273
|
+
}
|
|
1274
|
+
return [3, 12];
|
|
1275
|
+
case 2:
|
|
1276
|
+
_c = [{}];
|
|
1277
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1278
|
+
case 3:
|
|
1279
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1280
|
+
return [3, 13];
|
|
1281
|
+
case 4:
|
|
1282
|
+
_d = [{}];
|
|
1283
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1284
|
+
case 5:
|
|
1285
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1286
|
+
return [3, 13];
|
|
1287
|
+
case 6:
|
|
1288
|
+
_e = [{}];
|
|
1289
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1290
|
+
case 7:
|
|
1291
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1292
|
+
return [3, 13];
|
|
1293
|
+
case 8:
|
|
1294
|
+
_f = [{}];
|
|
1295
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1296
|
+
case 9:
|
|
1297
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1298
|
+
return [3, 13];
|
|
1299
|
+
case 10:
|
|
1300
|
+
_g = [{}];
|
|
1301
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1302
|
+
case 11:
|
|
1303
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1304
|
+
return [3, 13];
|
|
1305
|
+
case 12:
|
|
1306
|
+
parsedBody = parsedOutput.body;
|
|
1307
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1308
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1309
|
+
_j.label = 13;
|
|
1310
|
+
case 13:
|
|
1311
|
+
message = response.message || response.Message || errorCode;
|
|
1312
|
+
response.message = message;
|
|
1313
|
+
delete response.Message;
|
|
1314
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
}); };
|
|
1318
|
+
export var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1319
|
+
var contents, data, _a, _b;
|
|
1320
|
+
return __generator(this, function (_c) {
|
|
1321
|
+
switch (_c.label) {
|
|
1322
|
+
case 0:
|
|
1323
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1324
|
+
return [2, deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError(output, context)];
|
|
1325
|
+
}
|
|
1326
|
+
contents = {
|
|
1327
|
+
$metadata: deserializeMetadata(output),
|
|
1328
|
+
ruleGroupsNamespace: undefined,
|
|
1329
|
+
};
|
|
1330
|
+
_a = __expectNonNull;
|
|
1331
|
+
_b = __expectObject;
|
|
1332
|
+
return [4, parseBody(output.body, context)];
|
|
1333
|
+
case 1:
|
|
1334
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1335
|
+
if (data.ruleGroupsNamespace !== undefined && data.ruleGroupsNamespace !== null) {
|
|
1336
|
+
contents.ruleGroupsNamespace = deserializeAws_restJson1RuleGroupsNamespaceDescription(data.ruleGroupsNamespace, context);
|
|
1337
|
+
}
|
|
1338
|
+
return [2, Promise.resolve(contents)];
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
}); };
|
|
1342
|
+
var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1343
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
1344
|
+
var _h;
|
|
1345
|
+
return __generator(this, function (_j) {
|
|
1346
|
+
switch (_j.label) {
|
|
1347
|
+
case 0:
|
|
1348
|
+
_a = [__assign({}, output)];
|
|
1349
|
+
_h = {};
|
|
1350
|
+
return [4, parseBody(output.body, context)];
|
|
1351
|
+
case 1:
|
|
1352
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
1353
|
+
errorCode = "UnknownError";
|
|
1354
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1355
|
+
_b = errorCode;
|
|
1356
|
+
switch (_b) {
|
|
1357
|
+
case "AccessDeniedException": return [3, 2];
|
|
1358
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1359
|
+
case "InternalServerException": return [3, 4];
|
|
1360
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1361
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
1362
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
1363
|
+
case "ThrottlingException": return [3, 8];
|
|
1364
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
1365
|
+
case "ValidationException": return [3, 10];
|
|
1366
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
1367
|
+
}
|
|
1368
|
+
return [3, 12];
|
|
1369
|
+
case 2:
|
|
1370
|
+
_c = [{}];
|
|
1371
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1372
|
+
case 3:
|
|
1373
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1374
|
+
return [3, 13];
|
|
1375
|
+
case 4:
|
|
1376
|
+
_d = [{}];
|
|
1377
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1378
|
+
case 5:
|
|
1379
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1380
|
+
return [3, 13];
|
|
1381
|
+
case 6:
|
|
1382
|
+
_e = [{}];
|
|
1383
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1384
|
+
case 7:
|
|
1385
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1386
|
+
return [3, 13];
|
|
1387
|
+
case 8:
|
|
1388
|
+
_f = [{}];
|
|
1389
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1390
|
+
case 9:
|
|
1391
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1392
|
+
return [3, 13];
|
|
1393
|
+
case 10:
|
|
1394
|
+
_g = [{}];
|
|
1395
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1396
|
+
case 11:
|
|
1397
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1398
|
+
return [3, 13];
|
|
1399
|
+
case 12:
|
|
1400
|
+
parsedBody = parsedOutput.body;
|
|
1401
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1402
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1403
|
+
_j.label = 13;
|
|
1404
|
+
case 13:
|
|
1405
|
+
message = response.message || response.Message || errorCode;
|
|
1406
|
+
response.message = message;
|
|
1407
|
+
delete response.Message;
|
|
1408
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
}); };
|
|
1412
|
+
export var deserializeAws_restJson1DescribeWorkspaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1413
|
+
var contents, data, _a, _b;
|
|
1414
|
+
return __generator(this, function (_c) {
|
|
1415
|
+
switch (_c.label) {
|
|
1416
|
+
case 0:
|
|
1417
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1418
|
+
return [2, deserializeAws_restJson1DescribeWorkspaceCommandError(output, context)];
|
|
1419
|
+
}
|
|
1420
|
+
contents = {
|
|
1421
|
+
$metadata: deserializeMetadata(output),
|
|
1422
|
+
workspace: undefined,
|
|
1423
|
+
};
|
|
1424
|
+
_a = __expectNonNull;
|
|
1425
|
+
_b = __expectObject;
|
|
1426
|
+
return [4, parseBody(output.body, context)];
|
|
1427
|
+
case 1:
|
|
1428
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1429
|
+
if (data.workspace !== undefined && data.workspace !== null) {
|
|
1430
|
+
contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
|
|
1431
|
+
}
|
|
1432
|
+
return [2, Promise.resolve(contents)];
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
}); };
|
|
1436
|
+
var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1437
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
1438
|
+
var _h;
|
|
1439
|
+
return __generator(this, function (_j) {
|
|
1440
|
+
switch (_j.label) {
|
|
1441
|
+
case 0:
|
|
1442
|
+
_a = [__assign({}, output)];
|
|
1443
|
+
_h = {};
|
|
1444
|
+
return [4, parseBody(output.body, context)];
|
|
1445
|
+
case 1:
|
|
1446
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
1447
|
+
errorCode = "UnknownError";
|
|
1448
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1449
|
+
_b = errorCode;
|
|
1450
|
+
switch (_b) {
|
|
1451
|
+
case "AccessDeniedException": return [3, 2];
|
|
1452
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1453
|
+
case "InternalServerException": return [3, 4];
|
|
1454
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1455
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
1456
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
1457
|
+
case "ThrottlingException": return [3, 8];
|
|
1458
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
1459
|
+
case "ValidationException": return [3, 10];
|
|
1460
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
1461
|
+
}
|
|
1462
|
+
return [3, 12];
|
|
1463
|
+
case 2:
|
|
1464
|
+
_c = [{}];
|
|
1465
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1466
|
+
case 3:
|
|
1467
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1468
|
+
return [3, 13];
|
|
1469
|
+
case 4:
|
|
1470
|
+
_d = [{}];
|
|
1471
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1472
|
+
case 5:
|
|
1473
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1474
|
+
return [3, 13];
|
|
1475
|
+
case 6:
|
|
1476
|
+
_e = [{}];
|
|
1477
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1478
|
+
case 7:
|
|
1479
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1480
|
+
return [3, 13];
|
|
1481
|
+
case 8:
|
|
1482
|
+
_f = [{}];
|
|
1483
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1484
|
+
case 9:
|
|
1485
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1486
|
+
return [3, 13];
|
|
1487
|
+
case 10:
|
|
1488
|
+
_g = [{}];
|
|
1489
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1490
|
+
case 11:
|
|
1491
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1492
|
+
return [3, 13];
|
|
1493
|
+
case 12:
|
|
1494
|
+
parsedBody = parsedOutput.body;
|
|
1495
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1496
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1497
|
+
_j.label = 13;
|
|
1498
|
+
case 13:
|
|
1499
|
+
message = response.message || response.Message || errorCode;
|
|
1500
|
+
response.message = message;
|
|
1501
|
+
delete response.Message;
|
|
1502
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
}); };
|
|
1506
|
+
export var deserializeAws_restJson1ListRuleGroupsNamespacesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1507
|
+
var contents, data, _a, _b;
|
|
1508
|
+
return __generator(this, function (_c) {
|
|
1509
|
+
switch (_c.label) {
|
|
1510
|
+
case 0:
|
|
1511
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1512
|
+
return [2, deserializeAws_restJson1ListRuleGroupsNamespacesCommandError(output, context)];
|
|
1513
|
+
}
|
|
1514
|
+
contents = {
|
|
1515
|
+
$metadata: deserializeMetadata(output),
|
|
1516
|
+
nextToken: undefined,
|
|
1517
|
+
ruleGroupsNamespaces: undefined,
|
|
1518
|
+
};
|
|
1519
|
+
_a = __expectNonNull;
|
|
1520
|
+
_b = __expectObject;
|
|
1521
|
+
return [4, parseBody(output.body, context)];
|
|
1522
|
+
case 1:
|
|
1523
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1524
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
1525
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1526
|
+
}
|
|
1527
|
+
if (data.ruleGroupsNamespaces !== undefined && data.ruleGroupsNamespaces !== null) {
|
|
1528
|
+
contents.ruleGroupsNamespaces = deserializeAws_restJson1RuleGroupsNamespaceSummaryList(data.ruleGroupsNamespaces, context);
|
|
1529
|
+
}
|
|
1530
|
+
return [2, Promise.resolve(contents)];
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
}); };
|
|
1534
|
+
var deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1535
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
1536
|
+
var _h;
|
|
1537
|
+
return __generator(this, function (_j) {
|
|
1538
|
+
switch (_j.label) {
|
|
1539
|
+
case 0:
|
|
1540
|
+
_a = [__assign({}, output)];
|
|
1541
|
+
_h = {};
|
|
1542
|
+
return [4, parseBody(output.body, context)];
|
|
1543
|
+
case 1:
|
|
1544
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
1545
|
+
errorCode = "UnknownError";
|
|
1546
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1547
|
+
_b = errorCode;
|
|
1548
|
+
switch (_b) {
|
|
1549
|
+
case "AccessDeniedException": return [3, 2];
|
|
1550
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1551
|
+
case "InternalServerException": return [3, 4];
|
|
1552
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1553
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
1554
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
1555
|
+
case "ThrottlingException": return [3, 8];
|
|
1556
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
1557
|
+
case "ValidationException": return [3, 10];
|
|
1558
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
1559
|
+
}
|
|
1560
|
+
return [3, 12];
|
|
1561
|
+
case 2:
|
|
1562
|
+
_c = [{}];
|
|
1563
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1564
|
+
case 3:
|
|
1565
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1566
|
+
return [3, 13];
|
|
1567
|
+
case 4:
|
|
1568
|
+
_d = [{}];
|
|
1569
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1570
|
+
case 5:
|
|
1571
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1572
|
+
return [3, 13];
|
|
1573
|
+
case 6:
|
|
1574
|
+
_e = [{}];
|
|
1575
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1576
|
+
case 7:
|
|
1577
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1578
|
+
return [3, 13];
|
|
1579
|
+
case 8:
|
|
1580
|
+
_f = [{}];
|
|
1581
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1582
|
+
case 9:
|
|
1583
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1584
|
+
return [3, 13];
|
|
1585
|
+
case 10:
|
|
1586
|
+
_g = [{}];
|
|
1587
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1588
|
+
case 11:
|
|
1589
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1590
|
+
return [3, 13];
|
|
1591
|
+
case 12:
|
|
1592
|
+
parsedBody = parsedOutput.body;
|
|
1593
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1594
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1595
|
+
_j.label = 13;
|
|
1596
|
+
case 13:
|
|
1597
|
+
message = response.message || response.Message || errorCode;
|
|
1598
|
+
response.message = message;
|
|
1599
|
+
delete response.Message;
|
|
1600
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
}); };
|
|
1604
|
+
export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1605
|
+
var contents, data, _a, _b;
|
|
1606
|
+
return __generator(this, function (_c) {
|
|
1607
|
+
switch (_c.label) {
|
|
1608
|
+
case 0:
|
|
1609
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1610
|
+
return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
|
|
1611
|
+
}
|
|
1612
|
+
contents = {
|
|
1613
|
+
$metadata: deserializeMetadata(output),
|
|
1614
|
+
tags: undefined,
|
|
1615
|
+
};
|
|
1616
|
+
_a = __expectNonNull;
|
|
1617
|
+
_b = __expectObject;
|
|
1618
|
+
return [4, parseBody(output.body, context)];
|
|
1619
|
+
case 1:
|
|
1620
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1621
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
1622
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
1623
|
+
}
|
|
1624
|
+
return [2, Promise.resolve(contents)];
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
}); };
|
|
1628
|
+
var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1629
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
1630
|
+
var _h;
|
|
1631
|
+
return __generator(this, function (_j) {
|
|
1632
|
+
switch (_j.label) {
|
|
1633
|
+
case 0:
|
|
1634
|
+
_a = [__assign({}, output)];
|
|
1635
|
+
_h = {};
|
|
1636
|
+
return [4, parseBody(output.body, context)];
|
|
1637
|
+
case 1:
|
|
1638
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
1639
|
+
errorCode = "UnknownError";
|
|
1640
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1641
|
+
_b = errorCode;
|
|
1642
|
+
switch (_b) {
|
|
1643
|
+
case "AccessDeniedException": return [3, 2];
|
|
1644
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1645
|
+
case "InternalServerException": return [3, 4];
|
|
1646
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1647
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
1648
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
1649
|
+
case "ThrottlingException": return [3, 8];
|
|
1650
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
1651
|
+
case "ValidationException": return [3, 10];
|
|
1652
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
1653
|
+
}
|
|
1654
|
+
return [3, 12];
|
|
1655
|
+
case 2:
|
|
1656
|
+
_c = [{}];
|
|
1657
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1658
|
+
case 3:
|
|
1659
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1660
|
+
return [3, 13];
|
|
1661
|
+
case 4:
|
|
1662
|
+
_d = [{}];
|
|
1663
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1664
|
+
case 5:
|
|
1665
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1666
|
+
return [3, 13];
|
|
1667
|
+
case 6:
|
|
1668
|
+
_e = [{}];
|
|
1669
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1670
|
+
case 7:
|
|
1671
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1672
|
+
return [3, 13];
|
|
1673
|
+
case 8:
|
|
1674
|
+
_f = [{}];
|
|
1675
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1676
|
+
case 9:
|
|
1677
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1678
|
+
return [3, 13];
|
|
1679
|
+
case 10:
|
|
1680
|
+
_g = [{}];
|
|
1681
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1682
|
+
case 11:
|
|
1683
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1684
|
+
return [3, 13];
|
|
1685
|
+
case 12:
|
|
1686
|
+
parsedBody = parsedOutput.body;
|
|
1687
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1688
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1689
|
+
_j.label = 13;
|
|
1690
|
+
case 13:
|
|
1691
|
+
message = response.message || response.Message || errorCode;
|
|
1692
|
+
response.message = message;
|
|
1693
|
+
delete response.Message;
|
|
1694
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
}); };
|
|
1698
|
+
export var deserializeAws_restJson1ListWorkspacesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1699
|
+
var contents, data, _a, _b;
|
|
1700
|
+
return __generator(this, function (_c) {
|
|
1701
|
+
switch (_c.label) {
|
|
1702
|
+
case 0:
|
|
1703
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1704
|
+
return [2, deserializeAws_restJson1ListWorkspacesCommandError(output, context)];
|
|
1705
|
+
}
|
|
1706
|
+
contents = {
|
|
1707
|
+
$metadata: deserializeMetadata(output),
|
|
1708
|
+
nextToken: undefined,
|
|
1709
|
+
workspaces: undefined,
|
|
1710
|
+
};
|
|
1711
|
+
_a = __expectNonNull;
|
|
1712
|
+
_b = __expectObject;
|
|
1713
|
+
return [4, parseBody(output.body, context)];
|
|
1714
|
+
case 1:
|
|
1715
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1716
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
1717
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1718
|
+
}
|
|
1719
|
+
if (data.workspaces !== undefined && data.workspaces !== null) {
|
|
1720
|
+
contents.workspaces = deserializeAws_restJson1WorkspaceSummaryList(data.workspaces, context);
|
|
1721
|
+
}
|
|
1722
|
+
return [2, Promise.resolve(contents)];
|
|
1723
|
+
}
|
|
1724
|
+
});
|
|
1725
|
+
}); };
|
|
1726
|
+
var deserializeAws_restJson1ListWorkspacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1727
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
|
|
1728
|
+
var _g;
|
|
1729
|
+
return __generator(this, function (_h) {
|
|
1730
|
+
switch (_h.label) {
|
|
1731
|
+
case 0:
|
|
1732
|
+
_a = [__assign({}, output)];
|
|
1733
|
+
_g = {};
|
|
1734
|
+
return [4, parseBody(output.body, context)];
|
|
1735
|
+
case 1:
|
|
1736
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
|
|
1737
|
+
errorCode = "UnknownError";
|
|
1738
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1739
|
+
_b = errorCode;
|
|
1740
|
+
switch (_b) {
|
|
1741
|
+
case "AccessDeniedException": return [3, 2];
|
|
1742
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1743
|
+
case "InternalServerException": return [3, 4];
|
|
1744
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
1745
|
+
case "ThrottlingException": return [3, 6];
|
|
1746
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 6];
|
|
1747
|
+
case "ValidationException": return [3, 8];
|
|
1748
|
+
case "com.amazonaws.amp#ValidationException": return [3, 8];
|
|
1749
|
+
}
|
|
1750
|
+
return [3, 10];
|
|
1751
|
+
case 2:
|
|
1752
|
+
_c = [{}];
|
|
1753
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1754
|
+
case 3:
|
|
1755
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1756
|
+
return [3, 11];
|
|
1757
|
+
case 4:
|
|
1758
|
+
_d = [{}];
|
|
1759
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1760
|
+
case 5:
|
|
1761
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1762
|
+
return [3, 11];
|
|
1763
|
+
case 6:
|
|
1764
|
+
_e = [{}];
|
|
1765
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1766
|
+
case 7:
|
|
1767
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1768
|
+
return [3, 11];
|
|
1769
|
+
case 8:
|
|
1770
|
+
_f = [{}];
|
|
1771
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1772
|
+
case 9:
|
|
1773
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1774
|
+
return [3, 11];
|
|
1775
|
+
case 10:
|
|
1776
|
+
parsedBody = parsedOutput.body;
|
|
1777
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1778
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1779
|
+
_h.label = 11;
|
|
1780
|
+
case 11:
|
|
1781
|
+
message = response.message || response.Message || errorCode;
|
|
1782
|
+
response.message = message;
|
|
1783
|
+
delete response.Message;
|
|
1784
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
}); };
|
|
1788
|
+
export var deserializeAws_restJson1PutAlertManagerDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1789
|
+
var contents, data, _a, _b;
|
|
1790
|
+
return __generator(this, function (_c) {
|
|
1791
|
+
switch (_c.label) {
|
|
1792
|
+
case 0:
|
|
1793
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
1794
|
+
return [2, deserializeAws_restJson1PutAlertManagerDefinitionCommandError(output, context)];
|
|
1795
|
+
}
|
|
1796
|
+
contents = {
|
|
1797
|
+
$metadata: deserializeMetadata(output),
|
|
1798
|
+
status: undefined,
|
|
1799
|
+
};
|
|
1800
|
+
_a = __expectNonNull;
|
|
1801
|
+
_b = __expectObject;
|
|
1802
|
+
return [4, parseBody(output.body, context)];
|
|
1803
|
+
case 1:
|
|
1804
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1805
|
+
if (data.status !== undefined && data.status !== null) {
|
|
1806
|
+
contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
|
|
1807
|
+
}
|
|
1808
|
+
return [2, Promise.resolve(contents)];
|
|
1809
|
+
}
|
|
1810
|
+
});
|
|
1811
|
+
}); };
|
|
1812
|
+
var deserializeAws_restJson1PutAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1813
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
|
|
1814
|
+
var _k;
|
|
1815
|
+
return __generator(this, function (_l) {
|
|
1816
|
+
switch (_l.label) {
|
|
1817
|
+
case 0:
|
|
1818
|
+
_a = [__assign({}, output)];
|
|
1819
|
+
_k = {};
|
|
1820
|
+
return [4, parseBody(output.body, context)];
|
|
1821
|
+
case 1:
|
|
1822
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
|
|
1823
|
+
errorCode = "UnknownError";
|
|
1824
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1825
|
+
_b = errorCode;
|
|
1826
|
+
switch (_b) {
|
|
1827
|
+
case "AccessDeniedException": return [3, 2];
|
|
1828
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1829
|
+
case "ConflictException": return [3, 4];
|
|
1830
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
1831
|
+
case "InternalServerException": return [3, 6];
|
|
1832
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
1833
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
1834
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
1835
|
+
case "ServiceQuotaExceededException": return [3, 10];
|
|
1836
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 10];
|
|
1837
|
+
case "ThrottlingException": return [3, 12];
|
|
1838
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 12];
|
|
1839
|
+
case "ValidationException": return [3, 14];
|
|
1840
|
+
case "com.amazonaws.amp#ValidationException": return [3, 14];
|
|
1841
|
+
}
|
|
1842
|
+
return [3, 16];
|
|
1843
|
+
case 2:
|
|
1844
|
+
_c = [{}];
|
|
1845
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1846
|
+
case 3:
|
|
1847
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1848
|
+
return [3, 17];
|
|
1849
|
+
case 4:
|
|
1850
|
+
_d = [{}];
|
|
1851
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
1852
|
+
case 5:
|
|
1853
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1854
|
+
return [3, 17];
|
|
1855
|
+
case 6:
|
|
1856
|
+
_e = [{}];
|
|
1857
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1858
|
+
case 7:
|
|
1859
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1860
|
+
return [3, 17];
|
|
1861
|
+
case 8:
|
|
1862
|
+
_f = [{}];
|
|
1863
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1864
|
+
case 9:
|
|
1865
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1866
|
+
return [3, 17];
|
|
1867
|
+
case 10:
|
|
1868
|
+
_g = [{}];
|
|
1869
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
1870
|
+
case 11:
|
|
1871
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1872
|
+
return [3, 17];
|
|
1873
|
+
case 12:
|
|
1874
|
+
_h = [{}];
|
|
1875
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1876
|
+
case 13:
|
|
1877
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1878
|
+
return [3, 17];
|
|
1879
|
+
case 14:
|
|
1880
|
+
_j = [{}];
|
|
1881
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1882
|
+
case 15:
|
|
1883
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1884
|
+
return [3, 17];
|
|
1885
|
+
case 16:
|
|
1886
|
+
parsedBody = parsedOutput.body;
|
|
1887
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1888
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1889
|
+
_l.label = 17;
|
|
1890
|
+
case 17:
|
|
1891
|
+
message = response.message || response.Message || errorCode;
|
|
1892
|
+
response.message = message;
|
|
1893
|
+
delete response.Message;
|
|
1894
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1895
|
+
}
|
|
1896
|
+
});
|
|
1897
|
+
}); };
|
|
1898
|
+
export var deserializeAws_restJson1PutRuleGroupsNamespaceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1899
|
+
var contents, data, _a, _b;
|
|
1900
|
+
return __generator(this, function (_c) {
|
|
1901
|
+
switch (_c.label) {
|
|
1902
|
+
case 0:
|
|
1903
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
1904
|
+
return [2, deserializeAws_restJson1PutRuleGroupsNamespaceCommandError(output, context)];
|
|
1905
|
+
}
|
|
1906
|
+
contents = {
|
|
1907
|
+
$metadata: deserializeMetadata(output),
|
|
1908
|
+
arn: undefined,
|
|
1909
|
+
name: undefined,
|
|
1910
|
+
status: undefined,
|
|
1911
|
+
tags: undefined,
|
|
1912
|
+
};
|
|
1913
|
+
_a = __expectNonNull;
|
|
1914
|
+
_b = __expectObject;
|
|
1915
|
+
return [4, parseBody(output.body, context)];
|
|
1916
|
+
case 1:
|
|
1917
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1918
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1919
|
+
contents.arn = __expectString(data.arn);
|
|
1920
|
+
}
|
|
1921
|
+
if (data.name !== undefined && data.name !== null) {
|
|
1922
|
+
contents.name = __expectString(data.name);
|
|
1923
|
+
}
|
|
1924
|
+
if (data.status !== undefined && data.status !== null) {
|
|
1925
|
+
contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
|
|
1926
|
+
}
|
|
1927
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
1928
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
1929
|
+
}
|
|
1930
|
+
return [2, Promise.resolve(contents)];
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
}); };
|
|
1934
|
+
var deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1935
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
|
|
1936
|
+
var _k;
|
|
1937
|
+
return __generator(this, function (_l) {
|
|
1938
|
+
switch (_l.label) {
|
|
1939
|
+
case 0:
|
|
1940
|
+
_a = [__assign({}, output)];
|
|
1941
|
+
_k = {};
|
|
1942
|
+
return [4, parseBody(output.body, context)];
|
|
1943
|
+
case 1:
|
|
1944
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
|
|
1945
|
+
errorCode = "UnknownError";
|
|
1946
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1947
|
+
_b = errorCode;
|
|
1948
|
+
switch (_b) {
|
|
1949
|
+
case "AccessDeniedException": return [3, 2];
|
|
1950
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
1951
|
+
case "ConflictException": return [3, 4];
|
|
1952
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
1953
|
+
case "InternalServerException": return [3, 6];
|
|
1954
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
1955
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
1956
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
1957
|
+
case "ServiceQuotaExceededException": return [3, 10];
|
|
1958
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 10];
|
|
1959
|
+
case "ThrottlingException": return [3, 12];
|
|
1960
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 12];
|
|
1961
|
+
case "ValidationException": return [3, 14];
|
|
1962
|
+
case "com.amazonaws.amp#ValidationException": return [3, 14];
|
|
1963
|
+
}
|
|
1964
|
+
return [3, 16];
|
|
1965
|
+
case 2:
|
|
1966
|
+
_c = [{}];
|
|
1967
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1968
|
+
case 3:
|
|
1969
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1970
|
+
return [3, 17];
|
|
1971
|
+
case 4:
|
|
1972
|
+
_d = [{}];
|
|
1973
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
1974
|
+
case 5:
|
|
1975
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1976
|
+
return [3, 17];
|
|
1977
|
+
case 6:
|
|
1978
|
+
_e = [{}];
|
|
1979
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1980
|
+
case 7:
|
|
1981
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1982
|
+
return [3, 17];
|
|
1983
|
+
case 8:
|
|
1984
|
+
_f = [{}];
|
|
1985
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1986
|
+
case 9:
|
|
1987
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1988
|
+
return [3, 17];
|
|
1989
|
+
case 10:
|
|
1990
|
+
_g = [{}];
|
|
1991
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
1992
|
+
case 11:
|
|
1993
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1994
|
+
return [3, 17];
|
|
1995
|
+
case 12:
|
|
1996
|
+
_h = [{}];
|
|
1997
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1998
|
+
case 13:
|
|
1999
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2000
|
+
return [3, 17];
|
|
2001
|
+
case 14:
|
|
2002
|
+
_j = [{}];
|
|
2003
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2004
|
+
case 15:
|
|
2005
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2006
|
+
return [3, 17];
|
|
2007
|
+
case 16:
|
|
2008
|
+
parsedBody = parsedOutput.body;
|
|
2009
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2010
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2011
|
+
_l.label = 17;
|
|
2012
|
+
case 17:
|
|
2013
|
+
message = response.message || response.Message || errorCode;
|
|
2014
|
+
response.message = message;
|
|
2015
|
+
delete response.Message;
|
|
2016
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2017
|
+
}
|
|
2018
|
+
});
|
|
2019
|
+
}); };
|
|
2020
|
+
export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2021
|
+
var contents;
|
|
2022
|
+
return __generator(this, function (_a) {
|
|
2023
|
+
switch (_a.label) {
|
|
2024
|
+
case 0:
|
|
2025
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2026
|
+
return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
|
|
2027
|
+
}
|
|
2028
|
+
contents = {
|
|
2029
|
+
$metadata: deserializeMetadata(output),
|
|
2030
|
+
};
|
|
2031
|
+
return [4, collectBody(output.body, context)];
|
|
2032
|
+
case 1:
|
|
2033
|
+
_a.sent();
|
|
2034
|
+
return [2, Promise.resolve(contents)];
|
|
2035
|
+
}
|
|
2036
|
+
});
|
|
2037
|
+
}); };
|
|
2038
|
+
var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2039
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
2040
|
+
var _h;
|
|
2041
|
+
return __generator(this, function (_j) {
|
|
2042
|
+
switch (_j.label) {
|
|
2043
|
+
case 0:
|
|
2044
|
+
_a = [__assign({}, output)];
|
|
2045
|
+
_h = {};
|
|
2046
|
+
return [4, parseBody(output.body, context)];
|
|
2047
|
+
case 1:
|
|
2048
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
2049
|
+
errorCode = "UnknownError";
|
|
2050
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2051
|
+
_b = errorCode;
|
|
2052
|
+
switch (_b) {
|
|
2053
|
+
case "AccessDeniedException": return [3, 2];
|
|
2054
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
2055
|
+
case "InternalServerException": return [3, 4];
|
|
2056
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
2057
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
2058
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
2059
|
+
case "ThrottlingException": return [3, 8];
|
|
2060
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
2061
|
+
case "ValidationException": return [3, 10];
|
|
2062
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
2063
|
+
}
|
|
2064
|
+
return [3, 12];
|
|
2065
|
+
case 2:
|
|
2066
|
+
_c = [{}];
|
|
2067
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
2068
|
+
case 3:
|
|
2069
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2070
|
+
return [3, 13];
|
|
2071
|
+
case 4:
|
|
2072
|
+
_d = [{}];
|
|
2073
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
2074
|
+
case 5:
|
|
2075
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2076
|
+
return [3, 13];
|
|
2077
|
+
case 6:
|
|
2078
|
+
_e = [{}];
|
|
2079
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
2080
|
+
case 7:
|
|
2081
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2082
|
+
return [3, 13];
|
|
2083
|
+
case 8:
|
|
2084
|
+
_f = [{}];
|
|
2085
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
2086
|
+
case 9:
|
|
2087
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2088
|
+
return [3, 13];
|
|
2089
|
+
case 10:
|
|
2090
|
+
_g = [{}];
|
|
2091
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2092
|
+
case 11:
|
|
2093
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2094
|
+
return [3, 13];
|
|
2095
|
+
case 12:
|
|
2096
|
+
parsedBody = parsedOutput.body;
|
|
2097
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2098
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2099
|
+
_j.label = 13;
|
|
2100
|
+
case 13:
|
|
2101
|
+
message = response.message || response.Message || errorCode;
|
|
2102
|
+
response.message = message;
|
|
2103
|
+
delete response.Message;
|
|
2104
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
}); };
|
|
2108
|
+
export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2109
|
+
var contents;
|
|
2110
|
+
return __generator(this, function (_a) {
|
|
2111
|
+
switch (_a.label) {
|
|
2112
|
+
case 0:
|
|
2113
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2114
|
+
return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
|
|
2115
|
+
}
|
|
2116
|
+
contents = {
|
|
2117
|
+
$metadata: deserializeMetadata(output),
|
|
2118
|
+
};
|
|
2119
|
+
return [4, collectBody(output.body, context)];
|
|
2120
|
+
case 1:
|
|
2121
|
+
_a.sent();
|
|
2122
|
+
return [2, Promise.resolve(contents)];
|
|
2123
|
+
}
|
|
2124
|
+
});
|
|
2125
|
+
}); };
|
|
2126
|
+
var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2127
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
|
|
2128
|
+
var _h;
|
|
2129
|
+
return __generator(this, function (_j) {
|
|
2130
|
+
switch (_j.label) {
|
|
2131
|
+
case 0:
|
|
2132
|
+
_a = [__assign({}, output)];
|
|
2133
|
+
_h = {};
|
|
2134
|
+
return [4, parseBody(output.body, context)];
|
|
2135
|
+
case 1:
|
|
2136
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
2137
|
+
errorCode = "UnknownError";
|
|
2138
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2139
|
+
_b = errorCode;
|
|
2140
|
+
switch (_b) {
|
|
2141
|
+
case "AccessDeniedException": return [3, 2];
|
|
2142
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
2143
|
+
case "InternalServerException": return [3, 4];
|
|
2144
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 4];
|
|
2145
|
+
case "ResourceNotFoundException": return [3, 6];
|
|
2146
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
|
|
2147
|
+
case "ThrottlingException": return [3, 8];
|
|
2148
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 8];
|
|
2149
|
+
case "ValidationException": return [3, 10];
|
|
2150
|
+
case "com.amazonaws.amp#ValidationException": return [3, 10];
|
|
2151
|
+
}
|
|
2152
|
+
return [3, 12];
|
|
2153
|
+
case 2:
|
|
2154
|
+
_c = [{}];
|
|
2155
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
2156
|
+
case 3:
|
|
2157
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2158
|
+
return [3, 13];
|
|
2159
|
+
case 4:
|
|
2160
|
+
_d = [{}];
|
|
2161
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
2162
|
+
case 5:
|
|
2163
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2164
|
+
return [3, 13];
|
|
2165
|
+
case 6:
|
|
2166
|
+
_e = [{}];
|
|
2167
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
2168
|
+
case 7:
|
|
2169
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2170
|
+
return [3, 13];
|
|
2171
|
+
case 8:
|
|
2172
|
+
_f = [{}];
|
|
2173
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
2174
|
+
case 9:
|
|
2175
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2176
|
+
return [3, 13];
|
|
2177
|
+
case 10:
|
|
2178
|
+
_g = [{}];
|
|
2179
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2180
|
+
case 11:
|
|
2181
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2182
|
+
return [3, 13];
|
|
2183
|
+
case 12:
|
|
2184
|
+
parsedBody = parsedOutput.body;
|
|
2185
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2186
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2187
|
+
_j.label = 13;
|
|
2188
|
+
case 13:
|
|
2189
|
+
message = response.message || response.Message || errorCode;
|
|
2190
|
+
response.message = message;
|
|
2191
|
+
delete response.Message;
|
|
2192
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2193
|
+
}
|
|
2194
|
+
});
|
|
2195
|
+
}); };
|
|
2196
|
+
export var deserializeAws_restJson1UpdateWorkspaceAliasCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2197
|
+
var contents;
|
|
2198
|
+
return __generator(this, function (_a) {
|
|
2199
|
+
switch (_a.label) {
|
|
2200
|
+
case 0:
|
|
2201
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
2202
|
+
return [2, deserializeAws_restJson1UpdateWorkspaceAliasCommandError(output, context)];
|
|
2203
|
+
}
|
|
2204
|
+
contents = {
|
|
2205
|
+
$metadata: deserializeMetadata(output),
|
|
2206
|
+
};
|
|
2207
|
+
return [4, collectBody(output.body, context)];
|
|
2208
|
+
case 1:
|
|
2209
|
+
_a.sent();
|
|
2210
|
+
return [2, Promise.resolve(contents)];
|
|
2211
|
+
}
|
|
2212
|
+
});
|
|
2213
|
+
}); };
|
|
2214
|
+
var deserializeAws_restJson1UpdateWorkspaceAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2215
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
|
|
2216
|
+
var _k;
|
|
2217
|
+
return __generator(this, function (_l) {
|
|
2218
|
+
switch (_l.label) {
|
|
2219
|
+
case 0:
|
|
2220
|
+
_a = [__assign({}, output)];
|
|
2221
|
+
_k = {};
|
|
2222
|
+
return [4, parseBody(output.body, context)];
|
|
2223
|
+
case 1:
|
|
2224
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
|
|
2225
|
+
errorCode = "UnknownError";
|
|
2226
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2227
|
+
_b = errorCode;
|
|
2228
|
+
switch (_b) {
|
|
2229
|
+
case "AccessDeniedException": return [3, 2];
|
|
2230
|
+
case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
|
|
2231
|
+
case "ConflictException": return [3, 4];
|
|
2232
|
+
case "com.amazonaws.amp#ConflictException": return [3, 4];
|
|
2233
|
+
case "InternalServerException": return [3, 6];
|
|
2234
|
+
case "com.amazonaws.amp#InternalServerException": return [3, 6];
|
|
2235
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
2236
|
+
case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
|
|
2237
|
+
case "ServiceQuotaExceededException": return [3, 10];
|
|
2238
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException": return [3, 10];
|
|
2239
|
+
case "ThrottlingException": return [3, 12];
|
|
2240
|
+
case "com.amazonaws.amp#ThrottlingException": return [3, 12];
|
|
2241
|
+
case "ValidationException": return [3, 14];
|
|
2242
|
+
case "com.amazonaws.amp#ValidationException": return [3, 14];
|
|
2243
|
+
}
|
|
2244
|
+
return [3, 16];
|
|
2245
|
+
case 2:
|
|
2246
|
+
_c = [{}];
|
|
2247
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
2248
|
+
case 3:
|
|
2249
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2250
|
+
return [3, 17];
|
|
2251
|
+
case 4:
|
|
2252
|
+
_d = [{}];
|
|
2253
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
2254
|
+
case 5:
|
|
2255
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2256
|
+
return [3, 17];
|
|
2257
|
+
case 6:
|
|
2258
|
+
_e = [{}];
|
|
2259
|
+
return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
2260
|
+
case 7:
|
|
2261
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2262
|
+
return [3, 17];
|
|
2263
|
+
case 8:
|
|
2264
|
+
_f = [{}];
|
|
2265
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
2266
|
+
case 9:
|
|
2267
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2268
|
+
return [3, 17];
|
|
2269
|
+
case 10:
|
|
2270
|
+
_g = [{}];
|
|
2271
|
+
return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
2272
|
+
case 11:
|
|
2273
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2274
|
+
return [3, 17];
|
|
2275
|
+
case 12:
|
|
2276
|
+
_h = [{}];
|
|
2277
|
+
return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
2278
|
+
case 13:
|
|
2279
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2280
|
+
return [3, 17];
|
|
2281
|
+
case 14:
|
|
2282
|
+
_j = [{}];
|
|
2283
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2284
|
+
case 15:
|
|
2285
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2286
|
+
return [3, 17];
|
|
2287
|
+
case 16:
|
|
2288
|
+
parsedBody = parsedOutput.body;
|
|
2289
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2290
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2291
|
+
_l.label = 17;
|
|
2292
|
+
case 17:
|
|
2293
|
+
message = response.message || response.Message || errorCode;
|
|
2294
|
+
response.message = message;
|
|
2295
|
+
delete response.Message;
|
|
2296
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
}); };
|
|
2300
|
+
var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2301
|
+
var contents, data;
|
|
2302
|
+
return __generator(this, function (_a) {
|
|
2303
|
+
contents = {
|
|
2304
|
+
name: "AccessDeniedException",
|
|
2305
|
+
$fault: "client",
|
|
2306
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2307
|
+
message: undefined,
|
|
2308
|
+
};
|
|
2309
|
+
data = parsedOutput.body;
|
|
2310
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2311
|
+
contents.message = __expectString(data.message);
|
|
2312
|
+
}
|
|
2313
|
+
return [2, contents];
|
|
2314
|
+
});
|
|
2315
|
+
}); };
|
|
2316
|
+
var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2317
|
+
var contents, data;
|
|
2318
|
+
return __generator(this, function (_a) {
|
|
2319
|
+
contents = {
|
|
2320
|
+
name: "ConflictException",
|
|
2321
|
+
$fault: "client",
|
|
2322
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2323
|
+
message: undefined,
|
|
2324
|
+
resourceId: undefined,
|
|
2325
|
+
resourceType: undefined,
|
|
2326
|
+
};
|
|
2327
|
+
data = parsedOutput.body;
|
|
2328
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2329
|
+
contents.message = __expectString(data.message);
|
|
2330
|
+
}
|
|
2331
|
+
if (data.resourceId !== undefined && data.resourceId !== null) {
|
|
2332
|
+
contents.resourceId = __expectString(data.resourceId);
|
|
2333
|
+
}
|
|
2334
|
+
if (data.resourceType !== undefined && data.resourceType !== null) {
|
|
2335
|
+
contents.resourceType = __expectString(data.resourceType);
|
|
2336
|
+
}
|
|
2337
|
+
return [2, contents];
|
|
2338
|
+
});
|
|
2339
|
+
}); };
|
|
2340
|
+
var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2341
|
+
var contents, data;
|
|
2342
|
+
return __generator(this, function (_a) {
|
|
2343
|
+
contents = {
|
|
2344
|
+
name: "InternalServerException",
|
|
2345
|
+
$fault: "server",
|
|
2346
|
+
$retryable: {},
|
|
2347
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2348
|
+
message: undefined,
|
|
2349
|
+
retryAfterSeconds: undefined,
|
|
2350
|
+
};
|
|
2351
|
+
if (parsedOutput.headers["retry-after"] !== undefined) {
|
|
2352
|
+
contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
|
|
2353
|
+
}
|
|
2354
|
+
data = parsedOutput.body;
|
|
2355
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2356
|
+
contents.message = __expectString(data.message);
|
|
2357
|
+
}
|
|
2358
|
+
return [2, contents];
|
|
2359
|
+
});
|
|
2360
|
+
}); };
|
|
2361
|
+
var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2362
|
+
var contents, data;
|
|
2363
|
+
return __generator(this, function (_a) {
|
|
2364
|
+
contents = {
|
|
2365
|
+
name: "ResourceNotFoundException",
|
|
2366
|
+
$fault: "client",
|
|
2367
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2368
|
+
message: undefined,
|
|
2369
|
+
resourceId: undefined,
|
|
2370
|
+
resourceType: undefined,
|
|
2371
|
+
};
|
|
2372
|
+
data = parsedOutput.body;
|
|
2373
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2374
|
+
contents.message = __expectString(data.message);
|
|
2375
|
+
}
|
|
2376
|
+
if (data.resourceId !== undefined && data.resourceId !== null) {
|
|
2377
|
+
contents.resourceId = __expectString(data.resourceId);
|
|
2378
|
+
}
|
|
2379
|
+
if (data.resourceType !== undefined && data.resourceType !== null) {
|
|
2380
|
+
contents.resourceType = __expectString(data.resourceType);
|
|
2381
|
+
}
|
|
2382
|
+
return [2, contents];
|
|
2383
|
+
});
|
|
2384
|
+
}); };
|
|
2385
|
+
var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2386
|
+
var contents, data;
|
|
2387
|
+
return __generator(this, function (_a) {
|
|
2388
|
+
contents = {
|
|
2389
|
+
name: "ServiceQuotaExceededException",
|
|
2390
|
+
$fault: "client",
|
|
2391
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2392
|
+
message: undefined,
|
|
2393
|
+
quotaCode: undefined,
|
|
2394
|
+
resourceId: undefined,
|
|
2395
|
+
resourceType: undefined,
|
|
2396
|
+
serviceCode: undefined,
|
|
2397
|
+
};
|
|
2398
|
+
data = parsedOutput.body;
|
|
2399
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2400
|
+
contents.message = __expectString(data.message);
|
|
2401
|
+
}
|
|
2402
|
+
if (data.quotaCode !== undefined && data.quotaCode !== null) {
|
|
2403
|
+
contents.quotaCode = __expectString(data.quotaCode);
|
|
2404
|
+
}
|
|
2405
|
+
if (data.resourceId !== undefined && data.resourceId !== null) {
|
|
2406
|
+
contents.resourceId = __expectString(data.resourceId);
|
|
2407
|
+
}
|
|
2408
|
+
if (data.resourceType !== undefined && data.resourceType !== null) {
|
|
2409
|
+
contents.resourceType = __expectString(data.resourceType);
|
|
2410
|
+
}
|
|
2411
|
+
if (data.serviceCode !== undefined && data.serviceCode !== null) {
|
|
2412
|
+
contents.serviceCode = __expectString(data.serviceCode);
|
|
2413
|
+
}
|
|
2414
|
+
return [2, contents];
|
|
2415
|
+
});
|
|
2416
|
+
}); };
|
|
2417
|
+
var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2418
|
+
var contents, data;
|
|
2419
|
+
return __generator(this, function (_a) {
|
|
2420
|
+
contents = {
|
|
2421
|
+
name: "ThrottlingException",
|
|
2422
|
+
$fault: "client",
|
|
2423
|
+
$retryable: {},
|
|
2424
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2425
|
+
message: undefined,
|
|
2426
|
+
quotaCode: undefined,
|
|
2427
|
+
retryAfterSeconds: undefined,
|
|
2428
|
+
serviceCode: undefined,
|
|
2429
|
+
};
|
|
2430
|
+
if (parsedOutput.headers["retry-after"] !== undefined) {
|
|
2431
|
+
contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
|
|
2432
|
+
}
|
|
2433
|
+
data = parsedOutput.body;
|
|
2434
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2435
|
+
contents.message = __expectString(data.message);
|
|
2436
|
+
}
|
|
2437
|
+
if (data.quotaCode !== undefined && data.quotaCode !== null) {
|
|
2438
|
+
contents.quotaCode = __expectString(data.quotaCode);
|
|
2439
|
+
}
|
|
2440
|
+
if (data.serviceCode !== undefined && data.serviceCode !== null) {
|
|
2441
|
+
contents.serviceCode = __expectString(data.serviceCode);
|
|
2442
|
+
}
|
|
2443
|
+
return [2, contents];
|
|
2444
|
+
});
|
|
2445
|
+
}); };
|
|
2446
|
+
var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2447
|
+
var contents, data;
|
|
2448
|
+
return __generator(this, function (_a) {
|
|
2449
|
+
contents = {
|
|
2450
|
+
name: "ValidationException",
|
|
2451
|
+
$fault: "client",
|
|
2452
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2453
|
+
fieldList: undefined,
|
|
2454
|
+
message: undefined,
|
|
2455
|
+
reason: undefined,
|
|
2456
|
+
};
|
|
2457
|
+
data = parsedOutput.body;
|
|
2458
|
+
if (data.fieldList !== undefined && data.fieldList !== null) {
|
|
2459
|
+
contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
|
|
2460
|
+
}
|
|
2461
|
+
if (data.message !== undefined && data.message !== null) {
|
|
2462
|
+
contents.message = __expectString(data.message);
|
|
2463
|
+
}
|
|
2464
|
+
if (data.reason !== undefined && data.reason !== null) {
|
|
2465
|
+
contents.reason = __expectString(data.reason);
|
|
2466
|
+
}
|
|
2467
|
+
return [2, contents];
|
|
2468
|
+
});
|
|
2469
|
+
}); };
|
|
2470
|
+
var serializeAws_restJson1TagMap = function (input, context) {
|
|
2471
|
+
return Object.entries(input).reduce(function (acc, _a) {
|
|
2472
|
+
var _b;
|
|
2473
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
2474
|
+
if (value === null) {
|
|
2475
|
+
return acc;
|
|
2476
|
+
}
|
|
2477
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
|
|
2478
|
+
}, {});
|
|
2479
|
+
};
|
|
2480
|
+
var deserializeAws_restJson1AlertManagerDefinitionDescription = function (output, context) {
|
|
2481
|
+
return {
|
|
2482
|
+
createdAt: output.createdAt !== undefined && output.createdAt !== null
|
|
2483
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
|
|
2484
|
+
: undefined,
|
|
2485
|
+
data: output.data !== undefined && output.data !== null ? context.base64Decoder(output.data) : undefined,
|
|
2486
|
+
modifiedAt: output.modifiedAt !== undefined && output.modifiedAt !== null
|
|
2487
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
|
|
2488
|
+
: undefined,
|
|
2489
|
+
status: output.status !== undefined && output.status !== null
|
|
2490
|
+
? deserializeAws_restJson1AlertManagerDefinitionStatus(output.status, context)
|
|
2491
|
+
: undefined,
|
|
2492
|
+
};
|
|
2493
|
+
};
|
|
2494
|
+
var deserializeAws_restJson1AlertManagerDefinitionStatus = function (output, context) {
|
|
2495
|
+
return {
|
|
2496
|
+
statusCode: __expectString(output.statusCode),
|
|
2497
|
+
statusReason: __expectString(output.statusReason),
|
|
2498
|
+
};
|
|
2499
|
+
};
|
|
2500
|
+
var deserializeAws_restJson1RuleGroupsNamespaceDescription = function (output, context) {
|
|
2501
|
+
return {
|
|
2502
|
+
arn: __expectString(output.arn),
|
|
2503
|
+
createdAt: output.createdAt !== undefined && output.createdAt !== null
|
|
2504
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
|
|
2505
|
+
: undefined,
|
|
2506
|
+
data: output.data !== undefined && output.data !== null ? context.base64Decoder(output.data) : undefined,
|
|
2507
|
+
modifiedAt: output.modifiedAt !== undefined && output.modifiedAt !== null
|
|
2508
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
|
|
2509
|
+
: undefined,
|
|
2510
|
+
name: __expectString(output.name),
|
|
2511
|
+
status: output.status !== undefined && output.status !== null
|
|
2512
|
+
? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context)
|
|
2513
|
+
: undefined,
|
|
2514
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
2515
|
+
? deserializeAws_restJson1TagMap(output.tags, context)
|
|
2516
|
+
: undefined,
|
|
2517
|
+
};
|
|
2518
|
+
};
|
|
2519
|
+
var deserializeAws_restJson1RuleGroupsNamespaceStatus = function (output, context) {
|
|
2520
|
+
return {
|
|
2521
|
+
statusCode: __expectString(output.statusCode),
|
|
2522
|
+
statusReason: __expectString(output.statusReason),
|
|
2523
|
+
};
|
|
2524
|
+
};
|
|
2525
|
+
var deserializeAws_restJson1RuleGroupsNamespaceSummary = function (output, context) {
|
|
2526
|
+
return {
|
|
2527
|
+
arn: __expectString(output.arn),
|
|
2528
|
+
createdAt: output.createdAt !== undefined && output.createdAt !== null
|
|
2529
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
|
|
2530
|
+
: undefined,
|
|
2531
|
+
modifiedAt: output.modifiedAt !== undefined && output.modifiedAt !== null
|
|
2532
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt)))
|
|
2533
|
+
: undefined,
|
|
2534
|
+
name: __expectString(output.name),
|
|
2535
|
+
status: output.status !== undefined && output.status !== null
|
|
2536
|
+
? deserializeAws_restJson1RuleGroupsNamespaceStatus(output.status, context)
|
|
2537
|
+
: undefined,
|
|
2538
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
2539
|
+
? deserializeAws_restJson1TagMap(output.tags, context)
|
|
2540
|
+
: undefined,
|
|
2541
|
+
};
|
|
2542
|
+
};
|
|
2543
|
+
var deserializeAws_restJson1RuleGroupsNamespaceSummaryList = function (output, context) {
|
|
2544
|
+
return (output || [])
|
|
2545
|
+
.filter(function (e) { return e != null; })
|
|
2546
|
+
.map(function (entry) {
|
|
2547
|
+
if (entry === null) {
|
|
2548
|
+
return null;
|
|
2549
|
+
}
|
|
2550
|
+
return deserializeAws_restJson1RuleGroupsNamespaceSummary(entry, context);
|
|
2551
|
+
});
|
|
2552
|
+
};
|
|
2553
|
+
var deserializeAws_restJson1TagMap = function (output, context) {
|
|
2554
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
2555
|
+
var _b;
|
|
2556
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
2557
|
+
if (value === null) {
|
|
2558
|
+
return acc;
|
|
2559
|
+
}
|
|
2560
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
2561
|
+
}, {});
|
|
2562
|
+
};
|
|
2563
|
+
var deserializeAws_restJson1ValidationExceptionField = function (output, context) {
|
|
2564
|
+
return {
|
|
2565
|
+
message: __expectString(output.message),
|
|
2566
|
+
name: __expectString(output.name),
|
|
2567
|
+
};
|
|
2568
|
+
};
|
|
2569
|
+
var deserializeAws_restJson1ValidationExceptionFieldList = function (output, context) {
|
|
2570
|
+
return (output || [])
|
|
2571
|
+
.filter(function (e) { return e != null; })
|
|
2572
|
+
.map(function (entry) {
|
|
2573
|
+
if (entry === null) {
|
|
2574
|
+
return null;
|
|
2575
|
+
}
|
|
2576
|
+
return deserializeAws_restJson1ValidationExceptionField(entry, context);
|
|
2577
|
+
});
|
|
2578
|
+
};
|
|
2579
|
+
var deserializeAws_restJson1WorkspaceDescription = function (output, context) {
|
|
2580
|
+
return {
|
|
2581
|
+
alias: __expectString(output.alias),
|
|
2582
|
+
arn: __expectString(output.arn),
|
|
2583
|
+
createdAt: output.createdAt !== undefined && output.createdAt !== null
|
|
2584
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
|
|
2585
|
+
: undefined,
|
|
2586
|
+
prometheusEndpoint: __expectString(output.prometheusEndpoint),
|
|
2587
|
+
status: output.status !== undefined && output.status !== null
|
|
2588
|
+
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
|
|
2589
|
+
: undefined,
|
|
2590
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
2591
|
+
? deserializeAws_restJson1TagMap(output.tags, context)
|
|
2592
|
+
: undefined,
|
|
2593
|
+
workspaceId: __expectString(output.workspaceId),
|
|
2594
|
+
};
|
|
2595
|
+
};
|
|
2596
|
+
var deserializeAws_restJson1WorkspaceStatus = function (output, context) {
|
|
2597
|
+
return {
|
|
2598
|
+
statusCode: __expectString(output.statusCode),
|
|
2599
|
+
};
|
|
2600
|
+
};
|
|
2601
|
+
var deserializeAws_restJson1WorkspaceSummary = function (output, context) {
|
|
2602
|
+
return {
|
|
2603
|
+
alias: __expectString(output.alias),
|
|
2604
|
+
arn: __expectString(output.arn),
|
|
2605
|
+
createdAt: output.createdAt !== undefined && output.createdAt !== null
|
|
2606
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
|
|
2607
|
+
: undefined,
|
|
2608
|
+
status: output.status !== undefined && output.status !== null
|
|
2609
|
+
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
|
|
2610
|
+
: undefined,
|
|
2611
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
2612
|
+
? deserializeAws_restJson1TagMap(output.tags, context)
|
|
2613
|
+
: undefined,
|
|
2614
|
+
workspaceId: __expectString(output.workspaceId),
|
|
2615
|
+
};
|
|
2616
|
+
};
|
|
2617
|
+
var deserializeAws_restJson1WorkspaceSummaryList = function (output, context) {
|
|
2618
|
+
return (output || [])
|
|
2619
|
+
.filter(function (e) { return e != null; })
|
|
2620
|
+
.map(function (entry) {
|
|
2621
|
+
if (entry === null) {
|
|
2622
|
+
return null;
|
|
2623
|
+
}
|
|
2624
|
+
return deserializeAws_restJson1WorkspaceSummary(entry, context);
|
|
2625
|
+
});
|
|
2626
|
+
};
|
|
2627
|
+
var deserializeMetadata = function (output) {
|
|
2628
|
+
var _a;
|
|
2629
|
+
return ({
|
|
2630
|
+
httpStatusCode: output.statusCode,
|
|
2631
|
+
requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
|
|
2632
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
2633
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
2634
|
+
});
|
|
2635
|
+
};
|
|
2636
|
+
var collectBody = function (streamBody, context) {
|
|
2637
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
2638
|
+
if (streamBody instanceof Uint8Array) {
|
|
2639
|
+
return Promise.resolve(streamBody);
|
|
2640
|
+
}
|
|
2641
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
2642
|
+
};
|
|
2643
|
+
var collectBodyString = function (streamBody, context) {
|
|
2644
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
2645
|
+
};
|
|
2646
|
+
var isSerializableHeaderValue = function (value) {
|
|
2647
|
+
return value !== undefined &&
|
|
2648
|
+
value !== null &&
|
|
2649
|
+
value !== "" &&
|
|
2650
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
2651
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
2652
|
+
};
|
|
2653
|
+
var parseBody = function (streamBody, context) {
|
|
2654
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
2655
|
+
if (encoded.length) {
|
|
2656
|
+
return JSON.parse(encoded);
|
|
2657
|
+
}
|
|
2658
|
+
return {};
|
|
2659
|
+
});
|
|
2660
|
+
};
|
|
2661
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
2662
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
2663
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
2664
|
+
var cleanValue = rawValue;
|
|
2665
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
2666
|
+
cleanValue = cleanValue.split(":")[0];
|
|
2667
|
+
}
|
|
2668
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
2669
|
+
cleanValue = cleanValue.split("#")[1];
|
|
2670
|
+
}
|
|
2671
|
+
return cleanValue;
|
|
2672
|
+
};
|
|
2673
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2674
|
+
if (headerKey !== undefined) {
|
|
2675
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2676
|
+
}
|
|
2677
|
+
if (data.code !== undefined) {
|
|
2678
|
+
return sanitizeErrorCode(data.code);
|
|
2679
|
+
}
|
|
2680
|
+
if (data["__type"] !== undefined) {
|
|
2681
|
+
return sanitizeErrorCode(data["__type"]);
|
|
2682
|
+
}
|
|
2683
|
+
return "";
|
|
2684
|
+
};
|