@aws-sdk/client-finspace-data 3.40.0 → 3.45.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 (94) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/FinspaceData.js +165 -0
  4. package/dist-cjs/commands/CreateDataViewCommand.js +36 -0
  5. package/dist-cjs/commands/CreateDatasetCommand.js +36 -0
  6. package/dist-cjs/commands/DeleteDatasetCommand.js +36 -0
  7. package/dist-cjs/commands/GetChangesetCommand.js +36 -0
  8. package/dist-cjs/commands/GetDataViewCommand.js +36 -0
  9. package/dist-cjs/commands/GetDatasetCommand.js +36 -0
  10. package/dist-cjs/commands/ListChangesetsCommand.js +36 -0
  11. package/dist-cjs/commands/ListDataViewsCommand.js +36 -0
  12. package/dist-cjs/commands/ListDatasetsCommand.js +36 -0
  13. package/dist-cjs/commands/UpdateChangesetCommand.js +36 -0
  14. package/dist-cjs/commands/UpdateDatasetCommand.js +36 -0
  15. package/dist-cjs/commands/index.js +11 -0
  16. package/dist-cjs/endpoints.js +9 -0
  17. package/dist-cjs/index.js +1 -0
  18. package/dist-cjs/models/models_0.js +280 -43
  19. package/dist-cjs/pagination/Interfaces.js +2 -0
  20. package/dist-cjs/pagination/ListChangesetsPaginator.js +35 -0
  21. package/dist-cjs/pagination/ListDataViewsPaginator.js +35 -0
  22. package/dist-cjs/pagination/ListDatasetsPaginator.js +35 -0
  23. package/dist-cjs/pagination/index.js +7 -0
  24. package/dist-cjs/protocols/Aws_restJson1.js +1912 -60
  25. package/dist-es/FinspaceData.js +165 -0
  26. package/dist-es/commands/CreateDataViewCommand.js +39 -0
  27. package/dist-es/commands/CreateDatasetCommand.js +39 -0
  28. package/dist-es/commands/DeleteDatasetCommand.js +39 -0
  29. package/dist-es/commands/GetChangesetCommand.js +39 -0
  30. package/dist-es/commands/GetDataViewCommand.js +39 -0
  31. package/dist-es/commands/GetDatasetCommand.js +39 -0
  32. package/dist-es/commands/ListChangesetsCommand.js +39 -0
  33. package/dist-es/commands/ListDataViewsCommand.js +39 -0
  34. package/dist-es/commands/ListDatasetsCommand.js +39 -0
  35. package/dist-es/commands/UpdateChangesetCommand.js +39 -0
  36. package/dist-es/commands/UpdateDatasetCommand.js +39 -0
  37. package/dist-es/commands/index.js +11 -0
  38. package/dist-es/endpoints.js +9 -0
  39. package/dist-es/index.js +1 -0
  40. package/dist-es/models/models_0.js +206 -38
  41. package/dist-es/pagination/Interfaces.js +1 -0
  42. package/dist-es/pagination/ListChangesetsPaginator.js +74 -0
  43. package/dist-es/pagination/ListDataViewsPaginator.js +74 -0
  44. package/dist-es/pagination/ListDatasetsPaginator.js +74 -0
  45. package/dist-es/pagination/index.js +4 -0
  46. package/dist-es/protocols/Aws_restJson1.js +2109 -104
  47. package/dist-types/FinspaceData.d.ts +82 -5
  48. package/dist-types/FinspaceDataClient.d.ts +14 -3
  49. package/dist-types/commands/CreateChangesetCommand.d.ts +2 -2
  50. package/dist-types/commands/CreateDataViewCommand.d.ts +35 -0
  51. package/dist-types/commands/CreateDatasetCommand.d.ts +35 -0
  52. package/dist-types/commands/DeleteDatasetCommand.d.ts +35 -0
  53. package/dist-types/commands/GetChangesetCommand.d.ts +35 -0
  54. package/dist-types/commands/GetDataViewCommand.d.ts +35 -0
  55. package/dist-types/commands/GetDatasetCommand.d.ts +35 -0
  56. package/dist-types/commands/GetProgrammaticAccessCredentialsCommand.d.ts +2 -2
  57. package/dist-types/commands/GetWorkingLocationCommand.d.ts +3 -3
  58. package/dist-types/commands/ListChangesetsCommand.d.ts +35 -0
  59. package/dist-types/commands/ListDataViewsCommand.d.ts +35 -0
  60. package/dist-types/commands/ListDatasetsCommand.d.ts +35 -0
  61. package/dist-types/commands/UpdateChangesetCommand.d.ts +35 -0
  62. package/dist-types/commands/UpdateDatasetCommand.d.ts +35 -0
  63. package/dist-types/commands/index.d.ts +11 -0
  64. package/dist-types/index.d.ts +1 -0
  65. package/dist-types/models/models_0.d.ts +1438 -242
  66. package/dist-types/pagination/Interfaces.d.ts +6 -0
  67. package/dist-types/pagination/ListChangesetsPaginator.d.ts +4 -0
  68. package/dist-types/pagination/ListDataViewsPaginator.d.ts +4 -0
  69. package/dist-types/pagination/ListDatasetsPaginator.d.ts +4 -0
  70. package/dist-types/pagination/index.d.ts +4 -0
  71. package/dist-types/protocols/Aws_restJson1.d.ts +33 -0
  72. package/dist-types/ts3.4/FinspaceData.d.ts +55 -0
  73. package/dist-types/ts3.4/FinspaceDataClient.d.ts +13 -2
  74. package/dist-types/ts3.4/commands/CreateDataViewCommand.d.ts +17 -0
  75. package/dist-types/ts3.4/commands/CreateDatasetCommand.d.ts +17 -0
  76. package/dist-types/ts3.4/commands/DeleteDatasetCommand.d.ts +17 -0
  77. package/dist-types/ts3.4/commands/GetChangesetCommand.d.ts +17 -0
  78. package/dist-types/ts3.4/commands/GetDataViewCommand.d.ts +17 -0
  79. package/dist-types/ts3.4/commands/GetDatasetCommand.d.ts +17 -0
  80. package/dist-types/ts3.4/commands/ListChangesetsCommand.d.ts +17 -0
  81. package/dist-types/ts3.4/commands/ListDataViewsCommand.d.ts +17 -0
  82. package/dist-types/ts3.4/commands/ListDatasetsCommand.d.ts +17 -0
  83. package/dist-types/ts3.4/commands/UpdateChangesetCommand.d.ts +17 -0
  84. package/dist-types/ts3.4/commands/UpdateDatasetCommand.d.ts +17 -0
  85. package/dist-types/ts3.4/commands/index.d.ts +11 -0
  86. package/dist-types/ts3.4/index.d.ts +1 -0
  87. package/dist-types/ts3.4/models/models_0.d.ts +606 -71
  88. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  89. package/dist-types/ts3.4/pagination/ListChangesetsPaginator.d.ts +4 -0
  90. package/dist-types/ts3.4/pagination/ListDataViewsPaginator.d.ts +4 -0
  91. package/dist-types/ts3.4/pagination/ListDatasetsPaginator.d.ts +4 -0
  92. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  93. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +33 -0
  94. package/package.json +9 -7
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1GetWorkingLocationCommand = exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.deserializeAws_restJson1CreateChangesetCommand = exports.serializeAws_restJson1GetWorkingLocationCommand = exports.serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.serializeAws_restJson1CreateChangesetCommand = void 0;
3
+ exports.deserializeAws_restJson1UpdateDatasetCommand = exports.deserializeAws_restJson1UpdateChangesetCommand = exports.deserializeAws_restJson1ListDataViewsCommand = exports.deserializeAws_restJson1ListDatasetsCommand = exports.deserializeAws_restJson1ListChangesetsCommand = exports.deserializeAws_restJson1GetWorkingLocationCommand = exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.deserializeAws_restJson1GetDataViewCommand = exports.deserializeAws_restJson1GetDatasetCommand = exports.deserializeAws_restJson1GetChangesetCommand = exports.deserializeAws_restJson1DeleteDatasetCommand = exports.deserializeAws_restJson1CreateDataViewCommand = exports.deserializeAws_restJson1CreateDatasetCommand = exports.deserializeAws_restJson1CreateChangesetCommand = exports.serializeAws_restJson1UpdateDatasetCommand = exports.serializeAws_restJson1UpdateChangesetCommand = exports.serializeAws_restJson1ListDataViewsCommand = exports.serializeAws_restJson1ListDatasetsCommand = exports.serializeAws_restJson1ListChangesetsCommand = exports.serializeAws_restJson1GetWorkingLocationCommand = exports.serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.serializeAws_restJson1GetDataViewCommand = exports.serializeAws_restJson1GetDatasetCommand = exports.serializeAws_restJson1GetChangesetCommand = exports.serializeAws_restJson1DeleteDatasetCommand = exports.serializeAws_restJson1CreateDataViewCommand = exports.serializeAws_restJson1CreateDatasetCommand = exports.serializeAws_restJson1CreateChangesetCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const uuid_1 = require("uuid");
6
7
  const serializeAws_restJson1CreateChangesetCommand = async (input, context) => {
8
+ var _a;
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {
9
11
  "content-type": "application/json",
10
12
  };
11
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/changesets";
13
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/changesetsv2";
12
14
  if (input.datasetId !== undefined) {
13
15
  const labelValue = input.datasetId;
14
16
  if (labelValue.length <= 0) {
@@ -22,14 +24,11 @@ const serializeAws_restJson1CreateChangesetCommand = async (input, context) => {
22
24
  let body;
23
25
  body = JSON.stringify({
24
26
  ...(input.changeType !== undefined && input.changeType !== null && { changeType: input.changeType }),
27
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
25
28
  ...(input.formatParams !== undefined &&
26
- input.formatParams !== null && { formatParams: serializeAws_restJson1stringMap(input.formatParams, context) }),
27
- ...(input.formatType !== undefined && input.formatType !== null && { formatType: input.formatType }),
29
+ input.formatParams !== null && { formatParams: serializeAws_restJson1FormatParams(input.formatParams, context) }),
28
30
  ...(input.sourceParams !== undefined &&
29
- input.sourceParams !== null && { sourceParams: serializeAws_restJson1stringMap(input.sourceParams, context) }),
30
- ...(input.sourceType !== undefined && input.sourceType !== null && { sourceType: input.sourceType }),
31
- ...(input.tags !== undefined &&
32
- input.tags !== null && { tags: serializeAws_restJson1stringMap(input.tags, context) }),
31
+ input.sourceParams !== null && { sourceParams: serializeAws_restJson1SourceParams(input.sourceParams, context) }),
33
32
  });
34
33
  return new protocol_http_1.HttpRequest({
35
34
  protocol,
@@ -42,6 +41,217 @@ const serializeAws_restJson1CreateChangesetCommand = async (input, context) => {
42
41
  });
43
42
  };
44
43
  exports.serializeAws_restJson1CreateChangesetCommand = serializeAws_restJson1CreateChangesetCommand;
44
+ const serializeAws_restJson1CreateDatasetCommand = async (input, context) => {
45
+ var _a;
46
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
47
+ const headers = {
48
+ "content-type": "application/json",
49
+ };
50
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2";
51
+ let body;
52
+ body = JSON.stringify({
53
+ ...(input.alias !== undefined && input.alias !== null && { alias: input.alias }),
54
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
55
+ ...(input.datasetDescription !== undefined &&
56
+ input.datasetDescription !== null && { datasetDescription: input.datasetDescription }),
57
+ ...(input.datasetTitle !== undefined && input.datasetTitle !== null && { datasetTitle: input.datasetTitle }),
58
+ ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }),
59
+ ...(input.ownerInfo !== undefined &&
60
+ input.ownerInfo !== null && { ownerInfo: serializeAws_restJson1DatasetOwnerInfo(input.ownerInfo, context) }),
61
+ ...(input.permissionGroupParams !== undefined &&
62
+ input.permissionGroupParams !== null && {
63
+ permissionGroupParams: serializeAws_restJson1PermissionGroupParams(input.permissionGroupParams, context),
64
+ }),
65
+ ...(input.schemaDefinition !== undefined &&
66
+ input.schemaDefinition !== null && {
67
+ schemaDefinition: serializeAws_restJson1SchemaUnion(input.schemaDefinition, context),
68
+ }),
69
+ });
70
+ return new protocol_http_1.HttpRequest({
71
+ protocol,
72
+ hostname,
73
+ port,
74
+ method: "POST",
75
+ headers,
76
+ path: resolvedPath,
77
+ body,
78
+ });
79
+ };
80
+ exports.serializeAws_restJson1CreateDatasetCommand = serializeAws_restJson1CreateDatasetCommand;
81
+ const serializeAws_restJson1CreateDataViewCommand = async (input, context) => {
82
+ var _a;
83
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
+ const headers = {
85
+ "content-type": "application/json",
86
+ };
87
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/dataviewsv2";
88
+ if (input.datasetId !== undefined) {
89
+ const labelValue = input.datasetId;
90
+ if (labelValue.length <= 0) {
91
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
92
+ }
93
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
94
+ }
95
+ else {
96
+ throw new Error("No value provided for input HTTP label: datasetId.");
97
+ }
98
+ let body;
99
+ body = JSON.stringify({
100
+ ...(input.asOfTimestamp !== undefined && input.asOfTimestamp !== null && { asOfTimestamp: input.asOfTimestamp }),
101
+ ...(input.autoUpdate !== undefined && input.autoUpdate !== null && { autoUpdate: input.autoUpdate }),
102
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
103
+ ...(input.destinationTypeParams !== undefined &&
104
+ input.destinationTypeParams !== null && {
105
+ destinationTypeParams: serializeAws_restJson1DataViewDestinationTypeParams(input.destinationTypeParams, context),
106
+ }),
107
+ ...(input.partitionColumns !== undefined &&
108
+ input.partitionColumns !== null && {
109
+ partitionColumns: serializeAws_restJson1PartitionColumnList(input.partitionColumns, context),
110
+ }),
111
+ ...(input.sortColumns !== undefined &&
112
+ input.sortColumns !== null && { sortColumns: serializeAws_restJson1SortColumnList(input.sortColumns, context) }),
113
+ });
114
+ return new protocol_http_1.HttpRequest({
115
+ protocol,
116
+ hostname,
117
+ port,
118
+ method: "POST",
119
+ headers,
120
+ path: resolvedPath,
121
+ body,
122
+ });
123
+ };
124
+ exports.serializeAws_restJson1CreateDataViewCommand = serializeAws_restJson1CreateDataViewCommand;
125
+ const serializeAws_restJson1DeleteDatasetCommand = async (input, context) => {
126
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
127
+ const headers = {};
128
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2/{datasetId}";
129
+ if (input.datasetId !== undefined) {
130
+ const labelValue = input.datasetId;
131
+ if (labelValue.length <= 0) {
132
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
133
+ }
134
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
135
+ }
136
+ else {
137
+ throw new Error("No value provided for input HTTP label: datasetId.");
138
+ }
139
+ const query = {
140
+ ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
141
+ };
142
+ let body;
143
+ return new protocol_http_1.HttpRequest({
144
+ protocol,
145
+ hostname,
146
+ port,
147
+ method: "DELETE",
148
+ headers,
149
+ path: resolvedPath,
150
+ query,
151
+ body,
152
+ });
153
+ };
154
+ exports.serializeAws_restJson1DeleteDatasetCommand = serializeAws_restJson1DeleteDatasetCommand;
155
+ const serializeAws_restJson1GetChangesetCommand = async (input, context) => {
156
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
157
+ const headers = {};
158
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
159
+ "/datasets/{datasetId}/changesetsv2/{changesetId}";
160
+ if (input.datasetId !== undefined) {
161
+ const labelValue = input.datasetId;
162
+ if (labelValue.length <= 0) {
163
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
164
+ }
165
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
166
+ }
167
+ else {
168
+ throw new Error("No value provided for input HTTP label: datasetId.");
169
+ }
170
+ if (input.changesetId !== undefined) {
171
+ const labelValue = input.changesetId;
172
+ if (labelValue.length <= 0) {
173
+ throw new Error("Empty value provided for input HTTP label: changesetId.");
174
+ }
175
+ resolvedPath = resolvedPath.replace("{changesetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
176
+ }
177
+ else {
178
+ throw new Error("No value provided for input HTTP label: changesetId.");
179
+ }
180
+ let body;
181
+ return new protocol_http_1.HttpRequest({
182
+ protocol,
183
+ hostname,
184
+ port,
185
+ method: "GET",
186
+ headers,
187
+ path: resolvedPath,
188
+ body,
189
+ });
190
+ };
191
+ exports.serializeAws_restJson1GetChangesetCommand = serializeAws_restJson1GetChangesetCommand;
192
+ const serializeAws_restJson1GetDatasetCommand = async (input, context) => {
193
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
194
+ const headers = {};
195
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2/{datasetId}";
196
+ if (input.datasetId !== undefined) {
197
+ const labelValue = input.datasetId;
198
+ if (labelValue.length <= 0) {
199
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
200
+ }
201
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
202
+ }
203
+ else {
204
+ throw new Error("No value provided for input HTTP label: datasetId.");
205
+ }
206
+ let body;
207
+ return new protocol_http_1.HttpRequest({
208
+ protocol,
209
+ hostname,
210
+ port,
211
+ method: "GET",
212
+ headers,
213
+ path: resolvedPath,
214
+ body,
215
+ });
216
+ };
217
+ exports.serializeAws_restJson1GetDatasetCommand = serializeAws_restJson1GetDatasetCommand;
218
+ const serializeAws_restJson1GetDataViewCommand = async (input, context) => {
219
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
220
+ const headers = {};
221
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
222
+ "/datasets/{datasetId}/dataviewsv2/{dataViewId}";
223
+ if (input.dataViewId !== undefined) {
224
+ const labelValue = input.dataViewId;
225
+ if (labelValue.length <= 0) {
226
+ throw new Error("Empty value provided for input HTTP label: dataViewId.");
227
+ }
228
+ resolvedPath = resolvedPath.replace("{dataViewId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
229
+ }
230
+ else {
231
+ throw new Error("No value provided for input HTTP label: dataViewId.");
232
+ }
233
+ if (input.datasetId !== undefined) {
234
+ const labelValue = input.datasetId;
235
+ if (labelValue.length <= 0) {
236
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
237
+ }
238
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
239
+ }
240
+ else {
241
+ throw new Error("No value provided for input HTTP label: datasetId.");
242
+ }
243
+ let body;
244
+ return new protocol_http_1.HttpRequest({
245
+ protocol,
246
+ hostname,
247
+ port,
248
+ method: "GET",
249
+ headers,
250
+ path: resolvedPath,
251
+ body,
252
+ });
253
+ };
254
+ exports.serializeAws_restJson1GetDataViewCommand = serializeAws_restJson1GetDataViewCommand;
45
255
  const serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (input, context) => {
46
256
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
47
257
  const headers = {};
@@ -83,23 +293,1298 @@ const serializeAws_restJson1GetWorkingLocationCommand = async (input, context) =
83
293
  body,
84
294
  });
85
295
  };
86
- exports.serializeAws_restJson1GetWorkingLocationCommand = serializeAws_restJson1GetWorkingLocationCommand;
87
- const deserializeAws_restJson1CreateChangesetCommand = async (output, context) => {
296
+ exports.serializeAws_restJson1GetWorkingLocationCommand = serializeAws_restJson1GetWorkingLocationCommand;
297
+ const serializeAws_restJson1ListChangesetsCommand = async (input, context) => {
298
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
299
+ const headers = {};
300
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/changesetsv2";
301
+ if (input.datasetId !== undefined) {
302
+ const labelValue = input.datasetId;
303
+ if (labelValue.length <= 0) {
304
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
305
+ }
306
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
307
+ }
308
+ else {
309
+ throw new Error("No value provided for input HTTP label: datasetId.");
310
+ }
311
+ const query = {
312
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
313
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
314
+ };
315
+ let body;
316
+ return new protocol_http_1.HttpRequest({
317
+ protocol,
318
+ hostname,
319
+ port,
320
+ method: "GET",
321
+ headers,
322
+ path: resolvedPath,
323
+ query,
324
+ body,
325
+ });
326
+ };
327
+ exports.serializeAws_restJson1ListChangesetsCommand = serializeAws_restJson1ListChangesetsCommand;
328
+ const serializeAws_restJson1ListDatasetsCommand = async (input, context) => {
329
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
330
+ const headers = {};
331
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2";
332
+ const query = {
333
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
334
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
335
+ };
336
+ let body;
337
+ return new protocol_http_1.HttpRequest({
338
+ protocol,
339
+ hostname,
340
+ port,
341
+ method: "GET",
342
+ headers,
343
+ path: resolvedPath,
344
+ query,
345
+ body,
346
+ });
347
+ };
348
+ exports.serializeAws_restJson1ListDatasetsCommand = serializeAws_restJson1ListDatasetsCommand;
349
+ const serializeAws_restJson1ListDataViewsCommand = async (input, context) => {
350
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
351
+ const headers = {};
352
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/dataviewsv2";
353
+ if (input.datasetId !== undefined) {
354
+ const labelValue = input.datasetId;
355
+ if (labelValue.length <= 0) {
356
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
357
+ }
358
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
359
+ }
360
+ else {
361
+ throw new Error("No value provided for input HTTP label: datasetId.");
362
+ }
363
+ const query = {
364
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
365
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
366
+ };
367
+ let body;
368
+ return new protocol_http_1.HttpRequest({
369
+ protocol,
370
+ hostname,
371
+ port,
372
+ method: "GET",
373
+ headers,
374
+ path: resolvedPath,
375
+ query,
376
+ body,
377
+ });
378
+ };
379
+ exports.serializeAws_restJson1ListDataViewsCommand = serializeAws_restJson1ListDataViewsCommand;
380
+ const serializeAws_restJson1UpdateChangesetCommand = async (input, context) => {
381
+ var _a;
382
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
383
+ const headers = {
384
+ "content-type": "application/json",
385
+ };
386
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
387
+ "/datasets/{datasetId}/changesetsv2/{changesetId}";
388
+ if (input.datasetId !== undefined) {
389
+ const labelValue = input.datasetId;
390
+ if (labelValue.length <= 0) {
391
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
392
+ }
393
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
394
+ }
395
+ else {
396
+ throw new Error("No value provided for input HTTP label: datasetId.");
397
+ }
398
+ if (input.changesetId !== undefined) {
399
+ const labelValue = input.changesetId;
400
+ if (labelValue.length <= 0) {
401
+ throw new Error("Empty value provided for input HTTP label: changesetId.");
402
+ }
403
+ resolvedPath = resolvedPath.replace("{changesetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
404
+ }
405
+ else {
406
+ throw new Error("No value provided for input HTTP label: changesetId.");
407
+ }
408
+ let body;
409
+ body = JSON.stringify({
410
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
411
+ ...(input.formatParams !== undefined &&
412
+ input.formatParams !== null && { formatParams: serializeAws_restJson1FormatParams(input.formatParams, context) }),
413
+ ...(input.sourceParams !== undefined &&
414
+ input.sourceParams !== null && { sourceParams: serializeAws_restJson1SourceParams(input.sourceParams, context) }),
415
+ });
416
+ return new protocol_http_1.HttpRequest({
417
+ protocol,
418
+ hostname,
419
+ port,
420
+ method: "PUT",
421
+ headers,
422
+ path: resolvedPath,
423
+ body,
424
+ });
425
+ };
426
+ exports.serializeAws_restJson1UpdateChangesetCommand = serializeAws_restJson1UpdateChangesetCommand;
427
+ const serializeAws_restJson1UpdateDatasetCommand = async (input, context) => {
428
+ var _a;
429
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
430
+ const headers = {
431
+ "content-type": "application/json",
432
+ };
433
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2/{datasetId}";
434
+ if (input.datasetId !== undefined) {
435
+ const labelValue = input.datasetId;
436
+ if (labelValue.length <= 0) {
437
+ throw new Error("Empty value provided for input HTTP label: datasetId.");
438
+ }
439
+ resolvedPath = resolvedPath.replace("{datasetId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
440
+ }
441
+ else {
442
+ throw new Error("No value provided for input HTTP label: datasetId.");
443
+ }
444
+ let body;
445
+ body = JSON.stringify({
446
+ ...(input.alias !== undefined && input.alias !== null && { alias: input.alias }),
447
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
448
+ ...(input.datasetDescription !== undefined &&
449
+ input.datasetDescription !== null && { datasetDescription: input.datasetDescription }),
450
+ ...(input.datasetTitle !== undefined && input.datasetTitle !== null && { datasetTitle: input.datasetTitle }),
451
+ ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }),
452
+ ...(input.schemaDefinition !== undefined &&
453
+ input.schemaDefinition !== null && {
454
+ schemaDefinition: serializeAws_restJson1SchemaUnion(input.schemaDefinition, context),
455
+ }),
456
+ });
457
+ return new protocol_http_1.HttpRequest({
458
+ protocol,
459
+ hostname,
460
+ port,
461
+ method: "PUT",
462
+ headers,
463
+ path: resolvedPath,
464
+ body,
465
+ });
466
+ };
467
+ exports.serializeAws_restJson1UpdateDatasetCommand = serializeAws_restJson1UpdateDatasetCommand;
468
+ const deserializeAws_restJson1CreateChangesetCommand = async (output, context) => {
469
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
470
+ return deserializeAws_restJson1CreateChangesetCommandError(output, context);
471
+ }
472
+ const contents = {
473
+ $metadata: deserializeMetadata(output),
474
+ changesetId: undefined,
475
+ datasetId: undefined,
476
+ };
477
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
478
+ if (data.changesetId !== undefined && data.changesetId !== null) {
479
+ contents.changesetId = smithy_client_1.expectString(data.changesetId);
480
+ }
481
+ if (data.datasetId !== undefined && data.datasetId !== null) {
482
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
483
+ }
484
+ return Promise.resolve(contents);
485
+ };
486
+ exports.deserializeAws_restJson1CreateChangesetCommand = deserializeAws_restJson1CreateChangesetCommand;
487
+ const deserializeAws_restJson1CreateChangesetCommandError = async (output, context) => {
488
+ const parsedOutput = {
489
+ ...output,
490
+ body: await parseBody(output.body, context),
491
+ };
492
+ let response;
493
+ let errorCode = "UnknownError";
494
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
495
+ switch (errorCode) {
496
+ case "AccessDeniedException":
497
+ case "com.amazonaws.finspacedata#AccessDeniedException":
498
+ response = {
499
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
500
+ name: errorCode,
501
+ $metadata: deserializeMetadata(output),
502
+ };
503
+ break;
504
+ case "ConflictException":
505
+ case "com.amazonaws.finspacedata#ConflictException":
506
+ response = {
507
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
508
+ name: errorCode,
509
+ $metadata: deserializeMetadata(output),
510
+ };
511
+ break;
512
+ case "InternalServerException":
513
+ case "com.amazonaws.finspacedata#InternalServerException":
514
+ response = {
515
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
516
+ name: errorCode,
517
+ $metadata: deserializeMetadata(output),
518
+ };
519
+ break;
520
+ case "LimitExceededException":
521
+ case "com.amazonaws.finspacedata#LimitExceededException":
522
+ response = {
523
+ ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
524
+ name: errorCode,
525
+ $metadata: deserializeMetadata(output),
526
+ };
527
+ break;
528
+ case "ResourceNotFoundException":
529
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
530
+ response = {
531
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
532
+ name: errorCode,
533
+ $metadata: deserializeMetadata(output),
534
+ };
535
+ break;
536
+ case "ThrottlingException":
537
+ case "com.amazonaws.finspacedata#ThrottlingException":
538
+ response = {
539
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
540
+ name: errorCode,
541
+ $metadata: deserializeMetadata(output),
542
+ };
543
+ break;
544
+ case "ValidationException":
545
+ case "com.amazonaws.finspacedata#ValidationException":
546
+ response = {
547
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
548
+ name: errorCode,
549
+ $metadata: deserializeMetadata(output),
550
+ };
551
+ break;
552
+ default:
553
+ const parsedBody = parsedOutput.body;
554
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
555
+ response = {
556
+ ...parsedBody,
557
+ name: `${errorCode}`,
558
+ message: parsedBody.message || parsedBody.Message || errorCode,
559
+ $fault: "client",
560
+ $metadata: deserializeMetadata(output),
561
+ };
562
+ }
563
+ const message = response.message || response.Message || errorCode;
564
+ response.message = message;
565
+ delete response.Message;
566
+ return Promise.reject(Object.assign(new Error(message), response));
567
+ };
568
+ const deserializeAws_restJson1CreateDatasetCommand = async (output, context) => {
569
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
570
+ return deserializeAws_restJson1CreateDatasetCommandError(output, context);
571
+ }
572
+ const contents = {
573
+ $metadata: deserializeMetadata(output),
574
+ datasetId: undefined,
575
+ };
576
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
577
+ if (data.datasetId !== undefined && data.datasetId !== null) {
578
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
579
+ }
580
+ return Promise.resolve(contents);
581
+ };
582
+ exports.deserializeAws_restJson1CreateDatasetCommand = deserializeAws_restJson1CreateDatasetCommand;
583
+ const deserializeAws_restJson1CreateDatasetCommandError = async (output, context) => {
584
+ const parsedOutput = {
585
+ ...output,
586
+ body: await parseBody(output.body, context),
587
+ };
588
+ let response;
589
+ let errorCode = "UnknownError";
590
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
591
+ switch (errorCode) {
592
+ case "AccessDeniedException":
593
+ case "com.amazonaws.finspacedata#AccessDeniedException":
594
+ response = {
595
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
596
+ name: errorCode,
597
+ $metadata: deserializeMetadata(output),
598
+ };
599
+ break;
600
+ case "ConflictException":
601
+ case "com.amazonaws.finspacedata#ConflictException":
602
+ response = {
603
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
604
+ name: errorCode,
605
+ $metadata: deserializeMetadata(output),
606
+ };
607
+ break;
608
+ case "InternalServerException":
609
+ case "com.amazonaws.finspacedata#InternalServerException":
610
+ response = {
611
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
612
+ name: errorCode,
613
+ $metadata: deserializeMetadata(output),
614
+ };
615
+ break;
616
+ case "LimitExceededException":
617
+ case "com.amazonaws.finspacedata#LimitExceededException":
618
+ response = {
619
+ ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
620
+ name: errorCode,
621
+ $metadata: deserializeMetadata(output),
622
+ };
623
+ break;
624
+ case "ResourceNotFoundException":
625
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
626
+ response = {
627
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
628
+ name: errorCode,
629
+ $metadata: deserializeMetadata(output),
630
+ };
631
+ break;
632
+ case "ThrottlingException":
633
+ case "com.amazonaws.finspacedata#ThrottlingException":
634
+ response = {
635
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
636
+ name: errorCode,
637
+ $metadata: deserializeMetadata(output),
638
+ };
639
+ break;
640
+ case "ValidationException":
641
+ case "com.amazonaws.finspacedata#ValidationException":
642
+ response = {
643
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
644
+ name: errorCode,
645
+ $metadata: deserializeMetadata(output),
646
+ };
647
+ break;
648
+ default:
649
+ const parsedBody = parsedOutput.body;
650
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
651
+ response = {
652
+ ...parsedBody,
653
+ name: `${errorCode}`,
654
+ message: parsedBody.message || parsedBody.Message || errorCode,
655
+ $fault: "client",
656
+ $metadata: deserializeMetadata(output),
657
+ };
658
+ }
659
+ const message = response.message || response.Message || errorCode;
660
+ response.message = message;
661
+ delete response.Message;
662
+ return Promise.reject(Object.assign(new Error(message), response));
663
+ };
664
+ const deserializeAws_restJson1CreateDataViewCommand = async (output, context) => {
665
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
666
+ return deserializeAws_restJson1CreateDataViewCommandError(output, context);
667
+ }
668
+ const contents = {
669
+ $metadata: deserializeMetadata(output),
670
+ dataViewId: undefined,
671
+ datasetId: undefined,
672
+ };
673
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
674
+ if (data.dataViewId !== undefined && data.dataViewId !== null) {
675
+ contents.dataViewId = smithy_client_1.expectString(data.dataViewId);
676
+ }
677
+ if (data.datasetId !== undefined && data.datasetId !== null) {
678
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
679
+ }
680
+ return Promise.resolve(contents);
681
+ };
682
+ exports.deserializeAws_restJson1CreateDataViewCommand = deserializeAws_restJson1CreateDataViewCommand;
683
+ const deserializeAws_restJson1CreateDataViewCommandError = async (output, context) => {
684
+ const parsedOutput = {
685
+ ...output,
686
+ body: await parseBody(output.body, context),
687
+ };
688
+ let response;
689
+ let errorCode = "UnknownError";
690
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
691
+ switch (errorCode) {
692
+ case "ConflictException":
693
+ case "com.amazonaws.finspacedata#ConflictException":
694
+ response = {
695
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
696
+ name: errorCode,
697
+ $metadata: deserializeMetadata(output),
698
+ };
699
+ break;
700
+ case "InternalServerException":
701
+ case "com.amazonaws.finspacedata#InternalServerException":
702
+ response = {
703
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
704
+ name: errorCode,
705
+ $metadata: deserializeMetadata(output),
706
+ };
707
+ break;
708
+ case "LimitExceededException":
709
+ case "com.amazonaws.finspacedata#LimitExceededException":
710
+ response = {
711
+ ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
712
+ name: errorCode,
713
+ $metadata: deserializeMetadata(output),
714
+ };
715
+ break;
716
+ case "ResourceNotFoundException":
717
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
718
+ response = {
719
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
720
+ name: errorCode,
721
+ $metadata: deserializeMetadata(output),
722
+ };
723
+ break;
724
+ case "ThrottlingException":
725
+ case "com.amazonaws.finspacedata#ThrottlingException":
726
+ response = {
727
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
728
+ name: errorCode,
729
+ $metadata: deserializeMetadata(output),
730
+ };
731
+ break;
732
+ case "ValidationException":
733
+ case "com.amazonaws.finspacedata#ValidationException":
734
+ response = {
735
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
736
+ name: errorCode,
737
+ $metadata: deserializeMetadata(output),
738
+ };
739
+ break;
740
+ default:
741
+ const parsedBody = parsedOutput.body;
742
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
743
+ response = {
744
+ ...parsedBody,
745
+ name: `${errorCode}`,
746
+ message: parsedBody.message || parsedBody.Message || errorCode,
747
+ $fault: "client",
748
+ $metadata: deserializeMetadata(output),
749
+ };
750
+ }
751
+ const message = response.message || response.Message || errorCode;
752
+ response.message = message;
753
+ delete response.Message;
754
+ return Promise.reject(Object.assign(new Error(message), response));
755
+ };
756
+ const deserializeAws_restJson1DeleteDatasetCommand = async (output, context) => {
757
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
758
+ return deserializeAws_restJson1DeleteDatasetCommandError(output, context);
759
+ }
760
+ const contents = {
761
+ $metadata: deserializeMetadata(output),
762
+ datasetId: undefined,
763
+ };
764
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
765
+ if (data.datasetId !== undefined && data.datasetId !== null) {
766
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
767
+ }
768
+ return Promise.resolve(contents);
769
+ };
770
+ exports.deserializeAws_restJson1DeleteDatasetCommand = deserializeAws_restJson1DeleteDatasetCommand;
771
+ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context) => {
772
+ const parsedOutput = {
773
+ ...output,
774
+ body: await parseBody(output.body, context),
775
+ };
776
+ let response;
777
+ let errorCode = "UnknownError";
778
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
779
+ switch (errorCode) {
780
+ case "AccessDeniedException":
781
+ case "com.amazonaws.finspacedata#AccessDeniedException":
782
+ response = {
783
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
784
+ name: errorCode,
785
+ $metadata: deserializeMetadata(output),
786
+ };
787
+ break;
788
+ case "ConflictException":
789
+ case "com.amazonaws.finspacedata#ConflictException":
790
+ response = {
791
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
792
+ name: errorCode,
793
+ $metadata: deserializeMetadata(output),
794
+ };
795
+ break;
796
+ case "InternalServerException":
797
+ case "com.amazonaws.finspacedata#InternalServerException":
798
+ response = {
799
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
800
+ name: errorCode,
801
+ $metadata: deserializeMetadata(output),
802
+ };
803
+ break;
804
+ case "LimitExceededException":
805
+ case "com.amazonaws.finspacedata#LimitExceededException":
806
+ response = {
807
+ ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
808
+ name: errorCode,
809
+ $metadata: deserializeMetadata(output),
810
+ };
811
+ break;
812
+ case "ResourceNotFoundException":
813
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
814
+ response = {
815
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
816
+ name: errorCode,
817
+ $metadata: deserializeMetadata(output),
818
+ };
819
+ break;
820
+ case "ThrottlingException":
821
+ case "com.amazonaws.finspacedata#ThrottlingException":
822
+ response = {
823
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
824
+ name: errorCode,
825
+ $metadata: deserializeMetadata(output),
826
+ };
827
+ break;
828
+ case "ValidationException":
829
+ case "com.amazonaws.finspacedata#ValidationException":
830
+ response = {
831
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
832
+ name: errorCode,
833
+ $metadata: deserializeMetadata(output),
834
+ };
835
+ break;
836
+ default:
837
+ const parsedBody = parsedOutput.body;
838
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
839
+ response = {
840
+ ...parsedBody,
841
+ name: `${errorCode}`,
842
+ message: parsedBody.message || parsedBody.Message || errorCode,
843
+ $fault: "client",
844
+ $metadata: deserializeMetadata(output),
845
+ };
846
+ }
847
+ const message = response.message || response.Message || errorCode;
848
+ response.message = message;
849
+ delete response.Message;
850
+ return Promise.reject(Object.assign(new Error(message), response));
851
+ };
852
+ const deserializeAws_restJson1GetChangesetCommand = async (output, context) => {
853
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
854
+ return deserializeAws_restJson1GetChangesetCommandError(output, context);
855
+ }
856
+ const contents = {
857
+ $metadata: deserializeMetadata(output),
858
+ activeFromTimestamp: undefined,
859
+ activeUntilTimestamp: undefined,
860
+ changeType: undefined,
861
+ changesetArn: undefined,
862
+ changesetId: undefined,
863
+ createTime: undefined,
864
+ datasetId: undefined,
865
+ errorInfo: undefined,
866
+ formatParams: undefined,
867
+ sourceParams: undefined,
868
+ status: undefined,
869
+ updatedByChangesetId: undefined,
870
+ updatesChangesetId: undefined,
871
+ };
872
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
873
+ if (data.activeFromTimestamp !== undefined && data.activeFromTimestamp !== null) {
874
+ contents.activeFromTimestamp = smithy_client_1.expectLong(data.activeFromTimestamp);
875
+ }
876
+ if (data.activeUntilTimestamp !== undefined && data.activeUntilTimestamp !== null) {
877
+ contents.activeUntilTimestamp = smithy_client_1.expectLong(data.activeUntilTimestamp);
878
+ }
879
+ if (data.changeType !== undefined && data.changeType !== null) {
880
+ contents.changeType = smithy_client_1.expectString(data.changeType);
881
+ }
882
+ if (data.changesetArn !== undefined && data.changesetArn !== null) {
883
+ contents.changesetArn = smithy_client_1.expectString(data.changesetArn);
884
+ }
885
+ if (data.changesetId !== undefined && data.changesetId !== null) {
886
+ contents.changesetId = smithy_client_1.expectString(data.changesetId);
887
+ }
888
+ if (data.createTime !== undefined && data.createTime !== null) {
889
+ contents.createTime = smithy_client_1.expectLong(data.createTime);
890
+ }
891
+ if (data.datasetId !== undefined && data.datasetId !== null) {
892
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
893
+ }
894
+ if (data.errorInfo !== undefined && data.errorInfo !== null) {
895
+ contents.errorInfo = deserializeAws_restJson1ChangesetErrorInfo(data.errorInfo, context);
896
+ }
897
+ if (data.formatParams !== undefined && data.formatParams !== null) {
898
+ contents.formatParams = deserializeAws_restJson1FormatParams(data.formatParams, context);
899
+ }
900
+ if (data.sourceParams !== undefined && data.sourceParams !== null) {
901
+ contents.sourceParams = deserializeAws_restJson1SourceParams(data.sourceParams, context);
902
+ }
903
+ if (data.status !== undefined && data.status !== null) {
904
+ contents.status = smithy_client_1.expectString(data.status);
905
+ }
906
+ if (data.updatedByChangesetId !== undefined && data.updatedByChangesetId !== null) {
907
+ contents.updatedByChangesetId = smithy_client_1.expectString(data.updatedByChangesetId);
908
+ }
909
+ if (data.updatesChangesetId !== undefined && data.updatesChangesetId !== null) {
910
+ contents.updatesChangesetId = smithy_client_1.expectString(data.updatesChangesetId);
911
+ }
912
+ return Promise.resolve(contents);
913
+ };
914
+ exports.deserializeAws_restJson1GetChangesetCommand = deserializeAws_restJson1GetChangesetCommand;
915
+ const deserializeAws_restJson1GetChangesetCommandError = async (output, context) => {
916
+ const parsedOutput = {
917
+ ...output,
918
+ body: await parseBody(output.body, context),
919
+ };
920
+ let response;
921
+ let errorCode = "UnknownError";
922
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
923
+ switch (errorCode) {
924
+ case "AccessDeniedException":
925
+ case "com.amazonaws.finspacedata#AccessDeniedException":
926
+ response = {
927
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
928
+ name: errorCode,
929
+ $metadata: deserializeMetadata(output),
930
+ };
931
+ break;
932
+ case "ConflictException":
933
+ case "com.amazonaws.finspacedata#ConflictException":
934
+ response = {
935
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
936
+ name: errorCode,
937
+ $metadata: deserializeMetadata(output),
938
+ };
939
+ break;
940
+ case "InternalServerException":
941
+ case "com.amazonaws.finspacedata#InternalServerException":
942
+ response = {
943
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
944
+ name: errorCode,
945
+ $metadata: deserializeMetadata(output),
946
+ };
947
+ break;
948
+ case "ResourceNotFoundException":
949
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
950
+ response = {
951
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
952
+ name: errorCode,
953
+ $metadata: deserializeMetadata(output),
954
+ };
955
+ break;
956
+ case "ThrottlingException":
957
+ case "com.amazonaws.finspacedata#ThrottlingException":
958
+ response = {
959
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
960
+ name: errorCode,
961
+ $metadata: deserializeMetadata(output),
962
+ };
963
+ break;
964
+ case "ValidationException":
965
+ case "com.amazonaws.finspacedata#ValidationException":
966
+ response = {
967
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
968
+ name: errorCode,
969
+ $metadata: deserializeMetadata(output),
970
+ };
971
+ break;
972
+ default:
973
+ const parsedBody = parsedOutput.body;
974
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
975
+ response = {
976
+ ...parsedBody,
977
+ name: `${errorCode}`,
978
+ message: parsedBody.message || parsedBody.Message || errorCode,
979
+ $fault: "client",
980
+ $metadata: deserializeMetadata(output),
981
+ };
982
+ }
983
+ const message = response.message || response.Message || errorCode;
984
+ response.message = message;
985
+ delete response.Message;
986
+ return Promise.reject(Object.assign(new Error(message), response));
987
+ };
988
+ const deserializeAws_restJson1GetDatasetCommand = async (output, context) => {
989
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
990
+ return deserializeAws_restJson1GetDatasetCommandError(output, context);
991
+ }
992
+ const contents = {
993
+ $metadata: deserializeMetadata(output),
994
+ alias: undefined,
995
+ createTime: undefined,
996
+ datasetArn: undefined,
997
+ datasetDescription: undefined,
998
+ datasetId: undefined,
999
+ datasetTitle: undefined,
1000
+ kind: undefined,
1001
+ lastModifiedTime: undefined,
1002
+ schemaDefinition: undefined,
1003
+ status: undefined,
1004
+ };
1005
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1006
+ if (data.alias !== undefined && data.alias !== null) {
1007
+ contents.alias = smithy_client_1.expectString(data.alias);
1008
+ }
1009
+ if (data.createTime !== undefined && data.createTime !== null) {
1010
+ contents.createTime = smithy_client_1.expectLong(data.createTime);
1011
+ }
1012
+ if (data.datasetArn !== undefined && data.datasetArn !== null) {
1013
+ contents.datasetArn = smithy_client_1.expectString(data.datasetArn);
1014
+ }
1015
+ if (data.datasetDescription !== undefined && data.datasetDescription !== null) {
1016
+ contents.datasetDescription = smithy_client_1.expectString(data.datasetDescription);
1017
+ }
1018
+ if (data.datasetId !== undefined && data.datasetId !== null) {
1019
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
1020
+ }
1021
+ if (data.datasetTitle !== undefined && data.datasetTitle !== null) {
1022
+ contents.datasetTitle = smithy_client_1.expectString(data.datasetTitle);
1023
+ }
1024
+ if (data.kind !== undefined && data.kind !== null) {
1025
+ contents.kind = smithy_client_1.expectString(data.kind);
1026
+ }
1027
+ if (data.lastModifiedTime !== undefined && data.lastModifiedTime !== null) {
1028
+ contents.lastModifiedTime = smithy_client_1.expectLong(data.lastModifiedTime);
1029
+ }
1030
+ if (data.schemaDefinition !== undefined && data.schemaDefinition !== null) {
1031
+ contents.schemaDefinition = deserializeAws_restJson1SchemaUnion(data.schemaDefinition, context);
1032
+ }
1033
+ if (data.status !== undefined && data.status !== null) {
1034
+ contents.status = smithy_client_1.expectString(data.status);
1035
+ }
1036
+ return Promise.resolve(contents);
1037
+ };
1038
+ exports.deserializeAws_restJson1GetDatasetCommand = deserializeAws_restJson1GetDatasetCommand;
1039
+ const deserializeAws_restJson1GetDatasetCommandError = async (output, context) => {
1040
+ const parsedOutput = {
1041
+ ...output,
1042
+ body: await parseBody(output.body, context),
1043
+ };
1044
+ let response;
1045
+ let errorCode = "UnknownError";
1046
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1047
+ switch (errorCode) {
1048
+ case "AccessDeniedException":
1049
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1050
+ response = {
1051
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1052
+ name: errorCode,
1053
+ $metadata: deserializeMetadata(output),
1054
+ };
1055
+ break;
1056
+ case "ConflictException":
1057
+ case "com.amazonaws.finspacedata#ConflictException":
1058
+ response = {
1059
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1060
+ name: errorCode,
1061
+ $metadata: deserializeMetadata(output),
1062
+ };
1063
+ break;
1064
+ case "InternalServerException":
1065
+ case "com.amazonaws.finspacedata#InternalServerException":
1066
+ response = {
1067
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1068
+ name: errorCode,
1069
+ $metadata: deserializeMetadata(output),
1070
+ };
1071
+ break;
1072
+ case "ResourceNotFoundException":
1073
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1074
+ response = {
1075
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1076
+ name: errorCode,
1077
+ $metadata: deserializeMetadata(output),
1078
+ };
1079
+ break;
1080
+ case "ThrottlingException":
1081
+ case "com.amazonaws.finspacedata#ThrottlingException":
1082
+ response = {
1083
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1084
+ name: errorCode,
1085
+ $metadata: deserializeMetadata(output),
1086
+ };
1087
+ break;
1088
+ case "ValidationException":
1089
+ case "com.amazonaws.finspacedata#ValidationException":
1090
+ response = {
1091
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1092
+ name: errorCode,
1093
+ $metadata: deserializeMetadata(output),
1094
+ };
1095
+ break;
1096
+ default:
1097
+ const parsedBody = parsedOutput.body;
1098
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1099
+ response = {
1100
+ ...parsedBody,
1101
+ name: `${errorCode}`,
1102
+ message: parsedBody.message || parsedBody.Message || errorCode,
1103
+ $fault: "client",
1104
+ $metadata: deserializeMetadata(output),
1105
+ };
1106
+ }
1107
+ const message = response.message || response.Message || errorCode;
1108
+ response.message = message;
1109
+ delete response.Message;
1110
+ return Promise.reject(Object.assign(new Error(message), response));
1111
+ };
1112
+ const deserializeAws_restJson1GetDataViewCommand = async (output, context) => {
1113
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1114
+ return deserializeAws_restJson1GetDataViewCommandError(output, context);
1115
+ }
1116
+ const contents = {
1117
+ $metadata: deserializeMetadata(output),
1118
+ asOfTimestamp: undefined,
1119
+ autoUpdate: undefined,
1120
+ createTime: undefined,
1121
+ dataViewArn: undefined,
1122
+ dataViewId: undefined,
1123
+ datasetId: undefined,
1124
+ destinationTypeParams: undefined,
1125
+ errorInfo: undefined,
1126
+ lastModifiedTime: undefined,
1127
+ partitionColumns: undefined,
1128
+ sortColumns: undefined,
1129
+ status: undefined,
1130
+ };
1131
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1132
+ if (data.asOfTimestamp !== undefined && data.asOfTimestamp !== null) {
1133
+ contents.asOfTimestamp = smithy_client_1.expectLong(data.asOfTimestamp);
1134
+ }
1135
+ if (data.autoUpdate !== undefined && data.autoUpdate !== null) {
1136
+ contents.autoUpdate = smithy_client_1.expectBoolean(data.autoUpdate);
1137
+ }
1138
+ if (data.createTime !== undefined && data.createTime !== null) {
1139
+ contents.createTime = smithy_client_1.expectLong(data.createTime);
1140
+ }
1141
+ if (data.dataViewArn !== undefined && data.dataViewArn !== null) {
1142
+ contents.dataViewArn = smithy_client_1.expectString(data.dataViewArn);
1143
+ }
1144
+ if (data.dataViewId !== undefined && data.dataViewId !== null) {
1145
+ contents.dataViewId = smithy_client_1.expectString(data.dataViewId);
1146
+ }
1147
+ if (data.datasetId !== undefined && data.datasetId !== null) {
1148
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
1149
+ }
1150
+ if (data.destinationTypeParams !== undefined && data.destinationTypeParams !== null) {
1151
+ contents.destinationTypeParams = deserializeAws_restJson1DataViewDestinationTypeParams(data.destinationTypeParams, context);
1152
+ }
1153
+ if (data.errorInfo !== undefined && data.errorInfo !== null) {
1154
+ contents.errorInfo = deserializeAws_restJson1DataViewErrorInfo(data.errorInfo, context);
1155
+ }
1156
+ if (data.lastModifiedTime !== undefined && data.lastModifiedTime !== null) {
1157
+ contents.lastModifiedTime = smithy_client_1.expectLong(data.lastModifiedTime);
1158
+ }
1159
+ if (data.partitionColumns !== undefined && data.partitionColumns !== null) {
1160
+ contents.partitionColumns = deserializeAws_restJson1PartitionColumnList(data.partitionColumns, context);
1161
+ }
1162
+ if (data.sortColumns !== undefined && data.sortColumns !== null) {
1163
+ contents.sortColumns = deserializeAws_restJson1SortColumnList(data.sortColumns, context);
1164
+ }
1165
+ if (data.status !== undefined && data.status !== null) {
1166
+ contents.status = smithy_client_1.expectString(data.status);
1167
+ }
1168
+ return Promise.resolve(contents);
1169
+ };
1170
+ exports.deserializeAws_restJson1GetDataViewCommand = deserializeAws_restJson1GetDataViewCommand;
1171
+ const deserializeAws_restJson1GetDataViewCommandError = async (output, context) => {
1172
+ const parsedOutput = {
1173
+ ...output,
1174
+ body: await parseBody(output.body, context),
1175
+ };
1176
+ let response;
1177
+ let errorCode = "UnknownError";
1178
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
+ switch (errorCode) {
1180
+ case "ConflictException":
1181
+ case "com.amazonaws.finspacedata#ConflictException":
1182
+ response = {
1183
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1184
+ name: errorCode,
1185
+ $metadata: deserializeMetadata(output),
1186
+ };
1187
+ break;
1188
+ case "InternalServerException":
1189
+ case "com.amazonaws.finspacedata#InternalServerException":
1190
+ response = {
1191
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1192
+ name: errorCode,
1193
+ $metadata: deserializeMetadata(output),
1194
+ };
1195
+ break;
1196
+ case "ResourceNotFoundException":
1197
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1198
+ response = {
1199
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1200
+ name: errorCode,
1201
+ $metadata: deserializeMetadata(output),
1202
+ };
1203
+ break;
1204
+ case "ThrottlingException":
1205
+ case "com.amazonaws.finspacedata#ThrottlingException":
1206
+ response = {
1207
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1208
+ name: errorCode,
1209
+ $metadata: deserializeMetadata(output),
1210
+ };
1211
+ break;
1212
+ case "ValidationException":
1213
+ case "com.amazonaws.finspacedata#ValidationException":
1214
+ response = {
1215
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1216
+ name: errorCode,
1217
+ $metadata: deserializeMetadata(output),
1218
+ };
1219
+ break;
1220
+ default:
1221
+ const parsedBody = parsedOutput.body;
1222
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1223
+ response = {
1224
+ ...parsedBody,
1225
+ name: `${errorCode}`,
1226
+ message: parsedBody.message || parsedBody.Message || errorCode,
1227
+ $fault: "client",
1228
+ $metadata: deserializeMetadata(output),
1229
+ };
1230
+ }
1231
+ const message = response.message || response.Message || errorCode;
1232
+ response.message = message;
1233
+ delete response.Message;
1234
+ return Promise.reject(Object.assign(new Error(message), response));
1235
+ };
1236
+ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (output, context) => {
1237
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1238
+ return deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError(output, context);
1239
+ }
1240
+ const contents = {
1241
+ $metadata: deserializeMetadata(output),
1242
+ credentials: undefined,
1243
+ durationInMinutes: undefined,
1244
+ };
1245
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1246
+ if (data.credentials !== undefined && data.credentials !== null) {
1247
+ contents.credentials = deserializeAws_restJson1Credentials(data.credentials, context);
1248
+ }
1249
+ if (data.durationInMinutes !== undefined && data.durationInMinutes !== null) {
1250
+ contents.durationInMinutes = smithy_client_1.expectLong(data.durationInMinutes);
1251
+ }
1252
+ return Promise.resolve(contents);
1253
+ };
1254
+ exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand;
1255
+ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = async (output, context) => {
1256
+ const parsedOutput = {
1257
+ ...output,
1258
+ body: await parseBody(output.body, context),
1259
+ };
1260
+ let response;
1261
+ let errorCode = "UnknownError";
1262
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1263
+ switch (errorCode) {
1264
+ case "AccessDeniedException":
1265
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1266
+ response = {
1267
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1268
+ name: errorCode,
1269
+ $metadata: deserializeMetadata(output),
1270
+ };
1271
+ break;
1272
+ case "InternalServerException":
1273
+ case "com.amazonaws.finspacedata#InternalServerException":
1274
+ response = {
1275
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1276
+ name: errorCode,
1277
+ $metadata: deserializeMetadata(output),
1278
+ };
1279
+ break;
1280
+ case "ThrottlingException":
1281
+ case "com.amazonaws.finspacedata#ThrottlingException":
1282
+ response = {
1283
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1284
+ name: errorCode,
1285
+ $metadata: deserializeMetadata(output),
1286
+ };
1287
+ break;
1288
+ case "ValidationException":
1289
+ case "com.amazonaws.finspacedata#ValidationException":
1290
+ response = {
1291
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1292
+ name: errorCode,
1293
+ $metadata: deserializeMetadata(output),
1294
+ };
1295
+ break;
1296
+ default:
1297
+ const parsedBody = parsedOutput.body;
1298
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1299
+ response = {
1300
+ ...parsedBody,
1301
+ name: `${errorCode}`,
1302
+ message: parsedBody.message || parsedBody.Message || errorCode,
1303
+ $fault: "client",
1304
+ $metadata: deserializeMetadata(output),
1305
+ };
1306
+ }
1307
+ const message = response.message || response.Message || errorCode;
1308
+ response.message = message;
1309
+ delete response.Message;
1310
+ return Promise.reject(Object.assign(new Error(message), response));
1311
+ };
1312
+ const deserializeAws_restJson1GetWorkingLocationCommand = async (output, context) => {
1313
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1314
+ return deserializeAws_restJson1GetWorkingLocationCommandError(output, context);
1315
+ }
1316
+ const contents = {
1317
+ $metadata: deserializeMetadata(output),
1318
+ s3Bucket: undefined,
1319
+ s3Path: undefined,
1320
+ s3Uri: undefined,
1321
+ };
1322
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1323
+ if (data.s3Bucket !== undefined && data.s3Bucket !== null) {
1324
+ contents.s3Bucket = smithy_client_1.expectString(data.s3Bucket);
1325
+ }
1326
+ if (data.s3Path !== undefined && data.s3Path !== null) {
1327
+ contents.s3Path = smithy_client_1.expectString(data.s3Path);
1328
+ }
1329
+ if (data.s3Uri !== undefined && data.s3Uri !== null) {
1330
+ contents.s3Uri = smithy_client_1.expectString(data.s3Uri);
1331
+ }
1332
+ return Promise.resolve(contents);
1333
+ };
1334
+ exports.deserializeAws_restJson1GetWorkingLocationCommand = deserializeAws_restJson1GetWorkingLocationCommand;
1335
+ const deserializeAws_restJson1GetWorkingLocationCommandError = async (output, context) => {
1336
+ const parsedOutput = {
1337
+ ...output,
1338
+ body: await parseBody(output.body, context),
1339
+ };
1340
+ let response;
1341
+ let errorCode = "UnknownError";
1342
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1343
+ switch (errorCode) {
1344
+ case "AccessDeniedException":
1345
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1346
+ response = {
1347
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1348
+ name: errorCode,
1349
+ $metadata: deserializeMetadata(output),
1350
+ };
1351
+ break;
1352
+ case "InternalServerException":
1353
+ case "com.amazonaws.finspacedata#InternalServerException":
1354
+ response = {
1355
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1356
+ name: errorCode,
1357
+ $metadata: deserializeMetadata(output),
1358
+ };
1359
+ break;
1360
+ case "ThrottlingException":
1361
+ case "com.amazonaws.finspacedata#ThrottlingException":
1362
+ response = {
1363
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1364
+ name: errorCode,
1365
+ $metadata: deserializeMetadata(output),
1366
+ };
1367
+ break;
1368
+ case "ValidationException":
1369
+ case "com.amazonaws.finspacedata#ValidationException":
1370
+ response = {
1371
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1372
+ name: errorCode,
1373
+ $metadata: deserializeMetadata(output),
1374
+ };
1375
+ break;
1376
+ default:
1377
+ const parsedBody = parsedOutput.body;
1378
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1379
+ response = {
1380
+ ...parsedBody,
1381
+ name: `${errorCode}`,
1382
+ message: parsedBody.message || parsedBody.Message || errorCode,
1383
+ $fault: "client",
1384
+ $metadata: deserializeMetadata(output),
1385
+ };
1386
+ }
1387
+ const message = response.message || response.Message || errorCode;
1388
+ response.message = message;
1389
+ delete response.Message;
1390
+ return Promise.reject(Object.assign(new Error(message), response));
1391
+ };
1392
+ const deserializeAws_restJson1ListChangesetsCommand = async (output, context) => {
1393
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1394
+ return deserializeAws_restJson1ListChangesetsCommandError(output, context);
1395
+ }
1396
+ const contents = {
1397
+ $metadata: deserializeMetadata(output),
1398
+ changesets: undefined,
1399
+ nextToken: undefined,
1400
+ };
1401
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1402
+ if (data.changesets !== undefined && data.changesets !== null) {
1403
+ contents.changesets = deserializeAws_restJson1ChangesetList(data.changesets, context);
1404
+ }
1405
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1406
+ contents.nextToken = smithy_client_1.expectString(data.nextToken);
1407
+ }
1408
+ return Promise.resolve(contents);
1409
+ };
1410
+ exports.deserializeAws_restJson1ListChangesetsCommand = deserializeAws_restJson1ListChangesetsCommand;
1411
+ const deserializeAws_restJson1ListChangesetsCommandError = async (output, context) => {
1412
+ const parsedOutput = {
1413
+ ...output,
1414
+ body: await parseBody(output.body, context),
1415
+ };
1416
+ let response;
1417
+ let errorCode = "UnknownError";
1418
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1419
+ switch (errorCode) {
1420
+ case "AccessDeniedException":
1421
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1422
+ response = {
1423
+ ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1424
+ name: errorCode,
1425
+ $metadata: deserializeMetadata(output),
1426
+ };
1427
+ break;
1428
+ case "ConflictException":
1429
+ case "com.amazonaws.finspacedata#ConflictException":
1430
+ response = {
1431
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1432
+ name: errorCode,
1433
+ $metadata: deserializeMetadata(output),
1434
+ };
1435
+ break;
1436
+ case "InternalServerException":
1437
+ case "com.amazonaws.finspacedata#InternalServerException":
1438
+ response = {
1439
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1440
+ name: errorCode,
1441
+ $metadata: deserializeMetadata(output),
1442
+ };
1443
+ break;
1444
+ case "ResourceNotFoundException":
1445
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1446
+ response = {
1447
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1448
+ name: errorCode,
1449
+ $metadata: deserializeMetadata(output),
1450
+ };
1451
+ break;
1452
+ case "ThrottlingException":
1453
+ case "com.amazonaws.finspacedata#ThrottlingException":
1454
+ response = {
1455
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1456
+ name: errorCode,
1457
+ $metadata: deserializeMetadata(output),
1458
+ };
1459
+ break;
1460
+ case "ValidationException":
1461
+ case "com.amazonaws.finspacedata#ValidationException":
1462
+ response = {
1463
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1464
+ name: errorCode,
1465
+ $metadata: deserializeMetadata(output),
1466
+ };
1467
+ break;
1468
+ default:
1469
+ const parsedBody = parsedOutput.body;
1470
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1471
+ response = {
1472
+ ...parsedBody,
1473
+ name: `${errorCode}`,
1474
+ message: parsedBody.message || parsedBody.Message || errorCode,
1475
+ $fault: "client",
1476
+ $metadata: deserializeMetadata(output),
1477
+ };
1478
+ }
1479
+ const message = response.message || response.Message || errorCode;
1480
+ response.message = message;
1481
+ delete response.Message;
1482
+ return Promise.reject(Object.assign(new Error(message), response));
1483
+ };
1484
+ const deserializeAws_restJson1ListDatasetsCommand = async (output, context) => {
1485
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1486
+ return deserializeAws_restJson1ListDatasetsCommandError(output, context);
1487
+ }
1488
+ const contents = {
1489
+ $metadata: deserializeMetadata(output),
1490
+ datasets: undefined,
1491
+ nextToken: undefined,
1492
+ };
1493
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1494
+ if (data.datasets !== undefined && data.datasets !== null) {
1495
+ contents.datasets = deserializeAws_restJson1DatasetList(data.datasets, context);
1496
+ }
1497
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1498
+ contents.nextToken = smithy_client_1.expectString(data.nextToken);
1499
+ }
1500
+ return Promise.resolve(contents);
1501
+ };
1502
+ exports.deserializeAws_restJson1ListDatasetsCommand = deserializeAws_restJson1ListDatasetsCommand;
1503
+ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context) => {
1504
+ const parsedOutput = {
1505
+ ...output,
1506
+ body: await parseBody(output.body, context),
1507
+ };
1508
+ let response;
1509
+ let errorCode = "UnknownError";
1510
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1511
+ switch (errorCode) {
1512
+ case "ConflictException":
1513
+ case "com.amazonaws.finspacedata#ConflictException":
1514
+ response = {
1515
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1516
+ name: errorCode,
1517
+ $metadata: deserializeMetadata(output),
1518
+ };
1519
+ break;
1520
+ case "InternalServerException":
1521
+ case "com.amazonaws.finspacedata#InternalServerException":
1522
+ response = {
1523
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1524
+ name: errorCode,
1525
+ $metadata: deserializeMetadata(output),
1526
+ };
1527
+ break;
1528
+ case "ResourceNotFoundException":
1529
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1530
+ response = {
1531
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1532
+ name: errorCode,
1533
+ $metadata: deserializeMetadata(output),
1534
+ };
1535
+ break;
1536
+ case "ThrottlingException":
1537
+ case "com.amazonaws.finspacedata#ThrottlingException":
1538
+ response = {
1539
+ ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1540
+ name: errorCode,
1541
+ $metadata: deserializeMetadata(output),
1542
+ };
1543
+ break;
1544
+ case "ValidationException":
1545
+ case "com.amazonaws.finspacedata#ValidationException":
1546
+ response = {
1547
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1548
+ name: errorCode,
1549
+ $metadata: deserializeMetadata(output),
1550
+ };
1551
+ break;
1552
+ default:
1553
+ const parsedBody = parsedOutput.body;
1554
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1555
+ response = {
1556
+ ...parsedBody,
1557
+ name: `${errorCode}`,
1558
+ message: parsedBody.message || parsedBody.Message || errorCode,
1559
+ $fault: "client",
1560
+ $metadata: deserializeMetadata(output),
1561
+ };
1562
+ }
1563
+ const message = response.message || response.Message || errorCode;
1564
+ response.message = message;
1565
+ delete response.Message;
1566
+ return Promise.reject(Object.assign(new Error(message), response));
1567
+ };
1568
+ const deserializeAws_restJson1ListDataViewsCommand = async (output, context) => {
88
1569
  if (output.statusCode !== 200 && output.statusCode >= 300) {
89
- return deserializeAws_restJson1CreateChangesetCommandError(output, context);
1570
+ return deserializeAws_restJson1ListDataViewsCommandError(output, context);
90
1571
  }
91
1572
  const contents = {
92
1573
  $metadata: deserializeMetadata(output),
93
- changeset: undefined,
1574
+ dataViews: undefined,
1575
+ nextToken: undefined,
94
1576
  };
95
1577
  const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
96
- if (data.changeset !== undefined && data.changeset !== null) {
97
- contents.changeset = deserializeAws_restJson1ChangesetInfo(data.changeset, context);
1578
+ if (data.dataViews !== undefined && data.dataViews !== null) {
1579
+ contents.dataViews = deserializeAws_restJson1DataViewList(data.dataViews, context);
1580
+ }
1581
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1582
+ contents.nextToken = smithy_client_1.expectString(data.nextToken);
98
1583
  }
99
1584
  return Promise.resolve(contents);
100
1585
  };
101
- exports.deserializeAws_restJson1CreateChangesetCommand = deserializeAws_restJson1CreateChangesetCommand;
102
- const deserializeAws_restJson1CreateChangesetCommandError = async (output, context) => {
1586
+ exports.deserializeAws_restJson1ListDataViewsCommand = deserializeAws_restJson1ListDataViewsCommand;
1587
+ const deserializeAws_restJson1ListDataViewsCommandError = async (output, context) => {
103
1588
  const parsedOutput = {
104
1589
  ...output,
105
1590
  body: await parseBody(output.body, context),
@@ -108,10 +1593,10 @@ const deserializeAws_restJson1CreateChangesetCommandError = async (output, conte
108
1593
  let errorCode = "UnknownError";
109
1594
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
110
1595
  switch (errorCode) {
111
- case "AccessDeniedException":
112
- case "com.amazonaws.finspacedata#AccessDeniedException":
1596
+ case "ConflictException":
1597
+ case "com.amazonaws.finspacedata#ConflictException":
113
1598
  response = {
114
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1599
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
115
1600
  name: errorCode,
116
1601
  $metadata: deserializeMetadata(output),
117
1602
  };
@@ -164,26 +1649,26 @@ const deserializeAws_restJson1CreateChangesetCommandError = async (output, conte
164
1649
  delete response.Message;
165
1650
  return Promise.reject(Object.assign(new Error(message), response));
166
1651
  };
167
- const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (output, context) => {
1652
+ const deserializeAws_restJson1UpdateChangesetCommand = async (output, context) => {
168
1653
  if (output.statusCode !== 200 && output.statusCode >= 300) {
169
- return deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError(output, context);
1654
+ return deserializeAws_restJson1UpdateChangesetCommandError(output, context);
170
1655
  }
171
1656
  const contents = {
172
1657
  $metadata: deserializeMetadata(output),
173
- credentials: undefined,
174
- durationInMinutes: undefined,
1658
+ changesetId: undefined,
1659
+ datasetId: undefined,
175
1660
  };
176
1661
  const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
177
- if (data.credentials !== undefined && data.credentials !== null) {
178
- contents.credentials = deserializeAws_restJson1Credentials(data.credentials, context);
1662
+ if (data.changesetId !== undefined && data.changesetId !== null) {
1663
+ contents.changesetId = smithy_client_1.expectString(data.changesetId);
179
1664
  }
180
- if (data.durationInMinutes !== undefined && data.durationInMinutes !== null) {
181
- contents.durationInMinutes = smithy_client_1.expectLong(data.durationInMinutes);
1665
+ if (data.datasetId !== undefined && data.datasetId !== null) {
1666
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
182
1667
  }
183
1668
  return Promise.resolve(contents);
184
1669
  };
185
- exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand;
186
- const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = async (output, context) => {
1670
+ exports.deserializeAws_restJson1UpdateChangesetCommand = deserializeAws_restJson1UpdateChangesetCommand;
1671
+ const deserializeAws_restJson1UpdateChangesetCommandError = async (output, context) => {
187
1672
  const parsedOutput = {
188
1673
  ...output,
189
1674
  body: await parseBody(output.body, context),
@@ -200,6 +1685,14 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy
200
1685
  $metadata: deserializeMetadata(output),
201
1686
  };
202
1687
  break;
1688
+ case "ConflictException":
1689
+ case "com.amazonaws.finspacedata#ConflictException":
1690
+ response = {
1691
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1692
+ name: errorCode,
1693
+ $metadata: deserializeMetadata(output),
1694
+ };
1695
+ break;
203
1696
  case "InternalServerException":
204
1697
  case "com.amazonaws.finspacedata#InternalServerException":
205
1698
  response = {
@@ -208,6 +1701,14 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy
208
1701
  $metadata: deserializeMetadata(output),
209
1702
  };
210
1703
  break;
1704
+ case "ResourceNotFoundException":
1705
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1706
+ response = {
1707
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1708
+ name: errorCode,
1709
+ $metadata: deserializeMetadata(output),
1710
+ };
1711
+ break;
211
1712
  case "ThrottlingException":
212
1713
  case "com.amazonaws.finspacedata#ThrottlingException":
213
1714
  response = {
@@ -216,6 +1717,14 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy
216
1717
  $metadata: deserializeMetadata(output),
217
1718
  };
218
1719
  break;
1720
+ case "ValidationException":
1721
+ case "com.amazonaws.finspacedata#ValidationException":
1722
+ response = {
1723
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1724
+ name: errorCode,
1725
+ $metadata: deserializeMetadata(output),
1726
+ };
1727
+ break;
219
1728
  default:
220
1729
  const parsedBody = parsedOutput.body;
221
1730
  errorCode = parsedBody.code || parsedBody.Code || errorCode;
@@ -232,30 +1741,22 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy
232
1741
  delete response.Message;
233
1742
  return Promise.reject(Object.assign(new Error(message), response));
234
1743
  };
235
- const deserializeAws_restJson1GetWorkingLocationCommand = async (output, context) => {
1744
+ const deserializeAws_restJson1UpdateDatasetCommand = async (output, context) => {
236
1745
  if (output.statusCode !== 200 && output.statusCode >= 300) {
237
- return deserializeAws_restJson1GetWorkingLocationCommandError(output, context);
1746
+ return deserializeAws_restJson1UpdateDatasetCommandError(output, context);
238
1747
  }
239
1748
  const contents = {
240
1749
  $metadata: deserializeMetadata(output),
241
- s3Bucket: undefined,
242
- s3Path: undefined,
243
- s3Uri: undefined,
1750
+ datasetId: undefined,
244
1751
  };
245
1752
  const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
246
- if (data.s3Bucket !== undefined && data.s3Bucket !== null) {
247
- contents.s3Bucket = smithy_client_1.expectString(data.s3Bucket);
248
- }
249
- if (data.s3Path !== undefined && data.s3Path !== null) {
250
- contents.s3Path = smithy_client_1.expectString(data.s3Path);
251
- }
252
- if (data.s3Uri !== undefined && data.s3Uri !== null) {
253
- contents.s3Uri = smithy_client_1.expectString(data.s3Uri);
1753
+ if (data.datasetId !== undefined && data.datasetId !== null) {
1754
+ contents.datasetId = smithy_client_1.expectString(data.datasetId);
254
1755
  }
255
1756
  return Promise.resolve(contents);
256
1757
  };
257
- exports.deserializeAws_restJson1GetWorkingLocationCommand = deserializeAws_restJson1GetWorkingLocationCommand;
258
- const deserializeAws_restJson1GetWorkingLocationCommandError = async (output, context) => {
1758
+ exports.deserializeAws_restJson1UpdateDatasetCommand = deserializeAws_restJson1UpdateDatasetCommand;
1759
+ const deserializeAws_restJson1UpdateDatasetCommandError = async (output, context) => {
259
1760
  const parsedOutput = {
260
1761
  ...output,
261
1762
  body: await parseBody(output.body, context),
@@ -272,6 +1773,14 @@ const deserializeAws_restJson1GetWorkingLocationCommandError = async (output, co
272
1773
  $metadata: deserializeMetadata(output),
273
1774
  };
274
1775
  break;
1776
+ case "ConflictException":
1777
+ case "com.amazonaws.finspacedata#ConflictException":
1778
+ response = {
1779
+ ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1780
+ name: errorCode,
1781
+ $metadata: deserializeMetadata(output),
1782
+ };
1783
+ break;
275
1784
  case "InternalServerException":
276
1785
  case "com.amazonaws.finspacedata#InternalServerException":
277
1786
  response = {
@@ -280,6 +1789,14 @@ const deserializeAws_restJson1GetWorkingLocationCommandError = async (output, co
280
1789
  $metadata: deserializeMetadata(output),
281
1790
  };
282
1791
  break;
1792
+ case "ResourceNotFoundException":
1793
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1794
+ response = {
1795
+ ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1796
+ name: errorCode,
1797
+ $metadata: deserializeMetadata(output),
1798
+ };
1799
+ break;
283
1800
  case "ThrottlingException":
284
1801
  case "com.amazonaws.finspacedata#ThrottlingException":
285
1802
  response = {
@@ -325,6 +1842,19 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
325
1842
  }
326
1843
  return contents;
327
1844
  };
1845
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1846
+ const contents = {
1847
+ name: "ConflictException",
1848
+ $fault: "client",
1849
+ $metadata: deserializeMetadata(parsedOutput),
1850
+ message: undefined,
1851
+ };
1852
+ const data = parsedOutput.body;
1853
+ if (data.message !== undefined && data.message !== null) {
1854
+ contents.message = smithy_client_1.expectString(data.message);
1855
+ }
1856
+ return contents;
1857
+ };
328
1858
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
329
1859
  const contents = {
330
1860
  name: "InternalServerException",
@@ -338,6 +1868,19 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
338
1868
  }
339
1869
  return contents;
340
1870
  };
1871
+ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
1872
+ const contents = {
1873
+ name: "LimitExceededException",
1874
+ $fault: "client",
1875
+ $metadata: deserializeMetadata(parsedOutput),
1876
+ message: undefined,
1877
+ };
1878
+ const data = parsedOutput.body;
1879
+ if (data.message !== undefined && data.message !== null) {
1880
+ contents.message = smithy_client_1.expectString(data.message);
1881
+ }
1882
+ return contents;
1883
+ };
341
1884
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
342
1885
  const contents = {
343
1886
  name: "ResourceNotFoundException",
@@ -373,7 +1916,141 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
373
1916
  }
374
1917
  return contents;
375
1918
  };
376
- const serializeAws_restJson1stringMap = (input, context) => {
1919
+ const serializeAws_restJson1ColumnDefinition = (input, context) => {
1920
+ return {
1921
+ ...(input.columnDescription !== undefined &&
1922
+ input.columnDescription !== null && { columnDescription: input.columnDescription }),
1923
+ ...(input.columnName !== undefined && input.columnName !== null && { columnName: input.columnName }),
1924
+ ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }),
1925
+ };
1926
+ };
1927
+ const serializeAws_restJson1ColumnList = (input, context) => {
1928
+ return input
1929
+ .filter((e) => e != null)
1930
+ .map((entry) => {
1931
+ if (entry === null) {
1932
+ return null;
1933
+ }
1934
+ return serializeAws_restJson1ColumnDefinition(entry, context);
1935
+ });
1936
+ };
1937
+ const serializeAws_restJson1ColumnNameList = (input, context) => {
1938
+ return input
1939
+ .filter((e) => e != null)
1940
+ .map((entry) => {
1941
+ if (entry === null) {
1942
+ return null;
1943
+ }
1944
+ return entry;
1945
+ });
1946
+ };
1947
+ const serializeAws_restJson1DatasetOwnerInfo = (input, context) => {
1948
+ return {
1949
+ ...(input.email !== undefined && input.email !== null && { email: input.email }),
1950
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
1951
+ ...(input.phoneNumber !== undefined && input.phoneNumber !== null && { phoneNumber: input.phoneNumber }),
1952
+ };
1953
+ };
1954
+ const serializeAws_restJson1DataViewDestinationTypeParams = (input, context) => {
1955
+ return {
1956
+ ...(input.destinationType !== undefined &&
1957
+ input.destinationType !== null && { destinationType: input.destinationType }),
1958
+ ...(input.s3DestinationExportFileFormat !== undefined &&
1959
+ input.s3DestinationExportFileFormat !== null && {
1960
+ s3DestinationExportFileFormat: input.s3DestinationExportFileFormat,
1961
+ }),
1962
+ ...(input.s3DestinationExportFileFormatOptions !== undefined &&
1963
+ input.s3DestinationExportFileFormatOptions !== null && {
1964
+ s3DestinationExportFileFormatOptions: serializeAws_restJson1S3DestinationFormatOptions(input.s3DestinationExportFileFormatOptions, context),
1965
+ }),
1966
+ };
1967
+ };
1968
+ const serializeAws_restJson1FormatParams = (input, context) => {
1969
+ return Object.entries(input).reduce((acc, [key, value]) => {
1970
+ if (value === null) {
1971
+ return acc;
1972
+ }
1973
+ return {
1974
+ ...acc,
1975
+ [key]: value,
1976
+ };
1977
+ }, {});
1978
+ };
1979
+ const serializeAws_restJson1PartitionColumnList = (input, context) => {
1980
+ return input
1981
+ .filter((e) => e != null)
1982
+ .map((entry) => {
1983
+ if (entry === null) {
1984
+ return null;
1985
+ }
1986
+ return entry;
1987
+ });
1988
+ };
1989
+ const serializeAws_restJson1PermissionGroupParams = (input, context) => {
1990
+ return {
1991
+ ...(input.datasetPermissions !== undefined &&
1992
+ input.datasetPermissions !== null && {
1993
+ datasetPermissions: serializeAws_restJson1ResourcePermissionsList(input.datasetPermissions, context),
1994
+ }),
1995
+ ...(input.permissionGroupId !== undefined &&
1996
+ input.permissionGroupId !== null && { permissionGroupId: input.permissionGroupId }),
1997
+ };
1998
+ };
1999
+ const serializeAws_restJson1ResourcePermission = (input, context) => {
2000
+ return {
2001
+ ...(input.permission !== undefined && input.permission !== null && { permission: input.permission }),
2002
+ };
2003
+ };
2004
+ const serializeAws_restJson1ResourcePermissionsList = (input, context) => {
2005
+ return input
2006
+ .filter((e) => e != null)
2007
+ .map((entry) => {
2008
+ if (entry === null) {
2009
+ return null;
2010
+ }
2011
+ return serializeAws_restJson1ResourcePermission(entry, context);
2012
+ });
2013
+ };
2014
+ const serializeAws_restJson1S3DestinationFormatOptions = (input, context) => {
2015
+ return Object.entries(input).reduce((acc, [key, value]) => {
2016
+ if (value === null) {
2017
+ return acc;
2018
+ }
2019
+ return {
2020
+ ...acc,
2021
+ [key]: value,
2022
+ };
2023
+ }, {});
2024
+ };
2025
+ const serializeAws_restJson1SchemaDefinition = (input, context) => {
2026
+ return {
2027
+ ...(input.columns !== undefined &&
2028
+ input.columns !== null && { columns: serializeAws_restJson1ColumnList(input.columns, context) }),
2029
+ ...(input.primaryKeyColumns !== undefined &&
2030
+ input.primaryKeyColumns !== null && {
2031
+ primaryKeyColumns: serializeAws_restJson1ColumnNameList(input.primaryKeyColumns, context),
2032
+ }),
2033
+ };
2034
+ };
2035
+ const serializeAws_restJson1SchemaUnion = (input, context) => {
2036
+ return {
2037
+ ...(input.tabularSchemaConfig !== undefined &&
2038
+ input.tabularSchemaConfig !== null && {
2039
+ tabularSchemaConfig: serializeAws_restJson1SchemaDefinition(input.tabularSchemaConfig, context),
2040
+ }),
2041
+ };
2042
+ };
2043
+ const serializeAws_restJson1SortColumnList = (input, context) => {
2044
+ return input
2045
+ .filter((e) => e != null)
2046
+ .map((entry) => {
2047
+ if (entry === null) {
2048
+ return null;
2049
+ }
2050
+ return entry;
2051
+ });
2052
+ };
2053
+ const serializeAws_restJson1SourceParams = (input, context) => {
377
2054
  return Object.entries(input).reduce((acc, [key, value]) => {
378
2055
  if (value === null) {
379
2056
  return acc;
@@ -384,34 +2061,72 @@ const serializeAws_restJson1stringMap = (input, context) => {
384
2061
  };
385
2062
  }, {});
386
2063
  };
387
- const deserializeAws_restJson1ChangesetInfo = (output, context) => {
2064
+ const deserializeAws_restJson1ChangesetErrorInfo = (output, context) => {
2065
+ return {
2066
+ errorCategory: smithy_client_1.expectString(output.errorCategory),
2067
+ errorMessage: smithy_client_1.expectString(output.errorMessage),
2068
+ };
2069
+ };
2070
+ const deserializeAws_restJson1ChangesetList = (output, context) => {
2071
+ return (output || [])
2072
+ .filter((e) => e != null)
2073
+ .map((entry) => {
2074
+ if (entry === null) {
2075
+ return null;
2076
+ }
2077
+ return deserializeAws_restJson1ChangesetSummary(entry, context);
2078
+ });
2079
+ };
2080
+ const deserializeAws_restJson1ChangesetSummary = (output, context) => {
388
2081
  return {
2082
+ activeFromTimestamp: smithy_client_1.expectLong(output.activeFromTimestamp),
2083
+ activeUntilTimestamp: smithy_client_1.expectLong(output.activeUntilTimestamp),
389
2084
  changeType: smithy_client_1.expectString(output.changeType),
390
2085
  changesetArn: smithy_client_1.expectString(output.changesetArn),
391
- changesetLabels: output.changesetLabels !== undefined && output.changesetLabels !== null
392
- ? deserializeAws_restJson1stringMap(output.changesetLabels, context)
393
- : undefined,
394
- createTimestamp: output.createTimestamp !== undefined && output.createTimestamp !== null
395
- ? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.createTimestamp)))
396
- : undefined,
2086
+ changesetId: smithy_client_1.expectString(output.changesetId),
2087
+ createTime: smithy_client_1.expectLong(output.createTime),
397
2088
  datasetId: smithy_client_1.expectString(output.datasetId),
398
2089
  errorInfo: output.errorInfo !== undefined && output.errorInfo !== null
399
- ? deserializeAws_restJson1ErrorInfo(output.errorInfo, context)
2090
+ ? deserializeAws_restJson1ChangesetErrorInfo(output.errorInfo, context)
400
2091
  : undefined,
401
2092
  formatParams: output.formatParams !== undefined && output.formatParams !== null
402
- ? deserializeAws_restJson1stringMap(output.formatParams, context)
2093
+ ? deserializeAws_restJson1FormatParams(output.formatParams, context)
403
2094
  : undefined,
404
- formatType: smithy_client_1.expectString(output.formatType),
405
- id: smithy_client_1.expectString(output.id),
406
2095
  sourceParams: output.sourceParams !== undefined && output.sourceParams !== null
407
- ? deserializeAws_restJson1stringMap(output.sourceParams, context)
2096
+ ? deserializeAws_restJson1SourceParams(output.sourceParams, context)
408
2097
  : undefined,
409
- sourceType: smithy_client_1.expectString(output.sourceType),
410
2098
  status: smithy_client_1.expectString(output.status),
411
2099
  updatedByChangesetId: smithy_client_1.expectString(output.updatedByChangesetId),
412
2100
  updatesChangesetId: smithy_client_1.expectString(output.updatesChangesetId),
413
2101
  };
414
2102
  };
2103
+ const deserializeAws_restJson1ColumnDefinition = (output, context) => {
2104
+ return {
2105
+ columnDescription: smithy_client_1.expectString(output.columnDescription),
2106
+ columnName: smithy_client_1.expectString(output.columnName),
2107
+ dataType: smithy_client_1.expectString(output.dataType),
2108
+ };
2109
+ };
2110
+ const deserializeAws_restJson1ColumnList = (output, context) => {
2111
+ return (output || [])
2112
+ .filter((e) => e != null)
2113
+ .map((entry) => {
2114
+ if (entry === null) {
2115
+ return null;
2116
+ }
2117
+ return deserializeAws_restJson1ColumnDefinition(entry, context);
2118
+ });
2119
+ };
2120
+ const deserializeAws_restJson1ColumnNameList = (output, context) => {
2121
+ return (output || [])
2122
+ .filter((e) => e != null)
2123
+ .map((entry) => {
2124
+ if (entry === null) {
2125
+ return null;
2126
+ }
2127
+ return smithy_client_1.expectString(entry);
2128
+ });
2129
+ };
415
2130
  const deserializeAws_restJson1Credentials = (output, context) => {
416
2131
  return {
417
2132
  accessKeyId: smithy_client_1.expectString(output.accessKeyId),
@@ -419,13 +2134,150 @@ const deserializeAws_restJson1Credentials = (output, context) => {
419
2134
  sessionToken: smithy_client_1.expectString(output.sessionToken),
420
2135
  };
421
2136
  };
422
- const deserializeAws_restJson1ErrorInfo = (output, context) => {
2137
+ const deserializeAws_restJson1Dataset = (output, context) => {
2138
+ return {
2139
+ alias: smithy_client_1.expectString(output.alias),
2140
+ createTime: smithy_client_1.expectLong(output.createTime),
2141
+ datasetArn: smithy_client_1.expectString(output.datasetArn),
2142
+ datasetDescription: smithy_client_1.expectString(output.datasetDescription),
2143
+ datasetId: smithy_client_1.expectString(output.datasetId),
2144
+ datasetTitle: smithy_client_1.expectString(output.datasetTitle),
2145
+ kind: smithy_client_1.expectString(output.kind),
2146
+ lastModifiedTime: smithy_client_1.expectLong(output.lastModifiedTime),
2147
+ ownerInfo: output.ownerInfo !== undefined && output.ownerInfo !== null
2148
+ ? deserializeAws_restJson1DatasetOwnerInfo(output.ownerInfo, context)
2149
+ : undefined,
2150
+ schemaDefinition: output.schemaDefinition !== undefined && output.schemaDefinition !== null
2151
+ ? deserializeAws_restJson1SchemaUnion(output.schemaDefinition, context)
2152
+ : undefined,
2153
+ };
2154
+ };
2155
+ const deserializeAws_restJson1DatasetList = (output, context) => {
2156
+ return (output || [])
2157
+ .filter((e) => e != null)
2158
+ .map((entry) => {
2159
+ if (entry === null) {
2160
+ return null;
2161
+ }
2162
+ return deserializeAws_restJson1Dataset(entry, context);
2163
+ });
2164
+ };
2165
+ const deserializeAws_restJson1DatasetOwnerInfo = (output, context) => {
2166
+ return {
2167
+ email: smithy_client_1.expectString(output.email),
2168
+ name: smithy_client_1.expectString(output.name),
2169
+ phoneNumber: smithy_client_1.expectString(output.phoneNumber),
2170
+ };
2171
+ };
2172
+ const deserializeAws_restJson1DataViewDestinationTypeParams = (output, context) => {
2173
+ return {
2174
+ destinationType: smithy_client_1.expectString(output.destinationType),
2175
+ s3DestinationExportFileFormat: smithy_client_1.expectString(output.s3DestinationExportFileFormat),
2176
+ s3DestinationExportFileFormatOptions: output.s3DestinationExportFileFormatOptions !== undefined && output.s3DestinationExportFileFormatOptions !== null
2177
+ ? deserializeAws_restJson1S3DestinationFormatOptions(output.s3DestinationExportFileFormatOptions, context)
2178
+ : undefined,
2179
+ };
2180
+ };
2181
+ const deserializeAws_restJson1DataViewErrorInfo = (output, context) => {
423
2182
  return {
424
2183
  errorCategory: smithy_client_1.expectString(output.errorCategory),
425
2184
  errorMessage: smithy_client_1.expectString(output.errorMessage),
426
2185
  };
427
2186
  };
428
- const deserializeAws_restJson1stringMap = (output, context) => {
2187
+ const deserializeAws_restJson1DataViewList = (output, context) => {
2188
+ return (output || [])
2189
+ .filter((e) => e != null)
2190
+ .map((entry) => {
2191
+ if (entry === null) {
2192
+ return null;
2193
+ }
2194
+ return deserializeAws_restJson1DataViewSummary(entry, context);
2195
+ });
2196
+ };
2197
+ const deserializeAws_restJson1DataViewSummary = (output, context) => {
2198
+ return {
2199
+ asOfTimestamp: smithy_client_1.expectLong(output.asOfTimestamp),
2200
+ autoUpdate: smithy_client_1.expectBoolean(output.autoUpdate),
2201
+ createTime: smithy_client_1.expectLong(output.createTime),
2202
+ dataViewArn: smithy_client_1.expectString(output.dataViewArn),
2203
+ dataViewId: smithy_client_1.expectString(output.dataViewId),
2204
+ datasetId: smithy_client_1.expectString(output.datasetId),
2205
+ destinationTypeProperties: output.destinationTypeProperties !== undefined && output.destinationTypeProperties !== null
2206
+ ? deserializeAws_restJson1DataViewDestinationTypeParams(output.destinationTypeProperties, context)
2207
+ : undefined,
2208
+ errorInfo: output.errorInfo !== undefined && output.errorInfo !== null
2209
+ ? deserializeAws_restJson1DataViewErrorInfo(output.errorInfo, context)
2210
+ : undefined,
2211
+ lastModifiedTime: smithy_client_1.expectLong(output.lastModifiedTime),
2212
+ partitionColumns: output.partitionColumns !== undefined && output.partitionColumns !== null
2213
+ ? deserializeAws_restJson1PartitionColumnList(output.partitionColumns, context)
2214
+ : undefined,
2215
+ sortColumns: output.sortColumns !== undefined && output.sortColumns !== null
2216
+ ? deserializeAws_restJson1SortColumnList(output.sortColumns, context)
2217
+ : undefined,
2218
+ status: smithy_client_1.expectString(output.status),
2219
+ };
2220
+ };
2221
+ const deserializeAws_restJson1FormatParams = (output, context) => {
2222
+ return Object.entries(output).reduce((acc, [key, value]) => {
2223
+ if (value === null) {
2224
+ return acc;
2225
+ }
2226
+ return {
2227
+ ...acc,
2228
+ [key]: smithy_client_1.expectString(value),
2229
+ };
2230
+ }, {});
2231
+ };
2232
+ const deserializeAws_restJson1PartitionColumnList = (output, context) => {
2233
+ return (output || [])
2234
+ .filter((e) => e != null)
2235
+ .map((entry) => {
2236
+ if (entry === null) {
2237
+ return null;
2238
+ }
2239
+ return smithy_client_1.expectString(entry);
2240
+ });
2241
+ };
2242
+ const deserializeAws_restJson1S3DestinationFormatOptions = (output, context) => {
2243
+ return Object.entries(output).reduce((acc, [key, value]) => {
2244
+ if (value === null) {
2245
+ return acc;
2246
+ }
2247
+ return {
2248
+ ...acc,
2249
+ [key]: smithy_client_1.expectString(value),
2250
+ };
2251
+ }, {});
2252
+ };
2253
+ const deserializeAws_restJson1SchemaDefinition = (output, context) => {
2254
+ return {
2255
+ columns: output.columns !== undefined && output.columns !== null
2256
+ ? deserializeAws_restJson1ColumnList(output.columns, context)
2257
+ : undefined,
2258
+ primaryKeyColumns: output.primaryKeyColumns !== undefined && output.primaryKeyColumns !== null
2259
+ ? deserializeAws_restJson1ColumnNameList(output.primaryKeyColumns, context)
2260
+ : undefined,
2261
+ };
2262
+ };
2263
+ const deserializeAws_restJson1SchemaUnion = (output, context) => {
2264
+ return {
2265
+ tabularSchemaConfig: output.tabularSchemaConfig !== undefined && output.tabularSchemaConfig !== null
2266
+ ? deserializeAws_restJson1SchemaDefinition(output.tabularSchemaConfig, context)
2267
+ : undefined,
2268
+ };
2269
+ };
2270
+ const deserializeAws_restJson1SortColumnList = (output, context) => {
2271
+ return (output || [])
2272
+ .filter((e) => e != null)
2273
+ .map((entry) => {
2274
+ if (entry === null) {
2275
+ return null;
2276
+ }
2277
+ return smithy_client_1.expectString(entry);
2278
+ });
2279
+ };
2280
+ const deserializeAws_restJson1SourceParams = (output, context) => {
429
2281
  return Object.entries(output).reduce((acc, [key, value]) => {
430
2282
  if (value === null) {
431
2283
  return acc;