@aws-sdk/client-keyspaces 3.54.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 (128) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +219 -0
  4. package/dist-cjs/Keyspaces.js +202 -0
  5. package/dist-cjs/KeyspacesClient.js +35 -0
  6. package/dist-cjs/commands/CreateKeyspaceCommand.js +36 -0
  7. package/dist-cjs/commands/CreateTableCommand.js +36 -0
  8. package/dist-cjs/commands/DeleteKeyspaceCommand.js +36 -0
  9. package/dist-cjs/commands/DeleteTableCommand.js +36 -0
  10. package/dist-cjs/commands/GetKeyspaceCommand.js +36 -0
  11. package/dist-cjs/commands/GetTableCommand.js +36 -0
  12. package/dist-cjs/commands/ListKeyspacesCommand.js +36 -0
  13. package/dist-cjs/commands/ListTablesCommand.js +36 -0
  14. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  15. package/dist-cjs/commands/RestoreTableCommand.js +36 -0
  16. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  17. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  18. package/dist-cjs/commands/UpdateTableCommand.js +36 -0
  19. package/dist-cjs/commands/index.js +16 -0
  20. package/dist-cjs/endpoints.js +131 -0
  21. package/dist-cjs/index.js +11 -0
  22. package/dist-cjs/models/KeyspacesServiceException.js +11 -0
  23. package/dist-cjs/models/index.js +4 -0
  24. package/dist-cjs/models/models_0.js +364 -0
  25. package/dist-cjs/pagination/Interfaces.js +2 -0
  26. package/dist-cjs/pagination/ListKeyspacesPaginator.js +35 -0
  27. package/dist-cjs/pagination/ListTablesPaginator.js +35 -0
  28. package/dist-cjs/pagination/ListTagsForResourcePaginator.js +35 -0
  29. package/dist-cjs/pagination/index.js +7 -0
  30. package/dist-cjs/protocols/Aws_json1_0.js +1455 -0
  31. package/dist-cjs/runtimeConfig.browser.js +45 -0
  32. package/dist-cjs/runtimeConfig.js +50 -0
  33. package/dist-cjs/runtimeConfig.native.js +16 -0
  34. package/dist-cjs/runtimeConfig.shared.js +17 -0
  35. package/dist-es/Keyspaces.js +205 -0
  36. package/dist-es/KeyspacesClient.js +37 -0
  37. package/dist-es/commands/CreateKeyspaceCommand.js +39 -0
  38. package/dist-es/commands/CreateTableCommand.js +39 -0
  39. package/dist-es/commands/DeleteKeyspaceCommand.js +39 -0
  40. package/dist-es/commands/DeleteTableCommand.js +39 -0
  41. package/dist-es/commands/GetKeyspaceCommand.js +39 -0
  42. package/dist-es/commands/GetTableCommand.js +39 -0
  43. package/dist-es/commands/ListKeyspacesCommand.js +39 -0
  44. package/dist-es/commands/ListTablesCommand.js +39 -0
  45. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  46. package/dist-es/commands/RestoreTableCommand.js +39 -0
  47. package/dist-es/commands/TagResourceCommand.js +39 -0
  48. package/dist-es/commands/UntagResourceCommand.js +39 -0
  49. package/dist-es/commands/UpdateTableCommand.js +39 -0
  50. package/dist-es/commands/index.js +13 -0
  51. package/dist-es/endpoints.js +127 -0
  52. package/dist-es/index.js +6 -0
  53. package/dist-es/models/KeyspacesServiceException.js +12 -0
  54. package/dist-es/models/index.js +1 -0
  55. package/dist-es/models/models_0.js +273 -0
  56. package/dist-es/pagination/Interfaces.js +1 -0
  57. package/dist-es/pagination/ListKeyspacesPaginator.js +74 -0
  58. package/dist-es/pagination/ListTablesPaginator.js +74 -0
  59. package/dist-es/pagination/ListTagsForResourcePaginator.js +74 -0
  60. package/dist-es/pagination/index.js +4 -0
  61. package/dist-es/protocols/Aws_json1_0.js +1627 -0
  62. package/dist-es/runtimeConfig.browser.js +26 -0
  63. package/dist-es/runtimeConfig.js +28 -0
  64. package/dist-es/runtimeConfig.native.js +8 -0
  65. package/dist-es/runtimeConfig.shared.js +13 -0
  66. package/dist-types/Keyspaces.d.ts +187 -0
  67. package/dist-types/KeyspacesClient.d.ts +173 -0
  68. package/dist-types/commands/CreateKeyspaceCommand.d.ts +41 -0
  69. package/dist-types/commands/CreateTableCommand.d.ts +42 -0
  70. package/dist-types/commands/DeleteKeyspaceCommand.d.ts +35 -0
  71. package/dist-types/commands/DeleteTableCommand.d.ts +40 -0
  72. package/dist-types/commands/GetKeyspaceCommand.d.ts +35 -0
  73. package/dist-types/commands/GetTableCommand.d.ts +38 -0
  74. package/dist-types/commands/ListKeyspacesCommand.d.ts +35 -0
  75. package/dist-types/commands/ListTablesCommand.d.ts +35 -0
  76. package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
  77. package/dist-types/commands/RestoreTableCommand.d.ts +79 -0
  78. package/dist-types/commands/TagResourceCommand.d.ts +41 -0
  79. package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
  80. package/dist-types/commands/UpdateTableCommand.d.ts +37 -0
  81. package/dist-types/commands/index.d.ts +13 -0
  82. package/dist-types/endpoints.d.ts +2 -0
  83. package/dist-types/index.d.ts +6 -0
  84. package/dist-types/models/KeyspacesServiceException.d.ts +10 -0
  85. package/dist-types/models/index.d.ts +1 -0
  86. package/dist-types/models/models_0.d.ts +1307 -0
  87. package/dist-types/pagination/Interfaces.d.ts +6 -0
  88. package/dist-types/pagination/ListKeyspacesPaginator.d.ts +4 -0
  89. package/dist-types/pagination/ListTablesPaginator.d.ts +4 -0
  90. package/dist-types/pagination/ListTagsForResourcePaginator.d.ts +4 -0
  91. package/dist-types/pagination/index.d.ts +4 -0
  92. package/dist-types/protocols/Aws_json1_0.d.ts +41 -0
  93. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  94. package/dist-types/runtimeConfig.d.ts +40 -0
  95. package/dist-types/runtimeConfig.native.d.ts +39 -0
  96. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  97. package/dist-types/ts3.4/Keyspaces.d.ts +70 -0
  98. package/dist-types/ts3.4/KeyspacesClient.d.ts +86 -0
  99. package/dist-types/ts3.4/commands/CreateKeyspaceCommand.d.ts +17 -0
  100. package/dist-types/ts3.4/commands/CreateTableCommand.d.ts +17 -0
  101. package/dist-types/ts3.4/commands/DeleteKeyspaceCommand.d.ts +17 -0
  102. package/dist-types/ts3.4/commands/DeleteTableCommand.d.ts +17 -0
  103. package/dist-types/ts3.4/commands/GetKeyspaceCommand.d.ts +17 -0
  104. package/dist-types/ts3.4/commands/GetTableCommand.d.ts +17 -0
  105. package/dist-types/ts3.4/commands/ListKeyspacesCommand.d.ts +17 -0
  106. package/dist-types/ts3.4/commands/ListTablesCommand.d.ts +17 -0
  107. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  108. package/dist-types/ts3.4/commands/RestoreTableCommand.d.ts +17 -0
  109. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  110. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  111. package/dist-types/ts3.4/commands/UpdateTableCommand.d.ts +17 -0
  112. package/dist-types/ts3.4/commands/index.d.ts +13 -0
  113. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  114. package/dist-types/ts3.4/index.d.ts +6 -0
  115. package/dist-types/ts3.4/models/KeyspacesServiceException.d.ts +6 -0
  116. package/dist-types/ts3.4/models/index.d.ts +1 -0
  117. package/dist-types/ts3.4/models/models_0.d.ts +539 -0
  118. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  119. package/dist-types/ts3.4/pagination/ListKeyspacesPaginator.d.ts +4 -0
  120. package/dist-types/ts3.4/pagination/ListTablesPaginator.d.ts +4 -0
  121. package/dist-types/ts3.4/pagination/ListTagsForResourcePaginator.d.ts +4 -0
  122. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  123. package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +41 -0
  124. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  125. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  126. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  127. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  128. package/package.json +93 -0
@@ -0,0 +1,1455 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_json1_0UpdateTableCommand = exports.deserializeAws_json1_0UntagResourceCommand = exports.deserializeAws_json1_0TagResourceCommand = exports.deserializeAws_json1_0RestoreTableCommand = exports.deserializeAws_json1_0ListTagsForResourceCommand = exports.deserializeAws_json1_0ListTablesCommand = exports.deserializeAws_json1_0ListKeyspacesCommand = exports.deserializeAws_json1_0GetTableCommand = exports.deserializeAws_json1_0GetKeyspaceCommand = exports.deserializeAws_json1_0DeleteTableCommand = exports.deserializeAws_json1_0DeleteKeyspaceCommand = exports.deserializeAws_json1_0CreateTableCommand = exports.deserializeAws_json1_0CreateKeyspaceCommand = exports.serializeAws_json1_0UpdateTableCommand = exports.serializeAws_json1_0UntagResourceCommand = exports.serializeAws_json1_0TagResourceCommand = exports.serializeAws_json1_0RestoreTableCommand = exports.serializeAws_json1_0ListTagsForResourceCommand = exports.serializeAws_json1_0ListTablesCommand = exports.serializeAws_json1_0ListKeyspacesCommand = exports.serializeAws_json1_0GetTableCommand = exports.serializeAws_json1_0GetKeyspaceCommand = exports.serializeAws_json1_0DeleteTableCommand = exports.serializeAws_json1_0DeleteKeyspaceCommand = exports.serializeAws_json1_0CreateTableCommand = exports.serializeAws_json1_0CreateKeyspaceCommand = void 0;
4
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const KeyspacesServiceException_1 = require("../models/KeyspacesServiceException");
7
+ const models_0_1 = require("../models/models_0");
8
+ const serializeAws_json1_0CreateKeyspaceCommand = async (input, context) => {
9
+ const headers = {
10
+ "content-type": "application/x-amz-json-1.0",
11
+ "x-amz-target": "KeyspacesService.CreateKeyspace",
12
+ };
13
+ let body;
14
+ body = JSON.stringify(serializeAws_json1_0CreateKeyspaceRequest(input, context));
15
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
+ };
17
+ exports.serializeAws_json1_0CreateKeyspaceCommand = serializeAws_json1_0CreateKeyspaceCommand;
18
+ const serializeAws_json1_0CreateTableCommand = async (input, context) => {
19
+ const headers = {
20
+ "content-type": "application/x-amz-json-1.0",
21
+ "x-amz-target": "KeyspacesService.CreateTable",
22
+ };
23
+ let body;
24
+ body = JSON.stringify(serializeAws_json1_0CreateTableRequest(input, context));
25
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
+ };
27
+ exports.serializeAws_json1_0CreateTableCommand = serializeAws_json1_0CreateTableCommand;
28
+ const serializeAws_json1_0DeleteKeyspaceCommand = async (input, context) => {
29
+ const headers = {
30
+ "content-type": "application/x-amz-json-1.0",
31
+ "x-amz-target": "KeyspacesService.DeleteKeyspace",
32
+ };
33
+ let body;
34
+ body = JSON.stringify(serializeAws_json1_0DeleteKeyspaceRequest(input, context));
35
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
+ };
37
+ exports.serializeAws_json1_0DeleteKeyspaceCommand = serializeAws_json1_0DeleteKeyspaceCommand;
38
+ const serializeAws_json1_0DeleteTableCommand = async (input, context) => {
39
+ const headers = {
40
+ "content-type": "application/x-amz-json-1.0",
41
+ "x-amz-target": "KeyspacesService.DeleteTable",
42
+ };
43
+ let body;
44
+ body = JSON.stringify(serializeAws_json1_0DeleteTableRequest(input, context));
45
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
+ };
47
+ exports.serializeAws_json1_0DeleteTableCommand = serializeAws_json1_0DeleteTableCommand;
48
+ const serializeAws_json1_0GetKeyspaceCommand = async (input, context) => {
49
+ const headers = {
50
+ "content-type": "application/x-amz-json-1.0",
51
+ "x-amz-target": "KeyspacesService.GetKeyspace",
52
+ };
53
+ let body;
54
+ body = JSON.stringify(serializeAws_json1_0GetKeyspaceRequest(input, context));
55
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
+ };
57
+ exports.serializeAws_json1_0GetKeyspaceCommand = serializeAws_json1_0GetKeyspaceCommand;
58
+ const serializeAws_json1_0GetTableCommand = async (input, context) => {
59
+ const headers = {
60
+ "content-type": "application/x-amz-json-1.0",
61
+ "x-amz-target": "KeyspacesService.GetTable",
62
+ };
63
+ let body;
64
+ body = JSON.stringify(serializeAws_json1_0GetTableRequest(input, context));
65
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
66
+ };
67
+ exports.serializeAws_json1_0GetTableCommand = serializeAws_json1_0GetTableCommand;
68
+ const serializeAws_json1_0ListKeyspacesCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.0",
71
+ "x-amz-target": "KeyspacesService.ListKeyspaces",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_0ListKeyspacesRequest(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ exports.serializeAws_json1_0ListKeyspacesCommand = serializeAws_json1_0ListKeyspacesCommand;
78
+ const serializeAws_json1_0ListTablesCommand = async (input, context) => {
79
+ const headers = {
80
+ "content-type": "application/x-amz-json-1.0",
81
+ "x-amz-target": "KeyspacesService.ListTables",
82
+ };
83
+ let body;
84
+ body = JSON.stringify(serializeAws_json1_0ListTablesRequest(input, context));
85
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
+ };
87
+ exports.serializeAws_json1_0ListTablesCommand = serializeAws_json1_0ListTablesCommand;
88
+ const serializeAws_json1_0ListTagsForResourceCommand = async (input, context) => {
89
+ const headers = {
90
+ "content-type": "application/x-amz-json-1.0",
91
+ "x-amz-target": "KeyspacesService.ListTagsForResource",
92
+ };
93
+ let body;
94
+ body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
95
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
96
+ };
97
+ exports.serializeAws_json1_0ListTagsForResourceCommand = serializeAws_json1_0ListTagsForResourceCommand;
98
+ const serializeAws_json1_0RestoreTableCommand = async (input, context) => {
99
+ const headers = {
100
+ "content-type": "application/x-amz-json-1.0",
101
+ "x-amz-target": "KeyspacesService.RestoreTable",
102
+ };
103
+ let body;
104
+ body = JSON.stringify(serializeAws_json1_0RestoreTableRequest(input, context));
105
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
106
+ };
107
+ exports.serializeAws_json1_0RestoreTableCommand = serializeAws_json1_0RestoreTableCommand;
108
+ const serializeAws_json1_0TagResourceCommand = async (input, context) => {
109
+ const headers = {
110
+ "content-type": "application/x-amz-json-1.0",
111
+ "x-amz-target": "KeyspacesService.TagResource",
112
+ };
113
+ let body;
114
+ body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
115
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
116
+ };
117
+ exports.serializeAws_json1_0TagResourceCommand = serializeAws_json1_0TagResourceCommand;
118
+ const serializeAws_json1_0UntagResourceCommand = async (input, context) => {
119
+ const headers = {
120
+ "content-type": "application/x-amz-json-1.0",
121
+ "x-amz-target": "KeyspacesService.UntagResource",
122
+ };
123
+ let body;
124
+ body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
125
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
+ };
127
+ exports.serializeAws_json1_0UntagResourceCommand = serializeAws_json1_0UntagResourceCommand;
128
+ const serializeAws_json1_0UpdateTableCommand = async (input, context) => {
129
+ const headers = {
130
+ "content-type": "application/x-amz-json-1.0",
131
+ "x-amz-target": "KeyspacesService.UpdateTable",
132
+ };
133
+ let body;
134
+ body = JSON.stringify(serializeAws_json1_0UpdateTableRequest(input, context));
135
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
136
+ };
137
+ exports.serializeAws_json1_0UpdateTableCommand = serializeAws_json1_0UpdateTableCommand;
138
+ const deserializeAws_json1_0CreateKeyspaceCommand = async (output, context) => {
139
+ if (output.statusCode >= 300) {
140
+ return deserializeAws_json1_0CreateKeyspaceCommandError(output, context);
141
+ }
142
+ const data = await parseBody(output.body, context);
143
+ let contents = {};
144
+ contents = deserializeAws_json1_0CreateKeyspaceResponse(data, context);
145
+ const response = {
146
+ $metadata: deserializeMetadata(output),
147
+ ...contents,
148
+ };
149
+ return Promise.resolve(response);
150
+ };
151
+ exports.deserializeAws_json1_0CreateKeyspaceCommand = deserializeAws_json1_0CreateKeyspaceCommand;
152
+ const deserializeAws_json1_0CreateKeyspaceCommandError = async (output, context) => {
153
+ const parsedOutput = {
154
+ ...output,
155
+ body: await parseBody(output.body, context),
156
+ };
157
+ let response;
158
+ let errorCode = "UnknownError";
159
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
160
+ switch (errorCode) {
161
+ case "AccessDeniedException":
162
+ case "com.amazonaws.keyspaces#AccessDeniedException":
163
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
164
+ case "ConflictException":
165
+ case "com.amazonaws.keyspaces#ConflictException":
166
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
167
+ case "InternalServerException":
168
+ case "com.amazonaws.keyspaces#InternalServerException":
169
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
170
+ case "ServiceQuotaExceededException":
171
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
172
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
173
+ case "ValidationException":
174
+ case "com.amazonaws.keyspaces#ValidationException":
175
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
176
+ default:
177
+ const parsedBody = parsedOutput.body;
178
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
179
+ name: parsedBody.code || parsedBody.Code || errorCode,
180
+ $fault: "client",
181
+ $metadata: deserializeMetadata(output),
182
+ });
183
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
184
+ }
185
+ };
186
+ const deserializeAws_json1_0CreateTableCommand = async (output, context) => {
187
+ if (output.statusCode >= 300) {
188
+ return deserializeAws_json1_0CreateTableCommandError(output, context);
189
+ }
190
+ const data = await parseBody(output.body, context);
191
+ let contents = {};
192
+ contents = deserializeAws_json1_0CreateTableResponse(data, context);
193
+ const response = {
194
+ $metadata: deserializeMetadata(output),
195
+ ...contents,
196
+ };
197
+ return Promise.resolve(response);
198
+ };
199
+ exports.deserializeAws_json1_0CreateTableCommand = deserializeAws_json1_0CreateTableCommand;
200
+ const deserializeAws_json1_0CreateTableCommandError = async (output, context) => {
201
+ const parsedOutput = {
202
+ ...output,
203
+ body: await parseBody(output.body, context),
204
+ };
205
+ let response;
206
+ let errorCode = "UnknownError";
207
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
208
+ switch (errorCode) {
209
+ case "AccessDeniedException":
210
+ case "com.amazonaws.keyspaces#AccessDeniedException":
211
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
212
+ case "ConflictException":
213
+ case "com.amazonaws.keyspaces#ConflictException":
214
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
215
+ case "InternalServerException":
216
+ case "com.amazonaws.keyspaces#InternalServerException":
217
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
218
+ case "ResourceNotFoundException":
219
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
220
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
221
+ case "ServiceQuotaExceededException":
222
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
223
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
224
+ case "ValidationException":
225
+ case "com.amazonaws.keyspaces#ValidationException":
226
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
227
+ default:
228
+ const parsedBody = parsedOutput.body;
229
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
230
+ name: parsedBody.code || parsedBody.Code || errorCode,
231
+ $fault: "client",
232
+ $metadata: deserializeMetadata(output),
233
+ });
234
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
235
+ }
236
+ };
237
+ const deserializeAws_json1_0DeleteKeyspaceCommand = async (output, context) => {
238
+ if (output.statusCode >= 300) {
239
+ return deserializeAws_json1_0DeleteKeyspaceCommandError(output, context);
240
+ }
241
+ const data = await parseBody(output.body, context);
242
+ let contents = {};
243
+ contents = deserializeAws_json1_0DeleteKeyspaceResponse(data, context);
244
+ const response = {
245
+ $metadata: deserializeMetadata(output),
246
+ ...contents,
247
+ };
248
+ return Promise.resolve(response);
249
+ };
250
+ exports.deserializeAws_json1_0DeleteKeyspaceCommand = deserializeAws_json1_0DeleteKeyspaceCommand;
251
+ const deserializeAws_json1_0DeleteKeyspaceCommandError = async (output, context) => {
252
+ const parsedOutput = {
253
+ ...output,
254
+ body: await parseBody(output.body, context),
255
+ };
256
+ let response;
257
+ let errorCode = "UnknownError";
258
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
259
+ switch (errorCode) {
260
+ case "AccessDeniedException":
261
+ case "com.amazonaws.keyspaces#AccessDeniedException":
262
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
263
+ case "ConflictException":
264
+ case "com.amazonaws.keyspaces#ConflictException":
265
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
266
+ case "InternalServerException":
267
+ case "com.amazonaws.keyspaces#InternalServerException":
268
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
269
+ case "ResourceNotFoundException":
270
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
271
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
272
+ case "ServiceQuotaExceededException":
273
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
274
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
275
+ case "ValidationException":
276
+ case "com.amazonaws.keyspaces#ValidationException":
277
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
278
+ default:
279
+ const parsedBody = parsedOutput.body;
280
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
281
+ name: parsedBody.code || parsedBody.Code || errorCode,
282
+ $fault: "client",
283
+ $metadata: deserializeMetadata(output),
284
+ });
285
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
286
+ }
287
+ };
288
+ const deserializeAws_json1_0DeleteTableCommand = async (output, context) => {
289
+ if (output.statusCode >= 300) {
290
+ return deserializeAws_json1_0DeleteTableCommandError(output, context);
291
+ }
292
+ const data = await parseBody(output.body, context);
293
+ let contents = {};
294
+ contents = deserializeAws_json1_0DeleteTableResponse(data, context);
295
+ const response = {
296
+ $metadata: deserializeMetadata(output),
297
+ ...contents,
298
+ };
299
+ return Promise.resolve(response);
300
+ };
301
+ exports.deserializeAws_json1_0DeleteTableCommand = deserializeAws_json1_0DeleteTableCommand;
302
+ const deserializeAws_json1_0DeleteTableCommandError = async (output, context) => {
303
+ const parsedOutput = {
304
+ ...output,
305
+ body: await parseBody(output.body, context),
306
+ };
307
+ let response;
308
+ let errorCode = "UnknownError";
309
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
310
+ switch (errorCode) {
311
+ case "AccessDeniedException":
312
+ case "com.amazonaws.keyspaces#AccessDeniedException":
313
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
314
+ case "ConflictException":
315
+ case "com.amazonaws.keyspaces#ConflictException":
316
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
317
+ case "InternalServerException":
318
+ case "com.amazonaws.keyspaces#InternalServerException":
319
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
320
+ case "ResourceNotFoundException":
321
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
322
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
323
+ case "ServiceQuotaExceededException":
324
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
325
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
326
+ case "ValidationException":
327
+ case "com.amazonaws.keyspaces#ValidationException":
328
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
329
+ default:
330
+ const parsedBody = parsedOutput.body;
331
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
332
+ name: parsedBody.code || parsedBody.Code || errorCode,
333
+ $fault: "client",
334
+ $metadata: deserializeMetadata(output),
335
+ });
336
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
337
+ }
338
+ };
339
+ const deserializeAws_json1_0GetKeyspaceCommand = async (output, context) => {
340
+ if (output.statusCode >= 300) {
341
+ return deserializeAws_json1_0GetKeyspaceCommandError(output, context);
342
+ }
343
+ const data = await parseBody(output.body, context);
344
+ let contents = {};
345
+ contents = deserializeAws_json1_0GetKeyspaceResponse(data, context);
346
+ const response = {
347
+ $metadata: deserializeMetadata(output),
348
+ ...contents,
349
+ };
350
+ return Promise.resolve(response);
351
+ };
352
+ exports.deserializeAws_json1_0GetKeyspaceCommand = deserializeAws_json1_0GetKeyspaceCommand;
353
+ const deserializeAws_json1_0GetKeyspaceCommandError = async (output, context) => {
354
+ const parsedOutput = {
355
+ ...output,
356
+ body: await parseBody(output.body, context),
357
+ };
358
+ let response;
359
+ let errorCode = "UnknownError";
360
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
361
+ switch (errorCode) {
362
+ case "AccessDeniedException":
363
+ case "com.amazonaws.keyspaces#AccessDeniedException":
364
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
365
+ case "InternalServerException":
366
+ case "com.amazonaws.keyspaces#InternalServerException":
367
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
368
+ case "ResourceNotFoundException":
369
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
370
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
371
+ case "ServiceQuotaExceededException":
372
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
373
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
374
+ case "ValidationException":
375
+ case "com.amazonaws.keyspaces#ValidationException":
376
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
377
+ default:
378
+ const parsedBody = parsedOutput.body;
379
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
380
+ name: parsedBody.code || parsedBody.Code || errorCode,
381
+ $fault: "client",
382
+ $metadata: deserializeMetadata(output),
383
+ });
384
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
385
+ }
386
+ };
387
+ const deserializeAws_json1_0GetTableCommand = async (output, context) => {
388
+ if (output.statusCode >= 300) {
389
+ return deserializeAws_json1_0GetTableCommandError(output, context);
390
+ }
391
+ const data = await parseBody(output.body, context);
392
+ let contents = {};
393
+ contents = deserializeAws_json1_0GetTableResponse(data, context);
394
+ const response = {
395
+ $metadata: deserializeMetadata(output),
396
+ ...contents,
397
+ };
398
+ return Promise.resolve(response);
399
+ };
400
+ exports.deserializeAws_json1_0GetTableCommand = deserializeAws_json1_0GetTableCommand;
401
+ const deserializeAws_json1_0GetTableCommandError = async (output, context) => {
402
+ const parsedOutput = {
403
+ ...output,
404
+ body: await parseBody(output.body, context),
405
+ };
406
+ let response;
407
+ let errorCode = "UnknownError";
408
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
409
+ switch (errorCode) {
410
+ case "AccessDeniedException":
411
+ case "com.amazonaws.keyspaces#AccessDeniedException":
412
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
413
+ case "InternalServerException":
414
+ case "com.amazonaws.keyspaces#InternalServerException":
415
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
416
+ case "ResourceNotFoundException":
417
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
418
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
419
+ case "ServiceQuotaExceededException":
420
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
421
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
422
+ case "ValidationException":
423
+ case "com.amazonaws.keyspaces#ValidationException":
424
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
425
+ default:
426
+ const parsedBody = parsedOutput.body;
427
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
428
+ name: parsedBody.code || parsedBody.Code || errorCode,
429
+ $fault: "client",
430
+ $metadata: deserializeMetadata(output),
431
+ });
432
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
433
+ }
434
+ };
435
+ const deserializeAws_json1_0ListKeyspacesCommand = async (output, context) => {
436
+ if (output.statusCode >= 300) {
437
+ return deserializeAws_json1_0ListKeyspacesCommandError(output, context);
438
+ }
439
+ const data = await parseBody(output.body, context);
440
+ let contents = {};
441
+ contents = deserializeAws_json1_0ListKeyspacesResponse(data, context);
442
+ const response = {
443
+ $metadata: deserializeMetadata(output),
444
+ ...contents,
445
+ };
446
+ return Promise.resolve(response);
447
+ };
448
+ exports.deserializeAws_json1_0ListKeyspacesCommand = deserializeAws_json1_0ListKeyspacesCommand;
449
+ const deserializeAws_json1_0ListKeyspacesCommandError = async (output, context) => {
450
+ const parsedOutput = {
451
+ ...output,
452
+ body: await parseBody(output.body, context),
453
+ };
454
+ let response;
455
+ let errorCode = "UnknownError";
456
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
457
+ switch (errorCode) {
458
+ case "AccessDeniedException":
459
+ case "com.amazonaws.keyspaces#AccessDeniedException":
460
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
461
+ case "InternalServerException":
462
+ case "com.amazonaws.keyspaces#InternalServerException":
463
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
464
+ case "ResourceNotFoundException":
465
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
466
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
467
+ case "ServiceQuotaExceededException":
468
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
469
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
470
+ case "ValidationException":
471
+ case "com.amazonaws.keyspaces#ValidationException":
472
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
473
+ default:
474
+ const parsedBody = parsedOutput.body;
475
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
476
+ name: parsedBody.code || parsedBody.Code || errorCode,
477
+ $fault: "client",
478
+ $metadata: deserializeMetadata(output),
479
+ });
480
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
481
+ }
482
+ };
483
+ const deserializeAws_json1_0ListTablesCommand = async (output, context) => {
484
+ if (output.statusCode >= 300) {
485
+ return deserializeAws_json1_0ListTablesCommandError(output, context);
486
+ }
487
+ const data = await parseBody(output.body, context);
488
+ let contents = {};
489
+ contents = deserializeAws_json1_0ListTablesResponse(data, context);
490
+ const response = {
491
+ $metadata: deserializeMetadata(output),
492
+ ...contents,
493
+ };
494
+ return Promise.resolve(response);
495
+ };
496
+ exports.deserializeAws_json1_0ListTablesCommand = deserializeAws_json1_0ListTablesCommand;
497
+ const deserializeAws_json1_0ListTablesCommandError = async (output, context) => {
498
+ const parsedOutput = {
499
+ ...output,
500
+ body: await parseBody(output.body, context),
501
+ };
502
+ let response;
503
+ let errorCode = "UnknownError";
504
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
505
+ switch (errorCode) {
506
+ case "AccessDeniedException":
507
+ case "com.amazonaws.keyspaces#AccessDeniedException":
508
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
509
+ case "InternalServerException":
510
+ case "com.amazonaws.keyspaces#InternalServerException":
511
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
512
+ case "ResourceNotFoundException":
513
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
514
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
515
+ case "ServiceQuotaExceededException":
516
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
517
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
518
+ case "ValidationException":
519
+ case "com.amazonaws.keyspaces#ValidationException":
520
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
521
+ default:
522
+ const parsedBody = parsedOutput.body;
523
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
524
+ name: parsedBody.code || parsedBody.Code || errorCode,
525
+ $fault: "client",
526
+ $metadata: deserializeMetadata(output),
527
+ });
528
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
529
+ }
530
+ };
531
+ const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
532
+ if (output.statusCode >= 300) {
533
+ return deserializeAws_json1_0ListTagsForResourceCommandError(output, context);
534
+ }
535
+ const data = await parseBody(output.body, context);
536
+ let contents = {};
537
+ contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
538
+ const response = {
539
+ $metadata: deserializeMetadata(output),
540
+ ...contents,
541
+ };
542
+ return Promise.resolve(response);
543
+ };
544
+ exports.deserializeAws_json1_0ListTagsForResourceCommand = deserializeAws_json1_0ListTagsForResourceCommand;
545
+ const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, context) => {
546
+ const parsedOutput = {
547
+ ...output,
548
+ body: await parseBody(output.body, context),
549
+ };
550
+ let response;
551
+ let errorCode = "UnknownError";
552
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
553
+ switch (errorCode) {
554
+ case "AccessDeniedException":
555
+ case "com.amazonaws.keyspaces#AccessDeniedException":
556
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
557
+ case "InternalServerException":
558
+ case "com.amazonaws.keyspaces#InternalServerException":
559
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
560
+ case "ResourceNotFoundException":
561
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
562
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
563
+ case "ServiceQuotaExceededException":
564
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
565
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
566
+ case "ValidationException":
567
+ case "com.amazonaws.keyspaces#ValidationException":
568
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
569
+ default:
570
+ const parsedBody = parsedOutput.body;
571
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
572
+ name: parsedBody.code || parsedBody.Code || errorCode,
573
+ $fault: "client",
574
+ $metadata: deserializeMetadata(output),
575
+ });
576
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
577
+ }
578
+ };
579
+ const deserializeAws_json1_0RestoreTableCommand = async (output, context) => {
580
+ if (output.statusCode >= 300) {
581
+ return deserializeAws_json1_0RestoreTableCommandError(output, context);
582
+ }
583
+ const data = await parseBody(output.body, context);
584
+ let contents = {};
585
+ contents = deserializeAws_json1_0RestoreTableResponse(data, context);
586
+ const response = {
587
+ $metadata: deserializeMetadata(output),
588
+ ...contents,
589
+ };
590
+ return Promise.resolve(response);
591
+ };
592
+ exports.deserializeAws_json1_0RestoreTableCommand = deserializeAws_json1_0RestoreTableCommand;
593
+ const deserializeAws_json1_0RestoreTableCommandError = async (output, context) => {
594
+ const parsedOutput = {
595
+ ...output,
596
+ body: await parseBody(output.body, context),
597
+ };
598
+ let response;
599
+ let errorCode = "UnknownError";
600
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
601
+ switch (errorCode) {
602
+ case "AccessDeniedException":
603
+ case "com.amazonaws.keyspaces#AccessDeniedException":
604
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
605
+ case "ConflictException":
606
+ case "com.amazonaws.keyspaces#ConflictException":
607
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
608
+ case "InternalServerException":
609
+ case "com.amazonaws.keyspaces#InternalServerException":
610
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
611
+ case "ResourceNotFoundException":
612
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
613
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
614
+ case "ServiceQuotaExceededException":
615
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
616
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
617
+ case "ValidationException":
618
+ case "com.amazonaws.keyspaces#ValidationException":
619
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
620
+ default:
621
+ const parsedBody = parsedOutput.body;
622
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
623
+ name: parsedBody.code || parsedBody.Code || errorCode,
624
+ $fault: "client",
625
+ $metadata: deserializeMetadata(output),
626
+ });
627
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
628
+ }
629
+ };
630
+ const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
631
+ if (output.statusCode >= 300) {
632
+ return deserializeAws_json1_0TagResourceCommandError(output, context);
633
+ }
634
+ const data = await parseBody(output.body, context);
635
+ let contents = {};
636
+ contents = deserializeAws_json1_0TagResourceResponse(data, context);
637
+ const response = {
638
+ $metadata: deserializeMetadata(output),
639
+ ...contents,
640
+ };
641
+ return Promise.resolve(response);
642
+ };
643
+ exports.deserializeAws_json1_0TagResourceCommand = deserializeAws_json1_0TagResourceCommand;
644
+ const deserializeAws_json1_0TagResourceCommandError = async (output, context) => {
645
+ const parsedOutput = {
646
+ ...output,
647
+ body: await parseBody(output.body, context),
648
+ };
649
+ let response;
650
+ let errorCode = "UnknownError";
651
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
652
+ switch (errorCode) {
653
+ case "AccessDeniedException":
654
+ case "com.amazonaws.keyspaces#AccessDeniedException":
655
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
656
+ case "InternalServerException":
657
+ case "com.amazonaws.keyspaces#InternalServerException":
658
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
659
+ case "ResourceNotFoundException":
660
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
661
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
662
+ case "ServiceQuotaExceededException":
663
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
664
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
665
+ case "ValidationException":
666
+ case "com.amazonaws.keyspaces#ValidationException":
667
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
668
+ default:
669
+ const parsedBody = parsedOutput.body;
670
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
671
+ name: parsedBody.code || parsedBody.Code || errorCode,
672
+ $fault: "client",
673
+ $metadata: deserializeMetadata(output),
674
+ });
675
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
676
+ }
677
+ };
678
+ const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
679
+ if (output.statusCode >= 300) {
680
+ return deserializeAws_json1_0UntagResourceCommandError(output, context);
681
+ }
682
+ const data = await parseBody(output.body, context);
683
+ let contents = {};
684
+ contents = deserializeAws_json1_0UntagResourceResponse(data, context);
685
+ const response = {
686
+ $metadata: deserializeMetadata(output),
687
+ ...contents,
688
+ };
689
+ return Promise.resolve(response);
690
+ };
691
+ exports.deserializeAws_json1_0UntagResourceCommand = deserializeAws_json1_0UntagResourceCommand;
692
+ const deserializeAws_json1_0UntagResourceCommandError = async (output, context) => {
693
+ const parsedOutput = {
694
+ ...output,
695
+ body: await parseBody(output.body, context),
696
+ };
697
+ let response;
698
+ let errorCode = "UnknownError";
699
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
700
+ switch (errorCode) {
701
+ case "AccessDeniedException":
702
+ case "com.amazonaws.keyspaces#AccessDeniedException":
703
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
704
+ case "ConflictException":
705
+ case "com.amazonaws.keyspaces#ConflictException":
706
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
707
+ case "InternalServerException":
708
+ case "com.amazonaws.keyspaces#InternalServerException":
709
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
710
+ case "ResourceNotFoundException":
711
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
712
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
713
+ case "ServiceQuotaExceededException":
714
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
715
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
716
+ case "ValidationException":
717
+ case "com.amazonaws.keyspaces#ValidationException":
718
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
719
+ default:
720
+ const parsedBody = parsedOutput.body;
721
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
722
+ name: parsedBody.code || parsedBody.Code || errorCode,
723
+ $fault: "client",
724
+ $metadata: deserializeMetadata(output),
725
+ });
726
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
727
+ }
728
+ };
729
+ const deserializeAws_json1_0UpdateTableCommand = async (output, context) => {
730
+ if (output.statusCode >= 300) {
731
+ return deserializeAws_json1_0UpdateTableCommandError(output, context);
732
+ }
733
+ const data = await parseBody(output.body, context);
734
+ let contents = {};
735
+ contents = deserializeAws_json1_0UpdateTableResponse(data, context);
736
+ const response = {
737
+ $metadata: deserializeMetadata(output),
738
+ ...contents,
739
+ };
740
+ return Promise.resolve(response);
741
+ };
742
+ exports.deserializeAws_json1_0UpdateTableCommand = deserializeAws_json1_0UpdateTableCommand;
743
+ const deserializeAws_json1_0UpdateTableCommandError = async (output, context) => {
744
+ const parsedOutput = {
745
+ ...output,
746
+ body: await parseBody(output.body, context),
747
+ };
748
+ let response;
749
+ let errorCode = "UnknownError";
750
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
+ switch (errorCode) {
752
+ case "AccessDeniedException":
753
+ case "com.amazonaws.keyspaces#AccessDeniedException":
754
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
755
+ case "ConflictException":
756
+ case "com.amazonaws.keyspaces#ConflictException":
757
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
758
+ case "InternalServerException":
759
+ case "com.amazonaws.keyspaces#InternalServerException":
760
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
761
+ case "ResourceNotFoundException":
762
+ case "com.amazonaws.keyspaces#ResourceNotFoundException":
763
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
764
+ case "ServiceQuotaExceededException":
765
+ case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
766
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
767
+ case "ValidationException":
768
+ case "com.amazonaws.keyspaces#ValidationException":
769
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
770
+ default:
771
+ const parsedBody = parsedOutput.body;
772
+ response = new KeyspacesServiceException_1.KeyspacesServiceException({
773
+ name: parsedBody.code || parsedBody.Code || errorCode,
774
+ $fault: "client",
775
+ $metadata: deserializeMetadata(output),
776
+ });
777
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
778
+ }
779
+ };
780
+ const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
781
+ const body = parsedOutput.body;
782
+ const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
783
+ const exception = new models_0_1.AccessDeniedException({
784
+ $metadata: deserializeMetadata(parsedOutput),
785
+ ...deserialized,
786
+ });
787
+ return smithy_client_1.decorateServiceException(exception, body);
788
+ };
789
+ const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
790
+ const body = parsedOutput.body;
791
+ const deserialized = deserializeAws_json1_0ConflictException(body, context);
792
+ const exception = new models_0_1.ConflictException({
793
+ $metadata: deserializeMetadata(parsedOutput),
794
+ ...deserialized,
795
+ });
796
+ return smithy_client_1.decorateServiceException(exception, body);
797
+ };
798
+ const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
799
+ const body = parsedOutput.body;
800
+ const deserialized = deserializeAws_json1_0InternalServerException(body, context);
801
+ const exception = new models_0_1.InternalServerException({
802
+ $metadata: deserializeMetadata(parsedOutput),
803
+ ...deserialized,
804
+ });
805
+ return smithy_client_1.decorateServiceException(exception, body);
806
+ };
807
+ const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
808
+ const body = parsedOutput.body;
809
+ const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
810
+ const exception = new models_0_1.ResourceNotFoundException({
811
+ $metadata: deserializeMetadata(parsedOutput),
812
+ ...deserialized,
813
+ });
814
+ return smithy_client_1.decorateServiceException(exception, body);
815
+ };
816
+ const deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
817
+ const body = parsedOutput.body;
818
+ const deserialized = deserializeAws_json1_0ServiceQuotaExceededException(body, context);
819
+ const exception = new models_0_1.ServiceQuotaExceededException({
820
+ $metadata: deserializeMetadata(parsedOutput),
821
+ ...deserialized,
822
+ });
823
+ return smithy_client_1.decorateServiceException(exception, body);
824
+ };
825
+ const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
826
+ const body = parsedOutput.body;
827
+ const deserialized = deserializeAws_json1_0ValidationException(body, context);
828
+ const exception = new models_0_1.ValidationException({
829
+ $metadata: deserializeMetadata(parsedOutput),
830
+ ...deserialized,
831
+ });
832
+ return smithy_client_1.decorateServiceException(exception, body);
833
+ };
834
+ const serializeAws_json1_0CapacitySpecification = (input, context) => {
835
+ return {
836
+ ...(input.readCapacityUnits !== undefined &&
837
+ input.readCapacityUnits !== null && { readCapacityUnits: input.readCapacityUnits }),
838
+ ...(input.throughputMode !== undefined &&
839
+ input.throughputMode !== null && { throughputMode: input.throughputMode }),
840
+ ...(input.writeCapacityUnits !== undefined &&
841
+ input.writeCapacityUnits !== null && { writeCapacityUnits: input.writeCapacityUnits }),
842
+ };
843
+ };
844
+ const serializeAws_json1_0ClusteringKey = (input, context) => {
845
+ return {
846
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
847
+ ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }),
848
+ };
849
+ };
850
+ const serializeAws_json1_0ClusteringKeyList = (input, context) => {
851
+ return input
852
+ .filter((e) => e != null)
853
+ .map((entry) => {
854
+ if (entry === null) {
855
+ return null;
856
+ }
857
+ return serializeAws_json1_0ClusteringKey(entry, context);
858
+ });
859
+ };
860
+ const serializeAws_json1_0ColumnDefinition = (input, context) => {
861
+ return {
862
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
863
+ ...(input.type !== undefined && input.type !== null && { type: input.type }),
864
+ };
865
+ };
866
+ const serializeAws_json1_0ColumnDefinitionList = (input, context) => {
867
+ return input
868
+ .filter((e) => e != null)
869
+ .map((entry) => {
870
+ if (entry === null) {
871
+ return null;
872
+ }
873
+ return serializeAws_json1_0ColumnDefinition(entry, context);
874
+ });
875
+ };
876
+ const serializeAws_json1_0Comment = (input, context) => {
877
+ return {
878
+ ...(input.message !== undefined && input.message !== null && { message: input.message }),
879
+ };
880
+ };
881
+ const serializeAws_json1_0CreateKeyspaceRequest = (input, context) => {
882
+ return {
883
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
884
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }),
885
+ };
886
+ };
887
+ const serializeAws_json1_0CreateTableRequest = (input, context) => {
888
+ return {
889
+ ...(input.capacitySpecification !== undefined &&
890
+ input.capacitySpecification !== null && {
891
+ capacitySpecification: serializeAws_json1_0CapacitySpecification(input.capacitySpecification, context),
892
+ }),
893
+ ...(input.comment !== undefined &&
894
+ input.comment !== null && { comment: serializeAws_json1_0Comment(input.comment, context) }),
895
+ ...(input.defaultTimeToLive !== undefined &&
896
+ input.defaultTimeToLive !== null && { defaultTimeToLive: input.defaultTimeToLive }),
897
+ ...(input.encryptionSpecification !== undefined &&
898
+ input.encryptionSpecification !== null && {
899
+ encryptionSpecification: serializeAws_json1_0EncryptionSpecification(input.encryptionSpecification, context),
900
+ }),
901
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
902
+ ...(input.pointInTimeRecovery !== undefined &&
903
+ input.pointInTimeRecovery !== null && {
904
+ pointInTimeRecovery: serializeAws_json1_0PointInTimeRecovery(input.pointInTimeRecovery, context),
905
+ }),
906
+ ...(input.schemaDefinition !== undefined &&
907
+ input.schemaDefinition !== null && {
908
+ schemaDefinition: serializeAws_json1_0SchemaDefinition(input.schemaDefinition, context),
909
+ }),
910
+ ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }),
911
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }),
912
+ ...(input.ttl !== undefined && input.ttl !== null && { ttl: serializeAws_json1_0TimeToLive(input.ttl, context) }),
913
+ };
914
+ };
915
+ const serializeAws_json1_0DeleteKeyspaceRequest = (input, context) => {
916
+ return {
917
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
918
+ };
919
+ };
920
+ const serializeAws_json1_0DeleteTableRequest = (input, context) => {
921
+ return {
922
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
923
+ ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }),
924
+ };
925
+ };
926
+ const serializeAws_json1_0EncryptionSpecification = (input, context) => {
927
+ return {
928
+ ...(input.kmsKeyIdentifier !== undefined &&
929
+ input.kmsKeyIdentifier !== null && { kmsKeyIdentifier: input.kmsKeyIdentifier }),
930
+ ...(input.type !== undefined && input.type !== null && { type: input.type }),
931
+ };
932
+ };
933
+ const serializeAws_json1_0GetKeyspaceRequest = (input, context) => {
934
+ return {
935
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
936
+ };
937
+ };
938
+ const serializeAws_json1_0GetTableRequest = (input, context) => {
939
+ return {
940
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
941
+ ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }),
942
+ };
943
+ };
944
+ const serializeAws_json1_0ListKeyspacesRequest = (input, context) => {
945
+ return {
946
+ ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
947
+ ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
948
+ };
949
+ };
950
+ const serializeAws_json1_0ListTablesRequest = (input, context) => {
951
+ return {
952
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
953
+ ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
954
+ ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
955
+ };
956
+ };
957
+ const serializeAws_json1_0ListTagsForResourceRequest = (input, context) => {
958
+ return {
959
+ ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
960
+ ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
961
+ ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }),
962
+ };
963
+ };
964
+ const serializeAws_json1_0PartitionKey = (input, context) => {
965
+ return {
966
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
967
+ };
968
+ };
969
+ const serializeAws_json1_0PartitionKeyList = (input, context) => {
970
+ return input
971
+ .filter((e) => e != null)
972
+ .map((entry) => {
973
+ if (entry === null) {
974
+ return null;
975
+ }
976
+ return serializeAws_json1_0PartitionKey(entry, context);
977
+ });
978
+ };
979
+ const serializeAws_json1_0PointInTimeRecovery = (input, context) => {
980
+ return {
981
+ ...(input.status !== undefined && input.status !== null && { status: input.status }),
982
+ };
983
+ };
984
+ const serializeAws_json1_0RestoreTableRequest = (input, context) => {
985
+ return {
986
+ ...(input.capacitySpecificationOverride !== undefined &&
987
+ input.capacitySpecificationOverride !== null && {
988
+ capacitySpecificationOverride: serializeAws_json1_0CapacitySpecification(input.capacitySpecificationOverride, context),
989
+ }),
990
+ ...(input.encryptionSpecificationOverride !== undefined &&
991
+ input.encryptionSpecificationOverride !== null && {
992
+ encryptionSpecificationOverride: serializeAws_json1_0EncryptionSpecification(input.encryptionSpecificationOverride, context),
993
+ }),
994
+ ...(input.pointInTimeRecoveryOverride !== undefined &&
995
+ input.pointInTimeRecoveryOverride !== null && {
996
+ pointInTimeRecoveryOverride: serializeAws_json1_0PointInTimeRecovery(input.pointInTimeRecoveryOverride, context),
997
+ }),
998
+ ...(input.restoreTimestamp !== undefined &&
999
+ input.restoreTimestamp !== null && { restoreTimestamp: Math.round(input.restoreTimestamp.getTime() / 1000) }),
1000
+ ...(input.sourceKeyspaceName !== undefined &&
1001
+ input.sourceKeyspaceName !== null && { sourceKeyspaceName: input.sourceKeyspaceName }),
1002
+ ...(input.sourceTableName !== undefined &&
1003
+ input.sourceTableName !== null && { sourceTableName: input.sourceTableName }),
1004
+ ...(input.tagsOverride !== undefined &&
1005
+ input.tagsOverride !== null && { tagsOverride: serializeAws_json1_0TagList(input.tagsOverride, context) }),
1006
+ ...(input.targetKeyspaceName !== undefined &&
1007
+ input.targetKeyspaceName !== null && { targetKeyspaceName: input.targetKeyspaceName }),
1008
+ ...(input.targetTableName !== undefined &&
1009
+ input.targetTableName !== null && { targetTableName: input.targetTableName }),
1010
+ };
1011
+ };
1012
+ const serializeAws_json1_0SchemaDefinition = (input, context) => {
1013
+ return {
1014
+ ...(input.allColumns !== undefined &&
1015
+ input.allColumns !== null && { allColumns: serializeAws_json1_0ColumnDefinitionList(input.allColumns, context) }),
1016
+ ...(input.clusteringKeys !== undefined &&
1017
+ input.clusteringKeys !== null && {
1018
+ clusteringKeys: serializeAws_json1_0ClusteringKeyList(input.clusteringKeys, context),
1019
+ }),
1020
+ ...(input.partitionKeys !== undefined &&
1021
+ input.partitionKeys !== null && {
1022
+ partitionKeys: serializeAws_json1_0PartitionKeyList(input.partitionKeys, context),
1023
+ }),
1024
+ ...(input.staticColumns !== undefined &&
1025
+ input.staticColumns !== null && {
1026
+ staticColumns: serializeAws_json1_0StaticColumnList(input.staticColumns, context),
1027
+ }),
1028
+ };
1029
+ };
1030
+ const serializeAws_json1_0StaticColumn = (input, context) => {
1031
+ return {
1032
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
1033
+ };
1034
+ };
1035
+ const serializeAws_json1_0StaticColumnList = (input, context) => {
1036
+ return input
1037
+ .filter((e) => e != null)
1038
+ .map((entry) => {
1039
+ if (entry === null) {
1040
+ return null;
1041
+ }
1042
+ return serializeAws_json1_0StaticColumn(entry, context);
1043
+ });
1044
+ };
1045
+ const serializeAws_json1_0Tag = (input, context) => {
1046
+ return {
1047
+ ...(input.key !== undefined && input.key !== null && { key: input.key }),
1048
+ ...(input.value !== undefined && input.value !== null && { value: input.value }),
1049
+ };
1050
+ };
1051
+ const serializeAws_json1_0TagList = (input, context) => {
1052
+ return input
1053
+ .filter((e) => e != null)
1054
+ .map((entry) => {
1055
+ if (entry === null) {
1056
+ return null;
1057
+ }
1058
+ return serializeAws_json1_0Tag(entry, context);
1059
+ });
1060
+ };
1061
+ const serializeAws_json1_0TagResourceRequest = (input, context) => {
1062
+ return {
1063
+ ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }),
1064
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }),
1065
+ };
1066
+ };
1067
+ const serializeAws_json1_0TimeToLive = (input, context) => {
1068
+ return {
1069
+ ...(input.status !== undefined && input.status !== null && { status: input.status }),
1070
+ };
1071
+ };
1072
+ const serializeAws_json1_0UntagResourceRequest = (input, context) => {
1073
+ return {
1074
+ ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }),
1075
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }),
1076
+ };
1077
+ };
1078
+ const serializeAws_json1_0UpdateTableRequest = (input, context) => {
1079
+ return {
1080
+ ...(input.addColumns !== undefined &&
1081
+ input.addColumns !== null && { addColumns: serializeAws_json1_0ColumnDefinitionList(input.addColumns, context) }),
1082
+ ...(input.capacitySpecification !== undefined &&
1083
+ input.capacitySpecification !== null && {
1084
+ capacitySpecification: serializeAws_json1_0CapacitySpecification(input.capacitySpecification, context),
1085
+ }),
1086
+ ...(input.defaultTimeToLive !== undefined &&
1087
+ input.defaultTimeToLive !== null && { defaultTimeToLive: input.defaultTimeToLive }),
1088
+ ...(input.encryptionSpecification !== undefined &&
1089
+ input.encryptionSpecification !== null && {
1090
+ encryptionSpecification: serializeAws_json1_0EncryptionSpecification(input.encryptionSpecification, context),
1091
+ }),
1092
+ ...(input.keyspaceName !== undefined && input.keyspaceName !== null && { keyspaceName: input.keyspaceName }),
1093
+ ...(input.pointInTimeRecovery !== undefined &&
1094
+ input.pointInTimeRecovery !== null && {
1095
+ pointInTimeRecovery: serializeAws_json1_0PointInTimeRecovery(input.pointInTimeRecovery, context),
1096
+ }),
1097
+ ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }),
1098
+ ...(input.ttl !== undefined && input.ttl !== null && { ttl: serializeAws_json1_0TimeToLive(input.ttl, context) }),
1099
+ };
1100
+ };
1101
+ const deserializeAws_json1_0AccessDeniedException = (output, context) => {
1102
+ return {
1103
+ message: smithy_client_1.expectString(output.message),
1104
+ };
1105
+ };
1106
+ const deserializeAws_json1_0CapacitySpecificationSummary = (output, context) => {
1107
+ return {
1108
+ lastUpdateToPayPerRequestTimestamp: output.lastUpdateToPayPerRequestTimestamp !== undefined && output.lastUpdateToPayPerRequestTimestamp !== null
1109
+ ? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.lastUpdateToPayPerRequestTimestamp)))
1110
+ : undefined,
1111
+ readCapacityUnits: smithy_client_1.expectLong(output.readCapacityUnits),
1112
+ throughputMode: smithy_client_1.expectString(output.throughputMode),
1113
+ writeCapacityUnits: smithy_client_1.expectLong(output.writeCapacityUnits),
1114
+ };
1115
+ };
1116
+ const deserializeAws_json1_0ClusteringKey = (output, context) => {
1117
+ return {
1118
+ name: smithy_client_1.expectString(output.name),
1119
+ orderBy: smithy_client_1.expectString(output.orderBy),
1120
+ };
1121
+ };
1122
+ const deserializeAws_json1_0ClusteringKeyList = (output, context) => {
1123
+ const retVal = (output || [])
1124
+ .filter((e) => e != null)
1125
+ .map((entry) => {
1126
+ if (entry === null) {
1127
+ return null;
1128
+ }
1129
+ return deserializeAws_json1_0ClusteringKey(entry, context);
1130
+ });
1131
+ return retVal;
1132
+ };
1133
+ const deserializeAws_json1_0ColumnDefinition = (output, context) => {
1134
+ return {
1135
+ name: smithy_client_1.expectString(output.name),
1136
+ type: smithy_client_1.expectString(output.type),
1137
+ };
1138
+ };
1139
+ const deserializeAws_json1_0ColumnDefinitionList = (output, context) => {
1140
+ const retVal = (output || [])
1141
+ .filter((e) => e != null)
1142
+ .map((entry) => {
1143
+ if (entry === null) {
1144
+ return null;
1145
+ }
1146
+ return deserializeAws_json1_0ColumnDefinition(entry, context);
1147
+ });
1148
+ return retVal;
1149
+ };
1150
+ const deserializeAws_json1_0Comment = (output, context) => {
1151
+ return {
1152
+ message: smithy_client_1.expectString(output.message),
1153
+ };
1154
+ };
1155
+ const deserializeAws_json1_0ConflictException = (output, context) => {
1156
+ return {
1157
+ message: smithy_client_1.expectString(output.message),
1158
+ };
1159
+ };
1160
+ const deserializeAws_json1_0CreateKeyspaceResponse = (output, context) => {
1161
+ return {
1162
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1163
+ };
1164
+ };
1165
+ const deserializeAws_json1_0CreateTableResponse = (output, context) => {
1166
+ return {
1167
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1168
+ };
1169
+ };
1170
+ const deserializeAws_json1_0DeleteKeyspaceResponse = (output, context) => {
1171
+ return {};
1172
+ };
1173
+ const deserializeAws_json1_0DeleteTableResponse = (output, context) => {
1174
+ return {};
1175
+ };
1176
+ const deserializeAws_json1_0EncryptionSpecification = (output, context) => {
1177
+ return {
1178
+ kmsKeyIdentifier: smithy_client_1.expectString(output.kmsKeyIdentifier),
1179
+ type: smithy_client_1.expectString(output.type),
1180
+ };
1181
+ };
1182
+ const deserializeAws_json1_0GetKeyspaceResponse = (output, context) => {
1183
+ return {
1184
+ keyspaceName: smithy_client_1.expectString(output.keyspaceName),
1185
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1186
+ };
1187
+ };
1188
+ const deserializeAws_json1_0GetTableResponse = (output, context) => {
1189
+ return {
1190
+ capacitySpecification: output.capacitySpecification !== undefined && output.capacitySpecification !== null
1191
+ ? deserializeAws_json1_0CapacitySpecificationSummary(output.capacitySpecification, context)
1192
+ : undefined,
1193
+ comment: output.comment !== undefined && output.comment !== null
1194
+ ? deserializeAws_json1_0Comment(output.comment, context)
1195
+ : undefined,
1196
+ creationTimestamp: output.creationTimestamp !== undefined && output.creationTimestamp !== null
1197
+ ? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.creationTimestamp)))
1198
+ : undefined,
1199
+ defaultTimeToLive: smithy_client_1.expectInt32(output.defaultTimeToLive),
1200
+ encryptionSpecification: output.encryptionSpecification !== undefined && output.encryptionSpecification !== null
1201
+ ? deserializeAws_json1_0EncryptionSpecification(output.encryptionSpecification, context)
1202
+ : undefined,
1203
+ keyspaceName: smithy_client_1.expectString(output.keyspaceName),
1204
+ pointInTimeRecovery: output.pointInTimeRecovery !== undefined && output.pointInTimeRecovery !== null
1205
+ ? deserializeAws_json1_0PointInTimeRecoverySummary(output.pointInTimeRecovery, context)
1206
+ : undefined,
1207
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1208
+ schemaDefinition: output.schemaDefinition !== undefined && output.schemaDefinition !== null
1209
+ ? deserializeAws_json1_0SchemaDefinition(output.schemaDefinition, context)
1210
+ : undefined,
1211
+ status: smithy_client_1.expectString(output.status),
1212
+ tableName: smithy_client_1.expectString(output.tableName),
1213
+ ttl: output.ttl !== undefined && output.ttl !== null
1214
+ ? deserializeAws_json1_0TimeToLive(output.ttl, context)
1215
+ : undefined,
1216
+ };
1217
+ };
1218
+ const deserializeAws_json1_0InternalServerException = (output, context) => {
1219
+ return {
1220
+ message: smithy_client_1.expectString(output.message),
1221
+ };
1222
+ };
1223
+ const deserializeAws_json1_0KeyspaceSummary = (output, context) => {
1224
+ return {
1225
+ keyspaceName: smithy_client_1.expectString(output.keyspaceName),
1226
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1227
+ };
1228
+ };
1229
+ const deserializeAws_json1_0KeyspaceSummaryList = (output, context) => {
1230
+ const retVal = (output || [])
1231
+ .filter((e) => e != null)
1232
+ .map((entry) => {
1233
+ if (entry === null) {
1234
+ return null;
1235
+ }
1236
+ return deserializeAws_json1_0KeyspaceSummary(entry, context);
1237
+ });
1238
+ return retVal;
1239
+ };
1240
+ const deserializeAws_json1_0ListKeyspacesResponse = (output, context) => {
1241
+ return {
1242
+ keyspaces: output.keyspaces !== undefined && output.keyspaces !== null
1243
+ ? deserializeAws_json1_0KeyspaceSummaryList(output.keyspaces, context)
1244
+ : undefined,
1245
+ nextToken: smithy_client_1.expectString(output.nextToken),
1246
+ };
1247
+ };
1248
+ const deserializeAws_json1_0ListTablesResponse = (output, context) => {
1249
+ return {
1250
+ nextToken: smithy_client_1.expectString(output.nextToken),
1251
+ tables: output.tables !== undefined && output.tables !== null
1252
+ ? deserializeAws_json1_0TableSummaryList(output.tables, context)
1253
+ : undefined,
1254
+ };
1255
+ };
1256
+ const deserializeAws_json1_0ListTagsForResourceResponse = (output, context) => {
1257
+ return {
1258
+ nextToken: smithy_client_1.expectString(output.nextToken),
1259
+ tags: output.tags !== undefined && output.tags !== null
1260
+ ? deserializeAws_json1_0TagList(output.tags, context)
1261
+ : undefined,
1262
+ };
1263
+ };
1264
+ const deserializeAws_json1_0PartitionKey = (output, context) => {
1265
+ return {
1266
+ name: smithy_client_1.expectString(output.name),
1267
+ };
1268
+ };
1269
+ const deserializeAws_json1_0PartitionKeyList = (output, context) => {
1270
+ const retVal = (output || [])
1271
+ .filter((e) => e != null)
1272
+ .map((entry) => {
1273
+ if (entry === null) {
1274
+ return null;
1275
+ }
1276
+ return deserializeAws_json1_0PartitionKey(entry, context);
1277
+ });
1278
+ return retVal;
1279
+ };
1280
+ const deserializeAws_json1_0PointInTimeRecoverySummary = (output, context) => {
1281
+ return {
1282
+ earliestRestorableTimestamp: output.earliestRestorableTimestamp !== undefined && output.earliestRestorableTimestamp !== null
1283
+ ? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.earliestRestorableTimestamp)))
1284
+ : undefined,
1285
+ status: smithy_client_1.expectString(output.status),
1286
+ };
1287
+ };
1288
+ const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
1289
+ return {
1290
+ message: smithy_client_1.expectString(output.message),
1291
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1292
+ };
1293
+ };
1294
+ const deserializeAws_json1_0RestoreTableResponse = (output, context) => {
1295
+ return {
1296
+ restoredTableARN: smithy_client_1.expectString(output.restoredTableARN),
1297
+ };
1298
+ };
1299
+ const deserializeAws_json1_0SchemaDefinition = (output, context) => {
1300
+ return {
1301
+ allColumns: output.allColumns !== undefined && output.allColumns !== null
1302
+ ? deserializeAws_json1_0ColumnDefinitionList(output.allColumns, context)
1303
+ : undefined,
1304
+ clusteringKeys: output.clusteringKeys !== undefined && output.clusteringKeys !== null
1305
+ ? deserializeAws_json1_0ClusteringKeyList(output.clusteringKeys, context)
1306
+ : undefined,
1307
+ partitionKeys: output.partitionKeys !== undefined && output.partitionKeys !== null
1308
+ ? deserializeAws_json1_0PartitionKeyList(output.partitionKeys, context)
1309
+ : undefined,
1310
+ staticColumns: output.staticColumns !== undefined && output.staticColumns !== null
1311
+ ? deserializeAws_json1_0StaticColumnList(output.staticColumns, context)
1312
+ : undefined,
1313
+ };
1314
+ };
1315
+ const deserializeAws_json1_0ServiceQuotaExceededException = (output, context) => {
1316
+ return {
1317
+ message: smithy_client_1.expectString(output.message),
1318
+ };
1319
+ };
1320
+ const deserializeAws_json1_0StaticColumn = (output, context) => {
1321
+ return {
1322
+ name: smithy_client_1.expectString(output.name),
1323
+ };
1324
+ };
1325
+ const deserializeAws_json1_0StaticColumnList = (output, context) => {
1326
+ const retVal = (output || [])
1327
+ .filter((e) => e != null)
1328
+ .map((entry) => {
1329
+ if (entry === null) {
1330
+ return null;
1331
+ }
1332
+ return deserializeAws_json1_0StaticColumn(entry, context);
1333
+ });
1334
+ return retVal;
1335
+ };
1336
+ const deserializeAws_json1_0TableSummary = (output, context) => {
1337
+ return {
1338
+ keyspaceName: smithy_client_1.expectString(output.keyspaceName),
1339
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1340
+ tableName: smithy_client_1.expectString(output.tableName),
1341
+ };
1342
+ };
1343
+ const deserializeAws_json1_0TableSummaryList = (output, context) => {
1344
+ const retVal = (output || [])
1345
+ .filter((e) => e != null)
1346
+ .map((entry) => {
1347
+ if (entry === null) {
1348
+ return null;
1349
+ }
1350
+ return deserializeAws_json1_0TableSummary(entry, context);
1351
+ });
1352
+ return retVal;
1353
+ };
1354
+ const deserializeAws_json1_0Tag = (output, context) => {
1355
+ return {
1356
+ key: smithy_client_1.expectString(output.key),
1357
+ value: smithy_client_1.expectString(output.value),
1358
+ };
1359
+ };
1360
+ const deserializeAws_json1_0TagList = (output, context) => {
1361
+ const retVal = (output || [])
1362
+ .filter((e) => e != null)
1363
+ .map((entry) => {
1364
+ if (entry === null) {
1365
+ return null;
1366
+ }
1367
+ return deserializeAws_json1_0Tag(entry, context);
1368
+ });
1369
+ return retVal;
1370
+ };
1371
+ const deserializeAws_json1_0TagResourceResponse = (output, context) => {
1372
+ return {};
1373
+ };
1374
+ const deserializeAws_json1_0TimeToLive = (output, context) => {
1375
+ return {
1376
+ status: smithy_client_1.expectString(output.status),
1377
+ };
1378
+ };
1379
+ const deserializeAws_json1_0UntagResourceResponse = (output, context) => {
1380
+ return {};
1381
+ };
1382
+ const deserializeAws_json1_0UpdateTableResponse = (output, context) => {
1383
+ return {
1384
+ resourceArn: smithy_client_1.expectString(output.resourceArn),
1385
+ };
1386
+ };
1387
+ const deserializeAws_json1_0ValidationException = (output, context) => {
1388
+ return {
1389
+ message: smithy_client_1.expectString(output.message),
1390
+ };
1391
+ };
1392
+ const deserializeMetadata = (output) => {
1393
+ var _a;
1394
+ return ({
1395
+ httpStatusCode: output.statusCode,
1396
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1397
+ extendedRequestId: output.headers["x-amz-id-2"],
1398
+ cfId: output.headers["x-amz-cf-id"],
1399
+ });
1400
+ };
1401
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1402
+ if (streamBody instanceof Uint8Array) {
1403
+ return Promise.resolve(streamBody);
1404
+ }
1405
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1406
+ };
1407
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1408
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1409
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1410
+ const contents = {
1411
+ protocol,
1412
+ hostname,
1413
+ port,
1414
+ method: "POST",
1415
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1416
+ headers,
1417
+ };
1418
+ if (resolvedHostname !== undefined) {
1419
+ contents.hostname = resolvedHostname;
1420
+ }
1421
+ if (body !== undefined) {
1422
+ contents.body = body;
1423
+ }
1424
+ return new protocol_http_1.HttpRequest(contents);
1425
+ };
1426
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1427
+ if (encoded.length) {
1428
+ return JSON.parse(encoded);
1429
+ }
1430
+ return {};
1431
+ });
1432
+ const loadRestJsonErrorCode = (output, data) => {
1433
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1434
+ const sanitizeErrorCode = (rawValue) => {
1435
+ let cleanValue = rawValue;
1436
+ if (cleanValue.indexOf(":") >= 0) {
1437
+ cleanValue = cleanValue.split(":")[0];
1438
+ }
1439
+ if (cleanValue.indexOf("#") >= 0) {
1440
+ cleanValue = cleanValue.split("#")[1];
1441
+ }
1442
+ return cleanValue;
1443
+ };
1444
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1445
+ if (headerKey !== undefined) {
1446
+ return sanitizeErrorCode(output.headers[headerKey]);
1447
+ }
1448
+ if (data.code !== undefined) {
1449
+ return sanitizeErrorCode(data.code);
1450
+ }
1451
+ if (data["__type"] !== undefined) {
1452
+ return sanitizeErrorCode(data["__type"]);
1453
+ }
1454
+ return "";
1455
+ };