@aws-sdk/client-license-manager-user-subscriptions 3.185.0 → 3.188.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/LicenseManagerUserSubscriptions.js +42 -49
  3. package/dist-es/LicenseManagerUserSubscriptionsClient.js +22 -28
  4. package/dist-es/commands/AssociateUserCommand.js +21 -28
  5. package/dist-es/commands/DeregisterIdentityProviderCommand.js +21 -28
  6. package/dist-es/commands/DisassociateUserCommand.js +21 -28
  7. package/dist-es/commands/ListIdentityProvidersCommand.js +21 -28
  8. package/dist-es/commands/ListInstancesCommand.js +21 -28
  9. package/dist-es/commands/ListProductSubscriptionsCommand.js +21 -28
  10. package/dist-es/commands/ListUserAssociationsCommand.js +21 -28
  11. package/dist-es/commands/RegisterIdentityProviderCommand.js +21 -28
  12. package/dist-es/commands/StartProductSubscriptionCommand.js +21 -28
  13. package/dist-es/commands/StopProductSubscriptionCommand.js +21 -28
  14. package/dist-es/endpoints.js +8 -8
  15. package/dist-es/models/LicenseManagerUserSubscriptionsServiceException.js +5 -10
  16. package/dist-es/models/models_0.js +191 -123
  17. package/dist-es/pagination/ListIdentityProvidersPaginator.js +25 -68
  18. package/dist-es/pagination/ListInstancesPaginator.js +25 -68
  19. package/dist-es/pagination/ListProductSubscriptionsPaginator.js +25 -68
  20. package/dist-es/pagination/ListUserAssociationsPaginator.js +25 -68
  21. package/dist-es/protocols/Aws_restJson1.js +884 -1202
  22. package/dist-es/runtimeConfig.browser.js +26 -12
  23. package/dist-es/runtimeConfig.js +30 -12
  24. package/dist-es/runtimeConfig.native.js +8 -5
  25. package/dist-es/runtimeConfig.shared.js +8 -11
  26. package/package.json +33 -33
@@ -1,1190 +1,890 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { LicenseManagerUserSubscriptionsServiceException as __BaseException } from "../models/LicenseManagerUserSubscriptionsServiceException";
5
4
  import { AccessDeniedException, ConflictException, IdentityProvider, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_restJson1AssociateUserCommand = 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 || "") + "/user/AssociateUser";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Domain != null && { Domain: input.Domain })), (input.IdentityProvider != null && {
18
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
19
- })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.Username != null && { Username: input.Username })));
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
- }
5
+ export const serializeAws_restJson1AssociateUserCommand = 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 || ""}` + "/user/AssociateUser";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.Domain != null && { Domain: input.Domain }),
14
+ ...(input.IdentityProvider != null && {
15
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
16
+ }),
17
+ ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
18
+ ...(input.Username != null && { Username: input.Username }),
30
19
  });
31
- }); };
32
- export var serializeAws_restJson1DeregisterIdentityProviderCommand = 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
- "content-type": "application/json",
41
- };
42
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
43
- "/identity-provider/DeregisterIdentityProvider";
44
- body = JSON.stringify(__assign(__assign({}, (input.IdentityProvider != null && {
45
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
46
- })), (input.Product != null && { Product: input.Product })));
47
- return [2, new __HttpRequest({
48
- protocol: protocol,
49
- hostname: hostname,
50
- port: port,
51
- method: "POST",
52
- headers: headers,
53
- path: resolvedPath,
54
- body: body,
55
- })];
56
- }
20
+ return new __HttpRequest({
21
+ protocol,
22
+ hostname,
23
+ port,
24
+ method: "POST",
25
+ headers,
26
+ path: resolvedPath,
27
+ body,
57
28
  });
58
- }); };
59
- export var serializeAws_restJson1DisassociateUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
60
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
61
- return __generator(this, function (_c) {
62
- switch (_c.label) {
63
- case 0: return [4, context.endpoint()];
64
- case 1:
65
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
66
- headers = {
67
- "content-type": "application/json",
68
- };
69
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/user/DisassociateUser";
70
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Domain != null && { Domain: input.Domain })), (input.IdentityProvider != null && {
71
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
72
- })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.Username != null && { Username: input.Username })));
73
- return [2, new __HttpRequest({
74
- protocol: protocol,
75
- hostname: hostname,
76
- port: port,
77
- method: "POST",
78
- headers: headers,
79
- path: resolvedPath,
80
- body: body,
81
- })];
82
- }
29
+ };
30
+ export const serializeAws_restJson1DeregisterIdentityProviderCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {
33
+ "content-type": "application/json",
34
+ };
35
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
36
+ "/identity-provider/DeregisterIdentityProvider";
37
+ let body;
38
+ body = JSON.stringify({
39
+ ...(input.IdentityProvider != null && {
40
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
41
+ }),
42
+ ...(input.Product != null && { Product: input.Product }),
83
43
  });
84
- }); };
85
- export var serializeAws_restJson1ListIdentityProvidersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
86
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
87
- return __generator(this, function (_c) {
88
- switch (_c.label) {
89
- case 0: return [4, context.endpoint()];
90
- case 1:
91
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
92
- headers = {
93
- "content-type": "application/json",
94
- };
95
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/identity-provider/ListIdentityProviders";
96
- body = JSON.stringify(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
97
- return [2, new __HttpRequest({
98
- protocol: protocol,
99
- hostname: hostname,
100
- port: port,
101
- method: "POST",
102
- headers: headers,
103
- path: resolvedPath,
104
- body: body,
105
- })];
106
- }
44
+ return new __HttpRequest({
45
+ protocol,
46
+ hostname,
47
+ port,
48
+ method: "POST",
49
+ headers,
50
+ path: resolvedPath,
51
+ body,
107
52
  });
108
- }); };
109
- export var serializeAws_restJson1ListInstancesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
110
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
111
- return __generator(this, function (_c) {
112
- switch (_c.label) {
113
- case 0: return [4, context.endpoint()];
114
- case 1:
115
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
116
- headers = {
117
- "content-type": "application/json",
118
- };
119
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/instance/ListInstances";
120
- body = JSON.stringify(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
121
- return [2, new __HttpRequest({
122
- protocol: protocol,
123
- hostname: hostname,
124
- port: port,
125
- method: "POST",
126
- headers: headers,
127
- path: resolvedPath,
128
- body: body,
129
- })];
130
- }
53
+ };
54
+ export const serializeAws_restJson1DisassociateUserCommand = async (input, context) => {
55
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
+ const headers = {
57
+ "content-type": "application/json",
58
+ };
59
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/DisassociateUser";
60
+ let body;
61
+ body = JSON.stringify({
62
+ ...(input.Domain != null && { Domain: input.Domain }),
63
+ ...(input.IdentityProvider != null && {
64
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
65
+ }),
66
+ ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
67
+ ...(input.Username != null && { Username: input.Username }),
131
68
  });
132
- }); };
133
- export var serializeAws_restJson1ListProductSubscriptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
134
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
135
- return __generator(this, function (_c) {
136
- switch (_c.label) {
137
- case 0: return [4, context.endpoint()];
138
- case 1:
139
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
140
- headers = {
141
- "content-type": "application/json",
142
- };
143
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/user/ListProductSubscriptions";
144
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) })), (input.IdentityProvider != null && {
145
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
146
- })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.Product != null && { Product: input.Product })));
147
- return [2, new __HttpRequest({
148
- protocol: protocol,
149
- hostname: hostname,
150
- port: port,
151
- method: "POST",
152
- headers: headers,
153
- path: resolvedPath,
154
- body: body,
155
- })];
156
- }
69
+ return new __HttpRequest({
70
+ protocol,
71
+ hostname,
72
+ port,
73
+ method: "POST",
74
+ headers,
75
+ path: resolvedPath,
76
+ body,
157
77
  });
158
- }); };
159
- export var serializeAws_restJson1ListUserAssociationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
160
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
161
- return __generator(this, function (_c) {
162
- switch (_c.label) {
163
- case 0: return [4, context.endpoint()];
164
- case 1:
165
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
166
- headers = {
167
- "content-type": "application/json",
168
- };
169
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/user/ListUserAssociations";
170
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) })), (input.IdentityProvider != null && {
171
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
172
- })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
173
- return [2, new __HttpRequest({
174
- protocol: protocol,
175
- hostname: hostname,
176
- port: port,
177
- method: "POST",
178
- headers: headers,
179
- path: resolvedPath,
180
- body: body,
181
- })];
182
- }
78
+ };
79
+ export const serializeAws_restJson1ListIdentityProvidersCommand = async (input, context) => {
80
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
81
+ const headers = {
82
+ "content-type": "application/json",
83
+ };
84
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identity-provider/ListIdentityProviders";
85
+ let body;
86
+ body = JSON.stringify({
87
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
88
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
183
89
  });
184
- }); };
185
- export var serializeAws_restJson1RegisterIdentityProviderCommand = 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 || "") +
196
- "/identity-provider/RegisterIdentityProvider";
197
- body = JSON.stringify(__assign(__assign({}, (input.IdentityProvider != null && {
198
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
199
- })), (input.Product != null && { Product: input.Product })));
200
- return [2, new __HttpRequest({
201
- protocol: protocol,
202
- hostname: hostname,
203
- port: port,
204
- method: "POST",
205
- headers: headers,
206
- path: resolvedPath,
207
- body: body,
208
- })];
209
- }
90
+ return new __HttpRequest({
91
+ protocol,
92
+ hostname,
93
+ port,
94
+ method: "POST",
95
+ headers,
96
+ path: resolvedPath,
97
+ body,
210
98
  });
211
- }); };
212
- export var serializeAws_restJson1StartProductSubscriptionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
213
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
214
- return __generator(this, function (_c) {
215
- switch (_c.label) {
216
- case 0: return [4, context.endpoint()];
217
- case 1:
218
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
219
- headers = {
220
- "content-type": "application/json",
221
- };
222
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/user/StartProductSubscription";
223
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Domain != null && { Domain: input.Domain })), (input.IdentityProvider != null && {
224
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
225
- })), (input.Product != null && { Product: input.Product })), (input.Username != null && { Username: input.Username })));
226
- return [2, new __HttpRequest({
227
- protocol: protocol,
228
- hostname: hostname,
229
- port: port,
230
- method: "POST",
231
- headers: headers,
232
- path: resolvedPath,
233
- body: body,
234
- })];
235
- }
99
+ };
100
+ export const serializeAws_restJson1ListInstancesCommand = async (input, context) => {
101
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
102
+ const headers = {
103
+ "content-type": "application/json",
104
+ };
105
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/instance/ListInstances";
106
+ let body;
107
+ body = JSON.stringify({
108
+ ...(input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }),
109
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
110
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
236
111
  });
237
- }); };
238
- export var serializeAws_restJson1StopProductSubscriptionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
239
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
240
- return __generator(this, function (_c) {
241
- switch (_c.label) {
242
- case 0: return [4, context.endpoint()];
243
- case 1:
244
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
245
- headers = {
246
- "content-type": "application/json",
247
- };
248
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/user/StopProductSubscription";
249
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Domain != null && { Domain: input.Domain })), (input.IdentityProvider != null && {
250
- IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
251
- })), (input.Product != null && { Product: input.Product })), (input.Username != null && { Username: input.Username })));
252
- return [2, new __HttpRequest({
253
- protocol: protocol,
254
- hostname: hostname,
255
- port: port,
256
- method: "POST",
257
- headers: headers,
258
- path: resolvedPath,
259
- body: body,
260
- })];
261
- }
112
+ return new __HttpRequest({
113
+ protocol,
114
+ hostname,
115
+ port,
116
+ method: "POST",
117
+ headers,
118
+ path: resolvedPath,
119
+ body,
262
120
  });
263
- }); };
264
- export var deserializeAws_restJson1AssociateUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
265
- var contents, data, _a, _b;
266
- return __generator(this, function (_c) {
267
- switch (_c.label) {
268
- case 0:
269
- if (output.statusCode !== 200 && output.statusCode >= 300) {
270
- return [2, deserializeAws_restJson1AssociateUserCommandError(output, context)];
271
- }
272
- contents = map({
273
- $metadata: deserializeMetadata(output),
274
- });
275
- _a = __expectNonNull;
276
- _b = __expectObject;
277
- return [4, parseBody(output.body, context)];
278
- case 1:
279
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
280
- if (data.InstanceUserSummary != null) {
281
- contents.InstanceUserSummary = deserializeAws_restJson1InstanceUserSummary(data.InstanceUserSummary, context);
282
- }
283
- return [2, contents];
284
- }
121
+ };
122
+ export const serializeAws_restJson1ListProductSubscriptionsCommand = async (input, context) => {
123
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
+ const headers = {
125
+ "content-type": "application/json",
126
+ };
127
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/ListProductSubscriptions";
128
+ let body;
129
+ body = JSON.stringify({
130
+ ...(input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }),
131
+ ...(input.IdentityProvider != null && {
132
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
133
+ }),
134
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
135
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
136
+ ...(input.Product != null && { Product: input.Product }),
285
137
  });
286
- }); };
287
- var deserializeAws_restJson1AssociateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
288
- var parsedOutput, _a, errorCode, _b, parsedBody;
289
- var _c;
290
- return __generator(this, function (_d) {
291
- switch (_d.label) {
292
- case 0:
293
- _a = [__assign({}, output)];
294
- _c = {};
295
- return [4, parseErrorBody(output.body, context)];
296
- case 1:
297
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
298
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
299
- _b = errorCode;
300
- switch (_b) {
301
- case "AccessDeniedException": return [3, 2];
302
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
303
- case "ConflictException": return [3, 4];
304
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
305
- case "InternalServerException": return [3, 6];
306
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
307
- case "ResourceNotFoundException": return [3, 8];
308
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
309
- case "ServiceQuotaExceededException": return [3, 10];
310
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
311
- case "ThrottlingException": return [3, 12];
312
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
313
- case "ValidationException": return [3, 14];
314
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
315
- }
316
- return [3, 16];
317
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
318
- case 3: throw _d.sent();
319
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
320
- case 5: throw _d.sent();
321
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
322
- case 7: throw _d.sent();
323
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
324
- case 9: throw _d.sent();
325
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
326
- case 11: throw _d.sent();
327
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
328
- case 13: throw _d.sent();
329
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
330
- case 15: throw _d.sent();
331
- case 16:
332
- parsedBody = parsedOutput.body;
333
- throwDefaultError({
334
- output: output,
335
- parsedBody: parsedBody,
336
- exceptionCtor: __BaseException,
337
- errorCode: errorCode,
338
- });
339
- _d.label = 17;
340
- case 17: return [2];
341
- }
138
+ return new __HttpRequest({
139
+ protocol,
140
+ hostname,
141
+ port,
142
+ method: "POST",
143
+ headers,
144
+ path: resolvedPath,
145
+ body,
342
146
  });
343
- }); };
344
- export var deserializeAws_restJson1DeregisterIdentityProviderCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
345
- var contents, data, _a, _b;
346
- return __generator(this, function (_c) {
347
- switch (_c.label) {
348
- case 0:
349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
350
- return [2, deserializeAws_restJson1DeregisterIdentityProviderCommandError(output, context)];
351
- }
352
- contents = map({
353
- $metadata: deserializeMetadata(output),
354
- });
355
- _a = __expectNonNull;
356
- _b = __expectObject;
357
- return [4, parseBody(output.body, context)];
358
- case 1:
359
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
360
- if (data.IdentityProviderSummary != null) {
361
- contents.IdentityProviderSummary = deserializeAws_restJson1IdentityProviderSummary(data.IdentityProviderSummary, context);
362
- }
363
- return [2, contents];
364
- }
147
+ };
148
+ export const serializeAws_restJson1ListUserAssociationsCommand = async (input, context) => {
149
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
+ const headers = {
151
+ "content-type": "application/json",
152
+ };
153
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/ListUserAssociations";
154
+ let body;
155
+ body = JSON.stringify({
156
+ ...(input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }),
157
+ ...(input.IdentityProvider != null && {
158
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
159
+ }),
160
+ ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
161
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
162
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
365
163
  });
366
- }); };
367
- var deserializeAws_restJson1DeregisterIdentityProviderCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
368
- var parsedOutput, _a, errorCode, _b, parsedBody;
369
- var _c;
370
- return __generator(this, function (_d) {
371
- switch (_d.label) {
372
- case 0:
373
- _a = [__assign({}, output)];
374
- _c = {};
375
- return [4, parseErrorBody(output.body, context)];
376
- case 1:
377
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
378
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
379
- _b = errorCode;
380
- switch (_b) {
381
- case "AccessDeniedException": return [3, 2];
382
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
383
- case "ConflictException": return [3, 4];
384
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
385
- case "InternalServerException": return [3, 6];
386
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
387
- case "ResourceNotFoundException": return [3, 8];
388
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
389
- case "ServiceQuotaExceededException": return [3, 10];
390
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
391
- case "ThrottlingException": return [3, 12];
392
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
393
- case "ValidationException": return [3, 14];
394
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
395
- }
396
- return [3, 16];
397
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
398
- case 3: throw _d.sent();
399
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
400
- case 5: throw _d.sent();
401
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
402
- case 7: throw _d.sent();
403
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
404
- case 9: throw _d.sent();
405
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
406
- case 11: throw _d.sent();
407
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
408
- case 13: throw _d.sent();
409
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
410
- case 15: throw _d.sent();
411
- case 16:
412
- parsedBody = parsedOutput.body;
413
- throwDefaultError({
414
- output: output,
415
- parsedBody: parsedBody,
416
- exceptionCtor: __BaseException,
417
- errorCode: errorCode,
418
- });
419
- _d.label = 17;
420
- case 17: return [2];
421
- }
164
+ return new __HttpRequest({
165
+ protocol,
166
+ hostname,
167
+ port,
168
+ method: "POST",
169
+ headers,
170
+ path: resolvedPath,
171
+ body,
422
172
  });
423
- }); };
424
- export var deserializeAws_restJson1DisassociateUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
425
- var contents, data, _a, _b;
426
- return __generator(this, function (_c) {
427
- switch (_c.label) {
428
- case 0:
429
- if (output.statusCode !== 200 && output.statusCode >= 300) {
430
- return [2, deserializeAws_restJson1DisassociateUserCommandError(output, context)];
431
- }
432
- contents = map({
433
- $metadata: deserializeMetadata(output),
434
- });
435
- _a = __expectNonNull;
436
- _b = __expectObject;
437
- return [4, parseBody(output.body, context)];
438
- case 1:
439
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
440
- if (data.InstanceUserSummary != null) {
441
- contents.InstanceUserSummary = deserializeAws_restJson1InstanceUserSummary(data.InstanceUserSummary, context);
442
- }
443
- return [2, contents];
444
- }
173
+ };
174
+ export const serializeAws_restJson1RegisterIdentityProviderCommand = async (input, context) => {
175
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
176
+ const headers = {
177
+ "content-type": "application/json",
178
+ };
179
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
180
+ "/identity-provider/RegisterIdentityProvider";
181
+ let body;
182
+ body = JSON.stringify({
183
+ ...(input.IdentityProvider != null && {
184
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
185
+ }),
186
+ ...(input.Product != null && { Product: input.Product }),
445
187
  });
446
- }); };
447
- var deserializeAws_restJson1DisassociateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
448
- var parsedOutput, _a, errorCode, _b, parsedBody;
449
- var _c;
450
- return __generator(this, function (_d) {
451
- switch (_d.label) {
452
- case 0:
453
- _a = [__assign({}, output)];
454
- _c = {};
455
- return [4, parseErrorBody(output.body, context)];
456
- case 1:
457
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
458
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
- _b = errorCode;
460
- switch (_b) {
461
- case "AccessDeniedException": return [3, 2];
462
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
463
- case "ConflictException": return [3, 4];
464
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
465
- case "InternalServerException": return [3, 6];
466
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
467
- case "ResourceNotFoundException": return [3, 8];
468
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
469
- case "ServiceQuotaExceededException": return [3, 10];
470
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
471
- case "ThrottlingException": return [3, 12];
472
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
473
- case "ValidationException": return [3, 14];
474
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
475
- }
476
- return [3, 16];
477
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
478
- case 3: throw _d.sent();
479
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
480
- case 5: throw _d.sent();
481
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
482
- case 7: throw _d.sent();
483
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
484
- case 9: throw _d.sent();
485
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
486
- case 11: throw _d.sent();
487
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
488
- case 13: throw _d.sent();
489
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
490
- case 15: throw _d.sent();
491
- case 16:
492
- parsedBody = parsedOutput.body;
493
- throwDefaultError({
494
- output: output,
495
- parsedBody: parsedBody,
496
- exceptionCtor: __BaseException,
497
- errorCode: errorCode,
498
- });
499
- _d.label = 17;
500
- case 17: return [2];
501
- }
188
+ return new __HttpRequest({
189
+ protocol,
190
+ hostname,
191
+ port,
192
+ method: "POST",
193
+ headers,
194
+ path: resolvedPath,
195
+ body,
502
196
  });
503
- }); };
504
- export var deserializeAws_restJson1ListIdentityProvidersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
505
- var contents, data, _a, _b;
506
- return __generator(this, function (_c) {
507
- switch (_c.label) {
508
- case 0:
509
- if (output.statusCode !== 200 && output.statusCode >= 300) {
510
- return [2, deserializeAws_restJson1ListIdentityProvidersCommandError(output, context)];
511
- }
512
- contents = map({
513
- $metadata: deserializeMetadata(output),
514
- });
515
- _a = __expectNonNull;
516
- _b = __expectObject;
517
- return [4, parseBody(output.body, context)];
518
- case 1:
519
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
520
- if (data.IdentityProviderSummaries != null) {
521
- contents.IdentityProviderSummaries = deserializeAws_restJson1IdentityProviderSummaryList(data.IdentityProviderSummaries, context);
522
- }
523
- if (data.NextToken != null) {
524
- contents.NextToken = __expectString(data.NextToken);
525
- }
526
- return [2, contents];
527
- }
197
+ };
198
+ export const serializeAws_restJson1StartProductSubscriptionCommand = async (input, context) => {
199
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
200
+ const headers = {
201
+ "content-type": "application/json",
202
+ };
203
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/StartProductSubscription";
204
+ let body;
205
+ body = JSON.stringify({
206
+ ...(input.Domain != null && { Domain: input.Domain }),
207
+ ...(input.IdentityProvider != null && {
208
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
209
+ }),
210
+ ...(input.Product != null && { Product: input.Product }),
211
+ ...(input.Username != null && { Username: input.Username }),
528
212
  });
529
- }); };
530
- var deserializeAws_restJson1ListIdentityProvidersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
531
- var parsedOutput, _a, errorCode, _b, parsedBody;
532
- var _c;
533
- return __generator(this, function (_d) {
534
- switch (_d.label) {
535
- case 0:
536
- _a = [__assign({}, output)];
537
- _c = {};
538
- return [4, parseErrorBody(output.body, context)];
539
- case 1:
540
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
541
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
542
- _b = errorCode;
543
- switch (_b) {
544
- case "AccessDeniedException": return [3, 2];
545
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
546
- case "ConflictException": return [3, 4];
547
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
548
- case "InternalServerException": return [3, 6];
549
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
550
- case "ResourceNotFoundException": return [3, 8];
551
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
552
- case "ServiceQuotaExceededException": return [3, 10];
553
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
554
- case "ThrottlingException": return [3, 12];
555
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
556
- case "ValidationException": return [3, 14];
557
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
558
- }
559
- return [3, 16];
560
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
561
- case 3: throw _d.sent();
562
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
563
- case 5: throw _d.sent();
564
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
565
- case 7: throw _d.sent();
566
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
567
- case 9: throw _d.sent();
568
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
569
- case 11: throw _d.sent();
570
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
571
- case 13: throw _d.sent();
572
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
573
- case 15: throw _d.sent();
574
- case 16:
575
- parsedBody = parsedOutput.body;
576
- throwDefaultError({
577
- output: output,
578
- parsedBody: parsedBody,
579
- exceptionCtor: __BaseException,
580
- errorCode: errorCode,
581
- });
582
- _d.label = 17;
583
- case 17: return [2];
584
- }
213
+ return new __HttpRequest({
214
+ protocol,
215
+ hostname,
216
+ port,
217
+ method: "POST",
218
+ headers,
219
+ path: resolvedPath,
220
+ body,
585
221
  });
586
- }); };
587
- export var deserializeAws_restJson1ListInstancesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
588
- var contents, data, _a, _b;
589
- return __generator(this, function (_c) {
590
- switch (_c.label) {
591
- case 0:
592
- if (output.statusCode !== 200 && output.statusCode >= 300) {
593
- return [2, deserializeAws_restJson1ListInstancesCommandError(output, context)];
594
- }
595
- contents = map({
596
- $metadata: deserializeMetadata(output),
597
- });
598
- _a = __expectNonNull;
599
- _b = __expectObject;
600
- return [4, parseBody(output.body, context)];
601
- case 1:
602
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
603
- if (data.InstanceSummaries != null) {
604
- contents.InstanceSummaries = deserializeAws_restJson1InstanceSummaryList(data.InstanceSummaries, context);
605
- }
606
- if (data.NextToken != null) {
607
- contents.NextToken = __expectString(data.NextToken);
608
- }
609
- return [2, contents];
610
- }
222
+ };
223
+ export const serializeAws_restJson1StopProductSubscriptionCommand = async (input, context) => {
224
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
225
+ const headers = {
226
+ "content-type": "application/json",
227
+ };
228
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/StopProductSubscription";
229
+ let body;
230
+ body = JSON.stringify({
231
+ ...(input.Domain != null && { Domain: input.Domain }),
232
+ ...(input.IdentityProvider != null && {
233
+ IdentityProvider: serializeAws_restJson1IdentityProvider(input.IdentityProvider, context),
234
+ }),
235
+ ...(input.Product != null && { Product: input.Product }),
236
+ ...(input.Username != null && { Username: input.Username }),
611
237
  });
612
- }); };
613
- var deserializeAws_restJson1ListInstancesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
614
- var parsedOutput, _a, errorCode, _b, parsedBody;
615
- var _c;
616
- return __generator(this, function (_d) {
617
- switch (_d.label) {
618
- case 0:
619
- _a = [__assign({}, output)];
620
- _c = {};
621
- return [4, parseErrorBody(output.body, context)];
622
- case 1:
623
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
624
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
625
- _b = errorCode;
626
- switch (_b) {
627
- case "AccessDeniedException": return [3, 2];
628
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
629
- case "ConflictException": return [3, 4];
630
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
631
- case "InternalServerException": return [3, 6];
632
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
633
- case "ResourceNotFoundException": return [3, 8];
634
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
635
- case "ServiceQuotaExceededException": return [3, 10];
636
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
637
- case "ThrottlingException": return [3, 12];
638
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
639
- case "ValidationException": return [3, 14];
640
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
641
- }
642
- return [3, 16];
643
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
644
- case 3: throw _d.sent();
645
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
646
- case 5: throw _d.sent();
647
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
648
- case 7: throw _d.sent();
649
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
650
- case 9: throw _d.sent();
651
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
652
- case 11: throw _d.sent();
653
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
654
- case 13: throw _d.sent();
655
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
656
- case 15: throw _d.sent();
657
- case 16:
658
- parsedBody = parsedOutput.body;
659
- throwDefaultError({
660
- output: output,
661
- parsedBody: parsedBody,
662
- exceptionCtor: __BaseException,
663
- errorCode: errorCode,
664
- });
665
- _d.label = 17;
666
- case 17: return [2];
667
- }
238
+ return new __HttpRequest({
239
+ protocol,
240
+ hostname,
241
+ port,
242
+ method: "POST",
243
+ headers,
244
+ path: resolvedPath,
245
+ body,
668
246
  });
669
- }); };
670
- export var deserializeAws_restJson1ListProductSubscriptionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
671
- var contents, data, _a, _b;
672
- return __generator(this, function (_c) {
673
- switch (_c.label) {
674
- case 0:
675
- if (output.statusCode !== 200 && output.statusCode >= 300) {
676
- return [2, deserializeAws_restJson1ListProductSubscriptionsCommandError(output, context)];
677
- }
678
- contents = map({
679
- $metadata: deserializeMetadata(output),
680
- });
681
- _a = __expectNonNull;
682
- _b = __expectObject;
683
- return [4, parseBody(output.body, context)];
684
- case 1:
685
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
686
- if (data.NextToken != null) {
687
- contents.NextToken = __expectString(data.NextToken);
688
- }
689
- if (data.ProductUserSummaries != null) {
690
- contents.ProductUserSummaries = deserializeAws_restJson1ProductUserSummaryList(data.ProductUserSummaries, context);
691
- }
692
- return [2, contents];
693
- }
247
+ };
248
+ export const deserializeAws_restJson1AssociateUserCommand = async (output, context) => {
249
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
250
+ return deserializeAws_restJson1AssociateUserCommandError(output, context);
251
+ }
252
+ const contents = map({
253
+ $metadata: deserializeMetadata(output),
694
254
  });
695
- }); };
696
- var deserializeAws_restJson1ListProductSubscriptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
697
- var parsedOutput, _a, errorCode, _b, parsedBody;
698
- var _c;
699
- return __generator(this, function (_d) {
700
- switch (_d.label) {
701
- case 0:
702
- _a = [__assign({}, output)];
703
- _c = {};
704
- return [4, parseErrorBody(output.body, context)];
705
- case 1:
706
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
707
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
708
- _b = errorCode;
709
- switch (_b) {
710
- case "AccessDeniedException": return [3, 2];
711
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
712
- case "ConflictException": return [3, 4];
713
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
714
- case "InternalServerException": return [3, 6];
715
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
716
- case "ResourceNotFoundException": return [3, 8];
717
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
718
- case "ServiceQuotaExceededException": return [3, 10];
719
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
720
- case "ThrottlingException": return [3, 12];
721
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
722
- case "ValidationException": return [3, 14];
723
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
724
- }
725
- return [3, 16];
726
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
727
- case 3: throw _d.sent();
728
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
729
- case 5: throw _d.sent();
730
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
731
- case 7: throw _d.sent();
732
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
733
- case 9: throw _d.sent();
734
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
735
- case 11: throw _d.sent();
736
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
737
- case 13: throw _d.sent();
738
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
739
- case 15: throw _d.sent();
740
- case 16:
741
- parsedBody = parsedOutput.body;
742
- throwDefaultError({
743
- output: output,
744
- parsedBody: parsedBody,
745
- exceptionCtor: __BaseException,
746
- errorCode: errorCode,
747
- });
748
- _d.label = 17;
749
- case 17: return [2];
750
- }
255
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
256
+ if (data.InstanceUserSummary != null) {
257
+ contents.InstanceUserSummary = deserializeAws_restJson1InstanceUserSummary(data.InstanceUserSummary, context);
258
+ }
259
+ return contents;
260
+ };
261
+ const deserializeAws_restJson1AssociateUserCommandError = async (output, context) => {
262
+ const parsedOutput = {
263
+ ...output,
264
+ body: await parseErrorBody(output.body, context),
265
+ };
266
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
267
+ switch (errorCode) {
268
+ case "AccessDeniedException":
269
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
270
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
271
+ case "ConflictException":
272
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
273
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
274
+ case "InternalServerException":
275
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
276
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
277
+ case "ResourceNotFoundException":
278
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
279
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
280
+ case "ServiceQuotaExceededException":
281
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
282
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
283
+ case "ThrottlingException":
284
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
285
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
286
+ case "ValidationException":
287
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
288
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
289
+ default:
290
+ const parsedBody = parsedOutput.body;
291
+ throwDefaultError({
292
+ output,
293
+ parsedBody,
294
+ exceptionCtor: __BaseException,
295
+ errorCode,
296
+ });
297
+ }
298
+ };
299
+ export const deserializeAws_restJson1DeregisterIdentityProviderCommand = async (output, context) => {
300
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
301
+ return deserializeAws_restJson1DeregisterIdentityProviderCommandError(output, context);
302
+ }
303
+ const contents = map({
304
+ $metadata: deserializeMetadata(output),
751
305
  });
752
- }); };
753
- export var deserializeAws_restJson1ListUserAssociationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
754
- var contents, data, _a, _b;
755
- return __generator(this, function (_c) {
756
- switch (_c.label) {
757
- case 0:
758
- if (output.statusCode !== 200 && output.statusCode >= 300) {
759
- return [2, deserializeAws_restJson1ListUserAssociationsCommandError(output, context)];
760
- }
761
- contents = map({
762
- $metadata: deserializeMetadata(output),
763
- });
764
- _a = __expectNonNull;
765
- _b = __expectObject;
766
- return [4, parseBody(output.body, context)];
767
- case 1:
768
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
769
- if (data.InstanceUserSummaries != null) {
770
- contents.InstanceUserSummaries = deserializeAws_restJson1InstanceUserSummaryList(data.InstanceUserSummaries, context);
771
- }
772
- if (data.NextToken != null) {
773
- contents.NextToken = __expectString(data.NextToken);
774
- }
775
- return [2, contents];
776
- }
306
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
307
+ if (data.IdentityProviderSummary != null) {
308
+ contents.IdentityProviderSummary = deserializeAws_restJson1IdentityProviderSummary(data.IdentityProviderSummary, context);
309
+ }
310
+ return contents;
311
+ };
312
+ const deserializeAws_restJson1DeregisterIdentityProviderCommandError = async (output, context) => {
313
+ const parsedOutput = {
314
+ ...output,
315
+ body: await parseErrorBody(output.body, context),
316
+ };
317
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
318
+ switch (errorCode) {
319
+ case "AccessDeniedException":
320
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
321
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
322
+ case "ConflictException":
323
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
324
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
325
+ case "InternalServerException":
326
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
327
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
328
+ case "ResourceNotFoundException":
329
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
330
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
331
+ case "ServiceQuotaExceededException":
332
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
333
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
334
+ case "ThrottlingException":
335
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
336
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
337
+ case "ValidationException":
338
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
339
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
340
+ default:
341
+ const parsedBody = parsedOutput.body;
342
+ throwDefaultError({
343
+ output,
344
+ parsedBody,
345
+ exceptionCtor: __BaseException,
346
+ errorCode,
347
+ });
348
+ }
349
+ };
350
+ export const deserializeAws_restJson1DisassociateUserCommand = async (output, context) => {
351
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
352
+ return deserializeAws_restJson1DisassociateUserCommandError(output, context);
353
+ }
354
+ const contents = map({
355
+ $metadata: deserializeMetadata(output),
777
356
  });
778
- }); };
779
- var deserializeAws_restJson1ListUserAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
780
- var parsedOutput, _a, errorCode, _b, parsedBody;
781
- var _c;
782
- return __generator(this, function (_d) {
783
- switch (_d.label) {
784
- case 0:
785
- _a = [__assign({}, output)];
786
- _c = {};
787
- return [4, parseErrorBody(output.body, context)];
788
- case 1:
789
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
790
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
791
- _b = errorCode;
792
- switch (_b) {
793
- case "AccessDeniedException": return [3, 2];
794
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
795
- case "ConflictException": return [3, 4];
796
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
797
- case "InternalServerException": return [3, 6];
798
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
799
- case "ResourceNotFoundException": return [3, 8];
800
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
801
- case "ServiceQuotaExceededException": return [3, 10];
802
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
803
- case "ThrottlingException": return [3, 12];
804
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
805
- case "ValidationException": return [3, 14];
806
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
807
- }
808
- return [3, 16];
809
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
810
- case 3: throw _d.sent();
811
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
812
- case 5: throw _d.sent();
813
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
814
- case 7: throw _d.sent();
815
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
816
- case 9: throw _d.sent();
817
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
818
- case 11: throw _d.sent();
819
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
820
- case 13: throw _d.sent();
821
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
822
- case 15: throw _d.sent();
823
- case 16:
824
- parsedBody = parsedOutput.body;
825
- throwDefaultError({
826
- output: output,
827
- parsedBody: parsedBody,
828
- exceptionCtor: __BaseException,
829
- errorCode: errorCode,
830
- });
831
- _d.label = 17;
832
- case 17: return [2];
833
- }
357
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
358
+ if (data.InstanceUserSummary != null) {
359
+ contents.InstanceUserSummary = deserializeAws_restJson1InstanceUserSummary(data.InstanceUserSummary, context);
360
+ }
361
+ return contents;
362
+ };
363
+ const deserializeAws_restJson1DisassociateUserCommandError = async (output, context) => {
364
+ const parsedOutput = {
365
+ ...output,
366
+ body: await parseErrorBody(output.body, context),
367
+ };
368
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
369
+ switch (errorCode) {
370
+ case "AccessDeniedException":
371
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
372
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
373
+ case "ConflictException":
374
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
375
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
376
+ case "InternalServerException":
377
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
378
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
379
+ case "ResourceNotFoundException":
380
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
381
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
382
+ case "ServiceQuotaExceededException":
383
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
384
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
385
+ case "ThrottlingException":
386
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
387
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
388
+ case "ValidationException":
389
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
390
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
391
+ default:
392
+ const parsedBody = parsedOutput.body;
393
+ throwDefaultError({
394
+ output,
395
+ parsedBody,
396
+ exceptionCtor: __BaseException,
397
+ errorCode,
398
+ });
399
+ }
400
+ };
401
+ export const deserializeAws_restJson1ListIdentityProvidersCommand = async (output, context) => {
402
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
403
+ return deserializeAws_restJson1ListIdentityProvidersCommandError(output, context);
404
+ }
405
+ const contents = map({
406
+ $metadata: deserializeMetadata(output),
834
407
  });
835
- }); };
836
- export var deserializeAws_restJson1RegisterIdentityProviderCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
837
- var contents, data, _a, _b;
838
- return __generator(this, function (_c) {
839
- switch (_c.label) {
840
- case 0:
841
- if (output.statusCode !== 200 && output.statusCode >= 300) {
842
- return [2, deserializeAws_restJson1RegisterIdentityProviderCommandError(output, context)];
843
- }
844
- contents = map({
845
- $metadata: deserializeMetadata(output),
846
- });
847
- _a = __expectNonNull;
848
- _b = __expectObject;
849
- return [4, parseBody(output.body, context)];
850
- case 1:
851
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
852
- if (data.IdentityProviderSummary != null) {
853
- contents.IdentityProviderSummary = deserializeAws_restJson1IdentityProviderSummary(data.IdentityProviderSummary, context);
854
- }
855
- return [2, contents];
856
- }
408
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
409
+ if (data.IdentityProviderSummaries != null) {
410
+ contents.IdentityProviderSummaries = deserializeAws_restJson1IdentityProviderSummaryList(data.IdentityProviderSummaries, context);
411
+ }
412
+ if (data.NextToken != null) {
413
+ contents.NextToken = __expectString(data.NextToken);
414
+ }
415
+ return contents;
416
+ };
417
+ const deserializeAws_restJson1ListIdentityProvidersCommandError = async (output, context) => {
418
+ const parsedOutput = {
419
+ ...output,
420
+ body: await parseErrorBody(output.body, context),
421
+ };
422
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
423
+ switch (errorCode) {
424
+ case "AccessDeniedException":
425
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
426
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
427
+ case "ConflictException":
428
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
429
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
430
+ case "InternalServerException":
431
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
432
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
433
+ case "ResourceNotFoundException":
434
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
435
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
436
+ case "ServiceQuotaExceededException":
437
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
438
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
439
+ case "ThrottlingException":
440
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
441
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
442
+ case "ValidationException":
443
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
444
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
445
+ default:
446
+ const parsedBody = parsedOutput.body;
447
+ throwDefaultError({
448
+ output,
449
+ parsedBody,
450
+ exceptionCtor: __BaseException,
451
+ errorCode,
452
+ });
453
+ }
454
+ };
455
+ export const deserializeAws_restJson1ListInstancesCommand = async (output, context) => {
456
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
457
+ return deserializeAws_restJson1ListInstancesCommandError(output, context);
458
+ }
459
+ const contents = map({
460
+ $metadata: deserializeMetadata(output),
857
461
  });
858
- }); };
859
- var deserializeAws_restJson1RegisterIdentityProviderCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
860
- var parsedOutput, _a, errorCode, _b, parsedBody;
861
- var _c;
862
- return __generator(this, function (_d) {
863
- switch (_d.label) {
864
- case 0:
865
- _a = [__assign({}, output)];
866
- _c = {};
867
- return [4, parseErrorBody(output.body, context)];
868
- case 1:
869
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
870
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
871
- _b = errorCode;
872
- switch (_b) {
873
- case "AccessDeniedException": return [3, 2];
874
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
875
- case "ConflictException": return [3, 4];
876
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
877
- case "InternalServerException": return [3, 6];
878
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
879
- case "ResourceNotFoundException": return [3, 8];
880
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
881
- case "ServiceQuotaExceededException": return [3, 10];
882
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
883
- case "ThrottlingException": return [3, 12];
884
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
885
- case "ValidationException": return [3, 14];
886
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
887
- }
888
- return [3, 16];
889
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
890
- case 3: throw _d.sent();
891
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
892
- case 5: throw _d.sent();
893
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
894
- case 7: throw _d.sent();
895
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
896
- case 9: throw _d.sent();
897
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
898
- case 11: throw _d.sent();
899
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
900
- case 13: throw _d.sent();
901
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
902
- case 15: throw _d.sent();
903
- case 16:
904
- parsedBody = parsedOutput.body;
905
- throwDefaultError({
906
- output: output,
907
- parsedBody: parsedBody,
908
- exceptionCtor: __BaseException,
909
- errorCode: errorCode,
910
- });
911
- _d.label = 17;
912
- case 17: return [2];
913
- }
462
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
463
+ if (data.InstanceSummaries != null) {
464
+ contents.InstanceSummaries = deserializeAws_restJson1InstanceSummaryList(data.InstanceSummaries, context);
465
+ }
466
+ if (data.NextToken != null) {
467
+ contents.NextToken = __expectString(data.NextToken);
468
+ }
469
+ return contents;
470
+ };
471
+ const deserializeAws_restJson1ListInstancesCommandError = async (output, context) => {
472
+ const parsedOutput = {
473
+ ...output,
474
+ body: await parseErrorBody(output.body, context),
475
+ };
476
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
477
+ switch (errorCode) {
478
+ case "AccessDeniedException":
479
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
480
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
481
+ case "ConflictException":
482
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
483
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
484
+ case "InternalServerException":
485
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
486
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
487
+ case "ResourceNotFoundException":
488
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
489
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
490
+ case "ServiceQuotaExceededException":
491
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
492
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
493
+ case "ThrottlingException":
494
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
495
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
496
+ case "ValidationException":
497
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
498
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
499
+ default:
500
+ const parsedBody = parsedOutput.body;
501
+ throwDefaultError({
502
+ output,
503
+ parsedBody,
504
+ exceptionCtor: __BaseException,
505
+ errorCode,
506
+ });
507
+ }
508
+ };
509
+ export const deserializeAws_restJson1ListProductSubscriptionsCommand = async (output, context) => {
510
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
511
+ return deserializeAws_restJson1ListProductSubscriptionsCommandError(output, context);
512
+ }
513
+ const contents = map({
514
+ $metadata: deserializeMetadata(output),
914
515
  });
915
- }); };
916
- export var deserializeAws_restJson1StartProductSubscriptionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
917
- var contents, data, _a, _b;
918
- return __generator(this, function (_c) {
919
- switch (_c.label) {
920
- case 0:
921
- if (output.statusCode !== 200 && output.statusCode >= 300) {
922
- return [2, deserializeAws_restJson1StartProductSubscriptionCommandError(output, context)];
923
- }
924
- contents = map({
925
- $metadata: deserializeMetadata(output),
926
- });
927
- _a = __expectNonNull;
928
- _b = __expectObject;
929
- return [4, parseBody(output.body, context)];
930
- case 1:
931
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
932
- if (data.ProductUserSummary != null) {
933
- contents.ProductUserSummary = deserializeAws_restJson1ProductUserSummary(data.ProductUserSummary, context);
934
- }
935
- return [2, contents];
936
- }
516
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
517
+ if (data.NextToken != null) {
518
+ contents.NextToken = __expectString(data.NextToken);
519
+ }
520
+ if (data.ProductUserSummaries != null) {
521
+ contents.ProductUserSummaries = deserializeAws_restJson1ProductUserSummaryList(data.ProductUserSummaries, context);
522
+ }
523
+ return contents;
524
+ };
525
+ const deserializeAws_restJson1ListProductSubscriptionsCommandError = async (output, context) => {
526
+ const parsedOutput = {
527
+ ...output,
528
+ body: await parseErrorBody(output.body, context),
529
+ };
530
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
531
+ switch (errorCode) {
532
+ case "AccessDeniedException":
533
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
534
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
535
+ case "ConflictException":
536
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
537
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
538
+ case "InternalServerException":
539
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
540
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
541
+ case "ResourceNotFoundException":
542
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
543
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
544
+ case "ServiceQuotaExceededException":
545
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
546
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
547
+ case "ThrottlingException":
548
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
549
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
550
+ case "ValidationException":
551
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
552
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
553
+ default:
554
+ const parsedBody = parsedOutput.body;
555
+ throwDefaultError({
556
+ output,
557
+ parsedBody,
558
+ exceptionCtor: __BaseException,
559
+ errorCode,
560
+ });
561
+ }
562
+ };
563
+ export const deserializeAws_restJson1ListUserAssociationsCommand = async (output, context) => {
564
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
565
+ return deserializeAws_restJson1ListUserAssociationsCommandError(output, context);
566
+ }
567
+ const contents = map({
568
+ $metadata: deserializeMetadata(output),
937
569
  });
938
- }); };
939
- var deserializeAws_restJson1StartProductSubscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
940
- var parsedOutput, _a, errorCode, _b, parsedBody;
941
- var _c;
942
- return __generator(this, function (_d) {
943
- switch (_d.label) {
944
- case 0:
945
- _a = [__assign({}, output)];
946
- _c = {};
947
- return [4, parseErrorBody(output.body, context)];
948
- case 1:
949
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
950
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
951
- _b = errorCode;
952
- switch (_b) {
953
- case "AccessDeniedException": return [3, 2];
954
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
955
- case "ConflictException": return [3, 4];
956
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
957
- case "InternalServerException": return [3, 6];
958
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
959
- case "ResourceNotFoundException": return [3, 8];
960
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
961
- case "ServiceQuotaExceededException": return [3, 10];
962
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
963
- case "ThrottlingException": return [3, 12];
964
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
965
- case "ValidationException": return [3, 14];
966
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
967
- }
968
- return [3, 16];
969
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
970
- case 3: throw _d.sent();
971
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
972
- case 5: throw _d.sent();
973
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
974
- case 7: throw _d.sent();
975
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
976
- case 9: throw _d.sent();
977
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
978
- case 11: throw _d.sent();
979
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
980
- case 13: throw _d.sent();
981
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
982
- case 15: throw _d.sent();
983
- case 16:
984
- parsedBody = parsedOutput.body;
985
- throwDefaultError({
986
- output: output,
987
- parsedBody: parsedBody,
988
- exceptionCtor: __BaseException,
989
- errorCode: errorCode,
990
- });
991
- _d.label = 17;
992
- case 17: return [2];
993
- }
570
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
571
+ if (data.InstanceUserSummaries != null) {
572
+ contents.InstanceUserSummaries = deserializeAws_restJson1InstanceUserSummaryList(data.InstanceUserSummaries, context);
573
+ }
574
+ if (data.NextToken != null) {
575
+ contents.NextToken = __expectString(data.NextToken);
576
+ }
577
+ return contents;
578
+ };
579
+ const deserializeAws_restJson1ListUserAssociationsCommandError = async (output, context) => {
580
+ const parsedOutput = {
581
+ ...output,
582
+ body: await parseErrorBody(output.body, context),
583
+ };
584
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
585
+ switch (errorCode) {
586
+ case "AccessDeniedException":
587
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
588
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
589
+ case "ConflictException":
590
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
591
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
592
+ case "InternalServerException":
593
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
594
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
595
+ case "ResourceNotFoundException":
596
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
597
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
598
+ case "ServiceQuotaExceededException":
599
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
600
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
601
+ case "ThrottlingException":
602
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
603
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
604
+ case "ValidationException":
605
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
606
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
607
+ default:
608
+ const parsedBody = parsedOutput.body;
609
+ throwDefaultError({
610
+ output,
611
+ parsedBody,
612
+ exceptionCtor: __BaseException,
613
+ errorCode,
614
+ });
615
+ }
616
+ };
617
+ export const deserializeAws_restJson1RegisterIdentityProviderCommand = async (output, context) => {
618
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
619
+ return deserializeAws_restJson1RegisterIdentityProviderCommandError(output, context);
620
+ }
621
+ const contents = map({
622
+ $metadata: deserializeMetadata(output),
994
623
  });
995
- }); };
996
- export var deserializeAws_restJson1StopProductSubscriptionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
997
- var contents, data, _a, _b;
998
- return __generator(this, function (_c) {
999
- switch (_c.label) {
1000
- case 0:
1001
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1002
- return [2, deserializeAws_restJson1StopProductSubscriptionCommandError(output, context)];
1003
- }
1004
- contents = map({
1005
- $metadata: deserializeMetadata(output),
1006
- });
1007
- _a = __expectNonNull;
1008
- _b = __expectObject;
1009
- return [4, parseBody(output.body, context)];
1010
- case 1:
1011
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1012
- if (data.ProductUserSummary != null) {
1013
- contents.ProductUserSummary = deserializeAws_restJson1ProductUserSummary(data.ProductUserSummary, context);
1014
- }
1015
- return [2, contents];
1016
- }
624
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
625
+ if (data.IdentityProviderSummary != null) {
626
+ contents.IdentityProviderSummary = deserializeAws_restJson1IdentityProviderSummary(data.IdentityProviderSummary, context);
627
+ }
628
+ return contents;
629
+ };
630
+ const deserializeAws_restJson1RegisterIdentityProviderCommandError = async (output, context) => {
631
+ const parsedOutput = {
632
+ ...output,
633
+ body: await parseErrorBody(output.body, context),
634
+ };
635
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
636
+ switch (errorCode) {
637
+ case "AccessDeniedException":
638
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
639
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
640
+ case "ConflictException":
641
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
642
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
643
+ case "InternalServerException":
644
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
645
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
646
+ case "ResourceNotFoundException":
647
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
648
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
649
+ case "ServiceQuotaExceededException":
650
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
651
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
652
+ case "ThrottlingException":
653
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
654
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
655
+ case "ValidationException":
656
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
657
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
658
+ default:
659
+ const parsedBody = parsedOutput.body;
660
+ throwDefaultError({
661
+ output,
662
+ parsedBody,
663
+ exceptionCtor: __BaseException,
664
+ errorCode,
665
+ });
666
+ }
667
+ };
668
+ export const deserializeAws_restJson1StartProductSubscriptionCommand = async (output, context) => {
669
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
670
+ return deserializeAws_restJson1StartProductSubscriptionCommandError(output, context);
671
+ }
672
+ const contents = map({
673
+ $metadata: deserializeMetadata(output),
1017
674
  });
1018
- }); };
1019
- var deserializeAws_restJson1StopProductSubscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1020
- var parsedOutput, _a, errorCode, _b, parsedBody;
1021
- var _c;
1022
- return __generator(this, function (_d) {
1023
- switch (_d.label) {
1024
- case 0:
1025
- _a = [__assign({}, output)];
1026
- _c = {};
1027
- return [4, parseErrorBody(output.body, context)];
1028
- case 1:
1029
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1030
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1031
- _b = errorCode;
1032
- switch (_b) {
1033
- case "AccessDeniedException": return [3, 2];
1034
- case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": return [3, 2];
1035
- case "ConflictException": return [3, 4];
1036
- case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": return [3, 4];
1037
- case "InternalServerException": return [3, 6];
1038
- case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": return [3, 6];
1039
- case "ResourceNotFoundException": return [3, 8];
1040
- case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": return [3, 8];
1041
- case "ServiceQuotaExceededException": return [3, 10];
1042
- case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": return [3, 10];
1043
- case "ThrottlingException": return [3, 12];
1044
- case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": return [3, 12];
1045
- case "ValidationException": return [3, 14];
1046
- case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": return [3, 14];
1047
- }
1048
- return [3, 16];
1049
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1050
- case 3: throw _d.sent();
1051
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1052
- case 5: throw _d.sent();
1053
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1054
- case 7: throw _d.sent();
1055
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1056
- case 9: throw _d.sent();
1057
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1058
- case 11: throw _d.sent();
1059
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1060
- case 13: throw _d.sent();
1061
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1062
- case 15: throw _d.sent();
1063
- case 16:
1064
- parsedBody = parsedOutput.body;
1065
- throwDefaultError({
1066
- output: output,
1067
- parsedBody: parsedBody,
1068
- exceptionCtor: __BaseException,
1069
- errorCode: errorCode,
1070
- });
1071
- _d.label = 17;
1072
- case 17: return [2];
1073
- }
675
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
676
+ if (data.ProductUserSummary != null) {
677
+ contents.ProductUserSummary = deserializeAws_restJson1ProductUserSummary(data.ProductUserSummary, context);
678
+ }
679
+ return contents;
680
+ };
681
+ const deserializeAws_restJson1StartProductSubscriptionCommandError = async (output, context) => {
682
+ const parsedOutput = {
683
+ ...output,
684
+ body: await parseErrorBody(output.body, context),
685
+ };
686
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
687
+ switch (errorCode) {
688
+ case "AccessDeniedException":
689
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
690
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
691
+ case "ConflictException":
692
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
693
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
694
+ case "InternalServerException":
695
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
696
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
697
+ case "ResourceNotFoundException":
698
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
699
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
700
+ case "ServiceQuotaExceededException":
701
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
702
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
703
+ case "ThrottlingException":
704
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
705
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
706
+ case "ValidationException":
707
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
708
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
709
+ default:
710
+ const parsedBody = parsedOutput.body;
711
+ throwDefaultError({
712
+ output,
713
+ parsedBody,
714
+ exceptionCtor: __BaseException,
715
+ errorCode,
716
+ });
717
+ }
718
+ };
719
+ export const deserializeAws_restJson1StopProductSubscriptionCommand = async (output, context) => {
720
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
721
+ return deserializeAws_restJson1StopProductSubscriptionCommandError(output, context);
722
+ }
723
+ const contents = map({
724
+ $metadata: deserializeMetadata(output),
1074
725
  });
1075
- }); };
1076
- var map = __map;
1077
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1078
- var contents, data, exception;
1079
- return __generator(this, function (_a) {
1080
- contents = map({});
1081
- data = parsedOutput.body;
1082
- if (data.message != null) {
1083
- contents.message = __expectString(data.message);
1084
- }
1085
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1086
- return [2, __decorateServiceException(exception, parsedOutput.body)];
726
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
727
+ if (data.ProductUserSummary != null) {
728
+ contents.ProductUserSummary = deserializeAws_restJson1ProductUserSummary(data.ProductUserSummary, context);
729
+ }
730
+ return contents;
731
+ };
732
+ const deserializeAws_restJson1StopProductSubscriptionCommandError = async (output, context) => {
733
+ const parsedOutput = {
734
+ ...output,
735
+ body: await parseErrorBody(output.body, context),
736
+ };
737
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
738
+ switch (errorCode) {
739
+ case "AccessDeniedException":
740
+ case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException":
741
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
742
+ case "ConflictException":
743
+ case "com.amazonaws.licensemanagerusersubscriptions#ConflictException":
744
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
745
+ case "InternalServerException":
746
+ case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException":
747
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
748
+ case "ResourceNotFoundException":
749
+ case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException":
750
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
751
+ case "ServiceQuotaExceededException":
752
+ case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException":
753
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
754
+ case "ThrottlingException":
755
+ case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException":
756
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
757
+ case "ValidationException":
758
+ case "com.amazonaws.licensemanagerusersubscriptions#ValidationException":
759
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
760
+ default:
761
+ const parsedBody = parsedOutput.body;
762
+ throwDefaultError({
763
+ output,
764
+ parsedBody,
765
+ exceptionCtor: __BaseException,
766
+ errorCode,
767
+ });
768
+ }
769
+ };
770
+ const map = __map;
771
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
772
+ const contents = map({});
773
+ const data = parsedOutput.body;
774
+ if (data.message != null) {
775
+ contents.message = __expectString(data.message);
776
+ }
777
+ const exception = new AccessDeniedException({
778
+ $metadata: deserializeMetadata(parsedOutput),
779
+ ...contents,
1087
780
  });
1088
- }); };
1089
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1090
- var contents, data, exception;
1091
- return __generator(this, function (_a) {
1092
- contents = map({});
1093
- data = parsedOutput.body;
1094
- if (data.message != null) {
1095
- contents.message = __expectString(data.message);
1096
- }
1097
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1098
- return [2, __decorateServiceException(exception, parsedOutput.body)];
781
+ return __decorateServiceException(exception, parsedOutput.body);
782
+ };
783
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
784
+ const contents = map({});
785
+ const data = parsedOutput.body;
786
+ if (data.message != null) {
787
+ contents.message = __expectString(data.message);
788
+ }
789
+ const exception = new ConflictException({
790
+ $metadata: deserializeMetadata(parsedOutput),
791
+ ...contents,
1099
792
  });
1100
- }); };
1101
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1102
- var contents, data, exception;
1103
- return __generator(this, function (_a) {
1104
- contents = map({});
1105
- data = parsedOutput.body;
1106
- if (data.message != null) {
1107
- contents.message = __expectString(data.message);
1108
- }
1109
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1110
- return [2, __decorateServiceException(exception, parsedOutput.body)];
793
+ return __decorateServiceException(exception, parsedOutput.body);
794
+ };
795
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
796
+ const contents = map({});
797
+ const data = parsedOutput.body;
798
+ if (data.message != null) {
799
+ contents.message = __expectString(data.message);
800
+ }
801
+ const exception = new InternalServerException({
802
+ $metadata: deserializeMetadata(parsedOutput),
803
+ ...contents,
1111
804
  });
1112
- }); };
1113
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1114
- var contents, data, exception;
1115
- return __generator(this, function (_a) {
1116
- contents = map({});
1117
- data = parsedOutput.body;
1118
- if (data.message != null) {
1119
- contents.message = __expectString(data.message);
1120
- }
1121
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1122
- return [2, __decorateServiceException(exception, parsedOutput.body)];
805
+ return __decorateServiceException(exception, parsedOutput.body);
806
+ };
807
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
808
+ const contents = map({});
809
+ const data = parsedOutput.body;
810
+ if (data.message != null) {
811
+ contents.message = __expectString(data.message);
812
+ }
813
+ const exception = new ResourceNotFoundException({
814
+ $metadata: deserializeMetadata(parsedOutput),
815
+ ...contents,
1123
816
  });
1124
- }); };
1125
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1126
- var contents, data, exception;
1127
- return __generator(this, function (_a) {
1128
- contents = map({});
1129
- data = parsedOutput.body;
1130
- if (data.message != null) {
1131
- contents.message = __expectString(data.message);
1132
- }
1133
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1134
- return [2, __decorateServiceException(exception, parsedOutput.body)];
817
+ return __decorateServiceException(exception, parsedOutput.body);
818
+ };
819
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
820
+ const contents = map({});
821
+ const data = parsedOutput.body;
822
+ if (data.message != null) {
823
+ contents.message = __expectString(data.message);
824
+ }
825
+ const exception = new ServiceQuotaExceededException({
826
+ $metadata: deserializeMetadata(parsedOutput),
827
+ ...contents,
1135
828
  });
1136
- }); };
1137
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1138
- var contents, data, exception;
1139
- return __generator(this, function (_a) {
1140
- contents = map({});
1141
- data = parsedOutput.body;
1142
- if (data.message != null) {
1143
- contents.message = __expectString(data.message);
1144
- }
1145
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1146
- return [2, __decorateServiceException(exception, parsedOutput.body)];
829
+ return __decorateServiceException(exception, parsedOutput.body);
830
+ };
831
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
832
+ const contents = map({});
833
+ const data = parsedOutput.body;
834
+ if (data.message != null) {
835
+ contents.message = __expectString(data.message);
836
+ }
837
+ const exception = new ThrottlingException({
838
+ $metadata: deserializeMetadata(parsedOutput),
839
+ ...contents,
1147
840
  });
1148
- }); };
1149
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1150
- var contents, data, exception;
1151
- return __generator(this, function (_a) {
1152
- contents = map({});
1153
- data = parsedOutput.body;
1154
- if (data.message != null) {
1155
- contents.message = __expectString(data.message);
1156
- }
1157
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1158
- return [2, __decorateServiceException(exception, parsedOutput.body)];
841
+ return __decorateServiceException(exception, parsedOutput.body);
842
+ };
843
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
844
+ const contents = map({});
845
+ const data = parsedOutput.body;
846
+ if (data.message != null) {
847
+ contents.message = __expectString(data.message);
848
+ }
849
+ const exception = new ValidationException({
850
+ $metadata: deserializeMetadata(parsedOutput),
851
+ ...contents,
1159
852
  });
1160
- }); };
1161
- var serializeAws_restJson1ActiveDirectoryIdentityProvider = function (input, context) {
1162
- return __assign({}, (input.DirectoryId != null && { DirectoryId: input.DirectoryId }));
853
+ return __decorateServiceException(exception, parsedOutput.body);
1163
854
  };
1164
- var serializeAws_restJson1Filter = function (input, context) {
1165
- return __assign(__assign(__assign({}, (input.Attribute != null && { Attribute: input.Attribute })), (input.Operation != null && { Operation: input.Operation })), (input.Value != null && { Value: input.Value }));
855
+ const serializeAws_restJson1ActiveDirectoryIdentityProvider = (input, context) => {
856
+ return {
857
+ ...(input.DirectoryId != null && { DirectoryId: input.DirectoryId }),
858
+ };
859
+ };
860
+ const serializeAws_restJson1Filter = (input, context) => {
861
+ return {
862
+ ...(input.Attribute != null && { Attribute: input.Attribute }),
863
+ ...(input.Operation != null && { Operation: input.Operation }),
864
+ ...(input.Value != null && { Value: input.Value }),
865
+ };
1166
866
  };
1167
- var serializeAws_restJson1FilterList = function (input, context) {
867
+ const serializeAws_restJson1FilterList = (input, context) => {
1168
868
  return input
1169
- .filter(function (e) { return e != null; })
1170
- .map(function (entry) {
869
+ .filter((e) => e != null)
870
+ .map((entry) => {
1171
871
  return serializeAws_restJson1Filter(entry, context);
1172
872
  });
1173
873
  };
1174
- var serializeAws_restJson1IdentityProvider = function (input, context) {
874
+ const serializeAws_restJson1IdentityProvider = (input, context) => {
1175
875
  return IdentityProvider.visit(input, {
1176
- ActiveDirectoryIdentityProvider: function (value) { return ({
876
+ ActiveDirectoryIdentityProvider: (value) => ({
1177
877
  ActiveDirectoryIdentityProvider: serializeAws_restJson1ActiveDirectoryIdentityProvider(value, context),
1178
- }); },
1179
- _: function (name, value) { return ({ name: value }); },
878
+ }),
879
+ _: (name, value) => ({ name: value }),
1180
880
  });
1181
881
  };
1182
- var deserializeAws_restJson1ActiveDirectoryIdentityProvider = function (output, context) {
882
+ const deserializeAws_restJson1ActiveDirectoryIdentityProvider = (output, context) => {
1183
883
  return {
1184
884
  DirectoryId: __expectString(output.DirectoryId),
1185
885
  };
1186
886
  };
1187
- var deserializeAws_restJson1IdentityProvider = function (output, context) {
887
+ const deserializeAws_restJson1IdentityProvider = (output, context) => {
1188
888
  if (output.ActiveDirectoryIdentityProvider != null) {
1189
889
  return {
1190
890
  ActiveDirectoryIdentityProvider: deserializeAws_restJson1ActiveDirectoryIdentityProvider(output.ActiveDirectoryIdentityProvider, context),
@@ -1192,7 +892,7 @@ var deserializeAws_restJson1IdentityProvider = function (output, context) {
1192
892
  }
1193
893
  return { $unknown: Object.entries(output)[0] };
1194
894
  };
1195
- var deserializeAws_restJson1IdentityProviderSummary = function (output, context) {
895
+ const deserializeAws_restJson1IdentityProviderSummary = (output, context) => {
1196
896
  return {
1197
897
  FailureMessage: __expectString(output.FailureMessage),
1198
898
  IdentityProvider: output.IdentityProvider != null
@@ -1202,10 +902,10 @@ var deserializeAws_restJson1IdentityProviderSummary = function (output, context)
1202
902
  Status: __expectString(output.Status),
1203
903
  };
1204
904
  };
1205
- var deserializeAws_restJson1IdentityProviderSummaryList = function (output, context) {
1206
- var retVal = (output || [])
1207
- .filter(function (e) { return e != null; })
1208
- .map(function (entry) {
905
+ const deserializeAws_restJson1IdentityProviderSummaryList = (output, context) => {
906
+ const retVal = (output || [])
907
+ .filter((e) => e != null)
908
+ .map((entry) => {
1209
909
  if (entry === null) {
1210
910
  return null;
1211
911
  }
@@ -1213,7 +913,7 @@ var deserializeAws_restJson1IdentityProviderSummaryList = function (output, cont
1213
913
  });
1214
914
  return retVal;
1215
915
  };
1216
- var deserializeAws_restJson1InstanceSummary = function (output, context) {
916
+ const deserializeAws_restJson1InstanceSummary = (output, context) => {
1217
917
  return {
1218
918
  InstanceId: __expectString(output.InstanceId),
1219
919
  LastStatusCheckDate: __expectString(output.LastStatusCheckDate),
@@ -1222,10 +922,10 @@ var deserializeAws_restJson1InstanceSummary = function (output, context) {
1222
922
  StatusMessage: __expectString(output.StatusMessage),
1223
923
  };
1224
924
  };
1225
- var deserializeAws_restJson1InstanceSummaryList = function (output, context) {
1226
- var retVal = (output || [])
1227
- .filter(function (e) { return e != null; })
1228
- .map(function (entry) {
925
+ const deserializeAws_restJson1InstanceSummaryList = (output, context) => {
926
+ const retVal = (output || [])
927
+ .filter((e) => e != null)
928
+ .map((entry) => {
1229
929
  if (entry === null) {
1230
930
  return null;
1231
931
  }
@@ -1233,7 +933,7 @@ var deserializeAws_restJson1InstanceSummaryList = function (output, context) {
1233
933
  });
1234
934
  return retVal;
1235
935
  };
1236
- var deserializeAws_restJson1InstanceUserSummary = function (output, context) {
936
+ const deserializeAws_restJson1InstanceUserSummary = (output, context) => {
1237
937
  return {
1238
938
  AssociationDate: __expectString(output.AssociationDate),
1239
939
  DisassociationDate: __expectString(output.DisassociationDate),
@@ -1247,10 +947,10 @@ var deserializeAws_restJson1InstanceUserSummary = function (output, context) {
1247
947
  Username: __expectString(output.Username),
1248
948
  };
1249
949
  };
1250
- var deserializeAws_restJson1InstanceUserSummaryList = function (output, context) {
1251
- var retVal = (output || [])
1252
- .filter(function (e) { return e != null; })
1253
- .map(function (entry) {
950
+ const deserializeAws_restJson1InstanceUserSummaryList = (output, context) => {
951
+ const retVal = (output || [])
952
+ .filter((e) => e != null)
953
+ .map((entry) => {
1254
954
  if (entry === null) {
1255
955
  return null;
1256
956
  }
@@ -1258,7 +958,7 @@ var deserializeAws_restJson1InstanceUserSummaryList = function (output, context)
1258
958
  });
1259
959
  return retVal;
1260
960
  };
1261
- var deserializeAws_restJson1ProductUserSummary = function (output, context) {
961
+ const deserializeAws_restJson1ProductUserSummary = (output, context) => {
1262
962
  return {
1263
963
  Domain: __expectString(output.Domain),
1264
964
  IdentityProvider: output.IdentityProvider != null
@@ -1272,10 +972,10 @@ var deserializeAws_restJson1ProductUserSummary = function (output, context) {
1272
972
  Username: __expectString(output.Username),
1273
973
  };
1274
974
  };
1275
- var deserializeAws_restJson1ProductUserSummaryList = function (output, context) {
1276
- var retVal = (output || [])
1277
- .filter(function (e) { return e != null; })
1278
- .map(function (entry) {
975
+ const deserializeAws_restJson1ProductUserSummaryList = (output, context) => {
976
+ const retVal = (output || [])
977
+ .filter((e) => e != null)
978
+ .map((entry) => {
1279
979
  if (entry === null) {
1280
980
  return null;
1281
981
  }
@@ -1283,10 +983,10 @@ var deserializeAws_restJson1ProductUserSummaryList = function (output, context)
1283
983
  });
1284
984
  return retVal;
1285
985
  };
1286
- var deserializeAws_restJson1StringList = function (output, context) {
1287
- var retVal = (output || [])
1288
- .filter(function (e) { return e != null; })
1289
- .map(function (entry) {
986
+ const deserializeAws_restJson1StringList = (output, context) => {
987
+ const retVal = (output || [])
988
+ .filter((e) => e != null)
989
+ .map((entry) => {
1290
990
  if (entry === null) {
1291
991
  return null;
1292
992
  }
@@ -1294,57 +994,39 @@ var deserializeAws_restJson1StringList = function (output, context) {
1294
994
  });
1295
995
  return retVal;
1296
996
  };
1297
- var deserializeMetadata = function (output) {
1298
- var _a, _b;
1299
- return ({
1300
- httpStatusCode: output.statusCode,
1301
- 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"],
1302
- extendedRequestId: output.headers["x-amz-id-2"],
1303
- cfId: output.headers["x-amz-cf-id"],
1304
- });
1305
- };
1306
- var collectBody = function (streamBody, context) {
1307
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
997
+ const deserializeMetadata = (output) => ({
998
+ httpStatusCode: output.statusCode,
999
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1000
+ extendedRequestId: output.headers["x-amz-id-2"],
1001
+ cfId: output.headers["x-amz-cf-id"],
1002
+ });
1003
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1308
1004
  if (streamBody instanceof Uint8Array) {
1309
1005
  return Promise.resolve(streamBody);
1310
1006
  }
1311
1007
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1312
1008
  };
1313
- var collectBodyString = function (streamBody, context) {
1314
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1315
- };
1316
- var isSerializableHeaderValue = function (value) {
1317
- return value !== undefined &&
1318
- value !== null &&
1319
- value !== "" &&
1320
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1321
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1322
- };
1323
- var parseBody = function (streamBody, context) {
1324
- return collectBodyString(streamBody, context).then(function (encoded) {
1325
- if (encoded.length) {
1326
- return JSON.parse(encoded);
1327
- }
1328
- return {};
1329
- });
1009
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1010
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1011
+ value !== null &&
1012
+ value !== "" &&
1013
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1014
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1015
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1016
+ if (encoded.length) {
1017
+ return JSON.parse(encoded);
1018
+ }
1019
+ return {};
1020
+ });
1021
+ const parseErrorBody = async (errorBody, context) => {
1022
+ const value = await parseBody(errorBody, context);
1023
+ value.message = value.message ?? value.Message;
1024
+ return value;
1330
1025
  };
1331
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1332
- var value;
1333
- var _a;
1334
- return __generator(this, function (_b) {
1335
- switch (_b.label) {
1336
- case 0: return [4, parseBody(errorBody, context)];
1337
- case 1:
1338
- value = _b.sent();
1339
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1340
- return [2, value];
1341
- }
1342
- });
1343
- }); };
1344
- var loadRestJsonErrorCode = function (output, data) {
1345
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1346
- var sanitizeErrorCode = function (rawValue) {
1347
- var cleanValue = rawValue;
1026
+ const loadRestJsonErrorCode = (output, data) => {
1027
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1028
+ const sanitizeErrorCode = (rawValue) => {
1029
+ let cleanValue = rawValue;
1348
1030
  if (typeof cleanValue === "number") {
1349
1031
  cleanValue = cleanValue.toString();
1350
1032
  }
@@ -1359,7 +1041,7 @@ var loadRestJsonErrorCode = function (output, data) {
1359
1041
  }
1360
1042
  return cleanValue;
1361
1043
  };
1362
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1044
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1363
1045
  if (headerKey !== undefined) {
1364
1046
  return sanitizeErrorCode(output.headers[headerKey]);
1365
1047
  }