@aws-sdk/client-rum 3.185.0 → 3.188.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.
@@ -1,1139 +1,872 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
4
  import { RUMServiceException as __BaseException } from "../models/RUMServiceException";
6
- export var serializeAws_restJson1CreateAppMonitorCommand = 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 || "") + "/appmonitor";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.AppMonitorConfiguration != null && {
18
- AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
19
- })), (input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled })), (input.Domain != null && { Domain: input.Domain })), (input.Name != null && { Name: input.Name })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, 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
- }
30
- });
31
- }); };
32
- export var serializeAws_restJson1DeleteAppMonitorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, 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
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitor/{Name}";
41
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
42
- return [2, new __HttpRequest({
43
- protocol: protocol,
44
- hostname: hostname,
45
- port: port,
46
- method: "DELETE",
47
- headers: headers,
48
- path: resolvedPath,
49
- body: body,
50
- })];
51
- }
5
+ export const serializeAws_restJson1CreateAppMonitorCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitor";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.AppMonitorConfiguration != null && {
14
+ AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
15
+ }),
16
+ ...(input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled }),
17
+ ...(input.Domain != null && { Domain: input.Domain }),
18
+ ...(input.Name != null && { Name: input.Name }),
19
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
52
20
  });
53
- }); };
54
- export var serializeAws_restJson1GetAppMonitorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
55
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
56
- return __generator(this, function (_c) {
57
- switch (_c.label) {
58
- case 0: return [4, context.endpoint()];
59
- case 1:
60
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
61
- headers = {};
62
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitor/{Name}";
63
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
64
- return [2, new __HttpRequest({
65
- protocol: protocol,
66
- hostname: hostname,
67
- port: port,
68
- method: "GET",
69
- headers: headers,
70
- path: resolvedPath,
71
- body: body,
72
- })];
73
- }
21
+ return new __HttpRequest({
22
+ protocol,
23
+ hostname,
24
+ port,
25
+ method: "POST",
26
+ headers,
27
+ path: resolvedPath,
28
+ body,
74
29
  });
75
- }); };
76
- export var serializeAws_restJson1GetAppMonitorDataCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
77
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
78
- return __generator(this, function (_c) {
79
- switch (_c.label) {
80
- case 0: return [4, context.endpoint()];
81
- case 1:
82
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
83
- headers = {
84
- "content-type": "application/json",
85
- };
86
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitor/{Name}/data";
87
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
88
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_restJson1QueryFilters(input.Filters, context) })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.TimeRange != null && { TimeRange: serializeAws_restJson1TimeRange(input.TimeRange, context) })));
89
- return [2, new __HttpRequest({
90
- protocol: protocol,
91
- hostname: hostname,
92
- port: port,
93
- method: "POST",
94
- headers: headers,
95
- path: resolvedPath,
96
- body: body,
97
- })];
98
- }
30
+ };
31
+ export const serializeAws_restJson1DeleteAppMonitorCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {};
34
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitor/{Name}";
35
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
36
+ let body;
37
+ return new __HttpRequest({
38
+ protocol,
39
+ hostname,
40
+ port,
41
+ method: "DELETE",
42
+ headers,
43
+ path: resolvedPath,
44
+ body,
99
45
  });
100
- }); };
101
- export var serializeAws_restJson1ListAppMonitorsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
102
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
103
- return __generator(this, function (_c) {
104
- switch (_c.label) {
105
- case 0: return [4, context.endpoint()];
106
- case 1:
107
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
108
- headers = {};
109
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitors";
110
- query = map({
111
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
112
- nextToken: [, input.NextToken],
113
- });
114
- return [2, new __HttpRequest({
115
- protocol: protocol,
116
- hostname: hostname,
117
- port: port,
118
- method: "POST",
119
- headers: headers,
120
- path: resolvedPath,
121
- query: query,
122
- body: body,
123
- })];
124
- }
46
+ };
47
+ export const serializeAws_restJson1GetAppMonitorCommand = async (input, context) => {
48
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
49
+ const headers = {};
50
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitor/{Name}";
51
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
52
+ let body;
53
+ return new __HttpRequest({
54
+ protocol,
55
+ hostname,
56
+ port,
57
+ method: "GET",
58
+ headers,
59
+ path: resolvedPath,
60
+ body,
125
61
  });
126
- }); };
127
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
129
- return __generator(this, function (_c) {
130
- switch (_c.label) {
131
- case 0: return [4, context.endpoint()];
132
- case 1:
133
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
134
- headers = {};
135
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
136
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
137
- return [2, new __HttpRequest({
138
- protocol: protocol,
139
- hostname: hostname,
140
- port: port,
141
- method: "GET",
142
- headers: headers,
143
- path: resolvedPath,
144
- body: body,
145
- })];
146
- }
62
+ };
63
+ export const serializeAws_restJson1GetAppMonitorDataCommand = async (input, context) => {
64
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
65
+ const headers = {
66
+ "content-type": "application/json",
67
+ };
68
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitor/{Name}/data";
69
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
70
+ let body;
71
+ body = JSON.stringify({
72
+ ...(input.Filters != null && { Filters: serializeAws_restJson1QueryFilters(input.Filters, context) }),
73
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
74
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
75
+ ...(input.TimeRange != null && { TimeRange: serializeAws_restJson1TimeRange(input.TimeRange, context) }),
147
76
  });
148
- }); };
149
- export var serializeAws_restJson1PutRumEventsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
151
- return __generator(this, function (_c) {
152
- switch (_c.label) {
153
- case 0: return [4, context.endpoint()];
154
- case 1:
155
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
156
- headers = {
157
- "content-type": "application/json",
158
- };
159
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitors/{Id}";
160
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
161
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.AppMonitorDetails != null && {
162
- AppMonitorDetails: serializeAws_restJson1AppMonitorDetails(input.AppMonitorDetails, context),
163
- })), (input.BatchId != null && { BatchId: input.BatchId })), (input.RumEvents != null && { RumEvents: serializeAws_restJson1RumEventList(input.RumEvents, context) })), (input.UserDetails != null && { UserDetails: serializeAws_restJson1UserDetails(input.UserDetails, context) })));
164
- return [4, context.endpoint()];
165
- case 2:
166
- resolvedHostname = (_c.sent()).hostname;
167
- if (context.disableHostPrefix !== true) {
168
- resolvedHostname = "dataplane." + resolvedHostname;
169
- if (!__isValidHostname(resolvedHostname)) {
170
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
171
- }
172
- }
173
- return [2, new __HttpRequest({
174
- protocol: protocol,
175
- hostname: resolvedHostname,
176
- port: port,
177
- method: "POST",
178
- headers: headers,
179
- path: resolvedPath,
180
- body: body,
181
- })];
182
- }
77
+ return new __HttpRequest({
78
+ protocol,
79
+ hostname,
80
+ port,
81
+ method: "POST",
82
+ headers,
83
+ path: resolvedPath,
84
+ body,
183
85
  });
184
- }); };
185
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
186
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
187
- return __generator(this, function (_c) {
188
- switch (_c.label) {
189
- case 0: return [4, context.endpoint()];
190
- case 1:
191
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
192
- headers = {
193
- "content-type": "application/json",
194
- };
195
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
196
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
197
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
198
- return [2, new __HttpRequest({
199
- protocol: protocol,
200
- hostname: hostname,
201
- port: port,
202
- method: "POST",
203
- headers: headers,
204
- path: resolvedPath,
205
- body: body,
206
- })];
207
- }
86
+ };
87
+ export const serializeAws_restJson1ListAppMonitorsCommand = async (input, context) => {
88
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
89
+ const headers = {};
90
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitors";
91
+ const query = map({
92
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
93
+ nextToken: [, input.NextToken],
208
94
  });
209
- }); };
210
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
211
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
212
- return __generator(this, function (_c) {
213
- switch (_c.label) {
214
- case 0: return [4, context.endpoint()];
215
- case 1:
216
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
217
- headers = {};
218
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
219
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
220
- query = map({
221
- tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
222
- });
223
- return [2, new __HttpRequest({
224
- protocol: protocol,
225
- hostname: hostname,
226
- port: port,
227
- method: "DELETE",
228
- headers: headers,
229
- path: resolvedPath,
230
- query: query,
231
- body: body,
232
- })];
233
- }
95
+ let body;
96
+ return new __HttpRequest({
97
+ protocol,
98
+ hostname,
99
+ port,
100
+ method: "POST",
101
+ headers,
102
+ path: resolvedPath,
103
+ query,
104
+ body,
234
105
  });
235
- }); };
236
- export var serializeAws_restJson1UpdateAppMonitorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
237
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
238
- return __generator(this, function (_c) {
239
- switch (_c.label) {
240
- case 0: return [4, context.endpoint()];
241
- case 1:
242
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
243
- headers = {
244
- "content-type": "application/json",
245
- };
246
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/appmonitor/{Name}";
247
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
248
- body = JSON.stringify(__assign(__assign(__assign({}, (input.AppMonitorConfiguration != null && {
249
- AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
250
- })), (input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled })), (input.Domain != null && { Domain: input.Domain })));
251
- return [2, new __HttpRequest({
252
- protocol: protocol,
253
- hostname: hostname,
254
- port: port,
255
- method: "PATCH",
256
- headers: headers,
257
- path: resolvedPath,
258
- body: body,
259
- })];
260
- }
106
+ };
107
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
108
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const headers = {};
110
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
111
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
112
+ let body;
113
+ return new __HttpRequest({
114
+ protocol,
115
+ hostname,
116
+ port,
117
+ method: "GET",
118
+ headers,
119
+ path: resolvedPath,
120
+ body,
261
121
  });
262
- }); };
263
- export var deserializeAws_restJson1CreateAppMonitorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
264
- var contents, data, _a, _b;
265
- return __generator(this, function (_c) {
266
- switch (_c.label) {
267
- case 0:
268
- if (output.statusCode !== 200 && output.statusCode >= 300) {
269
- return [2, deserializeAws_restJson1CreateAppMonitorCommandError(output, context)];
270
- }
271
- contents = map({
272
- $metadata: deserializeMetadata(output),
273
- });
274
- _a = __expectNonNull;
275
- _b = __expectObject;
276
- return [4, parseBody(output.body, context)];
277
- case 1:
278
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
279
- if (data.Id != null) {
280
- contents.Id = __expectString(data.Id);
281
- }
282
- return [2, contents];
283
- }
122
+ };
123
+ export const serializeAws_restJson1PutRumEventsCommand = async (input, context) => {
124
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
125
+ const headers = {
126
+ "content-type": "application/json",
127
+ };
128
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitors/{Id}";
129
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
130
+ let body;
131
+ body = JSON.stringify({
132
+ ...(input.AppMonitorDetails != null && {
133
+ AppMonitorDetails: serializeAws_restJson1AppMonitorDetails(input.AppMonitorDetails, context),
134
+ }),
135
+ ...(input.BatchId != null && { BatchId: input.BatchId }),
136
+ ...(input.RumEvents != null && { RumEvents: serializeAws_restJson1RumEventList(input.RumEvents, context) }),
137
+ ...(input.UserDetails != null && { UserDetails: serializeAws_restJson1UserDetails(input.UserDetails, context) }),
284
138
  });
285
- }); };
286
- var deserializeAws_restJson1CreateAppMonitorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
287
- var parsedOutput, _a, errorCode, _b, parsedBody;
288
- var _c;
289
- return __generator(this, function (_d) {
290
- switch (_d.label) {
291
- case 0:
292
- _a = [__assign({}, output)];
293
- _c = {};
294
- return [4, parseErrorBody(output.body, context)];
295
- case 1:
296
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
297
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
298
- _b = errorCode;
299
- switch (_b) {
300
- case "AccessDeniedException": return [3, 2];
301
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
302
- case "ConflictException": return [3, 4];
303
- case "com.amazonaws.rum#ConflictException": return [3, 4];
304
- case "InternalServerException": return [3, 6];
305
- case "com.amazonaws.rum#InternalServerException": return [3, 6];
306
- case "ServiceQuotaExceededException": return [3, 8];
307
- case "com.amazonaws.rum#ServiceQuotaExceededException": return [3, 8];
308
- case "ThrottlingException": return [3, 10];
309
- case "com.amazonaws.rum#ThrottlingException": return [3, 10];
310
- case "ValidationException": return [3, 12];
311
- case "com.amazonaws.rum#ValidationException": return [3, 12];
312
- }
313
- return [3, 14];
314
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
315
- case 3: throw _d.sent();
316
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
317
- case 5: throw _d.sent();
318
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
319
- case 7: throw _d.sent();
320
- case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
321
- case 9: throw _d.sent();
322
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
323
- case 11: throw _d.sent();
324
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
325
- case 13: throw _d.sent();
326
- case 14:
327
- parsedBody = parsedOutput.body;
328
- throwDefaultError({
329
- output: output,
330
- parsedBody: parsedBody,
331
- exceptionCtor: __BaseException,
332
- errorCode: errorCode,
333
- });
334
- _d.label = 15;
335
- case 15: return [2];
139
+ let { hostname: resolvedHostname } = await context.endpoint();
140
+ if (context.disableHostPrefix !== true) {
141
+ resolvedHostname = "dataplane." + resolvedHostname;
142
+ if (!__isValidHostname(resolvedHostname)) {
143
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
336
144
  }
145
+ }
146
+ return new __HttpRequest({
147
+ protocol,
148
+ hostname: resolvedHostname,
149
+ port,
150
+ method: "POST",
151
+ headers,
152
+ path: resolvedPath,
153
+ body,
337
154
  });
338
- }); };
339
- export var deserializeAws_restJson1DeleteAppMonitorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
340
- var contents;
341
- return __generator(this, function (_a) {
342
- switch (_a.label) {
343
- case 0:
344
- if (output.statusCode !== 200 && output.statusCode >= 300) {
345
- return [2, deserializeAws_restJson1DeleteAppMonitorCommandError(output, context)];
346
- }
347
- contents = map({
348
- $metadata: deserializeMetadata(output),
349
- });
350
- return [4, collectBody(output.body, context)];
351
- case 1:
352
- _a.sent();
353
- return [2, contents];
354
- }
155
+ };
156
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
157
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
+ const headers = {
159
+ "content-type": "application/json",
160
+ };
161
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
162
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
163
+ let body;
164
+ body = JSON.stringify({
165
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
355
166
  });
356
- }); };
357
- var deserializeAws_restJson1DeleteAppMonitorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
358
- var parsedOutput, _a, errorCode, _b, parsedBody;
359
- var _c;
360
- return __generator(this, function (_d) {
361
- switch (_d.label) {
362
- case 0:
363
- _a = [__assign({}, output)];
364
- _c = {};
365
- return [4, parseErrorBody(output.body, context)];
366
- case 1:
367
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
368
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
369
- _b = errorCode;
370
- switch (_b) {
371
- case "AccessDeniedException": return [3, 2];
372
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
373
- case "ConflictException": return [3, 4];
374
- case "com.amazonaws.rum#ConflictException": return [3, 4];
375
- case "InternalServerException": return [3, 6];
376
- case "com.amazonaws.rum#InternalServerException": return [3, 6];
377
- case "ResourceNotFoundException": return [3, 8];
378
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 8];
379
- case "ThrottlingException": return [3, 10];
380
- case "com.amazonaws.rum#ThrottlingException": return [3, 10];
381
- case "ValidationException": return [3, 12];
382
- case "com.amazonaws.rum#ValidationException": return [3, 12];
383
- }
384
- return [3, 14];
385
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
386
- case 3: throw _d.sent();
387
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
388
- case 5: throw _d.sent();
389
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
390
- case 7: throw _d.sent();
391
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
392
- case 9: throw _d.sent();
393
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
394
- case 11: throw _d.sent();
395
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
396
- case 13: throw _d.sent();
397
- case 14:
398
- parsedBody = parsedOutput.body;
399
- throwDefaultError({
400
- output: output,
401
- parsedBody: parsedBody,
402
- exceptionCtor: __BaseException,
403
- errorCode: errorCode,
404
- });
405
- _d.label = 15;
406
- case 15: return [2];
407
- }
167
+ return new __HttpRequest({
168
+ protocol,
169
+ hostname,
170
+ port,
171
+ method: "POST",
172
+ headers,
173
+ path: resolvedPath,
174
+ body,
408
175
  });
409
- }); };
410
- export var deserializeAws_restJson1GetAppMonitorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
411
- var contents, data, _a, _b;
412
- return __generator(this, function (_c) {
413
- switch (_c.label) {
414
- case 0:
415
- if (output.statusCode !== 200 && output.statusCode >= 300) {
416
- return [2, deserializeAws_restJson1GetAppMonitorCommandError(output, context)];
417
- }
418
- contents = map({
419
- $metadata: deserializeMetadata(output),
420
- });
421
- _a = __expectNonNull;
422
- _b = __expectObject;
423
- return [4, parseBody(output.body, context)];
424
- case 1:
425
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
426
- if (data.AppMonitor != null) {
427
- contents.AppMonitor = deserializeAws_restJson1AppMonitor(data.AppMonitor, context);
428
- }
429
- return [2, contents];
430
- }
176
+ };
177
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
178
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
179
+ const headers = {};
180
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
181
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
182
+ const query = map({
183
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
431
184
  });
432
- }); };
433
- var deserializeAws_restJson1GetAppMonitorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
434
- var parsedOutput, _a, errorCode, _b, parsedBody;
435
- var _c;
436
- return __generator(this, function (_d) {
437
- switch (_d.label) {
438
- case 0:
439
- _a = [__assign({}, output)];
440
- _c = {};
441
- return [4, parseErrorBody(output.body, context)];
442
- case 1:
443
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
444
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
445
- _b = errorCode;
446
- switch (_b) {
447
- case "AccessDeniedException": return [3, 2];
448
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
449
- case "InternalServerException": return [3, 4];
450
- case "com.amazonaws.rum#InternalServerException": return [3, 4];
451
- case "ResourceNotFoundException": return [3, 6];
452
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 6];
453
- case "ThrottlingException": return [3, 8];
454
- case "com.amazonaws.rum#ThrottlingException": return [3, 8];
455
- case "ValidationException": return [3, 10];
456
- case "com.amazonaws.rum#ValidationException": return [3, 10];
457
- }
458
- return [3, 12];
459
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
460
- case 3: throw _d.sent();
461
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
462
- case 5: throw _d.sent();
463
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
464
- case 7: throw _d.sent();
465
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
466
- case 9: throw _d.sent();
467
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
468
- case 11: throw _d.sent();
469
- case 12:
470
- parsedBody = parsedOutput.body;
471
- throwDefaultError({
472
- output: output,
473
- parsedBody: parsedBody,
474
- exceptionCtor: __BaseException,
475
- errorCode: errorCode,
476
- });
477
- _d.label = 13;
478
- case 13: return [2];
479
- }
185
+ let body;
186
+ return new __HttpRequest({
187
+ protocol,
188
+ hostname,
189
+ port,
190
+ method: "DELETE",
191
+ headers,
192
+ path: resolvedPath,
193
+ query,
194
+ body,
480
195
  });
481
- }); };
482
- export var deserializeAws_restJson1GetAppMonitorDataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
483
- var contents, data, _a, _b;
484
- return __generator(this, function (_c) {
485
- switch (_c.label) {
486
- case 0:
487
- if (output.statusCode !== 200 && output.statusCode >= 300) {
488
- return [2, deserializeAws_restJson1GetAppMonitorDataCommandError(output, context)];
489
- }
490
- contents = map({
491
- $metadata: deserializeMetadata(output),
492
- });
493
- _a = __expectNonNull;
494
- _b = __expectObject;
495
- return [4, parseBody(output.body, context)];
496
- case 1:
497
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
498
- if (data.Events != null) {
499
- contents.Events = deserializeAws_restJson1EventDataList(data.Events, context);
500
- }
501
- if (data.NextToken != null) {
502
- contents.NextToken = __expectString(data.NextToken);
503
- }
504
- return [2, contents];
505
- }
196
+ };
197
+ export const serializeAws_restJson1UpdateAppMonitorCommand = async (input, context) => {
198
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
199
+ const headers = {
200
+ "content-type": "application/json",
201
+ };
202
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/appmonitor/{Name}";
203
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
204
+ let body;
205
+ body = JSON.stringify({
206
+ ...(input.AppMonitorConfiguration != null && {
207
+ AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
208
+ }),
209
+ ...(input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled }),
210
+ ...(input.Domain != null && { Domain: input.Domain }),
506
211
  });
507
- }); };
508
- var deserializeAws_restJson1GetAppMonitorDataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
509
- var parsedOutput, _a, errorCode, _b, parsedBody;
510
- var _c;
511
- return __generator(this, function (_d) {
512
- switch (_d.label) {
513
- case 0:
514
- _a = [__assign({}, output)];
515
- _c = {};
516
- return [4, parseErrorBody(output.body, context)];
517
- case 1:
518
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
519
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
520
- _b = errorCode;
521
- switch (_b) {
522
- case "AccessDeniedException": return [3, 2];
523
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
524
- case "InternalServerException": return [3, 4];
525
- case "com.amazonaws.rum#InternalServerException": return [3, 4];
526
- case "ResourceNotFoundException": return [3, 6];
527
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 6];
528
- case "ThrottlingException": return [3, 8];
529
- case "com.amazonaws.rum#ThrottlingException": return [3, 8];
530
- case "ValidationException": return [3, 10];
531
- case "com.amazonaws.rum#ValidationException": return [3, 10];
532
- }
533
- return [3, 12];
534
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
535
- case 3: throw _d.sent();
536
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
537
- case 5: throw _d.sent();
538
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
539
- case 7: throw _d.sent();
540
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
541
- case 9: throw _d.sent();
542
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
543
- case 11: throw _d.sent();
544
- case 12:
545
- parsedBody = parsedOutput.body;
546
- throwDefaultError({
547
- output: output,
548
- parsedBody: parsedBody,
549
- exceptionCtor: __BaseException,
550
- errorCode: errorCode,
551
- });
552
- _d.label = 13;
553
- case 13: return [2];
554
- }
212
+ return new __HttpRequest({
213
+ protocol,
214
+ hostname,
215
+ port,
216
+ method: "PATCH",
217
+ headers,
218
+ path: resolvedPath,
219
+ body,
555
220
  });
556
- }); };
557
- export var deserializeAws_restJson1ListAppMonitorsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
558
- var contents, data, _a, _b;
559
- return __generator(this, function (_c) {
560
- switch (_c.label) {
561
- case 0:
562
- if (output.statusCode !== 200 && output.statusCode >= 300) {
563
- return [2, deserializeAws_restJson1ListAppMonitorsCommandError(output, context)];
564
- }
565
- contents = map({
566
- $metadata: deserializeMetadata(output),
567
- });
568
- _a = __expectNonNull;
569
- _b = __expectObject;
570
- return [4, parseBody(output.body, context)];
571
- case 1:
572
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
573
- if (data.AppMonitorSummaries != null) {
574
- contents.AppMonitorSummaries = deserializeAws_restJson1AppMonitorSummaryList(data.AppMonitorSummaries, context);
575
- }
576
- if (data.NextToken != null) {
577
- contents.NextToken = __expectString(data.NextToken);
578
- }
579
- return [2, contents];
580
- }
221
+ };
222
+ export const deserializeAws_restJson1CreateAppMonitorCommand = async (output, context) => {
223
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
224
+ return deserializeAws_restJson1CreateAppMonitorCommandError(output, context);
225
+ }
226
+ const contents = map({
227
+ $metadata: deserializeMetadata(output),
581
228
  });
582
- }); };
583
- var deserializeAws_restJson1ListAppMonitorsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
584
- var parsedOutput, _a, errorCode, _b, parsedBody;
585
- var _c;
586
- return __generator(this, function (_d) {
587
- switch (_d.label) {
588
- case 0:
589
- _a = [__assign({}, output)];
590
- _c = {};
591
- return [4, parseErrorBody(output.body, context)];
592
- case 1:
593
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
594
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
595
- _b = errorCode;
596
- switch (_b) {
597
- case "AccessDeniedException": return [3, 2];
598
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
599
- case "InternalServerException": return [3, 4];
600
- case "com.amazonaws.rum#InternalServerException": return [3, 4];
601
- case "ThrottlingException": return [3, 6];
602
- case "com.amazonaws.rum#ThrottlingException": return [3, 6];
603
- case "ValidationException": return [3, 8];
604
- case "com.amazonaws.rum#ValidationException": return [3, 8];
605
- }
606
- return [3, 10];
607
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
608
- case 3: throw _d.sent();
609
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
610
- case 5: throw _d.sent();
611
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
612
- case 7: throw _d.sent();
613
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
614
- case 9: throw _d.sent();
615
- case 10:
616
- parsedBody = parsedOutput.body;
617
- throwDefaultError({
618
- output: output,
619
- parsedBody: parsedBody,
620
- exceptionCtor: __BaseException,
621
- errorCode: errorCode,
622
- });
623
- _d.label = 11;
624
- case 11: return [2];
625
- }
229
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
230
+ if (data.Id != null) {
231
+ contents.Id = __expectString(data.Id);
232
+ }
233
+ return contents;
234
+ };
235
+ const deserializeAws_restJson1CreateAppMonitorCommandError = async (output, context) => {
236
+ const parsedOutput = {
237
+ ...output,
238
+ body: await parseErrorBody(output.body, context),
239
+ };
240
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
241
+ switch (errorCode) {
242
+ case "AccessDeniedException":
243
+ case "com.amazonaws.rum#AccessDeniedException":
244
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
245
+ case "ConflictException":
246
+ case "com.amazonaws.rum#ConflictException":
247
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
248
+ case "InternalServerException":
249
+ case "com.amazonaws.rum#InternalServerException":
250
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
251
+ case "ServiceQuotaExceededException":
252
+ case "com.amazonaws.rum#ServiceQuotaExceededException":
253
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
254
+ case "ThrottlingException":
255
+ case "com.amazonaws.rum#ThrottlingException":
256
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
257
+ case "ValidationException":
258
+ case "com.amazonaws.rum#ValidationException":
259
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
260
+ default:
261
+ const parsedBody = parsedOutput.body;
262
+ throwDefaultError({
263
+ output,
264
+ parsedBody,
265
+ exceptionCtor: __BaseException,
266
+ errorCode,
267
+ });
268
+ }
269
+ };
270
+ export const deserializeAws_restJson1DeleteAppMonitorCommand = async (output, context) => {
271
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
272
+ return deserializeAws_restJson1DeleteAppMonitorCommandError(output, context);
273
+ }
274
+ const contents = map({
275
+ $metadata: deserializeMetadata(output),
626
276
  });
627
- }); };
628
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
629
- var contents, data, _a, _b;
630
- return __generator(this, function (_c) {
631
- switch (_c.label) {
632
- case 0:
633
- if (output.statusCode !== 200 && output.statusCode >= 300) {
634
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
635
- }
636
- contents = map({
637
- $metadata: deserializeMetadata(output),
638
- });
639
- _a = __expectNonNull;
640
- _b = __expectObject;
641
- return [4, parseBody(output.body, context)];
642
- case 1:
643
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
644
- if (data.ResourceArn != null) {
645
- contents.ResourceArn = __expectString(data.ResourceArn);
646
- }
647
- if (data.Tags != null) {
648
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
649
- }
650
- return [2, contents];
651
- }
277
+ await collectBody(output.body, context);
278
+ return contents;
279
+ };
280
+ const deserializeAws_restJson1DeleteAppMonitorCommandError = async (output, context) => {
281
+ const parsedOutput = {
282
+ ...output,
283
+ body: await parseErrorBody(output.body, context),
284
+ };
285
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
286
+ switch (errorCode) {
287
+ case "AccessDeniedException":
288
+ case "com.amazonaws.rum#AccessDeniedException":
289
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
290
+ case "ConflictException":
291
+ case "com.amazonaws.rum#ConflictException":
292
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
293
+ case "InternalServerException":
294
+ case "com.amazonaws.rum#InternalServerException":
295
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
296
+ case "ResourceNotFoundException":
297
+ case "com.amazonaws.rum#ResourceNotFoundException":
298
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
299
+ case "ThrottlingException":
300
+ case "com.amazonaws.rum#ThrottlingException":
301
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
302
+ case "ValidationException":
303
+ case "com.amazonaws.rum#ValidationException":
304
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
305
+ default:
306
+ const parsedBody = parsedOutput.body;
307
+ throwDefaultError({
308
+ output,
309
+ parsedBody,
310
+ exceptionCtor: __BaseException,
311
+ errorCode,
312
+ });
313
+ }
314
+ };
315
+ export const deserializeAws_restJson1GetAppMonitorCommand = async (output, context) => {
316
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
317
+ return deserializeAws_restJson1GetAppMonitorCommandError(output, context);
318
+ }
319
+ const contents = map({
320
+ $metadata: deserializeMetadata(output),
652
321
  });
653
- }); };
654
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
655
- var parsedOutput, _a, errorCode, _b, parsedBody;
656
- var _c;
657
- return __generator(this, function (_d) {
658
- switch (_d.label) {
659
- case 0:
660
- _a = [__assign({}, output)];
661
- _c = {};
662
- return [4, parseErrorBody(output.body, context)];
663
- case 1:
664
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
665
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
666
- _b = errorCode;
667
- switch (_b) {
668
- case "InternalServerException": return [3, 2];
669
- case "com.amazonaws.rum#InternalServerException": return [3, 2];
670
- case "ResourceNotFoundException": return [3, 4];
671
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 4];
672
- case "ValidationException": return [3, 6];
673
- case "com.amazonaws.rum#ValidationException": return [3, 6];
674
- }
675
- return [3, 8];
676
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
677
- case 3: throw _d.sent();
678
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
679
- case 5: throw _d.sent();
680
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
681
- case 7: throw _d.sent();
682
- case 8:
683
- parsedBody = parsedOutput.body;
684
- throwDefaultError({
685
- output: output,
686
- parsedBody: parsedBody,
687
- exceptionCtor: __BaseException,
688
- errorCode: errorCode,
689
- });
690
- _d.label = 9;
691
- case 9: return [2];
692
- }
322
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
323
+ if (data.AppMonitor != null) {
324
+ contents.AppMonitor = deserializeAws_restJson1AppMonitor(data.AppMonitor, context);
325
+ }
326
+ return contents;
327
+ };
328
+ const deserializeAws_restJson1GetAppMonitorCommandError = async (output, context) => {
329
+ const parsedOutput = {
330
+ ...output,
331
+ body: await parseErrorBody(output.body, context),
332
+ };
333
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
334
+ switch (errorCode) {
335
+ case "AccessDeniedException":
336
+ case "com.amazonaws.rum#AccessDeniedException":
337
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
338
+ case "InternalServerException":
339
+ case "com.amazonaws.rum#InternalServerException":
340
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
341
+ case "ResourceNotFoundException":
342
+ case "com.amazonaws.rum#ResourceNotFoundException":
343
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
344
+ case "ThrottlingException":
345
+ case "com.amazonaws.rum#ThrottlingException":
346
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
347
+ case "ValidationException":
348
+ case "com.amazonaws.rum#ValidationException":
349
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
350
+ default:
351
+ const parsedBody = parsedOutput.body;
352
+ throwDefaultError({
353
+ output,
354
+ parsedBody,
355
+ exceptionCtor: __BaseException,
356
+ errorCode,
357
+ });
358
+ }
359
+ };
360
+ export const deserializeAws_restJson1GetAppMonitorDataCommand = async (output, context) => {
361
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
362
+ return deserializeAws_restJson1GetAppMonitorDataCommandError(output, context);
363
+ }
364
+ const contents = map({
365
+ $metadata: deserializeMetadata(output),
693
366
  });
694
- }); };
695
- export var deserializeAws_restJson1PutRumEventsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
696
- var contents;
697
- return __generator(this, function (_a) {
698
- switch (_a.label) {
699
- case 0:
700
- if (output.statusCode !== 200 && output.statusCode >= 300) {
701
- return [2, deserializeAws_restJson1PutRumEventsCommandError(output, context)];
702
- }
703
- contents = map({
704
- $metadata: deserializeMetadata(output),
705
- });
706
- return [4, collectBody(output.body, context)];
707
- case 1:
708
- _a.sent();
709
- return [2, contents];
710
- }
367
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
368
+ if (data.Events != null) {
369
+ contents.Events = deserializeAws_restJson1EventDataList(data.Events, context);
370
+ }
371
+ if (data.NextToken != null) {
372
+ contents.NextToken = __expectString(data.NextToken);
373
+ }
374
+ return contents;
375
+ };
376
+ const deserializeAws_restJson1GetAppMonitorDataCommandError = async (output, context) => {
377
+ const parsedOutput = {
378
+ ...output,
379
+ body: await parseErrorBody(output.body, context),
380
+ };
381
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
382
+ switch (errorCode) {
383
+ case "AccessDeniedException":
384
+ case "com.amazonaws.rum#AccessDeniedException":
385
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
386
+ case "InternalServerException":
387
+ case "com.amazonaws.rum#InternalServerException":
388
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
389
+ case "ResourceNotFoundException":
390
+ case "com.amazonaws.rum#ResourceNotFoundException":
391
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
392
+ case "ThrottlingException":
393
+ case "com.amazonaws.rum#ThrottlingException":
394
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
395
+ case "ValidationException":
396
+ case "com.amazonaws.rum#ValidationException":
397
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
398
+ default:
399
+ const parsedBody = parsedOutput.body;
400
+ throwDefaultError({
401
+ output,
402
+ parsedBody,
403
+ exceptionCtor: __BaseException,
404
+ errorCode,
405
+ });
406
+ }
407
+ };
408
+ export const deserializeAws_restJson1ListAppMonitorsCommand = async (output, context) => {
409
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
410
+ return deserializeAws_restJson1ListAppMonitorsCommandError(output, context);
411
+ }
412
+ const contents = map({
413
+ $metadata: deserializeMetadata(output),
711
414
  });
712
- }); };
713
- var deserializeAws_restJson1PutRumEventsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
714
- var parsedOutput, _a, errorCode, _b, parsedBody;
715
- var _c;
716
- return __generator(this, function (_d) {
717
- switch (_d.label) {
718
- case 0:
719
- _a = [__assign({}, output)];
720
- _c = {};
721
- return [4, parseErrorBody(output.body, context)];
722
- case 1:
723
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
724
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
725
- _b = errorCode;
726
- switch (_b) {
727
- case "AccessDeniedException": return [3, 2];
728
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
729
- case "InternalServerException": return [3, 4];
730
- case "com.amazonaws.rum#InternalServerException": return [3, 4];
731
- case "ResourceNotFoundException": return [3, 6];
732
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 6];
733
- case "ThrottlingException": return [3, 8];
734
- case "com.amazonaws.rum#ThrottlingException": return [3, 8];
735
- case "ValidationException": return [3, 10];
736
- case "com.amazonaws.rum#ValidationException": return [3, 10];
737
- }
738
- return [3, 12];
739
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
740
- case 3: throw _d.sent();
741
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
742
- case 5: throw _d.sent();
743
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
744
- case 7: throw _d.sent();
745
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
746
- case 9: throw _d.sent();
747
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
748
- case 11: throw _d.sent();
749
- case 12:
750
- parsedBody = parsedOutput.body;
751
- throwDefaultError({
752
- output: output,
753
- parsedBody: parsedBody,
754
- exceptionCtor: __BaseException,
755
- errorCode: errorCode,
756
- });
757
- _d.label = 13;
758
- case 13: return [2];
759
- }
415
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
416
+ if (data.AppMonitorSummaries != null) {
417
+ contents.AppMonitorSummaries = deserializeAws_restJson1AppMonitorSummaryList(data.AppMonitorSummaries, context);
418
+ }
419
+ if (data.NextToken != null) {
420
+ contents.NextToken = __expectString(data.NextToken);
421
+ }
422
+ return contents;
423
+ };
424
+ const deserializeAws_restJson1ListAppMonitorsCommandError = async (output, context) => {
425
+ const parsedOutput = {
426
+ ...output,
427
+ body: await parseErrorBody(output.body, context),
428
+ };
429
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
430
+ switch (errorCode) {
431
+ case "AccessDeniedException":
432
+ case "com.amazonaws.rum#AccessDeniedException":
433
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
434
+ case "InternalServerException":
435
+ case "com.amazonaws.rum#InternalServerException":
436
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
437
+ case "ThrottlingException":
438
+ case "com.amazonaws.rum#ThrottlingException":
439
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
440
+ case "ValidationException":
441
+ case "com.amazonaws.rum#ValidationException":
442
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
443
+ default:
444
+ const parsedBody = parsedOutput.body;
445
+ throwDefaultError({
446
+ output,
447
+ parsedBody,
448
+ exceptionCtor: __BaseException,
449
+ errorCode,
450
+ });
451
+ }
452
+ };
453
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
454
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
455
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
456
+ }
457
+ const contents = map({
458
+ $metadata: deserializeMetadata(output),
760
459
  });
761
- }); };
762
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
763
- var contents;
764
- return __generator(this, function (_a) {
765
- switch (_a.label) {
766
- case 0:
767
- if (output.statusCode !== 200 && output.statusCode >= 300) {
768
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
769
- }
770
- contents = map({
771
- $metadata: deserializeMetadata(output),
772
- });
773
- return [4, collectBody(output.body, context)];
774
- case 1:
775
- _a.sent();
776
- return [2, contents];
777
- }
460
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
461
+ if (data.ResourceArn != null) {
462
+ contents.ResourceArn = __expectString(data.ResourceArn);
463
+ }
464
+ if (data.Tags != null) {
465
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
466
+ }
467
+ return contents;
468
+ };
469
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
470
+ const parsedOutput = {
471
+ ...output,
472
+ body: await parseErrorBody(output.body, context),
473
+ };
474
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
475
+ switch (errorCode) {
476
+ case "InternalServerException":
477
+ case "com.amazonaws.rum#InternalServerException":
478
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
479
+ case "ResourceNotFoundException":
480
+ case "com.amazonaws.rum#ResourceNotFoundException":
481
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
482
+ case "ValidationException":
483
+ case "com.amazonaws.rum#ValidationException":
484
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
485
+ default:
486
+ const parsedBody = parsedOutput.body;
487
+ throwDefaultError({
488
+ output,
489
+ parsedBody,
490
+ exceptionCtor: __BaseException,
491
+ errorCode,
492
+ });
493
+ }
494
+ };
495
+ export const deserializeAws_restJson1PutRumEventsCommand = async (output, context) => {
496
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
497
+ return deserializeAws_restJson1PutRumEventsCommandError(output, context);
498
+ }
499
+ const contents = map({
500
+ $metadata: deserializeMetadata(output),
778
501
  });
779
- }); };
780
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
781
- var parsedOutput, _a, errorCode, _b, parsedBody;
782
- var _c;
783
- return __generator(this, function (_d) {
784
- switch (_d.label) {
785
- case 0:
786
- _a = [__assign({}, output)];
787
- _c = {};
788
- return [4, parseErrorBody(output.body, context)];
789
- case 1:
790
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
791
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
- _b = errorCode;
793
- switch (_b) {
794
- case "InternalServerException": return [3, 2];
795
- case "com.amazonaws.rum#InternalServerException": return [3, 2];
796
- case "ResourceNotFoundException": return [3, 4];
797
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 4];
798
- case "ValidationException": return [3, 6];
799
- case "com.amazonaws.rum#ValidationException": return [3, 6];
800
- }
801
- return [3, 8];
802
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
803
- case 3: throw _d.sent();
804
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
805
- case 5: throw _d.sent();
806
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
807
- case 7: throw _d.sent();
808
- case 8:
809
- parsedBody = parsedOutput.body;
810
- throwDefaultError({
811
- output: output,
812
- parsedBody: parsedBody,
813
- exceptionCtor: __BaseException,
814
- errorCode: errorCode,
815
- });
816
- _d.label = 9;
817
- case 9: return [2];
818
- }
502
+ await collectBody(output.body, context);
503
+ return contents;
504
+ };
505
+ const deserializeAws_restJson1PutRumEventsCommandError = async (output, context) => {
506
+ const parsedOutput = {
507
+ ...output,
508
+ body: await parseErrorBody(output.body, context),
509
+ };
510
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
511
+ switch (errorCode) {
512
+ case "AccessDeniedException":
513
+ case "com.amazonaws.rum#AccessDeniedException":
514
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
515
+ case "InternalServerException":
516
+ case "com.amazonaws.rum#InternalServerException":
517
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
518
+ case "ResourceNotFoundException":
519
+ case "com.amazonaws.rum#ResourceNotFoundException":
520
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
521
+ case "ThrottlingException":
522
+ case "com.amazonaws.rum#ThrottlingException":
523
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
524
+ case "ValidationException":
525
+ case "com.amazonaws.rum#ValidationException":
526
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
527
+ default:
528
+ const parsedBody = parsedOutput.body;
529
+ throwDefaultError({
530
+ output,
531
+ parsedBody,
532
+ exceptionCtor: __BaseException,
533
+ errorCode,
534
+ });
535
+ }
536
+ };
537
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
538
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
539
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
540
+ }
541
+ const contents = map({
542
+ $metadata: deserializeMetadata(output),
819
543
  });
820
- }); };
821
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
822
- var contents;
823
- return __generator(this, function (_a) {
824
- switch (_a.label) {
825
- case 0:
826
- if (output.statusCode !== 200 && output.statusCode >= 300) {
827
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
828
- }
829
- contents = map({
830
- $metadata: deserializeMetadata(output),
831
- });
832
- return [4, collectBody(output.body, context)];
833
- case 1:
834
- _a.sent();
835
- return [2, contents];
836
- }
544
+ await collectBody(output.body, context);
545
+ return contents;
546
+ };
547
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
548
+ const parsedOutput = {
549
+ ...output,
550
+ body: await parseErrorBody(output.body, context),
551
+ };
552
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
553
+ switch (errorCode) {
554
+ case "InternalServerException":
555
+ case "com.amazonaws.rum#InternalServerException":
556
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
557
+ case "ResourceNotFoundException":
558
+ case "com.amazonaws.rum#ResourceNotFoundException":
559
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
560
+ case "ValidationException":
561
+ case "com.amazonaws.rum#ValidationException":
562
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
563
+ default:
564
+ const parsedBody = parsedOutput.body;
565
+ throwDefaultError({
566
+ output,
567
+ parsedBody,
568
+ exceptionCtor: __BaseException,
569
+ errorCode,
570
+ });
571
+ }
572
+ };
573
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
574
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
575
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
576
+ }
577
+ const contents = map({
578
+ $metadata: deserializeMetadata(output),
837
579
  });
838
- }); };
839
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
840
- var parsedOutput, _a, errorCode, _b, parsedBody;
841
- var _c;
842
- return __generator(this, function (_d) {
843
- switch (_d.label) {
844
- case 0:
845
- _a = [__assign({}, output)];
846
- _c = {};
847
- return [4, parseErrorBody(output.body, context)];
848
- case 1:
849
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
850
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
851
- _b = errorCode;
852
- switch (_b) {
853
- case "InternalServerException": return [3, 2];
854
- case "com.amazonaws.rum#InternalServerException": return [3, 2];
855
- case "ResourceNotFoundException": return [3, 4];
856
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 4];
857
- case "ValidationException": return [3, 6];
858
- case "com.amazonaws.rum#ValidationException": return [3, 6];
859
- }
860
- return [3, 8];
861
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
862
- case 3: throw _d.sent();
863
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
864
- case 5: throw _d.sent();
865
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
866
- case 7: throw _d.sent();
867
- case 8:
868
- parsedBody = parsedOutput.body;
869
- throwDefaultError({
870
- output: output,
871
- parsedBody: parsedBody,
872
- exceptionCtor: __BaseException,
873
- errorCode: errorCode,
874
- });
875
- _d.label = 9;
876
- case 9: return [2];
877
- }
580
+ await collectBody(output.body, context);
581
+ return contents;
582
+ };
583
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
584
+ const parsedOutput = {
585
+ ...output,
586
+ body: await parseErrorBody(output.body, context),
587
+ };
588
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
589
+ switch (errorCode) {
590
+ case "InternalServerException":
591
+ case "com.amazonaws.rum#InternalServerException":
592
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
593
+ case "ResourceNotFoundException":
594
+ case "com.amazonaws.rum#ResourceNotFoundException":
595
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
596
+ case "ValidationException":
597
+ case "com.amazonaws.rum#ValidationException":
598
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
599
+ default:
600
+ const parsedBody = parsedOutput.body;
601
+ throwDefaultError({
602
+ output,
603
+ parsedBody,
604
+ exceptionCtor: __BaseException,
605
+ errorCode,
606
+ });
607
+ }
608
+ };
609
+ export const deserializeAws_restJson1UpdateAppMonitorCommand = async (output, context) => {
610
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
611
+ return deserializeAws_restJson1UpdateAppMonitorCommandError(output, context);
612
+ }
613
+ const contents = map({
614
+ $metadata: deserializeMetadata(output),
878
615
  });
879
- }); };
880
- export var deserializeAws_restJson1UpdateAppMonitorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
881
- var contents;
882
- return __generator(this, function (_a) {
883
- switch (_a.label) {
884
- case 0:
885
- if (output.statusCode !== 200 && output.statusCode >= 300) {
886
- return [2, deserializeAws_restJson1UpdateAppMonitorCommandError(output, context)];
887
- }
888
- contents = map({
889
- $metadata: deserializeMetadata(output),
890
- });
891
- return [4, collectBody(output.body, context)];
892
- case 1:
893
- _a.sent();
894
- return [2, contents];
895
- }
616
+ await collectBody(output.body, context);
617
+ return contents;
618
+ };
619
+ const deserializeAws_restJson1UpdateAppMonitorCommandError = async (output, context) => {
620
+ const parsedOutput = {
621
+ ...output,
622
+ body: await parseErrorBody(output.body, context),
623
+ };
624
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
625
+ switch (errorCode) {
626
+ case "AccessDeniedException":
627
+ case "com.amazonaws.rum#AccessDeniedException":
628
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
629
+ case "ConflictException":
630
+ case "com.amazonaws.rum#ConflictException":
631
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
632
+ case "InternalServerException":
633
+ case "com.amazonaws.rum#InternalServerException":
634
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
635
+ case "ResourceNotFoundException":
636
+ case "com.amazonaws.rum#ResourceNotFoundException":
637
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
638
+ case "ThrottlingException":
639
+ case "com.amazonaws.rum#ThrottlingException":
640
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
641
+ case "ValidationException":
642
+ case "com.amazonaws.rum#ValidationException":
643
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
644
+ default:
645
+ const parsedBody = parsedOutput.body;
646
+ throwDefaultError({
647
+ output,
648
+ parsedBody,
649
+ exceptionCtor: __BaseException,
650
+ errorCode,
651
+ });
652
+ }
653
+ };
654
+ const map = __map;
655
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
656
+ const contents = map({});
657
+ const data = parsedOutput.body;
658
+ if (data.message != null) {
659
+ contents.message = __expectString(data.message);
660
+ }
661
+ const exception = new AccessDeniedException({
662
+ $metadata: deserializeMetadata(parsedOutput),
663
+ ...contents,
896
664
  });
897
- }); };
898
- var deserializeAws_restJson1UpdateAppMonitorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
899
- var parsedOutput, _a, errorCode, _b, parsedBody;
900
- var _c;
901
- return __generator(this, function (_d) {
902
- switch (_d.label) {
903
- case 0:
904
- _a = [__assign({}, output)];
905
- _c = {};
906
- return [4, parseErrorBody(output.body, context)];
907
- case 1:
908
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
909
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
910
- _b = errorCode;
911
- switch (_b) {
912
- case "AccessDeniedException": return [3, 2];
913
- case "com.amazonaws.rum#AccessDeniedException": return [3, 2];
914
- case "ConflictException": return [3, 4];
915
- case "com.amazonaws.rum#ConflictException": return [3, 4];
916
- case "InternalServerException": return [3, 6];
917
- case "com.amazonaws.rum#InternalServerException": return [3, 6];
918
- case "ResourceNotFoundException": return [3, 8];
919
- case "com.amazonaws.rum#ResourceNotFoundException": return [3, 8];
920
- case "ThrottlingException": return [3, 10];
921
- case "com.amazonaws.rum#ThrottlingException": return [3, 10];
922
- case "ValidationException": return [3, 12];
923
- case "com.amazonaws.rum#ValidationException": return [3, 12];
924
- }
925
- return [3, 14];
926
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
927
- case 3: throw _d.sent();
928
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
929
- case 5: throw _d.sent();
930
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
931
- case 7: throw _d.sent();
932
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
933
- case 9: throw _d.sent();
934
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
935
- case 11: throw _d.sent();
936
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
937
- case 13: throw _d.sent();
938
- case 14:
939
- parsedBody = parsedOutput.body;
940
- throwDefaultError({
941
- output: output,
942
- parsedBody: parsedBody,
943
- exceptionCtor: __BaseException,
944
- errorCode: errorCode,
945
- });
946
- _d.label = 15;
947
- case 15: return [2];
948
- }
665
+ return __decorateServiceException(exception, parsedOutput.body);
666
+ };
667
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
668
+ const contents = map({});
669
+ const data = parsedOutput.body;
670
+ if (data.message != null) {
671
+ contents.message = __expectString(data.message);
672
+ }
673
+ if (data.resourceName != null) {
674
+ contents.resourceName = __expectString(data.resourceName);
675
+ }
676
+ if (data.resourceType != null) {
677
+ contents.resourceType = __expectString(data.resourceType);
678
+ }
679
+ const exception = new ConflictException({
680
+ $metadata: deserializeMetadata(parsedOutput),
681
+ ...contents,
949
682
  });
950
- }); };
951
- var map = __map;
952
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
953
- var contents, data, exception;
954
- return __generator(this, function (_a) {
955
- contents = map({});
956
- data = parsedOutput.body;
957
- if (data.message != null) {
958
- contents.message = __expectString(data.message);
959
- }
960
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
961
- return [2, __decorateServiceException(exception, parsedOutput.body)];
683
+ return __decorateServiceException(exception, parsedOutput.body);
684
+ };
685
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
686
+ const contents = map({
687
+ retryAfterSeconds: [
688
+ () => void 0 !== parsedOutput.headers["retry-after"],
689
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
690
+ ],
962
691
  });
963
- }); };
964
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
965
- var contents, data, exception;
966
- return __generator(this, function (_a) {
967
- contents = map({});
968
- data = parsedOutput.body;
969
- if (data.message != null) {
970
- contents.message = __expectString(data.message);
971
- }
972
- if (data.resourceName != null) {
973
- contents.resourceName = __expectString(data.resourceName);
974
- }
975
- if (data.resourceType != null) {
976
- contents.resourceType = __expectString(data.resourceType);
977
- }
978
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
979
- return [2, __decorateServiceException(exception, parsedOutput.body)];
692
+ const data = parsedOutput.body;
693
+ if (data.message != null) {
694
+ contents.message = __expectString(data.message);
695
+ }
696
+ const exception = new InternalServerException({
697
+ $metadata: deserializeMetadata(parsedOutput),
698
+ ...contents,
980
699
  });
981
- }); };
982
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
983
- var contents, data, exception;
984
- return __generator(this, function (_a) {
985
- contents = map({
986
- retryAfterSeconds: [
987
- function () { return void 0 !== parsedOutput.headers["retry-after"]; },
988
- function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
989
- ],
990
- });
991
- data = parsedOutput.body;
992
- if (data.message != null) {
993
- contents.message = __expectString(data.message);
994
- }
995
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
996
- return [2, __decorateServiceException(exception, parsedOutput.body)];
700
+ return __decorateServiceException(exception, parsedOutput.body);
701
+ };
702
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
703
+ const contents = map({});
704
+ const data = parsedOutput.body;
705
+ if (data.message != null) {
706
+ contents.message = __expectString(data.message);
707
+ }
708
+ if (data.resourceName != null) {
709
+ contents.resourceName = __expectString(data.resourceName);
710
+ }
711
+ if (data.resourceType != null) {
712
+ contents.resourceType = __expectString(data.resourceType);
713
+ }
714
+ const exception = new ResourceNotFoundException({
715
+ $metadata: deserializeMetadata(parsedOutput),
716
+ ...contents,
997
717
  });
998
- }); };
999
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1000
- var contents, data, exception;
1001
- return __generator(this, function (_a) {
1002
- contents = map({});
1003
- data = parsedOutput.body;
1004
- if (data.message != null) {
1005
- contents.message = __expectString(data.message);
1006
- }
1007
- if (data.resourceName != null) {
1008
- contents.resourceName = __expectString(data.resourceName);
1009
- }
1010
- if (data.resourceType != null) {
1011
- contents.resourceType = __expectString(data.resourceType);
1012
- }
1013
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1014
- return [2, __decorateServiceException(exception, parsedOutput.body)];
718
+ return __decorateServiceException(exception, parsedOutput.body);
719
+ };
720
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
721
+ const contents = map({});
722
+ const data = parsedOutput.body;
723
+ if (data.message != null) {
724
+ contents.message = __expectString(data.message);
725
+ }
726
+ const exception = new ServiceQuotaExceededException({
727
+ $metadata: deserializeMetadata(parsedOutput),
728
+ ...contents,
1015
729
  });
1016
- }); };
1017
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1018
- var contents, data, exception;
1019
- return __generator(this, function (_a) {
1020
- contents = map({});
1021
- data = parsedOutput.body;
1022
- if (data.message != null) {
1023
- contents.message = __expectString(data.message);
1024
- }
1025
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1026
- return [2, __decorateServiceException(exception, parsedOutput.body)];
730
+ return __decorateServiceException(exception, parsedOutput.body);
731
+ };
732
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
733
+ const contents = map({
734
+ retryAfterSeconds: [
735
+ () => void 0 !== parsedOutput.headers["retry-after"],
736
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
737
+ ],
1027
738
  });
1028
- }); };
1029
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1030
- var contents, data, exception;
1031
- return __generator(this, function (_a) {
1032
- contents = map({
1033
- retryAfterSeconds: [
1034
- function () { return void 0 !== parsedOutput.headers["retry-after"]; },
1035
- function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
1036
- ],
1037
- });
1038
- data = parsedOutput.body;
1039
- if (data.message != null) {
1040
- contents.message = __expectString(data.message);
1041
- }
1042
- if (data.quotaCode != null) {
1043
- contents.quotaCode = __expectString(data.quotaCode);
1044
- }
1045
- if (data.serviceCode != null) {
1046
- contents.serviceCode = __expectString(data.serviceCode);
1047
- }
1048
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1049
- return [2, __decorateServiceException(exception, parsedOutput.body)];
739
+ const data = parsedOutput.body;
740
+ if (data.message != null) {
741
+ contents.message = __expectString(data.message);
742
+ }
743
+ if (data.quotaCode != null) {
744
+ contents.quotaCode = __expectString(data.quotaCode);
745
+ }
746
+ if (data.serviceCode != null) {
747
+ contents.serviceCode = __expectString(data.serviceCode);
748
+ }
749
+ const exception = new ThrottlingException({
750
+ $metadata: deserializeMetadata(parsedOutput),
751
+ ...contents,
1050
752
  });
1051
- }); };
1052
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1053
- var contents, data, exception;
1054
- return __generator(this, function (_a) {
1055
- contents = map({});
1056
- data = parsedOutput.body;
1057
- if (data.message != null) {
1058
- contents.message = __expectString(data.message);
1059
- }
1060
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1061
- return [2, __decorateServiceException(exception, parsedOutput.body)];
753
+ return __decorateServiceException(exception, parsedOutput.body);
754
+ };
755
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
756
+ const contents = map({});
757
+ const data = parsedOutput.body;
758
+ if (data.message != null) {
759
+ contents.message = __expectString(data.message);
760
+ }
761
+ const exception = new ValidationException({
762
+ $metadata: deserializeMetadata(parsedOutput),
763
+ ...contents,
1062
764
  });
1063
- }); };
1064
- var serializeAws_restJson1AppMonitorConfiguration = function (input, context) {
1065
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AllowCookies != null && { AllowCookies: input.AllowCookies })), (input.EnableXRay != null && { EnableXRay: input.EnableXRay })), (input.ExcludedPages != null && { ExcludedPages: serializeAws_restJson1Pages(input.ExcludedPages, context) })), (input.FavoritePages != null && {
1066
- FavoritePages: serializeAws_restJson1FavoritePages(input.FavoritePages, context),
1067
- })), (input.GuestRoleArn != null && { GuestRoleArn: input.GuestRoleArn })), (input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId })), (input.IncludedPages != null && { IncludedPages: serializeAws_restJson1Pages(input.IncludedPages, context) })), (input.SessionSampleRate != null && { SessionSampleRate: __serializeFloat(input.SessionSampleRate) })), (input.Telemetries != null && { Telemetries: serializeAws_restJson1Telemetries(input.Telemetries, context) }));
765
+ return __decorateServiceException(exception, parsedOutput.body);
1068
766
  };
1069
- var serializeAws_restJson1AppMonitorDetails = function (input, context) {
1070
- return __assign(__assign(__assign({}, (input.id != null && { id: input.id })), (input.name != null && { name: input.name })), (input.version != null && { version: input.version }));
767
+ const serializeAws_restJson1AppMonitorConfiguration = (input, context) => {
768
+ return {
769
+ ...(input.AllowCookies != null && { AllowCookies: input.AllowCookies }),
770
+ ...(input.EnableXRay != null && { EnableXRay: input.EnableXRay }),
771
+ ...(input.ExcludedPages != null && { ExcludedPages: serializeAws_restJson1Pages(input.ExcludedPages, context) }),
772
+ ...(input.FavoritePages != null && {
773
+ FavoritePages: serializeAws_restJson1FavoritePages(input.FavoritePages, context),
774
+ }),
775
+ ...(input.GuestRoleArn != null && { GuestRoleArn: input.GuestRoleArn }),
776
+ ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }),
777
+ ...(input.IncludedPages != null && { IncludedPages: serializeAws_restJson1Pages(input.IncludedPages, context) }),
778
+ ...(input.SessionSampleRate != null && { SessionSampleRate: __serializeFloat(input.SessionSampleRate) }),
779
+ ...(input.Telemetries != null && { Telemetries: serializeAws_restJson1Telemetries(input.Telemetries, context) }),
780
+ };
1071
781
  };
1072
- var serializeAws_restJson1FavoritePages = function (input, context) {
782
+ const serializeAws_restJson1AppMonitorDetails = (input, context) => {
783
+ return {
784
+ ...(input.id != null && { id: input.id }),
785
+ ...(input.name != null && { name: input.name }),
786
+ ...(input.version != null && { version: input.version }),
787
+ };
788
+ };
789
+ const serializeAws_restJson1FavoritePages = (input, context) => {
1073
790
  return input
1074
- .filter(function (e) { return e != null; })
1075
- .map(function (entry) {
791
+ .filter((e) => e != null)
792
+ .map((entry) => {
1076
793
  return entry;
1077
794
  });
1078
795
  };
1079
- var serializeAws_restJson1Pages = function (input, context) {
796
+ const serializeAws_restJson1Pages = (input, context) => {
1080
797
  return input
1081
- .filter(function (e) { return e != null; })
1082
- .map(function (entry) {
798
+ .filter((e) => e != null)
799
+ .map((entry) => {
1083
800
  return entry;
1084
801
  });
1085
802
  };
1086
- var serializeAws_restJson1QueryFilter = function (input, context) {
1087
- return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.Values != null && { Values: serializeAws_restJson1QueryFilterValueList(input.Values, context) }));
803
+ const serializeAws_restJson1QueryFilter = (input, context) => {
804
+ return {
805
+ ...(input.Name != null && { Name: input.Name }),
806
+ ...(input.Values != null && { Values: serializeAws_restJson1QueryFilterValueList(input.Values, context) }),
807
+ };
1088
808
  };
1089
- var serializeAws_restJson1QueryFilters = function (input, context) {
809
+ const serializeAws_restJson1QueryFilters = (input, context) => {
1090
810
  return input
1091
- .filter(function (e) { return e != null; })
1092
- .map(function (entry) {
811
+ .filter((e) => e != null)
812
+ .map((entry) => {
1093
813
  return serializeAws_restJson1QueryFilter(entry, context);
1094
814
  });
1095
815
  };
1096
- var serializeAws_restJson1QueryFilterValueList = function (input, context) {
816
+ const serializeAws_restJson1QueryFilterValueList = (input, context) => {
1097
817
  return input
1098
- .filter(function (e) { return e != null; })
1099
- .map(function (entry) {
818
+ .filter((e) => e != null)
819
+ .map((entry) => {
1100
820
  return entry;
1101
821
  });
1102
822
  };
1103
- var serializeAws_restJson1RumEvent = function (input, context) {
1104
- return __assign(__assign(__assign(__assign(__assign({}, (input.details != null && { details: __LazyJsonString.fromObject(input.details) })), (input.id != null && { id: input.id })), (input.metadata != null && { metadata: __LazyJsonString.fromObject(input.metadata) })), (input.timestamp != null && { timestamp: Math.round(input.timestamp.getTime() / 1000) })), (input.type != null && { type: input.type }));
823
+ const serializeAws_restJson1RumEvent = (input, context) => {
824
+ return {
825
+ ...(input.details != null && { details: __LazyJsonString.fromObject(input.details) }),
826
+ ...(input.id != null && { id: input.id }),
827
+ ...(input.metadata != null && { metadata: __LazyJsonString.fromObject(input.metadata) }),
828
+ ...(input.timestamp != null && { timestamp: Math.round(input.timestamp.getTime() / 1000) }),
829
+ ...(input.type != null && { type: input.type }),
830
+ };
1105
831
  };
1106
- var serializeAws_restJson1RumEventList = function (input, context) {
832
+ const serializeAws_restJson1RumEventList = (input, context) => {
1107
833
  return input
1108
- .filter(function (e) { return e != null; })
1109
- .map(function (entry) {
834
+ .filter((e) => e != null)
835
+ .map((entry) => {
1110
836
  return serializeAws_restJson1RumEvent(entry, context);
1111
837
  });
1112
838
  };
1113
- var serializeAws_restJson1TagMap = function (input, context) {
1114
- return Object.entries(input).reduce(function (acc, _a) {
1115
- var _b;
1116
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
839
+ const serializeAws_restJson1TagMap = (input, context) => {
840
+ return Object.entries(input).reduce((acc, [key, value]) => {
1117
841
  if (value === null) {
1118
842
  return acc;
1119
843
  }
1120
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
844
+ return {
845
+ ...acc,
846
+ [key]: value,
847
+ };
1121
848
  }, {});
1122
849
  };
1123
- var serializeAws_restJson1Telemetries = function (input, context) {
850
+ const serializeAws_restJson1Telemetries = (input, context) => {
1124
851
  return input
1125
- .filter(function (e) { return e != null; })
1126
- .map(function (entry) {
852
+ .filter((e) => e != null)
853
+ .map((entry) => {
1127
854
  return entry;
1128
855
  });
1129
856
  };
1130
- var serializeAws_restJson1TimeRange = function (input, context) {
1131
- return __assign(__assign({}, (input.After != null && { After: input.After })), (input.Before != null && { Before: input.Before }));
857
+ const serializeAws_restJson1TimeRange = (input, context) => {
858
+ return {
859
+ ...(input.After != null && { After: input.After }),
860
+ ...(input.Before != null && { Before: input.Before }),
861
+ };
1132
862
  };
1133
- var serializeAws_restJson1UserDetails = function (input, context) {
1134
- return __assign(__assign({}, (input.sessionId != null && { sessionId: input.sessionId })), (input.userId != null && { userId: input.userId }));
863
+ const serializeAws_restJson1UserDetails = (input, context) => {
864
+ return {
865
+ ...(input.sessionId != null && { sessionId: input.sessionId }),
866
+ ...(input.userId != null && { userId: input.userId }),
867
+ };
1135
868
  };
1136
- var deserializeAws_restJson1AppMonitor = function (output, context) {
869
+ const deserializeAws_restJson1AppMonitor = (output, context) => {
1137
870
  return {
1138
871
  AppMonitorConfiguration: output.AppMonitorConfiguration != null
1139
872
  ? deserializeAws_restJson1AppMonitorConfiguration(output.AppMonitorConfiguration, context)
@@ -1148,7 +881,7 @@ var deserializeAws_restJson1AppMonitor = function (output, context) {
1148
881
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
1149
882
  };
1150
883
  };
1151
- var deserializeAws_restJson1AppMonitorConfiguration = function (output, context) {
884
+ const deserializeAws_restJson1AppMonitorConfiguration = (output, context) => {
1152
885
  return {
1153
886
  AllowCookies: __expectBoolean(output.AllowCookies),
1154
887
  EnableXRay: __expectBoolean(output.EnableXRay),
@@ -1161,7 +894,7 @@ var deserializeAws_restJson1AppMonitorConfiguration = function (output, context)
1161
894
  Telemetries: output.Telemetries != null ? deserializeAws_restJson1Telemetries(output.Telemetries, context) : undefined,
1162
895
  };
1163
896
  };
1164
- var deserializeAws_restJson1AppMonitorSummary = function (output, context) {
897
+ const deserializeAws_restJson1AppMonitorSummary = (output, context) => {
1165
898
  return {
1166
899
  Created: __expectString(output.Created),
1167
900
  Id: __expectString(output.Id),
@@ -1170,10 +903,10 @@ var deserializeAws_restJson1AppMonitorSummary = function (output, context) {
1170
903
  State: __expectString(output.State),
1171
904
  };
1172
905
  };
1173
- var deserializeAws_restJson1AppMonitorSummaryList = function (output, context) {
1174
- var retVal = (output || [])
1175
- .filter(function (e) { return e != null; })
1176
- .map(function (entry) {
906
+ const deserializeAws_restJson1AppMonitorSummaryList = (output, context) => {
907
+ const retVal = (output || [])
908
+ .filter((e) => e != null)
909
+ .map((entry) => {
1177
910
  if (entry === null) {
1178
911
  return null;
1179
912
  }
@@ -1181,21 +914,21 @@ var deserializeAws_restJson1AppMonitorSummaryList = function (output, context) {
1181
914
  });
1182
915
  return retVal;
1183
916
  };
1184
- var deserializeAws_restJson1CwLog = function (output, context) {
917
+ const deserializeAws_restJson1CwLog = (output, context) => {
1185
918
  return {
1186
919
  CwLogEnabled: __expectBoolean(output.CwLogEnabled),
1187
920
  CwLogGroup: __expectString(output.CwLogGroup),
1188
921
  };
1189
922
  };
1190
- var deserializeAws_restJson1DataStorage = function (output, context) {
923
+ const deserializeAws_restJson1DataStorage = (output, context) => {
1191
924
  return {
1192
925
  CwLog: output.CwLog != null ? deserializeAws_restJson1CwLog(output.CwLog, context) : undefined,
1193
926
  };
1194
927
  };
1195
- var deserializeAws_restJson1EventDataList = function (output, context) {
1196
- var retVal = (output || [])
1197
- .filter(function (e) { return e != null; })
1198
- .map(function (entry) {
928
+ const deserializeAws_restJson1EventDataList = (output, context) => {
929
+ const retVal = (output || [])
930
+ .filter((e) => e != null)
931
+ .map((entry) => {
1199
932
  if (entry === null) {
1200
933
  return null;
1201
934
  }
@@ -1203,10 +936,10 @@ var deserializeAws_restJson1EventDataList = function (output, context) {
1203
936
  });
1204
937
  return retVal;
1205
938
  };
1206
- var deserializeAws_restJson1FavoritePages = function (output, context) {
1207
- var retVal = (output || [])
1208
- .filter(function (e) { return e != null; })
1209
- .map(function (entry) {
939
+ const deserializeAws_restJson1FavoritePages = (output, context) => {
940
+ const retVal = (output || [])
941
+ .filter((e) => e != null)
942
+ .map((entry) => {
1210
943
  if (entry === null) {
1211
944
  return null;
1212
945
  }
@@ -1214,10 +947,10 @@ var deserializeAws_restJson1FavoritePages = function (output, context) {
1214
947
  });
1215
948
  return retVal;
1216
949
  };
1217
- var deserializeAws_restJson1Pages = function (output, context) {
1218
- var retVal = (output || [])
1219
- .filter(function (e) { return e != null; })
1220
- .map(function (entry) {
950
+ const deserializeAws_restJson1Pages = (output, context) => {
951
+ const retVal = (output || [])
952
+ .filter((e) => e != null)
953
+ .map((entry) => {
1221
954
  if (entry === null) {
1222
955
  return null;
1223
956
  }
@@ -1225,20 +958,21 @@ var deserializeAws_restJson1Pages = function (output, context) {
1225
958
  });
1226
959
  return retVal;
1227
960
  };
1228
- var deserializeAws_restJson1TagMap = function (output, context) {
1229
- return Object.entries(output).reduce(function (acc, _a) {
1230
- var _b;
1231
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
961
+ const deserializeAws_restJson1TagMap = (output, context) => {
962
+ return Object.entries(output).reduce((acc, [key, value]) => {
1232
963
  if (value === null) {
1233
964
  return acc;
1234
965
  }
1235
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
966
+ return {
967
+ ...acc,
968
+ [key]: __expectString(value),
969
+ };
1236
970
  }, {});
1237
971
  };
1238
- var deserializeAws_restJson1Telemetries = function (output, context) {
1239
- var retVal = (output || [])
1240
- .filter(function (e) { return e != null; })
1241
- .map(function (entry) {
972
+ const deserializeAws_restJson1Telemetries = (output, context) => {
973
+ const retVal = (output || [])
974
+ .filter((e) => e != null)
975
+ .map((entry) => {
1242
976
  if (entry === null) {
1243
977
  return null;
1244
978
  }
@@ -1246,57 +980,39 @@ var deserializeAws_restJson1Telemetries = function (output, context) {
1246
980
  });
1247
981
  return retVal;
1248
982
  };
1249
- var deserializeMetadata = function (output) {
1250
- var _a, _b;
1251
- return ({
1252
- httpStatusCode: output.statusCode,
1253
- 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"],
1254
- extendedRequestId: output.headers["x-amz-id-2"],
1255
- cfId: output.headers["x-amz-cf-id"],
1256
- });
1257
- };
1258
- var collectBody = function (streamBody, context) {
1259
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
983
+ const deserializeMetadata = (output) => ({
984
+ httpStatusCode: output.statusCode,
985
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
986
+ extendedRequestId: output.headers["x-amz-id-2"],
987
+ cfId: output.headers["x-amz-cf-id"],
988
+ });
989
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1260
990
  if (streamBody instanceof Uint8Array) {
1261
991
  return Promise.resolve(streamBody);
1262
992
  }
1263
993
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1264
994
  };
1265
- var collectBodyString = function (streamBody, context) {
1266
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1267
- };
1268
- var isSerializableHeaderValue = function (value) {
1269
- return value !== undefined &&
1270
- value !== null &&
1271
- value !== "" &&
1272
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1273
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1274
- };
1275
- var parseBody = function (streamBody, context) {
1276
- return collectBodyString(streamBody, context).then(function (encoded) {
1277
- if (encoded.length) {
1278
- return JSON.parse(encoded);
1279
- }
1280
- return {};
1281
- });
995
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
996
+ const isSerializableHeaderValue = (value) => value !== undefined &&
997
+ value !== null &&
998
+ value !== "" &&
999
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1000
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1001
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1002
+ if (encoded.length) {
1003
+ return JSON.parse(encoded);
1004
+ }
1005
+ return {};
1006
+ });
1007
+ const parseErrorBody = async (errorBody, context) => {
1008
+ const value = await parseBody(errorBody, context);
1009
+ value.message = value.message ?? value.Message;
1010
+ return value;
1282
1011
  };
1283
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1284
- var value;
1285
- var _a;
1286
- return __generator(this, function (_b) {
1287
- switch (_b.label) {
1288
- case 0: return [4, parseBody(errorBody, context)];
1289
- case 1:
1290
- value = _b.sent();
1291
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1292
- return [2, value];
1293
- }
1294
- });
1295
- }); };
1296
- var loadRestJsonErrorCode = function (output, data) {
1297
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1298
- var sanitizeErrorCode = function (rawValue) {
1299
- var cleanValue = rawValue;
1012
+ const loadRestJsonErrorCode = (output, data) => {
1013
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1014
+ const sanitizeErrorCode = (rawValue) => {
1015
+ let cleanValue = rawValue;
1300
1016
  if (typeof cleanValue === "number") {
1301
1017
  cleanValue = cleanValue.toString();
1302
1018
  }
@@ -1311,7 +1027,7 @@ var loadRestJsonErrorCode = function (output, data) {
1311
1027
  }
1312
1028
  return cleanValue;
1313
1029
  };
1314
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1030
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1315
1031
  if (headerKey !== undefined) {
1316
1032
  return sanitizeErrorCode(output.headers[headerKey]);
1317
1033
  }