@aws-sdk/client-rum 3.183.0 → 3.185.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,872 +1,1139 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
2
3
  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";
3
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
4
5
  import { RUMServiceException as __BaseException } from "../models/RUMServiceException";
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) }),
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
+ }
20
30
  });
21
- return new __HttpRequest({
22
- protocol,
23
- hostname,
24
- port,
25
- method: "POST",
26
- headers,
27
- path: resolvedPath,
28
- body,
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
+ }
29
52
  });
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,
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
+ }
45
74
  });
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,
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
+ }
61
99
  });
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) }),
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
+ }
76
125
  });
77
- return new __HttpRequest({
78
- protocol,
79
- hostname,
80
- port,
81
- method: "POST",
82
- headers,
83
- path: resolvedPath,
84
- body,
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
+ }
85
147
  });
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],
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
+ }
94
183
  });
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,
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
+ }
105
208
  });
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,
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
+ }
121
234
  });
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) }),
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
+ }
138
261
  });
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.");
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];
144
283
  }
145
- }
146
- return new __HttpRequest({
147
- protocol,
148
- hostname: resolvedHostname,
149
- port,
150
- method: "POST",
151
- headers,
152
- path: resolvedPath,
153
- body,
154
284
  });
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) }),
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];
336
+ }
166
337
  });
167
- return new __HttpRequest({
168
- protocol,
169
- hostname,
170
- port,
171
- method: "POST",
172
- headers,
173
- path: resolvedPath,
174
- body,
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
+ }
175
355
  });
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)],
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
+ }
184
408
  });
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,
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
+ }
195
431
  });
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 }),
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
+ }
211
480
  });
212
- return new __HttpRequest({
213
- protocol,
214
- hostname,
215
- port,
216
- method: "PATCH",
217
- headers,
218
- path: resolvedPath,
219
- body,
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
+ }
220
506
  });
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),
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
+ }
228
555
  });
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),
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
+ }
276
581
  });
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),
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
+ }
321
626
  });
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),
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
+ }
366
652
  });
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),
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
+ }
414
693
  });
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),
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
+ }
459
711
  });
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),
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
+ }
501
760
  });
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),
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
+ }
543
778
  });
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),
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
+ }
579
819
  });
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),
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
+ }
615
837
  });
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,
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
+ }
664
878
  });
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,
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
+ }
682
896
  });
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
- ],
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
+ }
691
949
  });
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,
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)];
699
962
  });
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,
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)];
717
980
  });
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,
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)];
729
997
  });
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
- ],
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)];
738
1015
  });
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,
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)];
752
1027
  });
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,
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)];
764
1050
  });
765
- return __decorateServiceException(exception, parsedOutput.body);
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)];
1062
+ });
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) }));
766
1068
  };
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
- };
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 }));
781
1071
  };
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) => {
1072
+ var serializeAws_restJson1FavoritePages = function (input, context) {
790
1073
  return input
791
- .filter((e) => e != null)
792
- .map((entry) => {
1074
+ .filter(function (e) { return e != null; })
1075
+ .map(function (entry) {
793
1076
  return entry;
794
1077
  });
795
1078
  };
796
- const serializeAws_restJson1Pages = (input, context) => {
1079
+ var serializeAws_restJson1Pages = function (input, context) {
797
1080
  return input
798
- .filter((e) => e != null)
799
- .map((entry) => {
1081
+ .filter(function (e) { return e != null; })
1082
+ .map(function (entry) {
800
1083
  return entry;
801
1084
  });
802
1085
  };
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
- };
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) }));
808
1088
  };
809
- const serializeAws_restJson1QueryFilters = (input, context) => {
1089
+ var serializeAws_restJson1QueryFilters = function (input, context) {
810
1090
  return input
811
- .filter((e) => e != null)
812
- .map((entry) => {
1091
+ .filter(function (e) { return e != null; })
1092
+ .map(function (entry) {
813
1093
  return serializeAws_restJson1QueryFilter(entry, context);
814
1094
  });
815
1095
  };
816
- const serializeAws_restJson1QueryFilterValueList = (input, context) => {
1096
+ var serializeAws_restJson1QueryFilterValueList = function (input, context) {
817
1097
  return input
818
- .filter((e) => e != null)
819
- .map((entry) => {
1098
+ .filter(function (e) { return e != null; })
1099
+ .map(function (entry) {
820
1100
  return entry;
821
1101
  });
822
1102
  };
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
- };
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 }));
831
1105
  };
832
- const serializeAws_restJson1RumEventList = (input, context) => {
1106
+ var serializeAws_restJson1RumEventList = function (input, context) {
833
1107
  return input
834
- .filter((e) => e != null)
835
- .map((entry) => {
1108
+ .filter(function (e) { return e != null; })
1109
+ .map(function (entry) {
836
1110
  return serializeAws_restJson1RumEvent(entry, context);
837
1111
  });
838
1112
  };
839
- const serializeAws_restJson1TagMap = (input, context) => {
840
- return Object.entries(input).reduce((acc, [key, value]) => {
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];
841
1117
  if (value === null) {
842
1118
  return acc;
843
1119
  }
844
- return {
845
- ...acc,
846
- [key]: value,
847
- };
1120
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
848
1121
  }, {});
849
1122
  };
850
- const serializeAws_restJson1Telemetries = (input, context) => {
1123
+ var serializeAws_restJson1Telemetries = function (input, context) {
851
1124
  return input
852
- .filter((e) => e != null)
853
- .map((entry) => {
1125
+ .filter(function (e) { return e != null; })
1126
+ .map(function (entry) {
854
1127
  return entry;
855
1128
  });
856
1129
  };
857
- const serializeAws_restJson1TimeRange = (input, context) => {
858
- return {
859
- ...(input.After != null && { After: input.After }),
860
- ...(input.Before != null && { Before: input.Before }),
861
- };
1130
+ var serializeAws_restJson1TimeRange = function (input, context) {
1131
+ return __assign(__assign({}, (input.After != null && { After: input.After })), (input.Before != null && { Before: input.Before }));
862
1132
  };
863
- const serializeAws_restJson1UserDetails = (input, context) => {
864
- return {
865
- ...(input.sessionId != null && { sessionId: input.sessionId }),
866
- ...(input.userId != null && { userId: input.userId }),
867
- };
1133
+ var serializeAws_restJson1UserDetails = function (input, context) {
1134
+ return __assign(__assign({}, (input.sessionId != null && { sessionId: input.sessionId })), (input.userId != null && { userId: input.userId }));
868
1135
  };
869
- const deserializeAws_restJson1AppMonitor = (output, context) => {
1136
+ var deserializeAws_restJson1AppMonitor = function (output, context) {
870
1137
  return {
871
1138
  AppMonitorConfiguration: output.AppMonitorConfiguration != null
872
1139
  ? deserializeAws_restJson1AppMonitorConfiguration(output.AppMonitorConfiguration, context)
@@ -881,7 +1148,7 @@ const deserializeAws_restJson1AppMonitor = (output, context) => {
881
1148
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
882
1149
  };
883
1150
  };
884
- const deserializeAws_restJson1AppMonitorConfiguration = (output, context) => {
1151
+ var deserializeAws_restJson1AppMonitorConfiguration = function (output, context) {
885
1152
  return {
886
1153
  AllowCookies: __expectBoolean(output.AllowCookies),
887
1154
  EnableXRay: __expectBoolean(output.EnableXRay),
@@ -894,7 +1161,7 @@ const deserializeAws_restJson1AppMonitorConfiguration = (output, context) => {
894
1161
  Telemetries: output.Telemetries != null ? deserializeAws_restJson1Telemetries(output.Telemetries, context) : undefined,
895
1162
  };
896
1163
  };
897
- const deserializeAws_restJson1AppMonitorSummary = (output, context) => {
1164
+ var deserializeAws_restJson1AppMonitorSummary = function (output, context) {
898
1165
  return {
899
1166
  Created: __expectString(output.Created),
900
1167
  Id: __expectString(output.Id),
@@ -903,10 +1170,10 @@ const deserializeAws_restJson1AppMonitorSummary = (output, context) => {
903
1170
  State: __expectString(output.State),
904
1171
  };
905
1172
  };
906
- const deserializeAws_restJson1AppMonitorSummaryList = (output, context) => {
907
- const retVal = (output || [])
908
- .filter((e) => e != null)
909
- .map((entry) => {
1173
+ var deserializeAws_restJson1AppMonitorSummaryList = function (output, context) {
1174
+ var retVal = (output || [])
1175
+ .filter(function (e) { return e != null; })
1176
+ .map(function (entry) {
910
1177
  if (entry === null) {
911
1178
  return null;
912
1179
  }
@@ -914,21 +1181,21 @@ const deserializeAws_restJson1AppMonitorSummaryList = (output, context) => {
914
1181
  });
915
1182
  return retVal;
916
1183
  };
917
- const deserializeAws_restJson1CwLog = (output, context) => {
1184
+ var deserializeAws_restJson1CwLog = function (output, context) {
918
1185
  return {
919
1186
  CwLogEnabled: __expectBoolean(output.CwLogEnabled),
920
1187
  CwLogGroup: __expectString(output.CwLogGroup),
921
1188
  };
922
1189
  };
923
- const deserializeAws_restJson1DataStorage = (output, context) => {
1190
+ var deserializeAws_restJson1DataStorage = function (output, context) {
924
1191
  return {
925
1192
  CwLog: output.CwLog != null ? deserializeAws_restJson1CwLog(output.CwLog, context) : undefined,
926
1193
  };
927
1194
  };
928
- const deserializeAws_restJson1EventDataList = (output, context) => {
929
- const retVal = (output || [])
930
- .filter((e) => e != null)
931
- .map((entry) => {
1195
+ var deserializeAws_restJson1EventDataList = function (output, context) {
1196
+ var retVal = (output || [])
1197
+ .filter(function (e) { return e != null; })
1198
+ .map(function (entry) {
932
1199
  if (entry === null) {
933
1200
  return null;
934
1201
  }
@@ -936,10 +1203,10 @@ const deserializeAws_restJson1EventDataList = (output, context) => {
936
1203
  });
937
1204
  return retVal;
938
1205
  };
939
- const deserializeAws_restJson1FavoritePages = (output, context) => {
940
- const retVal = (output || [])
941
- .filter((e) => e != null)
942
- .map((entry) => {
1206
+ var deserializeAws_restJson1FavoritePages = function (output, context) {
1207
+ var retVal = (output || [])
1208
+ .filter(function (e) { return e != null; })
1209
+ .map(function (entry) {
943
1210
  if (entry === null) {
944
1211
  return null;
945
1212
  }
@@ -947,10 +1214,10 @@ const deserializeAws_restJson1FavoritePages = (output, context) => {
947
1214
  });
948
1215
  return retVal;
949
1216
  };
950
- const deserializeAws_restJson1Pages = (output, context) => {
951
- const retVal = (output || [])
952
- .filter((e) => e != null)
953
- .map((entry) => {
1217
+ var deserializeAws_restJson1Pages = function (output, context) {
1218
+ var retVal = (output || [])
1219
+ .filter(function (e) { return e != null; })
1220
+ .map(function (entry) {
954
1221
  if (entry === null) {
955
1222
  return null;
956
1223
  }
@@ -958,21 +1225,20 @@ const deserializeAws_restJson1Pages = (output, context) => {
958
1225
  });
959
1226
  return retVal;
960
1227
  };
961
- const deserializeAws_restJson1TagMap = (output, context) => {
962
- return Object.entries(output).reduce((acc, [key, value]) => {
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];
963
1232
  if (value === null) {
964
1233
  return acc;
965
1234
  }
966
- return {
967
- ...acc,
968
- [key]: __expectString(value),
969
- };
1235
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
970
1236
  }, {});
971
1237
  };
972
- const deserializeAws_restJson1Telemetries = (output, context) => {
973
- const retVal = (output || [])
974
- .filter((e) => e != null)
975
- .map((entry) => {
1238
+ var deserializeAws_restJson1Telemetries = function (output, context) {
1239
+ var retVal = (output || [])
1240
+ .filter(function (e) { return e != null; })
1241
+ .map(function (entry) {
976
1242
  if (entry === null) {
977
1243
  return null;
978
1244
  }
@@ -980,39 +1246,57 @@ const deserializeAws_restJson1Telemetries = (output, context) => {
980
1246
  });
981
1247
  return retVal;
982
1248
  };
983
- const deserializeMetadata = (output) => ({
984
- httpStatusCode: output.statusCode,
985
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-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) => {
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(); }
990
1260
  if (streamBody instanceof Uint8Array) {
991
1261
  return Promise.resolve(streamBody);
992
1262
  }
993
1263
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
994
1264
  };
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;
1265
+ var collectBodyString = function (streamBody, context) {
1266
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1011
1267
  };
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;
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
+ });
1282
+ };
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;
1016
1300
  if (typeof cleanValue === "number") {
1017
1301
  cleanValue = cleanValue.toString();
1018
1302
  }
@@ -1027,7 +1311,7 @@ const loadRestJsonErrorCode = (output, data) => {
1027
1311
  }
1028
1312
  return cleanValue;
1029
1313
  };
1030
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1314
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1031
1315
  if (headerKey !== undefined) {
1032
1316
  return sanitizeErrorCode(output.headers[headerKey]);
1033
1317
  }