@aws-sdk/client-codeguruprofiler 3.183.0 → 3.186.0

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