@aws-sdk/client-resource-explorer-2 3.206.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 (163) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +241 -0
  3. package/dist-cjs/ResourceExplorer2.js +292 -0
  4. package/dist-cjs/ResourceExplorer2Client.js +40 -0
  5. package/dist-cjs/commands/AssociateDefaultViewCommand.js +45 -0
  6. package/dist-cjs/commands/BatchGetViewCommand.js +45 -0
  7. package/dist-cjs/commands/CreateIndexCommand.js +45 -0
  8. package/dist-cjs/commands/CreateViewCommand.js +45 -0
  9. package/dist-cjs/commands/DeleteIndexCommand.js +45 -0
  10. package/dist-cjs/commands/DeleteViewCommand.js +45 -0
  11. package/dist-cjs/commands/DisassociateDefaultViewCommand.js +44 -0
  12. package/dist-cjs/commands/GetDefaultViewCommand.js +45 -0
  13. package/dist-cjs/commands/GetIndexCommand.js +45 -0
  14. package/dist-cjs/commands/GetViewCommand.js +45 -0
  15. package/dist-cjs/commands/ListIndexesCommand.js +45 -0
  16. package/dist-cjs/commands/ListSupportedResourceTypesCommand.js +45 -0
  17. package/dist-cjs/commands/ListTagsForResourceCommand.js +45 -0
  18. package/dist-cjs/commands/ListViewsCommand.js +45 -0
  19. package/dist-cjs/commands/SearchCommand.js +45 -0
  20. package/dist-cjs/commands/TagResourceCommand.js +45 -0
  21. package/dist-cjs/commands/UntagResourceCommand.js +45 -0
  22. package/dist-cjs/commands/UpdateIndexTypeCommand.js +45 -0
  23. package/dist-cjs/commands/UpdateViewCommand.js +45 -0
  24. package/dist-cjs/commands/index.js +22 -0
  25. package/dist-cjs/endpoint/EndpointParameters.js +11 -0
  26. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  27. package/dist-cjs/endpoint/ruleset.js +251 -0
  28. package/dist-cjs/index.js +11 -0
  29. package/dist-cjs/models/ResourceExplorer2ServiceException.js +11 -0
  30. package/dist-cjs/models/index.js +4 -0
  31. package/dist-cjs/models/models_0.js +318 -0
  32. package/dist-cjs/pagination/Interfaces.js +2 -0
  33. package/dist-cjs/pagination/ListIndexesPaginator.js +36 -0
  34. package/dist-cjs/pagination/ListSupportedResourceTypesPaginator.js +36 -0
  35. package/dist-cjs/pagination/ListViewsPaginator.js +36 -0
  36. package/dist-cjs/pagination/SearchPaginator.js +36 -0
  37. package/dist-cjs/pagination/index.js +8 -0
  38. package/dist-cjs/protocols/Aws_restJson1.js +1771 -0
  39. package/dist-cjs/runtimeConfig.browser.js +42 -0
  40. package/dist-cjs/runtimeConfig.js +50 -0
  41. package/dist-cjs/runtimeConfig.native.js +15 -0
  42. package/dist-cjs/runtimeConfig.shared.js +17 -0
  43. package/dist-es/ResourceExplorer2.js +288 -0
  44. package/dist-es/ResourceExplorer2Client.js +36 -0
  45. package/dist-es/commands/AssociateDefaultViewCommand.js +41 -0
  46. package/dist-es/commands/BatchGetViewCommand.js +41 -0
  47. package/dist-es/commands/CreateIndexCommand.js +41 -0
  48. package/dist-es/commands/CreateViewCommand.js +41 -0
  49. package/dist-es/commands/DeleteIndexCommand.js +41 -0
  50. package/dist-es/commands/DeleteViewCommand.js +41 -0
  51. package/dist-es/commands/DisassociateDefaultViewCommand.js +40 -0
  52. package/dist-es/commands/GetDefaultViewCommand.js +41 -0
  53. package/dist-es/commands/GetIndexCommand.js +41 -0
  54. package/dist-es/commands/GetViewCommand.js +41 -0
  55. package/dist-es/commands/ListIndexesCommand.js +41 -0
  56. package/dist-es/commands/ListSupportedResourceTypesCommand.js +41 -0
  57. package/dist-es/commands/ListTagsForResourceCommand.js +41 -0
  58. package/dist-es/commands/ListViewsCommand.js +41 -0
  59. package/dist-es/commands/SearchCommand.js +41 -0
  60. package/dist-es/commands/TagResourceCommand.js +41 -0
  61. package/dist-es/commands/UntagResourceCommand.js +41 -0
  62. package/dist-es/commands/UpdateIndexTypeCommand.js +41 -0
  63. package/dist-es/commands/UpdateViewCommand.js +41 -0
  64. package/dist-es/commands/index.js +19 -0
  65. package/dist-es/endpoint/EndpointParameters.js +7 -0
  66. package/dist-es/endpoint/endpointResolver.js +8 -0
  67. package/dist-es/endpoint/ruleset.js +248 -0
  68. package/dist-es/index.js +6 -0
  69. package/dist-es/models/ResourceExplorer2ServiceException.js +7 -0
  70. package/dist-es/models/index.js +1 -0
  71. package/dist-es/models/models_0.js +262 -0
  72. package/dist-es/pagination/Interfaces.js +1 -0
  73. package/dist-es/pagination/ListIndexesPaginator.js +32 -0
  74. package/dist-es/pagination/ListSupportedResourceTypesPaginator.js +32 -0
  75. package/dist-es/pagination/ListViewsPaginator.js +32 -0
  76. package/dist-es/pagination/SearchPaginator.js +32 -0
  77. package/dist-es/pagination/index.js +5 -0
  78. package/dist-es/protocols/Aws_restJson1.js +1730 -0
  79. package/dist-es/runtimeConfig.browser.js +37 -0
  80. package/dist-es/runtimeConfig.js +45 -0
  81. package/dist-es/runtimeConfig.native.js +11 -0
  82. package/dist-es/runtimeConfig.shared.js +13 -0
  83. package/dist-types/ResourceExplorer2.d.ts +336 -0
  84. package/dist-types/ResourceExplorer2Client.d.ts +196 -0
  85. package/dist-types/commands/AssociateDefaultViewCommand.d.ts +43 -0
  86. package/dist-types/commands/BatchGetViewCommand.d.ts +37 -0
  87. package/dist-types/commands/CreateIndexCommand.d.ts +90 -0
  88. package/dist-types/commands/CreateViewCommand.d.ts +44 -0
  89. package/dist-types/commands/DeleteIndexCommand.d.ts +42 -0
  90. package/dist-types/commands/DeleteViewCommand.d.ts +40 -0
  91. package/dist-types/commands/DisassociateDefaultViewCommand.d.ts +41 -0
  92. package/dist-types/commands/GetDefaultViewCommand.d.ts +38 -0
  93. package/dist-types/commands/GetIndexCommand.d.ts +38 -0
  94. package/dist-types/commands/GetViewCommand.d.ts +37 -0
  95. package/dist-types/commands/ListIndexesCommand.d.ts +38 -0
  96. package/dist-types/commands/ListSupportedResourceTypesCommand.d.ts +37 -0
  97. package/dist-types/commands/ListTagsForResourceCommand.d.ts +37 -0
  98. package/dist-types/commands/ListViewsCommand.d.ts +46 -0
  99. package/dist-types/commands/SearchCommand.d.ts +49 -0
  100. package/dist-types/commands/TagResourceCommand.d.ts +37 -0
  101. package/dist-types/commands/UntagResourceCommand.d.ts +37 -0
  102. package/dist-types/commands/UpdateIndexTypeCommand.d.ts +93 -0
  103. package/dist-types/commands/UpdateViewCommand.d.ts +38 -0
  104. package/dist-types/commands/index.d.ts +19 -0
  105. package/dist-types/endpoint/EndpointParameters.d.ts +17 -0
  106. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  107. package/dist-types/endpoint/ruleset.d.ts +2 -0
  108. package/dist-types/index.d.ts +6 -0
  109. package/dist-types/models/ResourceExplorer2ServiceException.d.ts +10 -0
  110. package/dist-types/models/index.d.ts +1 -0
  111. package/dist-types/models/models_0.d.ts +1080 -0
  112. package/dist-types/pagination/Interfaces.d.ts +6 -0
  113. package/dist-types/pagination/ListIndexesPaginator.d.ts +4 -0
  114. package/dist-types/pagination/ListSupportedResourceTypesPaginator.d.ts +4 -0
  115. package/dist-types/pagination/ListViewsPaginator.d.ts +4 -0
  116. package/dist-types/pagination/SearchPaginator.d.ts +4 -0
  117. package/dist-types/pagination/index.d.ts +5 -0
  118. package/dist-types/protocols/Aws_restJson1.d.ts +59 -0
  119. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  120. package/dist-types/runtimeConfig.d.ts +42 -0
  121. package/dist-types/runtimeConfig.native.d.ts +41 -0
  122. package/dist-types/runtimeConfig.shared.d.ts +17 -0
  123. package/dist-types/ts3.4/ResourceExplorer2.d.ts +327 -0
  124. package/dist-types/ts3.4/ResourceExplorer2Client.d.ts +226 -0
  125. package/dist-types/ts3.4/commands/AssociateDefaultViewCommand.d.ts +41 -0
  126. package/dist-types/ts3.4/commands/BatchGetViewCommand.d.ts +34 -0
  127. package/dist-types/ts3.4/commands/CreateIndexCommand.d.ts +34 -0
  128. package/dist-types/ts3.4/commands/CreateViewCommand.d.ts +34 -0
  129. package/dist-types/ts3.4/commands/DeleteIndexCommand.d.ts +34 -0
  130. package/dist-types/ts3.4/commands/DeleteViewCommand.d.ts +34 -0
  131. package/dist-types/ts3.4/commands/DisassociateDefaultViewCommand.d.ts +35 -0
  132. package/dist-types/ts3.4/commands/GetDefaultViewCommand.d.ts +34 -0
  133. package/dist-types/ts3.4/commands/GetIndexCommand.d.ts +34 -0
  134. package/dist-types/ts3.4/commands/GetViewCommand.d.ts +32 -0
  135. package/dist-types/ts3.4/commands/ListIndexesCommand.d.ts +34 -0
  136. package/dist-types/ts3.4/commands/ListSupportedResourceTypesCommand.d.ts +41 -0
  137. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  138. package/dist-types/ts3.4/commands/ListViewsCommand.d.ts +34 -0
  139. package/dist-types/ts3.4/commands/SearchCommand.d.ts +32 -0
  140. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  141. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +34 -0
  142. package/dist-types/ts3.4/commands/UpdateIndexTypeCommand.d.ts +37 -0
  143. package/dist-types/ts3.4/commands/UpdateViewCommand.d.ts +34 -0
  144. package/dist-types/ts3.4/commands/index.d.ts +19 -0
  145. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +32 -0
  146. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  147. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  148. package/dist-types/ts3.4/index.d.ts +6 -0
  149. package/dist-types/ts3.4/models/ResourceExplorer2ServiceException.d.ts +7 -0
  150. package/dist-types/ts3.4/models/index.d.ts +1 -0
  151. package/dist-types/ts3.4/models/models_0.d.ts +384 -0
  152. package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
  153. package/dist-types/ts3.4/pagination/ListIndexesPaginator.d.ts +11 -0
  154. package/dist-types/ts3.4/pagination/ListSupportedResourceTypesPaginator.d.ts +11 -0
  155. package/dist-types/ts3.4/pagination/ListViewsPaginator.d.ts +11 -0
  156. package/dist-types/ts3.4/pagination/SearchPaginator.d.ts +11 -0
  157. package/dist-types/ts3.4/pagination/index.d.ts +5 -0
  158. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +233 -0
  159. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +88 -0
  160. package/dist-types/ts3.4/runtimeConfig.d.ts +88 -0
  161. package/dist-types/ts3.4/runtimeConfig.native.d.ts +77 -0
  162. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  163. package/package.json +105 -0
@@ -0,0 +1,1771 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1UpdateViewCommand = exports.deserializeAws_restJson1UpdateIndexTypeCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1SearchCommand = exports.deserializeAws_restJson1ListViewsCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListSupportedResourceTypesCommand = exports.deserializeAws_restJson1ListIndexesCommand = exports.deserializeAws_restJson1GetViewCommand = exports.deserializeAws_restJson1GetIndexCommand = exports.deserializeAws_restJson1GetDefaultViewCommand = exports.deserializeAws_restJson1DisassociateDefaultViewCommand = exports.deserializeAws_restJson1DeleteViewCommand = exports.deserializeAws_restJson1DeleteIndexCommand = exports.deserializeAws_restJson1CreateViewCommand = exports.deserializeAws_restJson1CreateIndexCommand = exports.deserializeAws_restJson1BatchGetViewCommand = exports.deserializeAws_restJson1AssociateDefaultViewCommand = exports.serializeAws_restJson1UpdateViewCommand = exports.serializeAws_restJson1UpdateIndexTypeCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1SearchCommand = exports.serializeAws_restJson1ListViewsCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListSupportedResourceTypesCommand = exports.serializeAws_restJson1ListIndexesCommand = exports.serializeAws_restJson1GetViewCommand = exports.serializeAws_restJson1GetIndexCommand = exports.serializeAws_restJson1GetDefaultViewCommand = exports.serializeAws_restJson1DisassociateDefaultViewCommand = exports.serializeAws_restJson1DeleteViewCommand = exports.serializeAws_restJson1DeleteIndexCommand = exports.serializeAws_restJson1CreateViewCommand = exports.serializeAws_restJson1CreateIndexCommand = exports.serializeAws_restJson1BatchGetViewCommand = exports.serializeAws_restJson1AssociateDefaultViewCommand = void 0;
4
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const uuid_1 = require("uuid");
7
+ const models_0_1 = require("../models/models_0");
8
+ const ResourceExplorer2ServiceException_1 = require("../models/ResourceExplorer2ServiceException");
9
+ const serializeAws_restJson1AssociateDefaultViewCommand = async (input, context) => {
10
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
11
+ const headers = {
12
+ "content-type": "application/json",
13
+ };
14
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/AssociateDefaultView";
15
+ let body;
16
+ body = JSON.stringify({
17
+ ...(input.ViewArn != null && { ViewArn: input.ViewArn }),
18
+ });
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ exports.serializeAws_restJson1AssociateDefaultViewCommand = serializeAws_restJson1AssociateDefaultViewCommand;
30
+ const serializeAws_restJson1BatchGetViewCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {
33
+ "content-type": "application/json",
34
+ };
35
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchGetView";
36
+ let body;
37
+ body = JSON.stringify({
38
+ ...(input.ViewArns != null && { ViewArns: serializeAws_restJson1ViewArnList(input.ViewArns, context) }),
39
+ });
40
+ return new protocol_http_1.HttpRequest({
41
+ protocol,
42
+ hostname,
43
+ port,
44
+ method: "POST",
45
+ headers,
46
+ path: resolvedPath,
47
+ body,
48
+ });
49
+ };
50
+ exports.serializeAws_restJson1BatchGetViewCommand = serializeAws_restJson1BatchGetViewCommand;
51
+ const serializeAws_restJson1CreateIndexCommand = async (input, context) => {
52
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
53
+ const headers = {
54
+ "content-type": "application/json",
55
+ };
56
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateIndex";
57
+ let body;
58
+ body = JSON.stringify({
59
+ ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
60
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
61
+ });
62
+ return new protocol_http_1.HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "POST",
67
+ headers,
68
+ path: resolvedPath,
69
+ body,
70
+ });
71
+ };
72
+ exports.serializeAws_restJson1CreateIndexCommand = serializeAws_restJson1CreateIndexCommand;
73
+ const serializeAws_restJson1CreateViewCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {
76
+ "content-type": "application/json",
77
+ };
78
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateView";
79
+ let body;
80
+ body = JSON.stringify({
81
+ ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
82
+ ...(input.Filters != null && { Filters: serializeAws_restJson1SearchFilter(input.Filters, context) }),
83
+ ...(input.IncludedProperties != null && {
84
+ IncludedProperties: serializeAws_restJson1IncludedPropertyList(input.IncludedProperties, context),
85
+ }),
86
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
87
+ ...(input.ViewName != null && { ViewName: input.ViewName }),
88
+ });
89
+ return new protocol_http_1.HttpRequest({
90
+ protocol,
91
+ hostname,
92
+ port,
93
+ method: "POST",
94
+ headers,
95
+ path: resolvedPath,
96
+ body,
97
+ });
98
+ };
99
+ exports.serializeAws_restJson1CreateViewCommand = serializeAws_restJson1CreateViewCommand;
100
+ const serializeAws_restJson1DeleteIndexCommand = async (input, context) => {
101
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
102
+ const headers = {
103
+ "content-type": "application/json",
104
+ };
105
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteIndex";
106
+ let body;
107
+ body = JSON.stringify({
108
+ ...(input.Arn != null && { Arn: input.Arn }),
109
+ });
110
+ return new protocol_http_1.HttpRequest({
111
+ protocol,
112
+ hostname,
113
+ port,
114
+ method: "POST",
115
+ headers,
116
+ path: resolvedPath,
117
+ body,
118
+ });
119
+ };
120
+ exports.serializeAws_restJson1DeleteIndexCommand = serializeAws_restJson1DeleteIndexCommand;
121
+ const serializeAws_restJson1DeleteViewCommand = async (input, context) => {
122
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
+ const headers = {
124
+ "content-type": "application/json",
125
+ };
126
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteView";
127
+ let body;
128
+ body = JSON.stringify({
129
+ ...(input.ViewArn != null && { ViewArn: input.ViewArn }),
130
+ });
131
+ return new protocol_http_1.HttpRequest({
132
+ protocol,
133
+ hostname,
134
+ port,
135
+ method: "POST",
136
+ headers,
137
+ path: resolvedPath,
138
+ body,
139
+ });
140
+ };
141
+ exports.serializeAws_restJson1DeleteViewCommand = serializeAws_restJson1DeleteViewCommand;
142
+ const serializeAws_restJson1DisassociateDefaultViewCommand = async (input, context) => {
143
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
144
+ const headers = {
145
+ "content-type": "application/json",
146
+ };
147
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DisassociateDefaultView";
148
+ let body;
149
+ body = "";
150
+ return new protocol_http_1.HttpRequest({
151
+ protocol,
152
+ hostname,
153
+ port,
154
+ method: "POST",
155
+ headers,
156
+ path: resolvedPath,
157
+ body,
158
+ });
159
+ };
160
+ exports.serializeAws_restJson1DisassociateDefaultViewCommand = serializeAws_restJson1DisassociateDefaultViewCommand;
161
+ const serializeAws_restJson1GetDefaultViewCommand = async (input, context) => {
162
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
163
+ const headers = {
164
+ "content-type": "application/json",
165
+ };
166
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetDefaultView";
167
+ let body;
168
+ body = "";
169
+ return new protocol_http_1.HttpRequest({
170
+ protocol,
171
+ hostname,
172
+ port,
173
+ method: "POST",
174
+ headers,
175
+ path: resolvedPath,
176
+ body,
177
+ });
178
+ };
179
+ exports.serializeAws_restJson1GetDefaultViewCommand = serializeAws_restJson1GetDefaultViewCommand;
180
+ const serializeAws_restJson1GetIndexCommand = async (input, context) => {
181
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
182
+ const headers = {
183
+ "content-type": "application/json",
184
+ };
185
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetIndex";
186
+ let body;
187
+ body = "";
188
+ return new protocol_http_1.HttpRequest({
189
+ protocol,
190
+ hostname,
191
+ port,
192
+ method: "POST",
193
+ headers,
194
+ path: resolvedPath,
195
+ body,
196
+ });
197
+ };
198
+ exports.serializeAws_restJson1GetIndexCommand = serializeAws_restJson1GetIndexCommand;
199
+ const serializeAws_restJson1GetViewCommand = async (input, context) => {
200
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
201
+ const headers = {
202
+ "content-type": "application/json",
203
+ };
204
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetView";
205
+ let body;
206
+ body = JSON.stringify({
207
+ ...(input.ViewArn != null && { ViewArn: input.ViewArn }),
208
+ });
209
+ return new protocol_http_1.HttpRequest({
210
+ protocol,
211
+ hostname,
212
+ port,
213
+ method: "POST",
214
+ headers,
215
+ path: resolvedPath,
216
+ body,
217
+ });
218
+ };
219
+ exports.serializeAws_restJson1GetViewCommand = serializeAws_restJson1GetViewCommand;
220
+ const serializeAws_restJson1ListIndexesCommand = async (input, context) => {
221
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
222
+ const headers = {
223
+ "content-type": "application/json",
224
+ };
225
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListIndexes";
226
+ let body;
227
+ body = JSON.stringify({
228
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
229
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
230
+ ...(input.Regions != null && { Regions: serializeAws_restJson1RegionList(input.Regions, context) }),
231
+ ...(input.Type != null && { Type: input.Type }),
232
+ });
233
+ return new protocol_http_1.HttpRequest({
234
+ protocol,
235
+ hostname,
236
+ port,
237
+ method: "POST",
238
+ headers,
239
+ path: resolvedPath,
240
+ body,
241
+ });
242
+ };
243
+ exports.serializeAws_restJson1ListIndexesCommand = serializeAws_restJson1ListIndexesCommand;
244
+ const serializeAws_restJson1ListSupportedResourceTypesCommand = async (input, context) => {
245
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
+ const headers = {
247
+ "content-type": "application/json",
248
+ };
249
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListSupportedResourceTypes";
250
+ let body;
251
+ body = JSON.stringify({
252
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
253
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
254
+ });
255
+ return new protocol_http_1.HttpRequest({
256
+ protocol,
257
+ hostname,
258
+ port,
259
+ method: "POST",
260
+ headers,
261
+ path: resolvedPath,
262
+ body,
263
+ });
264
+ };
265
+ exports.serializeAws_restJson1ListSupportedResourceTypesCommand = serializeAws_restJson1ListSupportedResourceTypesCommand;
266
+ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
267
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
268
+ const headers = {};
269
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
270
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
271
+ let body;
272
+ return new protocol_http_1.HttpRequest({
273
+ protocol,
274
+ hostname,
275
+ port,
276
+ method: "GET",
277
+ headers,
278
+ path: resolvedPath,
279
+ body,
280
+ });
281
+ };
282
+ exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
283
+ const serializeAws_restJson1ListViewsCommand = async (input, context) => {
284
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
285
+ const headers = {
286
+ "content-type": "application/json",
287
+ };
288
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListViews";
289
+ let body;
290
+ body = JSON.stringify({
291
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
292
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
293
+ });
294
+ return new protocol_http_1.HttpRequest({
295
+ protocol,
296
+ hostname,
297
+ port,
298
+ method: "POST",
299
+ headers,
300
+ path: resolvedPath,
301
+ body,
302
+ });
303
+ };
304
+ exports.serializeAws_restJson1ListViewsCommand = serializeAws_restJson1ListViewsCommand;
305
+ const serializeAws_restJson1SearchCommand = async (input, context) => {
306
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
307
+ const headers = {
308
+ "content-type": "application/json",
309
+ };
310
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/Search";
311
+ let body;
312
+ body = JSON.stringify({
313
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
314
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
315
+ ...(input.QueryString != null && { QueryString: input.QueryString }),
316
+ ...(input.ViewArn != null && { ViewArn: input.ViewArn }),
317
+ });
318
+ return new protocol_http_1.HttpRequest({
319
+ protocol,
320
+ hostname,
321
+ port,
322
+ method: "POST",
323
+ headers,
324
+ path: resolvedPath,
325
+ body,
326
+ });
327
+ };
328
+ exports.serializeAws_restJson1SearchCommand = serializeAws_restJson1SearchCommand;
329
+ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
330
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
331
+ const headers = {
332
+ "content-type": "application/json",
333
+ };
334
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
335
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
336
+ let body;
337
+ body = JSON.stringify({
338
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
339
+ });
340
+ return new protocol_http_1.HttpRequest({
341
+ protocol,
342
+ hostname,
343
+ port,
344
+ method: "POST",
345
+ headers,
346
+ path: resolvedPath,
347
+ body,
348
+ });
349
+ };
350
+ exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
351
+ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
352
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
353
+ const headers = {};
354
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
355
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
356
+ const query = map({
357
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
358
+ });
359
+ let body;
360
+ return new protocol_http_1.HttpRequest({
361
+ protocol,
362
+ hostname,
363
+ port,
364
+ method: "DELETE",
365
+ headers,
366
+ path: resolvedPath,
367
+ query,
368
+ body,
369
+ });
370
+ };
371
+ exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
372
+ const serializeAws_restJson1UpdateIndexTypeCommand = async (input, context) => {
373
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
374
+ const headers = {
375
+ "content-type": "application/json",
376
+ };
377
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateIndexType";
378
+ let body;
379
+ body = JSON.stringify({
380
+ ...(input.Arn != null && { Arn: input.Arn }),
381
+ ...(input.Type != null && { Type: input.Type }),
382
+ });
383
+ return new protocol_http_1.HttpRequest({
384
+ protocol,
385
+ hostname,
386
+ port,
387
+ method: "POST",
388
+ headers,
389
+ path: resolvedPath,
390
+ body,
391
+ });
392
+ };
393
+ exports.serializeAws_restJson1UpdateIndexTypeCommand = serializeAws_restJson1UpdateIndexTypeCommand;
394
+ const serializeAws_restJson1UpdateViewCommand = async (input, context) => {
395
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
396
+ const headers = {
397
+ "content-type": "application/json",
398
+ };
399
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateView";
400
+ let body;
401
+ body = JSON.stringify({
402
+ ...(input.Filters != null && { Filters: serializeAws_restJson1SearchFilter(input.Filters, context) }),
403
+ ...(input.IncludedProperties != null && {
404
+ IncludedProperties: serializeAws_restJson1IncludedPropertyList(input.IncludedProperties, context),
405
+ }),
406
+ ...(input.ViewArn != null && { ViewArn: input.ViewArn }),
407
+ });
408
+ return new protocol_http_1.HttpRequest({
409
+ protocol,
410
+ hostname,
411
+ port,
412
+ method: "POST",
413
+ headers,
414
+ path: resolvedPath,
415
+ body,
416
+ });
417
+ };
418
+ exports.serializeAws_restJson1UpdateViewCommand = serializeAws_restJson1UpdateViewCommand;
419
+ const deserializeAws_restJson1AssociateDefaultViewCommand = async (output, context) => {
420
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
421
+ return deserializeAws_restJson1AssociateDefaultViewCommandError(output, context);
422
+ }
423
+ const contents = map({
424
+ $metadata: deserializeMetadata(output),
425
+ });
426
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
427
+ if (data.ViewArn != null) {
428
+ contents.ViewArn = (0, smithy_client_1.expectString)(data.ViewArn);
429
+ }
430
+ return contents;
431
+ };
432
+ exports.deserializeAws_restJson1AssociateDefaultViewCommand = deserializeAws_restJson1AssociateDefaultViewCommand;
433
+ const deserializeAws_restJson1AssociateDefaultViewCommandError = async (output, context) => {
434
+ const parsedOutput = {
435
+ ...output,
436
+ body: await parseErrorBody(output.body, context),
437
+ };
438
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
+ switch (errorCode) {
440
+ case "AccessDeniedException":
441
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
442
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
443
+ case "InternalServerException":
444
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
445
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
446
+ case "ResourceNotFoundException":
447
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
448
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
449
+ case "ThrottlingException":
450
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
451
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
452
+ case "ValidationException":
453
+ case "com.amazonaws.resourceexplorer2#ValidationException":
454
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
455
+ default:
456
+ const parsedBody = parsedOutput.body;
457
+ (0, smithy_client_1.throwDefaultError)({
458
+ output,
459
+ parsedBody,
460
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
461
+ errorCode,
462
+ });
463
+ }
464
+ };
465
+ const deserializeAws_restJson1BatchGetViewCommand = async (output, context) => {
466
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
467
+ return deserializeAws_restJson1BatchGetViewCommandError(output, context);
468
+ }
469
+ const contents = map({
470
+ $metadata: deserializeMetadata(output),
471
+ });
472
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
473
+ if (data.Errors != null) {
474
+ contents.Errors = deserializeAws_restJson1BatchGetViewErrors(data.Errors, context);
475
+ }
476
+ if (data.Views != null) {
477
+ contents.Views = deserializeAws_restJson1ViewList(data.Views, context);
478
+ }
479
+ return contents;
480
+ };
481
+ exports.deserializeAws_restJson1BatchGetViewCommand = deserializeAws_restJson1BatchGetViewCommand;
482
+ const deserializeAws_restJson1BatchGetViewCommandError = async (output, context) => {
483
+ const parsedOutput = {
484
+ ...output,
485
+ body: await parseErrorBody(output.body, context),
486
+ };
487
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
488
+ switch (errorCode) {
489
+ case "AccessDeniedException":
490
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
491
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
492
+ case "InternalServerException":
493
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
494
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
495
+ case "ThrottlingException":
496
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
497
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
498
+ case "UnauthorizedException":
499
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
500
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
501
+ case "ValidationException":
502
+ case "com.amazonaws.resourceexplorer2#ValidationException":
503
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
504
+ default:
505
+ const parsedBody = parsedOutput.body;
506
+ (0, smithy_client_1.throwDefaultError)({
507
+ output,
508
+ parsedBody,
509
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
510
+ errorCode,
511
+ });
512
+ }
513
+ };
514
+ const deserializeAws_restJson1CreateIndexCommand = async (output, context) => {
515
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
516
+ return deserializeAws_restJson1CreateIndexCommandError(output, context);
517
+ }
518
+ const contents = map({
519
+ $metadata: deserializeMetadata(output),
520
+ });
521
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
522
+ if (data.Arn != null) {
523
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
524
+ }
525
+ if (data.CreatedAt != null) {
526
+ contents.CreatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreatedAt));
527
+ }
528
+ if (data.State != null) {
529
+ contents.State = (0, smithy_client_1.expectString)(data.State);
530
+ }
531
+ return contents;
532
+ };
533
+ exports.deserializeAws_restJson1CreateIndexCommand = deserializeAws_restJson1CreateIndexCommand;
534
+ const deserializeAws_restJson1CreateIndexCommandError = async (output, context) => {
535
+ const parsedOutput = {
536
+ ...output,
537
+ body: await parseErrorBody(output.body, context),
538
+ };
539
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
540
+ switch (errorCode) {
541
+ case "AccessDeniedException":
542
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
543
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
544
+ case "ConflictException":
545
+ case "com.amazonaws.resourceexplorer2#ConflictException":
546
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
547
+ case "InternalServerException":
548
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
549
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
550
+ case "ThrottlingException":
551
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
552
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
553
+ case "ValidationException":
554
+ case "com.amazonaws.resourceexplorer2#ValidationException":
555
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
556
+ default:
557
+ const parsedBody = parsedOutput.body;
558
+ (0, smithy_client_1.throwDefaultError)({
559
+ output,
560
+ parsedBody,
561
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
562
+ errorCode,
563
+ });
564
+ }
565
+ };
566
+ const deserializeAws_restJson1CreateViewCommand = async (output, context) => {
567
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
568
+ return deserializeAws_restJson1CreateViewCommandError(output, context);
569
+ }
570
+ const contents = map({
571
+ $metadata: deserializeMetadata(output),
572
+ });
573
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
574
+ if (data.View != null) {
575
+ contents.View = deserializeAws_restJson1View(data.View, context);
576
+ }
577
+ return contents;
578
+ };
579
+ exports.deserializeAws_restJson1CreateViewCommand = deserializeAws_restJson1CreateViewCommand;
580
+ const deserializeAws_restJson1CreateViewCommandError = async (output, context) => {
581
+ const parsedOutput = {
582
+ ...output,
583
+ body: await parseErrorBody(output.body, context),
584
+ };
585
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
586
+ switch (errorCode) {
587
+ case "AccessDeniedException":
588
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
589
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
590
+ case "ConflictException":
591
+ case "com.amazonaws.resourceexplorer2#ConflictException":
592
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
593
+ case "InternalServerException":
594
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
595
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
596
+ case "ServiceQuotaExceededException":
597
+ case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException":
598
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
599
+ case "ThrottlingException":
600
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
601
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
602
+ case "UnauthorizedException":
603
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
604
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
605
+ case "ValidationException":
606
+ case "com.amazonaws.resourceexplorer2#ValidationException":
607
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
608
+ default:
609
+ const parsedBody = parsedOutput.body;
610
+ (0, smithy_client_1.throwDefaultError)({
611
+ output,
612
+ parsedBody,
613
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
614
+ errorCode,
615
+ });
616
+ }
617
+ };
618
+ const deserializeAws_restJson1DeleteIndexCommand = async (output, context) => {
619
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
620
+ return deserializeAws_restJson1DeleteIndexCommandError(output, context);
621
+ }
622
+ const contents = map({
623
+ $metadata: deserializeMetadata(output),
624
+ });
625
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
626
+ if (data.Arn != null) {
627
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
628
+ }
629
+ if (data.LastUpdatedAt != null) {
630
+ contents.LastUpdatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.LastUpdatedAt));
631
+ }
632
+ if (data.State != null) {
633
+ contents.State = (0, smithy_client_1.expectString)(data.State);
634
+ }
635
+ return contents;
636
+ };
637
+ exports.deserializeAws_restJson1DeleteIndexCommand = deserializeAws_restJson1DeleteIndexCommand;
638
+ const deserializeAws_restJson1DeleteIndexCommandError = async (output, context) => {
639
+ const parsedOutput = {
640
+ ...output,
641
+ body: await parseErrorBody(output.body, context),
642
+ };
643
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
644
+ switch (errorCode) {
645
+ case "AccessDeniedException":
646
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
647
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
648
+ case "InternalServerException":
649
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
650
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
651
+ case "ResourceNotFoundException":
652
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
653
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
654
+ case "ThrottlingException":
655
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
656
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
657
+ case "ValidationException":
658
+ case "com.amazonaws.resourceexplorer2#ValidationException":
659
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
660
+ default:
661
+ const parsedBody = parsedOutput.body;
662
+ (0, smithy_client_1.throwDefaultError)({
663
+ output,
664
+ parsedBody,
665
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
666
+ errorCode,
667
+ });
668
+ }
669
+ };
670
+ const deserializeAws_restJson1DeleteViewCommand = async (output, context) => {
671
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
672
+ return deserializeAws_restJson1DeleteViewCommandError(output, context);
673
+ }
674
+ const contents = map({
675
+ $metadata: deserializeMetadata(output),
676
+ });
677
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
678
+ if (data.ViewArn != null) {
679
+ contents.ViewArn = (0, smithy_client_1.expectString)(data.ViewArn);
680
+ }
681
+ return contents;
682
+ };
683
+ exports.deserializeAws_restJson1DeleteViewCommand = deserializeAws_restJson1DeleteViewCommand;
684
+ const deserializeAws_restJson1DeleteViewCommandError = async (output, context) => {
685
+ const parsedOutput = {
686
+ ...output,
687
+ body: await parseErrorBody(output.body, context),
688
+ };
689
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
+ switch (errorCode) {
691
+ case "AccessDeniedException":
692
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
693
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
694
+ case "InternalServerException":
695
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
696
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
697
+ case "ResourceNotFoundException":
698
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
699
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
700
+ case "ThrottlingException":
701
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
702
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
703
+ case "UnauthorizedException":
704
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
705
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
706
+ case "ValidationException":
707
+ case "com.amazonaws.resourceexplorer2#ValidationException":
708
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
709
+ default:
710
+ const parsedBody = parsedOutput.body;
711
+ (0, smithy_client_1.throwDefaultError)({
712
+ output,
713
+ parsedBody,
714
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
715
+ errorCode,
716
+ });
717
+ }
718
+ };
719
+ const deserializeAws_restJson1DisassociateDefaultViewCommand = async (output, context) => {
720
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
721
+ return deserializeAws_restJson1DisassociateDefaultViewCommandError(output, context);
722
+ }
723
+ const contents = map({
724
+ $metadata: deserializeMetadata(output),
725
+ });
726
+ await collectBody(output.body, context);
727
+ return contents;
728
+ };
729
+ exports.deserializeAws_restJson1DisassociateDefaultViewCommand = deserializeAws_restJson1DisassociateDefaultViewCommand;
730
+ const deserializeAws_restJson1DisassociateDefaultViewCommandError = async (output, context) => {
731
+ const parsedOutput = {
732
+ ...output,
733
+ body: await parseErrorBody(output.body, context),
734
+ };
735
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
736
+ switch (errorCode) {
737
+ case "AccessDeniedException":
738
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
739
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
740
+ case "InternalServerException":
741
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
742
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
743
+ case "ThrottlingException":
744
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
745
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
746
+ case "ValidationException":
747
+ case "com.amazonaws.resourceexplorer2#ValidationException":
748
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
749
+ default:
750
+ const parsedBody = parsedOutput.body;
751
+ (0, smithy_client_1.throwDefaultError)({
752
+ output,
753
+ parsedBody,
754
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
755
+ errorCode,
756
+ });
757
+ }
758
+ };
759
+ const deserializeAws_restJson1GetDefaultViewCommand = async (output, context) => {
760
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
761
+ return deserializeAws_restJson1GetDefaultViewCommandError(output, context);
762
+ }
763
+ const contents = map({
764
+ $metadata: deserializeMetadata(output),
765
+ });
766
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
767
+ if (data.ViewArn != null) {
768
+ contents.ViewArn = (0, smithy_client_1.expectString)(data.ViewArn);
769
+ }
770
+ return contents;
771
+ };
772
+ exports.deserializeAws_restJson1GetDefaultViewCommand = deserializeAws_restJson1GetDefaultViewCommand;
773
+ const deserializeAws_restJson1GetDefaultViewCommandError = async (output, context) => {
774
+ const parsedOutput = {
775
+ ...output,
776
+ body: await parseErrorBody(output.body, context),
777
+ };
778
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
779
+ switch (errorCode) {
780
+ case "AccessDeniedException":
781
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
782
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
783
+ case "InternalServerException":
784
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
785
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
786
+ case "ResourceNotFoundException":
787
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
788
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
789
+ case "ThrottlingException":
790
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
791
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
792
+ case "ValidationException":
793
+ case "com.amazonaws.resourceexplorer2#ValidationException":
794
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
795
+ default:
796
+ const parsedBody = parsedOutput.body;
797
+ (0, smithy_client_1.throwDefaultError)({
798
+ output,
799
+ parsedBody,
800
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
801
+ errorCode,
802
+ });
803
+ }
804
+ };
805
+ const deserializeAws_restJson1GetIndexCommand = async (output, context) => {
806
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
807
+ return deserializeAws_restJson1GetIndexCommandError(output, context);
808
+ }
809
+ const contents = map({
810
+ $metadata: deserializeMetadata(output),
811
+ });
812
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
813
+ if (data.Arn != null) {
814
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
815
+ }
816
+ if (data.CreatedAt != null) {
817
+ contents.CreatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreatedAt));
818
+ }
819
+ if (data.LastUpdatedAt != null) {
820
+ contents.LastUpdatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.LastUpdatedAt));
821
+ }
822
+ if (data.ReplicatingFrom != null) {
823
+ contents.ReplicatingFrom = deserializeAws_restJson1RegionList(data.ReplicatingFrom, context);
824
+ }
825
+ if (data.ReplicatingTo != null) {
826
+ contents.ReplicatingTo = deserializeAws_restJson1RegionList(data.ReplicatingTo, context);
827
+ }
828
+ if (data.State != null) {
829
+ contents.State = (0, smithy_client_1.expectString)(data.State);
830
+ }
831
+ if (data.Tags != null) {
832
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
833
+ }
834
+ if (data.Type != null) {
835
+ contents.Type = (0, smithy_client_1.expectString)(data.Type);
836
+ }
837
+ return contents;
838
+ };
839
+ exports.deserializeAws_restJson1GetIndexCommand = deserializeAws_restJson1GetIndexCommand;
840
+ const deserializeAws_restJson1GetIndexCommandError = async (output, context) => {
841
+ const parsedOutput = {
842
+ ...output,
843
+ body: await parseErrorBody(output.body, context),
844
+ };
845
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
846
+ switch (errorCode) {
847
+ case "AccessDeniedException":
848
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
849
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
850
+ case "InternalServerException":
851
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
852
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
853
+ case "ResourceNotFoundException":
854
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
855
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
856
+ case "ThrottlingException":
857
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
858
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
859
+ case "ValidationException":
860
+ case "com.amazonaws.resourceexplorer2#ValidationException":
861
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
862
+ default:
863
+ const parsedBody = parsedOutput.body;
864
+ (0, smithy_client_1.throwDefaultError)({
865
+ output,
866
+ parsedBody,
867
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
868
+ errorCode,
869
+ });
870
+ }
871
+ };
872
+ const deserializeAws_restJson1GetViewCommand = async (output, context) => {
873
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
874
+ return deserializeAws_restJson1GetViewCommandError(output, context);
875
+ }
876
+ const contents = map({
877
+ $metadata: deserializeMetadata(output),
878
+ });
879
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
880
+ if (data.Tags != null) {
881
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
882
+ }
883
+ if (data.View != null) {
884
+ contents.View = deserializeAws_restJson1View(data.View, context);
885
+ }
886
+ return contents;
887
+ };
888
+ exports.deserializeAws_restJson1GetViewCommand = deserializeAws_restJson1GetViewCommand;
889
+ const deserializeAws_restJson1GetViewCommandError = async (output, context) => {
890
+ const parsedOutput = {
891
+ ...output,
892
+ body: await parseErrorBody(output.body, context),
893
+ };
894
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
895
+ switch (errorCode) {
896
+ case "AccessDeniedException":
897
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
898
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
899
+ case "InternalServerException":
900
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
901
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
902
+ case "ResourceNotFoundException":
903
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
904
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
905
+ case "ThrottlingException":
906
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
907
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
908
+ case "UnauthorizedException":
909
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
910
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
911
+ case "ValidationException":
912
+ case "com.amazonaws.resourceexplorer2#ValidationException":
913
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
914
+ default:
915
+ const parsedBody = parsedOutput.body;
916
+ (0, smithy_client_1.throwDefaultError)({
917
+ output,
918
+ parsedBody,
919
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
920
+ errorCode,
921
+ });
922
+ }
923
+ };
924
+ const deserializeAws_restJson1ListIndexesCommand = async (output, context) => {
925
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
926
+ return deserializeAws_restJson1ListIndexesCommandError(output, context);
927
+ }
928
+ const contents = map({
929
+ $metadata: deserializeMetadata(output),
930
+ });
931
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
932
+ if (data.Indexes != null) {
933
+ contents.Indexes = deserializeAws_restJson1IndexList(data.Indexes, context);
934
+ }
935
+ if (data.NextToken != null) {
936
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
937
+ }
938
+ return contents;
939
+ };
940
+ exports.deserializeAws_restJson1ListIndexesCommand = deserializeAws_restJson1ListIndexesCommand;
941
+ const deserializeAws_restJson1ListIndexesCommandError = async (output, context) => {
942
+ const parsedOutput = {
943
+ ...output,
944
+ body: await parseErrorBody(output.body, context),
945
+ };
946
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
947
+ switch (errorCode) {
948
+ case "AccessDeniedException":
949
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
950
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
951
+ case "InternalServerException":
952
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
953
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
954
+ case "ThrottlingException":
955
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
956
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
957
+ case "ValidationException":
958
+ case "com.amazonaws.resourceexplorer2#ValidationException":
959
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
960
+ default:
961
+ const parsedBody = parsedOutput.body;
962
+ (0, smithy_client_1.throwDefaultError)({
963
+ output,
964
+ parsedBody,
965
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
966
+ errorCode,
967
+ });
968
+ }
969
+ };
970
+ const deserializeAws_restJson1ListSupportedResourceTypesCommand = async (output, context) => {
971
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
972
+ return deserializeAws_restJson1ListSupportedResourceTypesCommandError(output, context);
973
+ }
974
+ const contents = map({
975
+ $metadata: deserializeMetadata(output),
976
+ });
977
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
978
+ if (data.NextToken != null) {
979
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
980
+ }
981
+ if (data.ResourceTypes != null) {
982
+ contents.ResourceTypes = deserializeAws_restJson1ResourceTypeList(data.ResourceTypes, context);
983
+ }
984
+ return contents;
985
+ };
986
+ exports.deserializeAws_restJson1ListSupportedResourceTypesCommand = deserializeAws_restJson1ListSupportedResourceTypesCommand;
987
+ const deserializeAws_restJson1ListSupportedResourceTypesCommandError = async (output, context) => {
988
+ const parsedOutput = {
989
+ ...output,
990
+ body: await parseErrorBody(output.body, context),
991
+ };
992
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
993
+ switch (errorCode) {
994
+ case "AccessDeniedException":
995
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
996
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
997
+ case "InternalServerException":
998
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
999
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1000
+ case "ThrottlingException":
1001
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1002
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1003
+ case "ValidationException":
1004
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1005
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1006
+ default:
1007
+ const parsedBody = parsedOutput.body;
1008
+ (0, smithy_client_1.throwDefaultError)({
1009
+ output,
1010
+ parsedBody,
1011
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1012
+ errorCode,
1013
+ });
1014
+ }
1015
+ };
1016
+ const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1017
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1018
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1019
+ }
1020
+ const contents = map({
1021
+ $metadata: deserializeMetadata(output),
1022
+ });
1023
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1024
+ if (data.Tags != null) {
1025
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1026
+ }
1027
+ return contents;
1028
+ };
1029
+ exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1030
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1031
+ const parsedOutput = {
1032
+ ...output,
1033
+ body: await parseErrorBody(output.body, context),
1034
+ };
1035
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1036
+ switch (errorCode) {
1037
+ case "AccessDeniedException":
1038
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1039
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1040
+ case "InternalServerException":
1041
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1042
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1043
+ case "ResourceNotFoundException":
1044
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
1045
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1046
+ case "ThrottlingException":
1047
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1048
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1049
+ case "UnauthorizedException":
1050
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
1051
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1052
+ case "ValidationException":
1053
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1054
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1055
+ default:
1056
+ const parsedBody = parsedOutput.body;
1057
+ (0, smithy_client_1.throwDefaultError)({
1058
+ output,
1059
+ parsedBody,
1060
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1061
+ errorCode,
1062
+ });
1063
+ }
1064
+ };
1065
+ const deserializeAws_restJson1ListViewsCommand = async (output, context) => {
1066
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1067
+ return deserializeAws_restJson1ListViewsCommandError(output, context);
1068
+ }
1069
+ const contents = map({
1070
+ $metadata: deserializeMetadata(output),
1071
+ });
1072
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1073
+ if (data.NextToken != null) {
1074
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1075
+ }
1076
+ if (data.Views != null) {
1077
+ contents.Views = deserializeAws_restJson1ViewArnList(data.Views, context);
1078
+ }
1079
+ return contents;
1080
+ };
1081
+ exports.deserializeAws_restJson1ListViewsCommand = deserializeAws_restJson1ListViewsCommand;
1082
+ const deserializeAws_restJson1ListViewsCommandError = async (output, context) => {
1083
+ const parsedOutput = {
1084
+ ...output,
1085
+ body: await parseErrorBody(output.body, context),
1086
+ };
1087
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1088
+ switch (errorCode) {
1089
+ case "AccessDeniedException":
1090
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1091
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1092
+ case "InternalServerException":
1093
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1094
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1095
+ case "ThrottlingException":
1096
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1097
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1098
+ case "ValidationException":
1099
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1100
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1101
+ default:
1102
+ const parsedBody = parsedOutput.body;
1103
+ (0, smithy_client_1.throwDefaultError)({
1104
+ output,
1105
+ parsedBody,
1106
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1107
+ errorCode,
1108
+ });
1109
+ }
1110
+ };
1111
+ const deserializeAws_restJson1SearchCommand = async (output, context) => {
1112
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1113
+ return deserializeAws_restJson1SearchCommandError(output, context);
1114
+ }
1115
+ const contents = map({
1116
+ $metadata: deserializeMetadata(output),
1117
+ });
1118
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1119
+ if (data.Count != null) {
1120
+ contents.Count = deserializeAws_restJson1ResourceCount(data.Count, context);
1121
+ }
1122
+ if (data.NextToken != null) {
1123
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1124
+ }
1125
+ if (data.Resources != null) {
1126
+ contents.Resources = deserializeAws_restJson1ResourceList(data.Resources, context);
1127
+ }
1128
+ if (data.ViewArn != null) {
1129
+ contents.ViewArn = (0, smithy_client_1.expectString)(data.ViewArn);
1130
+ }
1131
+ return contents;
1132
+ };
1133
+ exports.deserializeAws_restJson1SearchCommand = deserializeAws_restJson1SearchCommand;
1134
+ const deserializeAws_restJson1SearchCommandError = async (output, context) => {
1135
+ const parsedOutput = {
1136
+ ...output,
1137
+ body: await parseErrorBody(output.body, context),
1138
+ };
1139
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1140
+ switch (errorCode) {
1141
+ case "AccessDeniedException":
1142
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1143
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1144
+ case "InternalServerException":
1145
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1146
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1147
+ case "ResourceNotFoundException":
1148
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
1149
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1150
+ case "ThrottlingException":
1151
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1152
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1153
+ case "UnauthorizedException":
1154
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
1155
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1156
+ case "ValidationException":
1157
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1158
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1159
+ default:
1160
+ const parsedBody = parsedOutput.body;
1161
+ (0, smithy_client_1.throwDefaultError)({
1162
+ output,
1163
+ parsedBody,
1164
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1165
+ errorCode,
1166
+ });
1167
+ }
1168
+ };
1169
+ const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1170
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1171
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1172
+ }
1173
+ const contents = map({
1174
+ $metadata: deserializeMetadata(output),
1175
+ });
1176
+ await collectBody(output.body, context);
1177
+ return contents;
1178
+ };
1179
+ exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1180
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1181
+ const parsedOutput = {
1182
+ ...output,
1183
+ body: await parseErrorBody(output.body, context),
1184
+ };
1185
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1186
+ switch (errorCode) {
1187
+ case "AccessDeniedException":
1188
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1189
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1190
+ case "ConflictException":
1191
+ case "com.amazonaws.resourceexplorer2#ConflictException":
1192
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1193
+ case "InternalServerException":
1194
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1195
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1196
+ case "ThrottlingException":
1197
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1198
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1199
+ case "UnauthorizedException":
1200
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
1201
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1202
+ case "ValidationException":
1203
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1204
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1205
+ default:
1206
+ const parsedBody = parsedOutput.body;
1207
+ (0, smithy_client_1.throwDefaultError)({
1208
+ output,
1209
+ parsedBody,
1210
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1211
+ errorCode,
1212
+ });
1213
+ }
1214
+ };
1215
+ const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1216
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1217
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1218
+ }
1219
+ const contents = map({
1220
+ $metadata: deserializeMetadata(output),
1221
+ });
1222
+ await collectBody(output.body, context);
1223
+ return contents;
1224
+ };
1225
+ exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1226
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1227
+ const parsedOutput = {
1228
+ ...output,
1229
+ body: await parseErrorBody(output.body, context),
1230
+ };
1231
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1232
+ switch (errorCode) {
1233
+ case "AccessDeniedException":
1234
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1235
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1236
+ case "InternalServerException":
1237
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1238
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1239
+ case "ResourceNotFoundException":
1240
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
1241
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1242
+ case "ThrottlingException":
1243
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1244
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1245
+ case "UnauthorizedException":
1246
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
1247
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1248
+ case "ValidationException":
1249
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1250
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1251
+ default:
1252
+ const parsedBody = parsedOutput.body;
1253
+ (0, smithy_client_1.throwDefaultError)({
1254
+ output,
1255
+ parsedBody,
1256
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1257
+ errorCode,
1258
+ });
1259
+ }
1260
+ };
1261
+ const deserializeAws_restJson1UpdateIndexTypeCommand = async (output, context) => {
1262
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1263
+ return deserializeAws_restJson1UpdateIndexTypeCommandError(output, context);
1264
+ }
1265
+ const contents = map({
1266
+ $metadata: deserializeMetadata(output),
1267
+ });
1268
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1269
+ if (data.Arn != null) {
1270
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1271
+ }
1272
+ if (data.LastUpdatedAt != null) {
1273
+ contents.LastUpdatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.LastUpdatedAt));
1274
+ }
1275
+ if (data.State != null) {
1276
+ contents.State = (0, smithy_client_1.expectString)(data.State);
1277
+ }
1278
+ if (data.Type != null) {
1279
+ contents.Type = (0, smithy_client_1.expectString)(data.Type);
1280
+ }
1281
+ return contents;
1282
+ };
1283
+ exports.deserializeAws_restJson1UpdateIndexTypeCommand = deserializeAws_restJson1UpdateIndexTypeCommand;
1284
+ const deserializeAws_restJson1UpdateIndexTypeCommandError = async (output, context) => {
1285
+ const parsedOutput = {
1286
+ ...output,
1287
+ body: await parseErrorBody(output.body, context),
1288
+ };
1289
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1290
+ switch (errorCode) {
1291
+ case "AccessDeniedException":
1292
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1293
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1294
+ case "ConflictException":
1295
+ case "com.amazonaws.resourceexplorer2#ConflictException":
1296
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1297
+ case "InternalServerException":
1298
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1299
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1300
+ case "ResourceNotFoundException":
1301
+ case "com.amazonaws.resourceexplorer2#ResourceNotFoundException":
1302
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1303
+ case "ServiceQuotaExceededException":
1304
+ case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException":
1305
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1306
+ case "ThrottlingException":
1307
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1308
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1309
+ case "ValidationException":
1310
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1311
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1312
+ default:
1313
+ const parsedBody = parsedOutput.body;
1314
+ (0, smithy_client_1.throwDefaultError)({
1315
+ output,
1316
+ parsedBody,
1317
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1318
+ errorCode,
1319
+ });
1320
+ }
1321
+ };
1322
+ const deserializeAws_restJson1UpdateViewCommand = async (output, context) => {
1323
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1324
+ return deserializeAws_restJson1UpdateViewCommandError(output, context);
1325
+ }
1326
+ const contents = map({
1327
+ $metadata: deserializeMetadata(output),
1328
+ });
1329
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1330
+ if (data.View != null) {
1331
+ contents.View = deserializeAws_restJson1View(data.View, context);
1332
+ }
1333
+ return contents;
1334
+ };
1335
+ exports.deserializeAws_restJson1UpdateViewCommand = deserializeAws_restJson1UpdateViewCommand;
1336
+ const deserializeAws_restJson1UpdateViewCommandError = async (output, context) => {
1337
+ const parsedOutput = {
1338
+ ...output,
1339
+ body: await parseErrorBody(output.body, context),
1340
+ };
1341
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1342
+ switch (errorCode) {
1343
+ case "AccessDeniedException":
1344
+ case "com.amazonaws.resourceexplorer2#AccessDeniedException":
1345
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1346
+ case "InternalServerException":
1347
+ case "com.amazonaws.resourceexplorer2#InternalServerException":
1348
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1349
+ case "ServiceQuotaExceededException":
1350
+ case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException":
1351
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1352
+ case "ThrottlingException":
1353
+ case "com.amazonaws.resourceexplorer2#ThrottlingException":
1354
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1355
+ case "UnauthorizedException":
1356
+ case "com.amazonaws.resourceexplorer2#UnauthorizedException":
1357
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1358
+ case "ValidationException":
1359
+ case "com.amazonaws.resourceexplorer2#ValidationException":
1360
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1361
+ default:
1362
+ const parsedBody = parsedOutput.body;
1363
+ (0, smithy_client_1.throwDefaultError)({
1364
+ output,
1365
+ parsedBody,
1366
+ exceptionCtor: ResourceExplorer2ServiceException_1.ResourceExplorer2ServiceException,
1367
+ errorCode,
1368
+ });
1369
+ }
1370
+ };
1371
+ const map = smithy_client_1.map;
1372
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1373
+ const contents = map({});
1374
+ const data = parsedOutput.body;
1375
+ if (data.Message != null) {
1376
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1377
+ }
1378
+ const exception = new models_0_1.AccessDeniedException({
1379
+ $metadata: deserializeMetadata(parsedOutput),
1380
+ ...contents,
1381
+ });
1382
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1383
+ };
1384
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1385
+ const contents = map({});
1386
+ const data = parsedOutput.body;
1387
+ if (data.Message != null) {
1388
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1389
+ }
1390
+ const exception = new models_0_1.ConflictException({
1391
+ $metadata: deserializeMetadata(parsedOutput),
1392
+ ...contents,
1393
+ });
1394
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1395
+ };
1396
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1397
+ const contents = map({});
1398
+ const data = parsedOutput.body;
1399
+ if (data.Message != null) {
1400
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1401
+ }
1402
+ const exception = new models_0_1.InternalServerException({
1403
+ $metadata: deserializeMetadata(parsedOutput),
1404
+ ...contents,
1405
+ });
1406
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1407
+ };
1408
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1409
+ const contents = map({});
1410
+ const data = parsedOutput.body;
1411
+ if (data.Message != null) {
1412
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1413
+ }
1414
+ const exception = new models_0_1.ResourceNotFoundException({
1415
+ $metadata: deserializeMetadata(parsedOutput),
1416
+ ...contents,
1417
+ });
1418
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1419
+ };
1420
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1421
+ const contents = map({});
1422
+ const data = parsedOutput.body;
1423
+ if (data.Message != null) {
1424
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1425
+ }
1426
+ if (data.Name != null) {
1427
+ contents.Name = (0, smithy_client_1.expectString)(data.Name);
1428
+ }
1429
+ if (data.Value != null) {
1430
+ contents.Value = (0, smithy_client_1.expectString)(data.Value);
1431
+ }
1432
+ const exception = new models_0_1.ServiceQuotaExceededException({
1433
+ $metadata: deserializeMetadata(parsedOutput),
1434
+ ...contents,
1435
+ });
1436
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1437
+ };
1438
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1439
+ const contents = map({});
1440
+ const data = parsedOutput.body;
1441
+ if (data.Message != null) {
1442
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1443
+ }
1444
+ const exception = new models_0_1.ThrottlingException({
1445
+ $metadata: deserializeMetadata(parsedOutput),
1446
+ ...contents,
1447
+ });
1448
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1449
+ };
1450
+ const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
1451
+ const contents = map({});
1452
+ const data = parsedOutput.body;
1453
+ if (data.Message != null) {
1454
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1455
+ }
1456
+ const exception = new models_0_1.UnauthorizedException({
1457
+ $metadata: deserializeMetadata(parsedOutput),
1458
+ ...contents,
1459
+ });
1460
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1461
+ };
1462
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1463
+ const contents = map({});
1464
+ const data = parsedOutput.body;
1465
+ if (data.FieldList != null) {
1466
+ contents.FieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.FieldList, context);
1467
+ }
1468
+ if (data.Message != null) {
1469
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1470
+ }
1471
+ const exception = new models_0_1.ValidationException({
1472
+ $metadata: deserializeMetadata(parsedOutput),
1473
+ ...contents,
1474
+ });
1475
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1476
+ };
1477
+ const serializeAws_restJson1IncludedProperty = (input, context) => {
1478
+ return {
1479
+ ...(input.Name != null && { Name: input.Name }),
1480
+ };
1481
+ };
1482
+ const serializeAws_restJson1IncludedPropertyList = (input, context) => {
1483
+ return input
1484
+ .filter((e) => e != null)
1485
+ .map((entry) => {
1486
+ return serializeAws_restJson1IncludedProperty(entry, context);
1487
+ });
1488
+ };
1489
+ const serializeAws_restJson1RegionList = (input, context) => {
1490
+ return input
1491
+ .filter((e) => e != null)
1492
+ .map((entry) => {
1493
+ return entry;
1494
+ });
1495
+ };
1496
+ const serializeAws_restJson1SearchFilter = (input, context) => {
1497
+ return {
1498
+ ...(input.FilterString != null && { FilterString: input.FilterString }),
1499
+ };
1500
+ };
1501
+ const serializeAws_restJson1TagMap = (input, context) => {
1502
+ return Object.entries(input).reduce((acc, [key, value]) => {
1503
+ if (value === null) {
1504
+ return acc;
1505
+ }
1506
+ return {
1507
+ ...acc,
1508
+ [key]: value,
1509
+ };
1510
+ }, {});
1511
+ };
1512
+ const serializeAws_restJson1ViewArnList = (input, context) => {
1513
+ return input
1514
+ .filter((e) => e != null)
1515
+ .map((entry) => {
1516
+ return entry;
1517
+ });
1518
+ };
1519
+ const deserializeAws_restJson1BatchGetViewError = (output, context) => {
1520
+ return {
1521
+ ErrorMessage: (0, smithy_client_1.expectString)(output.ErrorMessage),
1522
+ ViewArn: (0, smithy_client_1.expectString)(output.ViewArn),
1523
+ };
1524
+ };
1525
+ const deserializeAws_restJson1BatchGetViewErrors = (output, context) => {
1526
+ const retVal = (output || [])
1527
+ .filter((e) => e != null)
1528
+ .map((entry) => {
1529
+ if (entry === null) {
1530
+ return null;
1531
+ }
1532
+ return deserializeAws_restJson1BatchGetViewError(entry, context);
1533
+ });
1534
+ return retVal;
1535
+ };
1536
+ const deserializeAws_restJson1IncludedProperty = (output, context) => {
1537
+ return {
1538
+ Name: (0, smithy_client_1.expectString)(output.Name),
1539
+ };
1540
+ };
1541
+ const deserializeAws_restJson1IncludedPropertyList = (output, context) => {
1542
+ const retVal = (output || [])
1543
+ .filter((e) => e != null)
1544
+ .map((entry) => {
1545
+ if (entry === null) {
1546
+ return null;
1547
+ }
1548
+ return deserializeAws_restJson1IncludedProperty(entry, context);
1549
+ });
1550
+ return retVal;
1551
+ };
1552
+ const deserializeAws_restJson1Index = (output, context) => {
1553
+ return {
1554
+ Arn: (0, smithy_client_1.expectString)(output.Arn),
1555
+ Region: (0, smithy_client_1.expectString)(output.Region),
1556
+ Type: (0, smithy_client_1.expectString)(output.Type),
1557
+ };
1558
+ };
1559
+ const deserializeAws_restJson1IndexList = (output, context) => {
1560
+ const retVal = (output || [])
1561
+ .filter((e) => e != null)
1562
+ .map((entry) => {
1563
+ if (entry === null) {
1564
+ return null;
1565
+ }
1566
+ return deserializeAws_restJson1Index(entry, context);
1567
+ });
1568
+ return retVal;
1569
+ };
1570
+ const deserializeAws_restJson1RegionList = (output, context) => {
1571
+ const retVal = (output || [])
1572
+ .filter((e) => e != null)
1573
+ .map((entry) => {
1574
+ if (entry === null) {
1575
+ return null;
1576
+ }
1577
+ return (0, smithy_client_1.expectString)(entry);
1578
+ });
1579
+ return retVal;
1580
+ };
1581
+ const deserializeAws_restJson1Resource = (output, context) => {
1582
+ return {
1583
+ Arn: (0, smithy_client_1.expectString)(output.Arn),
1584
+ LastReportedAt: output.LastReportedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.LastReportedAt)) : undefined,
1585
+ OwningAccountId: (0, smithy_client_1.expectString)(output.OwningAccountId),
1586
+ Properties: output.Properties != null ? deserializeAws_restJson1ResourcePropertyList(output.Properties, context) : undefined,
1587
+ Region: (0, smithy_client_1.expectString)(output.Region),
1588
+ ResourceType: (0, smithy_client_1.expectString)(output.ResourceType),
1589
+ Service: (0, smithy_client_1.expectString)(output.Service),
1590
+ };
1591
+ };
1592
+ const deserializeAws_restJson1ResourceCount = (output, context) => {
1593
+ return {
1594
+ Complete: (0, smithy_client_1.expectBoolean)(output.Complete),
1595
+ TotalResources: (0, smithy_client_1.expectLong)(output.TotalResources),
1596
+ };
1597
+ };
1598
+ const deserializeAws_restJson1ResourceList = (output, context) => {
1599
+ const retVal = (output || [])
1600
+ .filter((e) => e != null)
1601
+ .map((entry) => {
1602
+ if (entry === null) {
1603
+ return null;
1604
+ }
1605
+ return deserializeAws_restJson1Resource(entry, context);
1606
+ });
1607
+ return retVal;
1608
+ };
1609
+ const deserializeAws_restJson1ResourceProperty = (output, context) => {
1610
+ return {
1611
+ Data: output.Data != null ? deserializeAws_restJson1Document(output.Data, context) : undefined,
1612
+ LastReportedAt: output.LastReportedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.LastReportedAt)) : undefined,
1613
+ Name: (0, smithy_client_1.expectString)(output.Name),
1614
+ };
1615
+ };
1616
+ const deserializeAws_restJson1ResourcePropertyList = (output, context) => {
1617
+ const retVal = (output || [])
1618
+ .filter((e) => e != null)
1619
+ .map((entry) => {
1620
+ if (entry === null) {
1621
+ return null;
1622
+ }
1623
+ return deserializeAws_restJson1ResourceProperty(entry, context);
1624
+ });
1625
+ return retVal;
1626
+ };
1627
+ const deserializeAws_restJson1ResourceTypeList = (output, context) => {
1628
+ const retVal = (output || [])
1629
+ .filter((e) => e != null)
1630
+ .map((entry) => {
1631
+ if (entry === null) {
1632
+ return null;
1633
+ }
1634
+ return deserializeAws_restJson1SupportedResourceType(entry, context);
1635
+ });
1636
+ return retVal;
1637
+ };
1638
+ const deserializeAws_restJson1SearchFilter = (output, context) => {
1639
+ return {
1640
+ FilterString: (0, smithy_client_1.expectString)(output.FilterString),
1641
+ };
1642
+ };
1643
+ const deserializeAws_restJson1SupportedResourceType = (output, context) => {
1644
+ return {
1645
+ ResourceType: (0, smithy_client_1.expectString)(output.ResourceType),
1646
+ Service: (0, smithy_client_1.expectString)(output.Service),
1647
+ };
1648
+ };
1649
+ const deserializeAws_restJson1TagMap = (output, context) => {
1650
+ return Object.entries(output).reduce((acc, [key, value]) => {
1651
+ if (value === null) {
1652
+ return acc;
1653
+ }
1654
+ return {
1655
+ ...acc,
1656
+ [key]: (0, smithy_client_1.expectString)(value),
1657
+ };
1658
+ }, {});
1659
+ };
1660
+ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
1661
+ return {
1662
+ Name: (0, smithy_client_1.expectString)(output.Name),
1663
+ ValidationIssue: (0, smithy_client_1.expectString)(output.ValidationIssue),
1664
+ };
1665
+ };
1666
+ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
1667
+ const retVal = (output || [])
1668
+ .filter((e) => e != null)
1669
+ .map((entry) => {
1670
+ if (entry === null) {
1671
+ return null;
1672
+ }
1673
+ return deserializeAws_restJson1ValidationExceptionField(entry, context);
1674
+ });
1675
+ return retVal;
1676
+ };
1677
+ const deserializeAws_restJson1View = (output, context) => {
1678
+ return {
1679
+ Filters: output.Filters != null ? deserializeAws_restJson1SearchFilter(output.Filters, context) : undefined,
1680
+ IncludedProperties: output.IncludedProperties != null
1681
+ ? deserializeAws_restJson1IncludedPropertyList(output.IncludedProperties, context)
1682
+ : undefined,
1683
+ LastUpdatedAt: output.LastUpdatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.LastUpdatedAt)) : undefined,
1684
+ Owner: (0, smithy_client_1.expectString)(output.Owner),
1685
+ Scope: (0, smithy_client_1.expectString)(output.Scope),
1686
+ ViewArn: (0, smithy_client_1.expectString)(output.ViewArn),
1687
+ };
1688
+ };
1689
+ const deserializeAws_restJson1ViewArnList = (output, context) => {
1690
+ const retVal = (output || [])
1691
+ .filter((e) => e != null)
1692
+ .map((entry) => {
1693
+ if (entry === null) {
1694
+ return null;
1695
+ }
1696
+ return (0, smithy_client_1.expectString)(entry);
1697
+ });
1698
+ return retVal;
1699
+ };
1700
+ const deserializeAws_restJson1ViewList = (output, context) => {
1701
+ const retVal = (output || [])
1702
+ .filter((e) => e != null)
1703
+ .map((entry) => {
1704
+ if (entry === null) {
1705
+ return null;
1706
+ }
1707
+ return deserializeAws_restJson1View(entry, context);
1708
+ });
1709
+ return retVal;
1710
+ };
1711
+ const deserializeAws_restJson1Document = (output, context) => {
1712
+ return output;
1713
+ };
1714
+ const deserializeMetadata = (output) => ({
1715
+ httpStatusCode: output.statusCode,
1716
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1717
+ extendedRequestId: output.headers["x-amz-id-2"],
1718
+ cfId: output.headers["x-amz-cf-id"],
1719
+ });
1720
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1721
+ if (streamBody instanceof Uint8Array) {
1722
+ return Promise.resolve(streamBody);
1723
+ }
1724
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1725
+ };
1726
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1727
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1728
+ value !== null &&
1729
+ value !== "" &&
1730
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1731
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1732
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1733
+ if (encoded.length) {
1734
+ return JSON.parse(encoded);
1735
+ }
1736
+ return {};
1737
+ });
1738
+ const parseErrorBody = async (errorBody, context) => {
1739
+ const value = await parseBody(errorBody, context);
1740
+ value.message = value.message ?? value.Message;
1741
+ return value;
1742
+ };
1743
+ const loadRestJsonErrorCode = (output, data) => {
1744
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1745
+ const sanitizeErrorCode = (rawValue) => {
1746
+ let cleanValue = rawValue;
1747
+ if (typeof cleanValue === "number") {
1748
+ cleanValue = cleanValue.toString();
1749
+ }
1750
+ if (cleanValue.indexOf(",") >= 0) {
1751
+ cleanValue = cleanValue.split(",")[0];
1752
+ }
1753
+ if (cleanValue.indexOf(":") >= 0) {
1754
+ cleanValue = cleanValue.split(":")[0];
1755
+ }
1756
+ if (cleanValue.indexOf("#") >= 0) {
1757
+ cleanValue = cleanValue.split("#")[1];
1758
+ }
1759
+ return cleanValue;
1760
+ };
1761
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1762
+ if (headerKey !== undefined) {
1763
+ return sanitizeErrorCode(output.headers[headerKey]);
1764
+ }
1765
+ if (data.code !== undefined) {
1766
+ return sanitizeErrorCode(data.code);
1767
+ }
1768
+ if (data["__type"] !== undefined) {
1769
+ return sanitizeErrorCode(data["__type"]);
1770
+ }
1771
+ };