@aws-sdk/client-license-manager-user-subscriptions 3.142.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 (120) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +211 -0
  4. package/dist-cjs/LicenseManagerUserSubscriptions.js +157 -0
  5. package/dist-cjs/LicenseManagerUserSubscriptionsClient.js +37 -0
  6. package/dist-cjs/commands/AssociateUserCommand.js +36 -0
  7. package/dist-cjs/commands/DeregisterIdentityProviderCommand.js +36 -0
  8. package/dist-cjs/commands/DisassociateUserCommand.js +36 -0
  9. package/dist-cjs/commands/ListIdentityProvidersCommand.js +36 -0
  10. package/dist-cjs/commands/ListInstancesCommand.js +36 -0
  11. package/dist-cjs/commands/ListProductSubscriptionsCommand.js +36 -0
  12. package/dist-cjs/commands/ListUserAssociationsCommand.js +36 -0
  13. package/dist-cjs/commands/RegisterIdentityProviderCommand.js +36 -0
  14. package/dist-cjs/commands/StartProductSubscriptionCommand.js +36 -0
  15. package/dist-cjs/commands/StopProductSubscriptionCommand.js +36 -0
  16. package/dist-cjs/commands/index.js +13 -0
  17. package/dist-cjs/endpoints.js +168 -0
  18. package/dist-cjs/index.js +11 -0
  19. package/dist-cjs/models/LicenseManagerUserSubscriptionsServiceException.js +11 -0
  20. package/dist-cjs/models/index.js +4 -0
  21. package/dist-cjs/models/models_0.js +250 -0
  22. package/dist-cjs/pagination/Interfaces.js +2 -0
  23. package/dist-cjs/pagination/ListIdentityProvidersPaginator.js +36 -0
  24. package/dist-cjs/pagination/ListInstancesPaginator.js +36 -0
  25. package/dist-cjs/pagination/ListProductSubscriptionsPaginator.js +36 -0
  26. package/dist-cjs/pagination/ListUserAssociationsPaginator.js +36 -0
  27. package/dist-cjs/pagination/index.js +8 -0
  28. package/dist-cjs/protocols/Aws_restJson1.js +1072 -0
  29. package/dist-cjs/runtimeConfig.browser.js +45 -0
  30. package/dist-cjs/runtimeConfig.js +52 -0
  31. package/dist-cjs/runtimeConfig.native.js +16 -0
  32. package/dist-cjs/runtimeConfig.shared.js +17 -0
  33. package/dist-es/LicenseManagerUserSubscriptions.js +160 -0
  34. package/dist-es/LicenseManagerUserSubscriptionsClient.js +39 -0
  35. package/dist-es/commands/AssociateUserCommand.js +39 -0
  36. package/dist-es/commands/DeregisterIdentityProviderCommand.js +39 -0
  37. package/dist-es/commands/DisassociateUserCommand.js +39 -0
  38. package/dist-es/commands/ListIdentityProvidersCommand.js +39 -0
  39. package/dist-es/commands/ListInstancesCommand.js +39 -0
  40. package/dist-es/commands/ListProductSubscriptionsCommand.js +39 -0
  41. package/dist-es/commands/ListUserAssociationsCommand.js +39 -0
  42. package/dist-es/commands/RegisterIdentityProviderCommand.js +39 -0
  43. package/dist-es/commands/StartProductSubscriptionCommand.js +39 -0
  44. package/dist-es/commands/StopProductSubscriptionCommand.js +39 -0
  45. package/dist-es/commands/index.js +10 -0
  46. package/dist-es/endpoints.js +164 -0
  47. package/dist-es/index.js +6 -0
  48. package/dist-es/models/LicenseManagerUserSubscriptionsServiceException.js +12 -0
  49. package/dist-es/models/index.js +1 -0
  50. package/dist-es/models/models_0.js +145 -0
  51. package/dist-es/pagination/Interfaces.js +1 -0
  52. package/dist-es/pagination/ListIdentityProvidersPaginator.js +75 -0
  53. package/dist-es/pagination/ListInstancesPaginator.js +75 -0
  54. package/dist-es/pagination/ListProductSubscriptionsPaginator.js +75 -0
  55. package/dist-es/pagination/ListUserAssociationsPaginator.js +75 -0
  56. package/dist-es/pagination/index.js +5 -0
  57. package/dist-es/protocols/Aws_restJson1.js +1356 -0
  58. package/dist-es/runtimeConfig.browser.js +26 -0
  59. package/dist-es/runtimeConfig.js +30 -0
  60. package/dist-es/runtimeConfig.native.js +8 -0
  61. package/dist-es/runtimeConfig.shared.js +13 -0
  62. package/dist-types/LicenseManagerUserSubscriptions.d.ts +77 -0
  63. package/dist-types/LicenseManagerUserSubscriptionsClient.d.ts +154 -0
  64. package/dist-types/commands/AssociateUserCommand.d.ts +35 -0
  65. package/dist-types/commands/DeregisterIdentityProviderCommand.d.ts +35 -0
  66. package/dist-types/commands/DisassociateUserCommand.d.ts +35 -0
  67. package/dist-types/commands/ListIdentityProvidersCommand.d.ts +35 -0
  68. package/dist-types/commands/ListInstancesCommand.d.ts +35 -0
  69. package/dist-types/commands/ListProductSubscriptionsCommand.d.ts +35 -0
  70. package/dist-types/commands/ListUserAssociationsCommand.d.ts +35 -0
  71. package/dist-types/commands/RegisterIdentityProviderCommand.d.ts +35 -0
  72. package/dist-types/commands/StartProductSubscriptionCommand.d.ts +35 -0
  73. package/dist-types/commands/StopProductSubscriptionCommand.d.ts +35 -0
  74. package/dist-types/commands/index.d.ts +10 -0
  75. package/dist-types/endpoints.d.ts +2 -0
  76. package/dist-types/index.d.ts +6 -0
  77. package/dist-types/models/LicenseManagerUserSubscriptionsServiceException.d.ts +10 -0
  78. package/dist-types/models/index.d.ts +1 -0
  79. package/dist-types/models/models_0.d.ts +596 -0
  80. package/dist-types/pagination/Interfaces.d.ts +6 -0
  81. package/dist-types/pagination/ListIdentityProvidersPaginator.d.ts +4 -0
  82. package/dist-types/pagination/ListInstancesPaginator.d.ts +4 -0
  83. package/dist-types/pagination/ListProductSubscriptionsPaginator.d.ts +4 -0
  84. package/dist-types/pagination/ListUserAssociationsPaginator.d.ts +4 -0
  85. package/dist-types/pagination/index.d.ts +5 -0
  86. package/dist-types/protocols/Aws_restJson1.d.ts +32 -0
  87. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  88. package/dist-types/runtimeConfig.d.ts +40 -0
  89. package/dist-types/runtimeConfig.native.d.ts +39 -0
  90. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  91. package/dist-types/ts3.4/LicenseManagerUserSubscriptions.d.ts +55 -0
  92. package/dist-types/ts3.4/LicenseManagerUserSubscriptionsClient.d.ts +83 -0
  93. package/dist-types/ts3.4/commands/AssociateUserCommand.d.ts +17 -0
  94. package/dist-types/ts3.4/commands/DeregisterIdentityProviderCommand.d.ts +17 -0
  95. package/dist-types/ts3.4/commands/DisassociateUserCommand.d.ts +17 -0
  96. package/dist-types/ts3.4/commands/ListIdentityProvidersCommand.d.ts +17 -0
  97. package/dist-types/ts3.4/commands/ListInstancesCommand.d.ts +17 -0
  98. package/dist-types/ts3.4/commands/ListProductSubscriptionsCommand.d.ts +17 -0
  99. package/dist-types/ts3.4/commands/ListUserAssociationsCommand.d.ts +17 -0
  100. package/dist-types/ts3.4/commands/RegisterIdentityProviderCommand.d.ts +17 -0
  101. package/dist-types/ts3.4/commands/StartProductSubscriptionCommand.d.ts +17 -0
  102. package/dist-types/ts3.4/commands/StopProductSubscriptionCommand.d.ts +17 -0
  103. package/dist-types/ts3.4/commands/index.d.ts +10 -0
  104. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  105. package/dist-types/ts3.4/index.d.ts +6 -0
  106. package/dist-types/ts3.4/models/LicenseManagerUserSubscriptionsServiceException.d.ts +6 -0
  107. package/dist-types/ts3.4/models/index.d.ts +1 -0
  108. package/dist-types/ts3.4/models/models_0.d.ts +340 -0
  109. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  110. package/dist-types/ts3.4/pagination/ListIdentityProvidersPaginator.d.ts +4 -0
  111. package/dist-types/ts3.4/pagination/ListInstancesPaginator.d.ts +4 -0
  112. package/dist-types/ts3.4/pagination/ListProductSubscriptionsPaginator.d.ts +4 -0
  113. package/dist-types/ts3.4/pagination/ListUserAssociationsPaginator.d.ts +4 -0
  114. package/dist-types/ts3.4/pagination/index.d.ts +5 -0
  115. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +32 -0
  116. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  117. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  118. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  119. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  120. package/package.json +94 -0
@@ -0,0 +1,1356 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
2
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
+ 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
+ import { LicenseManagerUserSubscriptionsServiceException as __BaseException } from "../models/LicenseManagerUserSubscriptionsServiceException";
5
+ 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
+ }
30
+ });
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
+ }
57
+ });
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
+ }
83
+ });
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
+ }
107
+ });
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
+ }
131
+ });
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
+ }
157
+ });
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
+ }
183
+ });
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
+ }
210
+ });
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
+ }
236
+ });
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
+ }
262
+ });
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
+ }
285
+ });
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, parseBody(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
+ }
342
+ });
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
+ }
365
+ });
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, parseBody(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
+ }
422
+ });
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
+ }
445
+ });
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, parseBody(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
+ }
502
+ });
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
+ }
528
+ });
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, parseBody(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
+ }
585
+ });
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
+ }
611
+ });
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, parseBody(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
+ }
668
+ });
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
+ }
694
+ });
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, parseBody(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
+ }
751
+ });
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
+ }
777
+ });
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, parseBody(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
+ }
834
+ });
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
+ }
857
+ });
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, parseBody(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
+ }
914
+ });
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
+ }
937
+ });
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, parseBody(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
+ }
994
+ });
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
+ }
1017
+ });
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, parseBody(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
+ }
1074
+ });
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)];
1087
+ });
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)];
1099
+ });
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)];
1111
+ });
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)];
1123
+ });
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)];
1135
+ });
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)];
1147
+ });
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)];
1159
+ });
1160
+ }); };
1161
+ var serializeAws_restJson1ActiveDirectoryIdentityProvider = function (input, context) {
1162
+ return __assign({}, (input.DirectoryId != null && { DirectoryId: input.DirectoryId }));
1163
+ };
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 }));
1166
+ };
1167
+ var serializeAws_restJson1FilterList = function (input, context) {
1168
+ return input
1169
+ .filter(function (e) { return e != null; })
1170
+ .map(function (entry) {
1171
+ return serializeAws_restJson1Filter(entry, context);
1172
+ });
1173
+ };
1174
+ var serializeAws_restJson1IdentityProvider = function (input, context) {
1175
+ return IdentityProvider.visit(input, {
1176
+ ActiveDirectoryIdentityProvider: function (value) { return ({
1177
+ ActiveDirectoryIdentityProvider: serializeAws_restJson1ActiveDirectoryIdentityProvider(value, context),
1178
+ }); },
1179
+ _: function (name, value) { return ({ name: value }); },
1180
+ });
1181
+ };
1182
+ var deserializeAws_restJson1ActiveDirectoryIdentityProvider = function (output, context) {
1183
+ return {
1184
+ DirectoryId: __expectString(output.DirectoryId),
1185
+ };
1186
+ };
1187
+ var deserializeAws_restJson1IdentityProvider = function (output, context) {
1188
+ if (output.ActiveDirectoryIdentityProvider != null) {
1189
+ return {
1190
+ ActiveDirectoryIdentityProvider: deserializeAws_restJson1ActiveDirectoryIdentityProvider(output.ActiveDirectoryIdentityProvider, context),
1191
+ };
1192
+ }
1193
+ return { $unknown: Object.entries(output)[0] };
1194
+ };
1195
+ var deserializeAws_restJson1IdentityProviderSummary = function (output, context) {
1196
+ return {
1197
+ FailureMessage: __expectString(output.FailureMessage),
1198
+ IdentityProvider: output.IdentityProvider != null
1199
+ ? deserializeAws_restJson1IdentityProvider(__expectUnion(output.IdentityProvider), context)
1200
+ : undefined,
1201
+ Product: __expectString(output.Product),
1202
+ Status: __expectString(output.Status),
1203
+ };
1204
+ };
1205
+ var deserializeAws_restJson1IdentityProviderSummaryList = function (output, context) {
1206
+ var retVal = (output || [])
1207
+ .filter(function (e) { return e != null; })
1208
+ .map(function (entry) {
1209
+ if (entry === null) {
1210
+ return null;
1211
+ }
1212
+ return deserializeAws_restJson1IdentityProviderSummary(entry, context);
1213
+ });
1214
+ return retVal;
1215
+ };
1216
+ var deserializeAws_restJson1InstanceSummary = function (output, context) {
1217
+ return {
1218
+ InstanceId: __expectString(output.InstanceId),
1219
+ LastStatusCheckDate: __expectString(output.LastStatusCheckDate),
1220
+ Products: output.Products != null ? deserializeAws_restJson1StringList(output.Products, context) : undefined,
1221
+ Status: __expectString(output.Status),
1222
+ StatusMessage: __expectString(output.StatusMessage),
1223
+ };
1224
+ };
1225
+ var deserializeAws_restJson1InstanceSummaryList = function (output, context) {
1226
+ var retVal = (output || [])
1227
+ .filter(function (e) { return e != null; })
1228
+ .map(function (entry) {
1229
+ if (entry === null) {
1230
+ return null;
1231
+ }
1232
+ return deserializeAws_restJson1InstanceSummary(entry, context);
1233
+ });
1234
+ return retVal;
1235
+ };
1236
+ var deserializeAws_restJson1InstanceUserSummary = function (output, context) {
1237
+ return {
1238
+ AssociationDate: __expectString(output.AssociationDate),
1239
+ DisassociationDate: __expectString(output.DisassociationDate),
1240
+ Domain: __expectString(output.Domain),
1241
+ IdentityProvider: output.IdentityProvider != null
1242
+ ? deserializeAws_restJson1IdentityProvider(__expectUnion(output.IdentityProvider), context)
1243
+ : undefined,
1244
+ InstanceId: __expectString(output.InstanceId),
1245
+ Status: __expectString(output.Status),
1246
+ StatusMessage: __expectString(output.StatusMessage),
1247
+ Username: __expectString(output.Username),
1248
+ };
1249
+ };
1250
+ var deserializeAws_restJson1InstanceUserSummaryList = function (output, context) {
1251
+ var retVal = (output || [])
1252
+ .filter(function (e) { return e != null; })
1253
+ .map(function (entry) {
1254
+ if (entry === null) {
1255
+ return null;
1256
+ }
1257
+ return deserializeAws_restJson1InstanceUserSummary(entry, context);
1258
+ });
1259
+ return retVal;
1260
+ };
1261
+ var deserializeAws_restJson1ProductUserSummary = function (output, context) {
1262
+ return {
1263
+ Domain: __expectString(output.Domain),
1264
+ IdentityProvider: output.IdentityProvider != null
1265
+ ? deserializeAws_restJson1IdentityProvider(__expectUnion(output.IdentityProvider), context)
1266
+ : undefined,
1267
+ Product: __expectString(output.Product),
1268
+ Status: __expectString(output.Status),
1269
+ StatusMessage: __expectString(output.StatusMessage),
1270
+ SubscriptionEndDate: __expectString(output.SubscriptionEndDate),
1271
+ SubscriptionStartDate: __expectString(output.SubscriptionStartDate),
1272
+ Username: __expectString(output.Username),
1273
+ };
1274
+ };
1275
+ var deserializeAws_restJson1ProductUserSummaryList = function (output, context) {
1276
+ var retVal = (output || [])
1277
+ .filter(function (e) { return e != null; })
1278
+ .map(function (entry) {
1279
+ if (entry === null) {
1280
+ return null;
1281
+ }
1282
+ return deserializeAws_restJson1ProductUserSummary(entry, context);
1283
+ });
1284
+ return retVal;
1285
+ };
1286
+ var deserializeAws_restJson1StringList = function (output, context) {
1287
+ var retVal = (output || [])
1288
+ .filter(function (e) { return e != null; })
1289
+ .map(function (entry) {
1290
+ if (entry === null) {
1291
+ return null;
1292
+ }
1293
+ return __expectString(entry);
1294
+ });
1295
+ return retVal;
1296
+ };
1297
+ var deserializeMetadata = function (output) {
1298
+ var _a;
1299
+ return ({
1300
+ httpStatusCode: output.statusCode,
1301
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-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(); }
1308
+ if (streamBody instanceof Uint8Array) {
1309
+ return Promise.resolve(streamBody);
1310
+ }
1311
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1312
+ };
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
+ });
1330
+ };
1331
+ var loadRestJsonErrorCode = function (output, data) {
1332
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1333
+ var sanitizeErrorCode = function (rawValue) {
1334
+ var cleanValue = rawValue;
1335
+ if (typeof cleanValue === "number") {
1336
+ cleanValue = cleanValue.toString();
1337
+ }
1338
+ if (cleanValue.indexOf(":") >= 0) {
1339
+ cleanValue = cleanValue.split(":")[0];
1340
+ }
1341
+ if (cleanValue.indexOf("#") >= 0) {
1342
+ cleanValue = cleanValue.split("#")[1];
1343
+ }
1344
+ return cleanValue;
1345
+ };
1346
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1347
+ if (headerKey !== undefined) {
1348
+ return sanitizeErrorCode(output.headers[headerKey]);
1349
+ }
1350
+ if (data.code !== undefined) {
1351
+ return sanitizeErrorCode(data.code);
1352
+ }
1353
+ if (data["__type"] !== undefined) {
1354
+ return sanitizeErrorCode(data["__type"]);
1355
+ }
1356
+ };