@aws-sdk/client-trustedadvisor 3.454.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 (143) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +285 -0
  3. package/dist-cjs/TrustedAdvisor.js +31 -0
  4. package/dist-cjs/TrustedAdvisorClient.js +43 -0
  5. package/dist-cjs/commands/GetOrganizationRecommendationCommand.js +52 -0
  6. package/dist-cjs/commands/GetRecommendationCommand.js +52 -0
  7. package/dist-cjs/commands/ListChecksCommand.js +51 -0
  8. package/dist-cjs/commands/ListOrganizationRecommendationAccountsCommand.js +52 -0
  9. package/dist-cjs/commands/ListOrganizationRecommendationResourcesCommand.js +51 -0
  10. package/dist-cjs/commands/ListOrganizationRecommendationsCommand.js +51 -0
  11. package/dist-cjs/commands/ListRecommendationResourcesCommand.js +51 -0
  12. package/dist-cjs/commands/ListRecommendationsCommand.js +51 -0
  13. package/dist-cjs/commands/UpdateOrganizationRecommendationLifecycleCommand.js +52 -0
  14. package/dist-cjs/commands/UpdateRecommendationLifecycleCommand.js +52 -0
  15. package/dist-cjs/commands/index.js +13 -0
  16. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  17. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  18. package/dist-cjs/endpoint/ruleset.js +7 -0
  19. package/dist-cjs/extensionConfiguration.js +2 -0
  20. package/dist-cjs/index.js +12 -0
  21. package/dist-cjs/models/TrustedAdvisorServiceException.js +12 -0
  22. package/dist-cjs/models/index.js +4 -0
  23. package/dist-cjs/models/models_0.js +202 -0
  24. package/dist-cjs/pagination/Interfaces.js +2 -0
  25. package/dist-cjs/pagination/ListChecksPaginator.js +29 -0
  26. package/dist-cjs/pagination/ListOrganizationRecommendationAccountsPaginator.js +29 -0
  27. package/dist-cjs/pagination/ListOrganizationRecommendationResourcesPaginator.js +29 -0
  28. package/dist-cjs/pagination/ListOrganizationRecommendationsPaginator.js +29 -0
  29. package/dist-cjs/pagination/ListRecommendationResourcesPaginator.js +29 -0
  30. package/dist-cjs/pagination/ListRecommendationsPaginator.js +29 -0
  31. package/dist-cjs/pagination/index.js +10 -0
  32. package/dist-cjs/protocols/Aws_restJson1.js +1023 -0
  33. package/dist-cjs/runtimeConfig.browser.js +39 -0
  34. package/dist-cjs/runtimeConfig.js +50 -0
  35. package/dist-cjs/runtimeConfig.native.js +15 -0
  36. package/dist-cjs/runtimeConfig.shared.js +24 -0
  37. package/dist-cjs/runtimeExtensions.js +22 -0
  38. package/dist-es/TrustedAdvisor.js +27 -0
  39. package/dist-es/TrustedAdvisorClient.js +39 -0
  40. package/dist-es/commands/GetOrganizationRecommendationCommand.js +48 -0
  41. package/dist-es/commands/GetRecommendationCommand.js +48 -0
  42. package/dist-es/commands/ListChecksCommand.js +47 -0
  43. package/dist-es/commands/ListOrganizationRecommendationAccountsCommand.js +48 -0
  44. package/dist-es/commands/ListOrganizationRecommendationResourcesCommand.js +47 -0
  45. package/dist-es/commands/ListOrganizationRecommendationsCommand.js +47 -0
  46. package/dist-es/commands/ListRecommendationResourcesCommand.js +47 -0
  47. package/dist-es/commands/ListRecommendationsCommand.js +47 -0
  48. package/dist-es/commands/UpdateOrganizationRecommendationLifecycleCommand.js +48 -0
  49. package/dist-es/commands/UpdateRecommendationLifecycleCommand.js +48 -0
  50. package/dist-es/commands/index.js +10 -0
  51. package/dist-es/endpoint/EndpointParameters.js +8 -0
  52. package/dist-es/endpoint/endpointResolver.js +8 -0
  53. package/dist-es/endpoint/ruleset.js +4 -0
  54. package/dist-es/extensionConfiguration.js +1 -0
  55. package/dist-es/index.js +7 -0
  56. package/dist-es/models/TrustedAdvisorServiceException.js +8 -0
  57. package/dist-es/models/index.js +1 -0
  58. package/dist-es/models/models_0.js +185 -0
  59. package/dist-es/pagination/Interfaces.js +1 -0
  60. package/dist-es/pagination/ListChecksPaginator.js +25 -0
  61. package/dist-es/pagination/ListOrganizationRecommendationAccountsPaginator.js +25 -0
  62. package/dist-es/pagination/ListOrganizationRecommendationResourcesPaginator.js +25 -0
  63. package/dist-es/pagination/ListOrganizationRecommendationsPaginator.js +25 -0
  64. package/dist-es/pagination/ListRecommendationResourcesPaginator.js +25 -0
  65. package/dist-es/pagination/ListRecommendationsPaginator.js +25 -0
  66. package/dist-es/pagination/index.js +7 -0
  67. package/dist-es/protocols/Aws_restJson1.js +1000 -0
  68. package/dist-es/runtimeConfig.browser.js +34 -0
  69. package/dist-es/runtimeConfig.js +45 -0
  70. package/dist-es/runtimeConfig.native.js +11 -0
  71. package/dist-es/runtimeConfig.shared.js +20 -0
  72. package/dist-es/runtimeExtensions.js +18 -0
  73. package/dist-types/TrustedAdvisor.d.ts +80 -0
  74. package/dist-types/TrustedAdvisorClient.d.ts +179 -0
  75. package/dist-types/commands/GetOrganizationRecommendationCommand.d.ts +125 -0
  76. package/dist-types/commands/GetRecommendationCommand.d.ts +123 -0
  77. package/dist-types/commands/ListChecksCommand.d.ts +108 -0
  78. package/dist-types/commands/ListOrganizationRecommendationAccountsCommand.d.ts +105 -0
  79. package/dist-types/commands/ListOrganizationRecommendationResourcesCommand.d.ts +110 -0
  80. package/dist-types/commands/ListOrganizationRecommendationsCommand.d.ts +127 -0
  81. package/dist-types/commands/ListRecommendationResourcesCommand.d.ts +106 -0
  82. package/dist-types/commands/ListRecommendationsCommand.d.ts +125 -0
  83. package/dist-types/commands/UpdateOrganizationRecommendationLifecycleCommand.d.ts +94 -0
  84. package/dist-types/commands/UpdateRecommendationLifecycleCommand.d.ts +92 -0
  85. package/dist-types/commands/index.d.ts +10 -0
  86. package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
  87. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  88. package/dist-types/endpoint/ruleset.d.ts +2 -0
  89. package/dist-types/extensionConfiguration.d.ts +8 -0
  90. package/dist-types/index.d.ts +15 -0
  91. package/dist-types/models/TrustedAdvisorServiceException.d.ts +13 -0
  92. package/dist-types/models/index.d.ts +1 -0
  93. package/dist-types/models/models_0.d.ts +1322 -0
  94. package/dist-types/pagination/Interfaces.d.ts +8 -0
  95. package/dist-types/pagination/ListChecksPaginator.d.ts +7 -0
  96. package/dist-types/pagination/ListOrganizationRecommendationAccountsPaginator.d.ts +7 -0
  97. package/dist-types/pagination/ListOrganizationRecommendationResourcesPaginator.d.ts +7 -0
  98. package/dist-types/pagination/ListOrganizationRecommendationsPaginator.d.ts +7 -0
  99. package/dist-types/pagination/ListRecommendationResourcesPaginator.d.ts +7 -0
  100. package/dist-types/pagination/ListRecommendationsPaginator.d.ts +7 -0
  101. package/dist-types/pagination/index.d.ts +7 -0
  102. package/dist-types/protocols/Aws_restJson1.d.ts +92 -0
  103. package/dist-types/runtimeConfig.browser.d.ts +46 -0
  104. package/dist-types/runtimeConfig.d.ts +46 -0
  105. package/dist-types/runtimeConfig.native.d.ts +45 -0
  106. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  107. package/dist-types/runtimeExtensions.d.ts +17 -0
  108. package/dist-types/ts3.4/TrustedAdvisor.d.ts +195 -0
  109. package/dist-types/ts3.4/TrustedAdvisorClient.d.ts +179 -0
  110. package/dist-types/ts3.4/commands/GetOrganizationRecommendationCommand.d.ts +42 -0
  111. package/dist-types/ts3.4/commands/GetRecommendationCommand.d.ts +39 -0
  112. package/dist-types/ts3.4/commands/ListChecksCommand.d.ts +35 -0
  113. package/dist-types/ts3.4/commands/ListOrganizationRecommendationAccountsCommand.d.ts +42 -0
  114. package/dist-types/ts3.4/commands/ListOrganizationRecommendationResourcesCommand.d.ts +42 -0
  115. package/dist-types/ts3.4/commands/ListOrganizationRecommendationsCommand.d.ts +42 -0
  116. package/dist-types/ts3.4/commands/ListRecommendationResourcesCommand.d.ts +42 -0
  117. package/dist-types/ts3.4/commands/ListRecommendationsCommand.d.ts +39 -0
  118. package/dist-types/ts3.4/commands/UpdateOrganizationRecommendationLifecycleCommand.d.ts +38 -0
  119. package/dist-types/ts3.4/commands/UpdateRecommendationLifecycleCommand.d.ts +38 -0
  120. package/dist-types/ts3.4/commands/index.d.ts +10 -0
  121. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  122. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  123. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  124. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  125. package/dist-types/ts3.4/index.d.ts +10 -0
  126. package/dist-types/ts3.4/models/TrustedAdvisorServiceException.d.ts +8 -0
  127. package/dist-types/ts3.4/models/index.d.ts +1 -0
  128. package/dist-types/ts3.4/models/models_0.d.ts +397 -0
  129. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  130. package/dist-types/ts3.4/pagination/ListChecksPaginator.d.ts +11 -0
  131. package/dist-types/ts3.4/pagination/ListOrganizationRecommendationAccountsPaginator.d.ts +11 -0
  132. package/dist-types/ts3.4/pagination/ListOrganizationRecommendationResourcesPaginator.d.ts +11 -0
  133. package/dist-types/ts3.4/pagination/ListOrganizationRecommendationsPaginator.d.ts +11 -0
  134. package/dist-types/ts3.4/pagination/ListRecommendationResourcesPaginator.d.ts +11 -0
  135. package/dist-types/ts3.4/pagination/ListRecommendationsPaginator.d.ts +11 -0
  136. package/dist-types/ts3.4/pagination/index.d.ts +7 -0
  137. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +125 -0
  138. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  139. package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
  140. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  141. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  142. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  143. package/package.json +102 -0
@@ -0,0 +1,1023 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_UpdateRecommendationLifecycleCommand = exports.de_UpdateOrganizationRecommendationLifecycleCommand = exports.de_ListRecommendationsCommand = exports.de_ListRecommendationResourcesCommand = exports.de_ListOrganizationRecommendationsCommand = exports.de_ListOrganizationRecommendationResourcesCommand = exports.de_ListOrganizationRecommendationAccountsCommand = exports.de_ListChecksCommand = exports.de_GetRecommendationCommand = exports.de_GetOrganizationRecommendationCommand = exports.se_UpdateRecommendationLifecycleCommand = exports.se_UpdateOrganizationRecommendationLifecycleCommand = exports.se_ListRecommendationsCommand = exports.se_ListRecommendationResourcesCommand = exports.se_ListOrganizationRecommendationsCommand = exports.se_ListOrganizationRecommendationResourcesCommand = exports.se_ListOrganizationRecommendationAccountsCommand = exports.se_ListChecksCommand = exports.se_GetRecommendationCommand = exports.se_GetOrganizationRecommendationCommand = void 0;
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const TrustedAdvisorServiceException_1 = require("../models/TrustedAdvisorServiceException");
8
+ const se_GetOrganizationRecommendationCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {};
11
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
12
+ "/v1/organization-recommendations/{organizationRecommendationIdentifier}";
13
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "organizationRecommendationIdentifier", () => input.organizationRecommendationIdentifier, "{organizationRecommendationIdentifier}", false);
14
+ let body;
15
+ return new protocol_http_1.HttpRequest({
16
+ protocol,
17
+ hostname,
18
+ port,
19
+ method: "GET",
20
+ headers,
21
+ path: resolvedPath,
22
+ body,
23
+ });
24
+ };
25
+ exports.se_GetOrganizationRecommendationCommand = se_GetOrganizationRecommendationCommand;
26
+ const se_GetRecommendationCommand = async (input, context) => {
27
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
28
+ const headers = {};
29
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
30
+ "/v1/recommendations/{recommendationIdentifier}";
31
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "recommendationIdentifier", () => input.recommendationIdentifier, "{recommendationIdentifier}", false);
32
+ let body;
33
+ return new protocol_http_1.HttpRequest({
34
+ protocol,
35
+ hostname,
36
+ port,
37
+ method: "GET",
38
+ headers,
39
+ path: resolvedPath,
40
+ body,
41
+ });
42
+ };
43
+ exports.se_GetRecommendationCommand = se_GetRecommendationCommand;
44
+ const se_ListChecksCommand = async (input, context) => {
45
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const headers = {};
47
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/checks";
48
+ const query = (0, smithy_client_1.map)({
49
+ nextToken: [, input.nextToken],
50
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
51
+ pillar: [, input.pillar],
52
+ awsService: [, input.awsService],
53
+ source: [, input.source],
54
+ language: [, input.language],
55
+ });
56
+ let body;
57
+ return new protocol_http_1.HttpRequest({
58
+ protocol,
59
+ hostname,
60
+ port,
61
+ method: "GET",
62
+ headers,
63
+ path: resolvedPath,
64
+ query,
65
+ body,
66
+ });
67
+ };
68
+ exports.se_ListChecksCommand = se_ListChecksCommand;
69
+ const se_ListOrganizationRecommendationAccountsCommand = async (input, context) => {
70
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
71
+ const headers = {};
72
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
73
+ "/v1/organization-recommendations/{organizationRecommendationIdentifier}/accounts";
74
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "organizationRecommendationIdentifier", () => input.organizationRecommendationIdentifier, "{organizationRecommendationIdentifier}", false);
75
+ const query = (0, smithy_client_1.map)({
76
+ nextToken: [, input.nextToken],
77
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
78
+ affectedAccountId: [, input.affectedAccountId],
79
+ });
80
+ let body;
81
+ return new protocol_http_1.HttpRequest({
82
+ protocol,
83
+ hostname,
84
+ port,
85
+ method: "GET",
86
+ headers,
87
+ path: resolvedPath,
88
+ query,
89
+ body,
90
+ });
91
+ };
92
+ exports.se_ListOrganizationRecommendationAccountsCommand = se_ListOrganizationRecommendationAccountsCommand;
93
+ const se_ListOrganizationRecommendationResourcesCommand = async (input, context) => {
94
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
+ const headers = {};
96
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
97
+ "/v1/organization-recommendations/{organizationRecommendationIdentifier}/resources";
98
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "organizationRecommendationIdentifier", () => input.organizationRecommendationIdentifier, "{organizationRecommendationIdentifier}", false);
99
+ const query = (0, smithy_client_1.map)({
100
+ nextToken: [, input.nextToken],
101
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
102
+ status: [, input.status],
103
+ regionCode: [, input.regionCode],
104
+ affectedAccountId: [, input.affectedAccountId],
105
+ });
106
+ let body;
107
+ return new protocol_http_1.HttpRequest({
108
+ protocol,
109
+ hostname,
110
+ port,
111
+ method: "GET",
112
+ headers,
113
+ path: resolvedPath,
114
+ query,
115
+ body,
116
+ });
117
+ };
118
+ exports.se_ListOrganizationRecommendationResourcesCommand = se_ListOrganizationRecommendationResourcesCommand;
119
+ const se_ListOrganizationRecommendationsCommand = async (input, context) => {
120
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
+ const headers = {};
122
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/organization-recommendations";
123
+ const query = (0, smithy_client_1.map)({
124
+ nextToken: [, input.nextToken],
125
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
126
+ type: [, input.type],
127
+ status: [, input.status],
128
+ pillar: [, input.pillar],
129
+ awsService: [, input.awsService],
130
+ source: [, input.source],
131
+ checkIdentifier: [, input.checkIdentifier],
132
+ afterLastUpdatedAt: [
133
+ () => input.afterLastUpdatedAt !== void 0,
134
+ () => (input.afterLastUpdatedAt.toISOString().split(".")[0] + "Z").toString(),
135
+ ],
136
+ beforeLastUpdatedAt: [
137
+ () => input.beforeLastUpdatedAt !== void 0,
138
+ () => (input.beforeLastUpdatedAt.toISOString().split(".")[0] + "Z").toString(),
139
+ ],
140
+ });
141
+ let body;
142
+ return new protocol_http_1.HttpRequest({
143
+ protocol,
144
+ hostname,
145
+ port,
146
+ method: "GET",
147
+ headers,
148
+ path: resolvedPath,
149
+ query,
150
+ body,
151
+ });
152
+ };
153
+ exports.se_ListOrganizationRecommendationsCommand = se_ListOrganizationRecommendationsCommand;
154
+ const se_ListRecommendationResourcesCommand = async (input, context) => {
155
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
+ const headers = {};
157
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
158
+ "/v1/recommendations/{recommendationIdentifier}/resources";
159
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "recommendationIdentifier", () => input.recommendationIdentifier, "{recommendationIdentifier}", false);
160
+ const query = (0, smithy_client_1.map)({
161
+ nextToken: [, input.nextToken],
162
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
163
+ status: [, input.status],
164
+ regionCode: [, input.regionCode],
165
+ });
166
+ let body;
167
+ return new protocol_http_1.HttpRequest({
168
+ protocol,
169
+ hostname,
170
+ port,
171
+ method: "GET",
172
+ headers,
173
+ path: resolvedPath,
174
+ query,
175
+ body,
176
+ });
177
+ };
178
+ exports.se_ListRecommendationResourcesCommand = se_ListRecommendationResourcesCommand;
179
+ const se_ListRecommendationsCommand = async (input, context) => {
180
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
+ const headers = {};
182
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/recommendations";
183
+ const query = (0, smithy_client_1.map)({
184
+ nextToken: [, input.nextToken],
185
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
186
+ type: [, input.type],
187
+ status: [, input.status],
188
+ pillar: [, input.pillar],
189
+ awsService: [, input.awsService],
190
+ source: [, input.source],
191
+ checkIdentifier: [, input.checkIdentifier],
192
+ afterLastUpdatedAt: [
193
+ () => input.afterLastUpdatedAt !== void 0,
194
+ () => (input.afterLastUpdatedAt.toISOString().split(".")[0] + "Z").toString(),
195
+ ],
196
+ beforeLastUpdatedAt: [
197
+ () => input.beforeLastUpdatedAt !== void 0,
198
+ () => (input.beforeLastUpdatedAt.toISOString().split(".")[0] + "Z").toString(),
199
+ ],
200
+ });
201
+ let body;
202
+ return new protocol_http_1.HttpRequest({
203
+ protocol,
204
+ hostname,
205
+ port,
206
+ method: "GET",
207
+ headers,
208
+ path: resolvedPath,
209
+ query,
210
+ body,
211
+ });
212
+ };
213
+ exports.se_ListRecommendationsCommand = se_ListRecommendationsCommand;
214
+ const se_UpdateOrganizationRecommendationLifecycleCommand = async (input, context) => {
215
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
216
+ const headers = {
217
+ "content-type": "application/json",
218
+ };
219
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
220
+ "/v1/organization-recommendations/{organizationRecommendationIdentifier}/lifecycle";
221
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "organizationRecommendationIdentifier", () => input.organizationRecommendationIdentifier, "{organizationRecommendationIdentifier}", false);
222
+ let body;
223
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
224
+ lifecycleStage: [],
225
+ updateReason: [],
226
+ updateReasonCode: [],
227
+ }));
228
+ return new protocol_http_1.HttpRequest({
229
+ protocol,
230
+ hostname,
231
+ port,
232
+ method: "PUT",
233
+ headers,
234
+ path: resolvedPath,
235
+ body,
236
+ });
237
+ };
238
+ exports.se_UpdateOrganizationRecommendationLifecycleCommand = se_UpdateOrganizationRecommendationLifecycleCommand;
239
+ const se_UpdateRecommendationLifecycleCommand = async (input, context) => {
240
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
241
+ const headers = {
242
+ "content-type": "application/json",
243
+ };
244
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
245
+ "/v1/recommendations/{recommendationIdentifier}/lifecycle";
246
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "recommendationIdentifier", () => input.recommendationIdentifier, "{recommendationIdentifier}", false);
247
+ let body;
248
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
249
+ lifecycleStage: [],
250
+ updateReason: [],
251
+ updateReasonCode: [],
252
+ }));
253
+ return new protocol_http_1.HttpRequest({
254
+ protocol,
255
+ hostname,
256
+ port,
257
+ method: "PUT",
258
+ headers,
259
+ path: resolvedPath,
260
+ body,
261
+ });
262
+ };
263
+ exports.se_UpdateRecommendationLifecycleCommand = se_UpdateRecommendationLifecycleCommand;
264
+ const de_GetOrganizationRecommendationCommand = async (output, context) => {
265
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
266
+ return de_GetOrganizationRecommendationCommandError(output, context);
267
+ }
268
+ const contents = (0, smithy_client_1.map)({
269
+ $metadata: deserializeMetadata(output),
270
+ });
271
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
272
+ const doc = (0, smithy_client_1.take)(data, {
273
+ organizationRecommendation: (_) => de_OrganizationRecommendation(_, context),
274
+ });
275
+ Object.assign(contents, doc);
276
+ return contents;
277
+ };
278
+ exports.de_GetOrganizationRecommendationCommand = de_GetOrganizationRecommendationCommand;
279
+ const de_GetOrganizationRecommendationCommandError = async (output, context) => {
280
+ const parsedOutput = {
281
+ ...output,
282
+ body: await parseErrorBody(output.body, context),
283
+ };
284
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
285
+ switch (errorCode) {
286
+ case "AccessDeniedException":
287
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
288
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
289
+ case "InternalServerException":
290
+ case "com.amazonaws.trustedadvisor#InternalServerException":
291
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
292
+ case "ResourceNotFoundException":
293
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
294
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
295
+ case "ThrottlingException":
296
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
297
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
298
+ case "ValidationException":
299
+ case "com.amazonaws.trustedadvisor#ValidationException":
300
+ throw await de_ValidationExceptionRes(parsedOutput, context);
301
+ default:
302
+ const parsedBody = parsedOutput.body;
303
+ return throwDefaultError({
304
+ output,
305
+ parsedBody,
306
+ errorCode,
307
+ });
308
+ }
309
+ };
310
+ const de_GetRecommendationCommand = async (output, context) => {
311
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
312
+ return de_GetRecommendationCommandError(output, context);
313
+ }
314
+ const contents = (0, smithy_client_1.map)({
315
+ $metadata: deserializeMetadata(output),
316
+ });
317
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
318
+ const doc = (0, smithy_client_1.take)(data, {
319
+ recommendation: (_) => de_Recommendation(_, context),
320
+ });
321
+ Object.assign(contents, doc);
322
+ return contents;
323
+ };
324
+ exports.de_GetRecommendationCommand = de_GetRecommendationCommand;
325
+ const de_GetRecommendationCommandError = async (output, context) => {
326
+ const parsedOutput = {
327
+ ...output,
328
+ body: await parseErrorBody(output.body, context),
329
+ };
330
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
331
+ switch (errorCode) {
332
+ case "AccessDeniedException":
333
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
334
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
335
+ case "InternalServerException":
336
+ case "com.amazonaws.trustedadvisor#InternalServerException":
337
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
338
+ case "ResourceNotFoundException":
339
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
340
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
341
+ case "ThrottlingException":
342
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
343
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
344
+ case "ValidationException":
345
+ case "com.amazonaws.trustedadvisor#ValidationException":
346
+ throw await de_ValidationExceptionRes(parsedOutput, context);
347
+ default:
348
+ const parsedBody = parsedOutput.body;
349
+ return throwDefaultError({
350
+ output,
351
+ parsedBody,
352
+ errorCode,
353
+ });
354
+ }
355
+ };
356
+ const de_ListChecksCommand = async (output, context) => {
357
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
358
+ return de_ListChecksCommandError(output, context);
359
+ }
360
+ const contents = (0, smithy_client_1.map)({
361
+ $metadata: deserializeMetadata(output),
362
+ });
363
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
364
+ const doc = (0, smithy_client_1.take)(data, {
365
+ checkSummaries: smithy_client_1._json,
366
+ nextToken: smithy_client_1.expectString,
367
+ });
368
+ Object.assign(contents, doc);
369
+ return contents;
370
+ };
371
+ exports.de_ListChecksCommand = de_ListChecksCommand;
372
+ const de_ListChecksCommandError = async (output, context) => {
373
+ const parsedOutput = {
374
+ ...output,
375
+ body: await parseErrorBody(output.body, context),
376
+ };
377
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
378
+ switch (errorCode) {
379
+ case "AccessDeniedException":
380
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
381
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
382
+ case "InternalServerException":
383
+ case "com.amazonaws.trustedadvisor#InternalServerException":
384
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
385
+ case "ThrottlingException":
386
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
387
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
388
+ case "ValidationException":
389
+ case "com.amazonaws.trustedadvisor#ValidationException":
390
+ throw await de_ValidationExceptionRes(parsedOutput, context);
391
+ default:
392
+ const parsedBody = parsedOutput.body;
393
+ return throwDefaultError({
394
+ output,
395
+ parsedBody,
396
+ errorCode,
397
+ });
398
+ }
399
+ };
400
+ const de_ListOrganizationRecommendationAccountsCommand = async (output, context) => {
401
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
402
+ return de_ListOrganizationRecommendationAccountsCommandError(output, context);
403
+ }
404
+ const contents = (0, smithy_client_1.map)({
405
+ $metadata: deserializeMetadata(output),
406
+ });
407
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
408
+ const doc = (0, smithy_client_1.take)(data, {
409
+ accountRecommendationLifecycleSummaries: (_) => de_AccountRecommendationLifecycleSummaryList(_, context),
410
+ nextToken: smithy_client_1.expectString,
411
+ });
412
+ Object.assign(contents, doc);
413
+ return contents;
414
+ };
415
+ exports.de_ListOrganizationRecommendationAccountsCommand = de_ListOrganizationRecommendationAccountsCommand;
416
+ const de_ListOrganizationRecommendationAccountsCommandError = async (output, context) => {
417
+ const parsedOutput = {
418
+ ...output,
419
+ body: await parseErrorBody(output.body, context),
420
+ };
421
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ switch (errorCode) {
423
+ case "AccessDeniedException":
424
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
425
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
426
+ case "InternalServerException":
427
+ case "com.amazonaws.trustedadvisor#InternalServerException":
428
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
429
+ case "ResourceNotFoundException":
430
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
431
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
432
+ case "ThrottlingException":
433
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
434
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
435
+ case "ValidationException":
436
+ case "com.amazonaws.trustedadvisor#ValidationException":
437
+ throw await de_ValidationExceptionRes(parsedOutput, context);
438
+ default:
439
+ const parsedBody = parsedOutput.body;
440
+ return throwDefaultError({
441
+ output,
442
+ parsedBody,
443
+ errorCode,
444
+ });
445
+ }
446
+ };
447
+ const de_ListOrganizationRecommendationResourcesCommand = async (output, context) => {
448
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
449
+ return de_ListOrganizationRecommendationResourcesCommandError(output, context);
450
+ }
451
+ const contents = (0, smithy_client_1.map)({
452
+ $metadata: deserializeMetadata(output),
453
+ });
454
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
455
+ const doc = (0, smithy_client_1.take)(data, {
456
+ nextToken: smithy_client_1.expectString,
457
+ organizationRecommendationResourceSummaries: (_) => de_OrganizationRecommendationResourceSummaryList(_, context),
458
+ });
459
+ Object.assign(contents, doc);
460
+ return contents;
461
+ };
462
+ exports.de_ListOrganizationRecommendationResourcesCommand = de_ListOrganizationRecommendationResourcesCommand;
463
+ const de_ListOrganizationRecommendationResourcesCommandError = async (output, context) => {
464
+ const parsedOutput = {
465
+ ...output,
466
+ body: await parseErrorBody(output.body, context),
467
+ };
468
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
469
+ switch (errorCode) {
470
+ case "AccessDeniedException":
471
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
472
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
473
+ case "InternalServerException":
474
+ case "com.amazonaws.trustedadvisor#InternalServerException":
475
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
476
+ case "ResourceNotFoundException":
477
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
478
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
479
+ case "ThrottlingException":
480
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
481
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
482
+ case "ValidationException":
483
+ case "com.amazonaws.trustedadvisor#ValidationException":
484
+ throw await de_ValidationExceptionRes(parsedOutput, context);
485
+ default:
486
+ const parsedBody = parsedOutput.body;
487
+ return throwDefaultError({
488
+ output,
489
+ parsedBody,
490
+ errorCode,
491
+ });
492
+ }
493
+ };
494
+ const de_ListOrganizationRecommendationsCommand = async (output, context) => {
495
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
496
+ return de_ListOrganizationRecommendationsCommandError(output, context);
497
+ }
498
+ const contents = (0, smithy_client_1.map)({
499
+ $metadata: deserializeMetadata(output),
500
+ });
501
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
502
+ const doc = (0, smithy_client_1.take)(data, {
503
+ nextToken: smithy_client_1.expectString,
504
+ organizationRecommendationSummaries: (_) => de_OrganizationRecommendationSummaryList(_, context),
505
+ });
506
+ Object.assign(contents, doc);
507
+ return contents;
508
+ };
509
+ exports.de_ListOrganizationRecommendationsCommand = de_ListOrganizationRecommendationsCommand;
510
+ const de_ListOrganizationRecommendationsCommandError = async (output, context) => {
511
+ const parsedOutput = {
512
+ ...output,
513
+ body: await parseErrorBody(output.body, context),
514
+ };
515
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
516
+ switch (errorCode) {
517
+ case "AccessDeniedException":
518
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
519
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
520
+ case "InternalServerException":
521
+ case "com.amazonaws.trustedadvisor#InternalServerException":
522
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
523
+ case "ThrottlingException":
524
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
525
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
526
+ case "ValidationException":
527
+ case "com.amazonaws.trustedadvisor#ValidationException":
528
+ throw await de_ValidationExceptionRes(parsedOutput, context);
529
+ default:
530
+ const parsedBody = parsedOutput.body;
531
+ return throwDefaultError({
532
+ output,
533
+ parsedBody,
534
+ errorCode,
535
+ });
536
+ }
537
+ };
538
+ const de_ListRecommendationResourcesCommand = async (output, context) => {
539
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
540
+ return de_ListRecommendationResourcesCommandError(output, context);
541
+ }
542
+ const contents = (0, smithy_client_1.map)({
543
+ $metadata: deserializeMetadata(output),
544
+ });
545
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
546
+ const doc = (0, smithy_client_1.take)(data, {
547
+ nextToken: smithy_client_1.expectString,
548
+ recommendationResourceSummaries: (_) => de_RecommendationResourceSummaryList(_, context),
549
+ });
550
+ Object.assign(contents, doc);
551
+ return contents;
552
+ };
553
+ exports.de_ListRecommendationResourcesCommand = de_ListRecommendationResourcesCommand;
554
+ const de_ListRecommendationResourcesCommandError = async (output, context) => {
555
+ const parsedOutput = {
556
+ ...output,
557
+ body: await parseErrorBody(output.body, context),
558
+ };
559
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
560
+ switch (errorCode) {
561
+ case "AccessDeniedException":
562
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
563
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
564
+ case "InternalServerException":
565
+ case "com.amazonaws.trustedadvisor#InternalServerException":
566
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
567
+ case "ResourceNotFoundException":
568
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
569
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
570
+ case "ThrottlingException":
571
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
572
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
573
+ case "ValidationException":
574
+ case "com.amazonaws.trustedadvisor#ValidationException":
575
+ throw await de_ValidationExceptionRes(parsedOutput, context);
576
+ default:
577
+ const parsedBody = parsedOutput.body;
578
+ return throwDefaultError({
579
+ output,
580
+ parsedBody,
581
+ errorCode,
582
+ });
583
+ }
584
+ };
585
+ const de_ListRecommendationsCommand = async (output, context) => {
586
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
587
+ return de_ListRecommendationsCommandError(output, context);
588
+ }
589
+ const contents = (0, smithy_client_1.map)({
590
+ $metadata: deserializeMetadata(output),
591
+ });
592
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
593
+ const doc = (0, smithy_client_1.take)(data, {
594
+ nextToken: smithy_client_1.expectString,
595
+ recommendationSummaries: (_) => de_RecommendationSummaryList(_, context),
596
+ });
597
+ Object.assign(contents, doc);
598
+ return contents;
599
+ };
600
+ exports.de_ListRecommendationsCommand = de_ListRecommendationsCommand;
601
+ const de_ListRecommendationsCommandError = async (output, context) => {
602
+ const parsedOutput = {
603
+ ...output,
604
+ body: await parseErrorBody(output.body, context),
605
+ };
606
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
607
+ switch (errorCode) {
608
+ case "AccessDeniedException":
609
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
610
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
611
+ case "InternalServerException":
612
+ case "com.amazonaws.trustedadvisor#InternalServerException":
613
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
614
+ case "ThrottlingException":
615
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
616
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
617
+ case "ValidationException":
618
+ case "com.amazonaws.trustedadvisor#ValidationException":
619
+ throw await de_ValidationExceptionRes(parsedOutput, context);
620
+ default:
621
+ const parsedBody = parsedOutput.body;
622
+ return throwDefaultError({
623
+ output,
624
+ parsedBody,
625
+ errorCode,
626
+ });
627
+ }
628
+ };
629
+ const de_UpdateOrganizationRecommendationLifecycleCommand = async (output, context) => {
630
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
631
+ return de_UpdateOrganizationRecommendationLifecycleCommandError(output, context);
632
+ }
633
+ const contents = (0, smithy_client_1.map)({
634
+ $metadata: deserializeMetadata(output),
635
+ });
636
+ await (0, smithy_client_1.collectBody)(output.body, context);
637
+ return contents;
638
+ };
639
+ exports.de_UpdateOrganizationRecommendationLifecycleCommand = de_UpdateOrganizationRecommendationLifecycleCommand;
640
+ const de_UpdateOrganizationRecommendationLifecycleCommandError = async (output, context) => {
641
+ const parsedOutput = {
642
+ ...output,
643
+ body: await parseErrorBody(output.body, context),
644
+ };
645
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
646
+ switch (errorCode) {
647
+ case "AccessDeniedException":
648
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
649
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
650
+ case "ConflictException":
651
+ case "com.amazonaws.trustedadvisor#ConflictException":
652
+ throw await de_ConflictExceptionRes(parsedOutput, context);
653
+ case "InternalServerException":
654
+ case "com.amazonaws.trustedadvisor#InternalServerException":
655
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
656
+ case "ResourceNotFoundException":
657
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
658
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
659
+ case "ThrottlingException":
660
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
661
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
662
+ case "ValidationException":
663
+ case "com.amazonaws.trustedadvisor#ValidationException":
664
+ throw await de_ValidationExceptionRes(parsedOutput, context);
665
+ default:
666
+ const parsedBody = parsedOutput.body;
667
+ return throwDefaultError({
668
+ output,
669
+ parsedBody,
670
+ errorCode,
671
+ });
672
+ }
673
+ };
674
+ const de_UpdateRecommendationLifecycleCommand = async (output, context) => {
675
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
676
+ return de_UpdateRecommendationLifecycleCommandError(output, context);
677
+ }
678
+ const contents = (0, smithy_client_1.map)({
679
+ $metadata: deserializeMetadata(output),
680
+ });
681
+ await (0, smithy_client_1.collectBody)(output.body, context);
682
+ return contents;
683
+ };
684
+ exports.de_UpdateRecommendationLifecycleCommand = de_UpdateRecommendationLifecycleCommand;
685
+ const de_UpdateRecommendationLifecycleCommandError = async (output, context) => {
686
+ const parsedOutput = {
687
+ ...output,
688
+ body: await parseErrorBody(output.body, context),
689
+ };
690
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
691
+ switch (errorCode) {
692
+ case "AccessDeniedException":
693
+ case "com.amazonaws.trustedadvisor#AccessDeniedException":
694
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
695
+ case "ConflictException":
696
+ case "com.amazonaws.trustedadvisor#ConflictException":
697
+ throw await de_ConflictExceptionRes(parsedOutput, context);
698
+ case "InternalServerException":
699
+ case "com.amazonaws.trustedadvisor#InternalServerException":
700
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
701
+ case "ResourceNotFoundException":
702
+ case "com.amazonaws.trustedadvisor#ResourceNotFoundException":
703
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
704
+ case "ThrottlingException":
705
+ case "com.amazonaws.trustedadvisor#ThrottlingException":
706
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
707
+ case "ValidationException":
708
+ case "com.amazonaws.trustedadvisor#ValidationException":
709
+ throw await de_ValidationExceptionRes(parsedOutput, context);
710
+ default:
711
+ const parsedBody = parsedOutput.body;
712
+ return throwDefaultError({
713
+ output,
714
+ parsedBody,
715
+ errorCode,
716
+ });
717
+ }
718
+ };
719
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(TrustedAdvisorServiceException_1.TrustedAdvisorServiceException);
720
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
721
+ const contents = (0, smithy_client_1.map)({});
722
+ const data = parsedOutput.body;
723
+ const doc = (0, smithy_client_1.take)(data, {
724
+ message: smithy_client_1.expectString,
725
+ });
726
+ Object.assign(contents, doc);
727
+ const exception = new models_0_1.AccessDeniedException({
728
+ $metadata: deserializeMetadata(parsedOutput),
729
+ ...contents,
730
+ });
731
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
732
+ };
733
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
734
+ const contents = (0, smithy_client_1.map)({});
735
+ const data = parsedOutput.body;
736
+ const doc = (0, smithy_client_1.take)(data, {
737
+ message: smithy_client_1.expectString,
738
+ });
739
+ Object.assign(contents, doc);
740
+ const exception = new models_0_1.ConflictException({
741
+ $metadata: deserializeMetadata(parsedOutput),
742
+ ...contents,
743
+ });
744
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
745
+ };
746
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
747
+ const contents = (0, smithy_client_1.map)({});
748
+ const data = parsedOutput.body;
749
+ const doc = (0, smithy_client_1.take)(data, {
750
+ message: smithy_client_1.expectString,
751
+ });
752
+ Object.assign(contents, doc);
753
+ const exception = new models_0_1.InternalServerException({
754
+ $metadata: deserializeMetadata(parsedOutput),
755
+ ...contents,
756
+ });
757
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
758
+ };
759
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
760
+ const contents = (0, smithy_client_1.map)({});
761
+ const data = parsedOutput.body;
762
+ const doc = (0, smithy_client_1.take)(data, {
763
+ message: smithy_client_1.expectString,
764
+ });
765
+ Object.assign(contents, doc);
766
+ const exception = new models_0_1.ResourceNotFoundException({
767
+ $metadata: deserializeMetadata(parsedOutput),
768
+ ...contents,
769
+ });
770
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
771
+ };
772
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
773
+ const contents = (0, smithy_client_1.map)({});
774
+ const data = parsedOutput.body;
775
+ const doc = (0, smithy_client_1.take)(data, {
776
+ message: smithy_client_1.expectString,
777
+ });
778
+ Object.assign(contents, doc);
779
+ const exception = new models_0_1.ThrottlingException({
780
+ $metadata: deserializeMetadata(parsedOutput),
781
+ ...contents,
782
+ });
783
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
784
+ };
785
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
786
+ const contents = (0, smithy_client_1.map)({});
787
+ const data = parsedOutput.body;
788
+ const doc = (0, smithy_client_1.take)(data, {
789
+ message: smithy_client_1.expectString,
790
+ });
791
+ Object.assign(contents, doc);
792
+ const exception = new models_0_1.ValidationException({
793
+ $metadata: deserializeMetadata(parsedOutput),
794
+ ...contents,
795
+ });
796
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
797
+ };
798
+ const de_AccountRecommendationLifecycleSummary = (output, context) => {
799
+ return (0, smithy_client_1.take)(output, {
800
+ accountId: smithy_client_1.expectString,
801
+ accountRecommendationArn: smithy_client_1.expectString,
802
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
803
+ lifecycleStage: smithy_client_1.expectString,
804
+ updateReason: smithy_client_1.expectString,
805
+ updateReasonCode: smithy_client_1.expectString,
806
+ updatedOnBehalfOf: smithy_client_1.expectString,
807
+ updatedOnBehalfOfJobTitle: smithy_client_1.expectString,
808
+ });
809
+ };
810
+ const de_AccountRecommendationLifecycleSummaryList = (output, context) => {
811
+ const retVal = (output || [])
812
+ .filter((e) => e != null)
813
+ .map((entry) => {
814
+ return de_AccountRecommendationLifecycleSummary(entry, context);
815
+ });
816
+ return retVal;
817
+ };
818
+ const de_OrganizationRecommendation = (output, context) => {
819
+ return (0, smithy_client_1.take)(output, {
820
+ arn: smithy_client_1.expectString,
821
+ awsServices: smithy_client_1._json,
822
+ checkArn: smithy_client_1.expectString,
823
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
824
+ createdBy: smithy_client_1.expectString,
825
+ description: smithy_client_1.expectString,
826
+ id: smithy_client_1.expectString,
827
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
828
+ lifecycleStage: smithy_client_1.expectString,
829
+ name: smithy_client_1.expectString,
830
+ pillarSpecificAggregates: (_) => de_RecommendationPillarSpecificAggregates(_, context),
831
+ pillars: smithy_client_1._json,
832
+ resolvedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
833
+ resourcesAggregates: smithy_client_1._json,
834
+ source: smithy_client_1.expectString,
835
+ status: smithy_client_1.expectString,
836
+ type: smithy_client_1.expectString,
837
+ updateReason: smithy_client_1.expectString,
838
+ updateReasonCode: smithy_client_1.expectString,
839
+ updatedOnBehalfOf: smithy_client_1.expectString,
840
+ updatedOnBehalfOfJobTitle: smithy_client_1.expectString,
841
+ });
842
+ };
843
+ const de_OrganizationRecommendationResourceSummary = (output, context) => {
844
+ return (0, smithy_client_1.take)(output, {
845
+ accountId: smithy_client_1.expectString,
846
+ arn: smithy_client_1.expectString,
847
+ awsResourceId: smithy_client_1.expectString,
848
+ id: smithy_client_1.expectString,
849
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
850
+ metadata: smithy_client_1._json,
851
+ recommendationArn: smithy_client_1.expectString,
852
+ regionCode: smithy_client_1.expectString,
853
+ status: smithy_client_1.expectString,
854
+ });
855
+ };
856
+ const de_OrganizationRecommendationResourceSummaryList = (output, context) => {
857
+ const retVal = (output || [])
858
+ .filter((e) => e != null)
859
+ .map((entry) => {
860
+ return de_OrganizationRecommendationResourceSummary(entry, context);
861
+ });
862
+ return retVal;
863
+ };
864
+ const de_OrganizationRecommendationSummary = (output, context) => {
865
+ return (0, smithy_client_1.take)(output, {
866
+ arn: smithy_client_1.expectString,
867
+ awsServices: smithy_client_1._json,
868
+ checkArn: smithy_client_1.expectString,
869
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
870
+ id: smithy_client_1.expectString,
871
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
872
+ lifecycleStage: smithy_client_1.expectString,
873
+ name: smithy_client_1.expectString,
874
+ pillarSpecificAggregates: (_) => de_RecommendationPillarSpecificAggregates(_, context),
875
+ pillars: smithy_client_1._json,
876
+ resourcesAggregates: smithy_client_1._json,
877
+ source: smithy_client_1.expectString,
878
+ status: smithy_client_1.expectString,
879
+ type: smithy_client_1.expectString,
880
+ });
881
+ };
882
+ const de_OrganizationRecommendationSummaryList = (output, context) => {
883
+ const retVal = (output || [])
884
+ .filter((e) => e != null)
885
+ .map((entry) => {
886
+ return de_OrganizationRecommendationSummary(entry, context);
887
+ });
888
+ return retVal;
889
+ };
890
+ const de_Recommendation = (output, context) => {
891
+ return (0, smithy_client_1.take)(output, {
892
+ arn: smithy_client_1.expectString,
893
+ awsServices: smithy_client_1._json,
894
+ checkArn: smithy_client_1.expectString,
895
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
896
+ createdBy: smithy_client_1.expectString,
897
+ description: smithy_client_1.expectString,
898
+ id: smithy_client_1.expectString,
899
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
900
+ lifecycleStage: smithy_client_1.expectString,
901
+ name: smithy_client_1.expectString,
902
+ pillarSpecificAggregates: (_) => de_RecommendationPillarSpecificAggregates(_, context),
903
+ pillars: smithy_client_1._json,
904
+ resolvedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
905
+ resourcesAggregates: smithy_client_1._json,
906
+ source: smithy_client_1.expectString,
907
+ status: smithy_client_1.expectString,
908
+ type: smithy_client_1.expectString,
909
+ updateReason: smithy_client_1.expectString,
910
+ updateReasonCode: smithy_client_1.expectString,
911
+ updatedOnBehalfOf: smithy_client_1.expectString,
912
+ updatedOnBehalfOfJobTitle: smithy_client_1.expectString,
913
+ });
914
+ };
915
+ const de_RecommendationCostOptimizingAggregates = (output, context) => {
916
+ return (0, smithy_client_1.take)(output, {
917
+ estimatedMonthlySavings: smithy_client_1.limitedParseDouble,
918
+ estimatedPercentMonthlySavings: smithy_client_1.limitedParseDouble,
919
+ });
920
+ };
921
+ const de_RecommendationPillarSpecificAggregates = (output, context) => {
922
+ return (0, smithy_client_1.take)(output, {
923
+ costOptimizing: (_) => de_RecommendationCostOptimizingAggregates(_, context),
924
+ });
925
+ };
926
+ const de_RecommendationResourceSummary = (output, context) => {
927
+ return (0, smithy_client_1.take)(output, {
928
+ arn: smithy_client_1.expectString,
929
+ awsResourceId: smithy_client_1.expectString,
930
+ id: smithy_client_1.expectString,
931
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
932
+ metadata: smithy_client_1._json,
933
+ recommendationArn: smithy_client_1.expectString,
934
+ regionCode: smithy_client_1.expectString,
935
+ status: smithy_client_1.expectString,
936
+ });
937
+ };
938
+ const de_RecommendationResourceSummaryList = (output, context) => {
939
+ const retVal = (output || [])
940
+ .filter((e) => e != null)
941
+ .map((entry) => {
942
+ return de_RecommendationResourceSummary(entry, context);
943
+ });
944
+ return retVal;
945
+ };
946
+ const de_RecommendationSummary = (output, context) => {
947
+ return (0, smithy_client_1.take)(output, {
948
+ arn: smithy_client_1.expectString,
949
+ awsServices: smithy_client_1._json,
950
+ checkArn: smithy_client_1.expectString,
951
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
952
+ id: smithy_client_1.expectString,
953
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
954
+ lifecycleStage: smithy_client_1.expectString,
955
+ name: smithy_client_1.expectString,
956
+ pillarSpecificAggregates: (_) => de_RecommendationPillarSpecificAggregates(_, context),
957
+ pillars: smithy_client_1._json,
958
+ resourcesAggregates: smithy_client_1._json,
959
+ source: smithy_client_1.expectString,
960
+ status: smithy_client_1.expectString,
961
+ type: smithy_client_1.expectString,
962
+ });
963
+ };
964
+ const de_RecommendationSummaryList = (output, context) => {
965
+ const retVal = (output || [])
966
+ .filter((e) => e != null)
967
+ .map((entry) => {
968
+ return de_RecommendationSummary(entry, context);
969
+ });
970
+ return retVal;
971
+ };
972
+ const deserializeMetadata = (output) => ({
973
+ httpStatusCode: output.statusCode,
974
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
975
+ extendedRequestId: output.headers["x-amz-id-2"],
976
+ cfId: output.headers["x-amz-cf-id"],
977
+ });
978
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
979
+ const isSerializableHeaderValue = (value) => value !== undefined &&
980
+ value !== null &&
981
+ value !== "" &&
982
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
983
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
984
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
985
+ if (encoded.length) {
986
+ return JSON.parse(encoded);
987
+ }
988
+ return {};
989
+ });
990
+ const parseErrorBody = async (errorBody, context) => {
991
+ const value = await parseBody(errorBody, context);
992
+ value.message = value.message ?? value.Message;
993
+ return value;
994
+ };
995
+ const loadRestJsonErrorCode = (output, data) => {
996
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
997
+ const sanitizeErrorCode = (rawValue) => {
998
+ let cleanValue = rawValue;
999
+ if (typeof cleanValue === "number") {
1000
+ cleanValue = cleanValue.toString();
1001
+ }
1002
+ if (cleanValue.indexOf(",") >= 0) {
1003
+ cleanValue = cleanValue.split(",")[0];
1004
+ }
1005
+ if (cleanValue.indexOf(":") >= 0) {
1006
+ cleanValue = cleanValue.split(":")[0];
1007
+ }
1008
+ if (cleanValue.indexOf("#") >= 0) {
1009
+ cleanValue = cleanValue.split("#")[1];
1010
+ }
1011
+ return cleanValue;
1012
+ };
1013
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1014
+ if (headerKey !== undefined) {
1015
+ return sanitizeErrorCode(output.headers[headerKey]);
1016
+ }
1017
+ if (data.code !== undefined) {
1018
+ return sanitizeErrorCode(data.code);
1019
+ }
1020
+ if (data["__type"] !== undefined) {
1021
+ return sanitizeErrorCode(data["__type"]);
1022
+ }
1023
+ };