@aws-sdk/client-amplifybackend 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.
- package/CHANGELOG.md +41 -0
- package/dist-cjs/AmplifyBackend.js +90 -0
- package/dist-cjs/commands/CreateBackendStorageCommand.js +36 -0
- package/dist-cjs/commands/DeleteBackendStorageCommand.js +36 -0
- package/dist-cjs/commands/GetBackendStorageCommand.js +36 -0
- package/dist-cjs/commands/ImportBackendStorageCommand.js +36 -0
- package/dist-cjs/commands/ListS3BucketsCommand.js +36 -0
- package/dist-cjs/commands/UpdateBackendStorageCommand.js +36 -0
- package/dist-cjs/commands/index.js +6 -0
- package/dist-cjs/endpoints.js +9 -0
- package/dist-cjs/models/models_0.js +121 -2
- package/dist-cjs/protocols/Aws_restJson1.js +937 -101
- package/dist-es/AmplifyBackend.js +90 -0
- package/dist-es/commands/CreateBackendStorageCommand.js +39 -0
- package/dist-es/commands/DeleteBackendStorageCommand.js +39 -0
- package/dist-es/commands/GetBackendStorageCommand.js +39 -0
- package/dist-es/commands/ImportBackendStorageCommand.js +39 -0
- package/dist-es/commands/ListS3BucketsCommand.js +39 -0
- package/dist-es/commands/UpdateBackendStorageCommand.js +39 -0
- package/dist-es/commands/index.js +6 -0
- package/dist-es/endpoints.js +9 -0
- package/dist-es/models/models_0.js +84 -0
- package/dist-es/protocols/Aws_restJson1.js +1008 -86
- package/dist-types/AmplifyBackend.d.ts +42 -0
- package/dist-types/AmplifyBackendClient.d.ts +8 -2
- package/dist-types/commands/CloneBackendCommand.d.ts +1 -1
- package/dist-types/commands/CreateBackendAPICommand.d.ts +1 -1
- package/dist-types/commands/CreateBackendAuthCommand.d.ts +1 -1
- package/dist-types/commands/CreateBackendCommand.d.ts +1 -1
- package/dist-types/commands/CreateBackendConfigCommand.d.ts +1 -1
- package/dist-types/commands/CreateBackendStorageCommand.d.ts +35 -0
- package/dist-types/commands/CreateTokenCommand.d.ts +1 -1
- package/dist-types/commands/DeleteBackendAPICommand.d.ts +1 -1
- package/dist-types/commands/DeleteBackendAuthCommand.d.ts +1 -1
- package/dist-types/commands/DeleteBackendCommand.d.ts +1 -1
- package/dist-types/commands/DeleteBackendStorageCommand.d.ts +35 -0
- package/dist-types/commands/DeleteTokenCommand.d.ts +1 -1
- package/dist-types/commands/GenerateBackendAPIModelsCommand.d.ts +1 -1
- package/dist-types/commands/GetBackendAPICommand.d.ts +1 -1
- package/dist-types/commands/GetBackendAPIModelsCommand.d.ts +1 -1
- package/dist-types/commands/GetBackendAuthCommand.d.ts +1 -1
- package/dist-types/commands/GetBackendCommand.d.ts +1 -1
- package/dist-types/commands/GetBackendJobCommand.d.ts +1 -1
- package/dist-types/commands/GetBackendStorageCommand.d.ts +35 -0
- package/dist-types/commands/GetTokenCommand.d.ts +1 -1
- package/dist-types/commands/ImportBackendAuthCommand.d.ts +1 -1
- package/dist-types/commands/ImportBackendStorageCommand.d.ts +35 -0
- package/dist-types/commands/ListBackendJobsCommand.d.ts +1 -1
- package/dist-types/commands/ListS3BucketsCommand.d.ts +35 -0
- package/dist-types/commands/RemoveAllBackendsCommand.d.ts +1 -1
- package/dist-types/commands/RemoveBackendConfigCommand.d.ts +1 -1
- package/dist-types/commands/UpdateBackendAPICommand.d.ts +1 -1
- package/dist-types/commands/UpdateBackendAuthCommand.d.ts +1 -1
- package/dist-types/commands/UpdateBackendConfigCommand.d.ts +1 -1
- package/dist-types/commands/UpdateBackendJobCommand.d.ts +1 -1
- package/dist-types/commands/UpdateBackendStorageCommand.d.ts +35 -0
- package/dist-types/commands/index.d.ts +6 -0
- package/dist-types/models/models_0.d.ts +403 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/dist-types/ts3.4/AmplifyBackend.d.ts +30 -0
- package/dist-types/ts3.4/AmplifyBackendClient.d.ts +8 -2
- package/dist-types/ts3.4/commands/CreateBackendStorageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteBackendStorageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetBackendStorageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ImportBackendStorageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListS3BucketsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateBackendStorageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +6 -0
- package/dist-types/ts3.4/models/models_0.d.ts +236 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +18 -0
- package/package.json +6 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.deserializeAws_restJson1GetBackendStorageCommand = exports.deserializeAws_restJson1GetBackendJobCommand = exports.deserializeAws_restJson1GetBackendAuthCommand = exports.deserializeAws_restJson1GetBackendAPIModelsCommand = exports.deserializeAws_restJson1GetBackendAPICommand = exports.deserializeAws_restJson1GetBackendCommand = exports.deserializeAws_restJson1GenerateBackendAPIModelsCommand = exports.deserializeAws_restJson1DeleteTokenCommand = exports.deserializeAws_restJson1DeleteBackendStorageCommand = exports.deserializeAws_restJson1DeleteBackendAuthCommand = exports.deserializeAws_restJson1DeleteBackendAPICommand = exports.deserializeAws_restJson1DeleteBackendCommand = exports.deserializeAws_restJson1CreateTokenCommand = exports.deserializeAws_restJson1CreateBackendStorageCommand = exports.deserializeAws_restJson1CreateBackendConfigCommand = exports.deserializeAws_restJson1CreateBackendAuthCommand = exports.deserializeAws_restJson1CreateBackendAPICommand = exports.deserializeAws_restJson1CreateBackendCommand = exports.deserializeAws_restJson1CloneBackendCommand = exports.serializeAws_restJson1UpdateBackendStorageCommand = exports.serializeAws_restJson1UpdateBackendJobCommand = exports.serializeAws_restJson1UpdateBackendConfigCommand = exports.serializeAws_restJson1UpdateBackendAuthCommand = exports.serializeAws_restJson1UpdateBackendAPICommand = exports.serializeAws_restJson1RemoveBackendConfigCommand = exports.serializeAws_restJson1RemoveAllBackendsCommand = exports.serializeAws_restJson1ListS3BucketsCommand = exports.serializeAws_restJson1ListBackendJobsCommand = exports.serializeAws_restJson1ImportBackendStorageCommand = exports.serializeAws_restJson1ImportBackendAuthCommand = exports.serializeAws_restJson1GetTokenCommand = exports.serializeAws_restJson1GetBackendStorageCommand = exports.serializeAws_restJson1GetBackendJobCommand = exports.serializeAws_restJson1GetBackendAuthCommand = exports.serializeAws_restJson1GetBackendAPIModelsCommand = exports.serializeAws_restJson1GetBackendAPICommand = exports.serializeAws_restJson1GetBackendCommand = exports.serializeAws_restJson1GenerateBackendAPIModelsCommand = exports.serializeAws_restJson1DeleteTokenCommand = exports.serializeAws_restJson1DeleteBackendStorageCommand = exports.serializeAws_restJson1DeleteBackendAuthCommand = exports.serializeAws_restJson1DeleteBackendAPICommand = exports.serializeAws_restJson1DeleteBackendCommand = exports.serializeAws_restJson1CreateTokenCommand = exports.serializeAws_restJson1CreateBackendStorageCommand = exports.serializeAws_restJson1CreateBackendConfigCommand = exports.serializeAws_restJson1CreateBackendAuthCommand = exports.serializeAws_restJson1CreateBackendAPICommand = exports.serializeAws_restJson1CreateBackendCommand = exports.serializeAws_restJson1CloneBackendCommand = void 0;
|
|
4
|
+
exports.deserializeAws_restJson1UpdateBackendStorageCommand = exports.deserializeAws_restJson1UpdateBackendJobCommand = exports.deserializeAws_restJson1UpdateBackendConfigCommand = exports.deserializeAws_restJson1UpdateBackendAuthCommand = exports.deserializeAws_restJson1UpdateBackendAPICommand = exports.deserializeAws_restJson1RemoveBackendConfigCommand = exports.deserializeAws_restJson1RemoveAllBackendsCommand = exports.deserializeAws_restJson1ListS3BucketsCommand = exports.deserializeAws_restJson1ListBackendJobsCommand = exports.deserializeAws_restJson1ImportBackendStorageCommand = exports.deserializeAws_restJson1ImportBackendAuthCommand = exports.deserializeAws_restJson1GetTokenCommand = void 0;
|
|
4
5
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
6
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
7
|
const serializeAws_restJson1CloneBackendCommand = async (input, context) => {
|
|
@@ -181,6 +182,43 @@ const serializeAws_restJson1CreateBackendConfigCommand = async (input, context)
|
|
|
181
182
|
});
|
|
182
183
|
};
|
|
183
184
|
exports.serializeAws_restJson1CreateBackendConfigCommand = serializeAws_restJson1CreateBackendConfigCommand;
|
|
185
|
+
const serializeAws_restJson1CreateBackendStorageCommand = async (input, context) => {
|
|
186
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
187
|
+
const headers = {
|
|
188
|
+
"content-type": "application/json",
|
|
189
|
+
};
|
|
190
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/storage";
|
|
191
|
+
if (input.AppId !== undefined) {
|
|
192
|
+
const labelValue = input.AppId;
|
|
193
|
+
if (labelValue.length <= 0) {
|
|
194
|
+
throw new Error("Empty value provided for input HTTP label: AppId.");
|
|
195
|
+
}
|
|
196
|
+
resolvedPath = resolvedPath.replace("{AppId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
throw new Error("No value provided for input HTTP label: AppId.");
|
|
200
|
+
}
|
|
201
|
+
let body;
|
|
202
|
+
body = JSON.stringify({
|
|
203
|
+
...(input.BackendEnvironmentName !== undefined &&
|
|
204
|
+
input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
|
|
205
|
+
...(input.ResourceConfig !== undefined &&
|
|
206
|
+
input.ResourceConfig !== null && {
|
|
207
|
+
resourceConfig: serializeAws_restJson1CreateBackendStorageResourceConfig(input.ResourceConfig, context),
|
|
208
|
+
}),
|
|
209
|
+
...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
|
|
210
|
+
});
|
|
211
|
+
return new protocol_http_1.HttpRequest({
|
|
212
|
+
protocol,
|
|
213
|
+
hostname,
|
|
214
|
+
port,
|
|
215
|
+
method: "POST",
|
|
216
|
+
headers,
|
|
217
|
+
path: resolvedPath,
|
|
218
|
+
body,
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
exports.serializeAws_restJson1CreateBackendStorageCommand = serializeAws_restJson1CreateBackendStorageCommand;
|
|
184
222
|
const serializeAws_restJson1CreateTokenCommand = async (input, context) => {
|
|
185
223
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
186
224
|
const headers = {};
|
|
@@ -332,6 +370,49 @@ const serializeAws_restJson1DeleteBackendAuthCommand = async (input, context) =>
|
|
|
332
370
|
});
|
|
333
371
|
};
|
|
334
372
|
exports.serializeAws_restJson1DeleteBackendAuthCommand = serializeAws_restJson1DeleteBackendAuthCommand;
|
|
373
|
+
const serializeAws_restJson1DeleteBackendStorageCommand = async (input, context) => {
|
|
374
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
375
|
+
const headers = {
|
|
376
|
+
"content-type": "application/json",
|
|
377
|
+
};
|
|
378
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
379
|
+
"/backend/{AppId}/storage/{BackendEnvironmentName}/remove";
|
|
380
|
+
if (input.AppId !== undefined) {
|
|
381
|
+
const labelValue = input.AppId;
|
|
382
|
+
if (labelValue.length <= 0) {
|
|
383
|
+
throw new Error("Empty value provided for input HTTP label: AppId.");
|
|
384
|
+
}
|
|
385
|
+
resolvedPath = resolvedPath.replace("{AppId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
throw new Error("No value provided for input HTTP label: AppId.");
|
|
389
|
+
}
|
|
390
|
+
if (input.BackendEnvironmentName !== undefined) {
|
|
391
|
+
const labelValue = input.BackendEnvironmentName;
|
|
392
|
+
if (labelValue.length <= 0) {
|
|
393
|
+
throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
|
|
394
|
+
}
|
|
395
|
+
resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
|
|
399
|
+
}
|
|
400
|
+
let body;
|
|
401
|
+
body = JSON.stringify({
|
|
402
|
+
...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
|
|
403
|
+
...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
|
|
404
|
+
});
|
|
405
|
+
return new protocol_http_1.HttpRequest({
|
|
406
|
+
protocol,
|
|
407
|
+
hostname,
|
|
408
|
+
port,
|
|
409
|
+
method: "POST",
|
|
410
|
+
headers,
|
|
411
|
+
path: resolvedPath,
|
|
412
|
+
body,
|
|
413
|
+
});
|
|
414
|
+
};
|
|
415
|
+
exports.serializeAws_restJson1DeleteBackendStorageCommand = serializeAws_restJson1DeleteBackendStorageCommand;
|
|
335
416
|
const serializeAws_restJson1DeleteTokenCommand = async (input, context) => {
|
|
336
417
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
337
418
|
const headers = {};
|
|
@@ -620,6 +701,48 @@ const serializeAws_restJson1GetBackendJobCommand = async (input, context) => {
|
|
|
620
701
|
});
|
|
621
702
|
};
|
|
622
703
|
exports.serializeAws_restJson1GetBackendJobCommand = serializeAws_restJson1GetBackendJobCommand;
|
|
704
|
+
const serializeAws_restJson1GetBackendStorageCommand = async (input, context) => {
|
|
705
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
706
|
+
const headers = {
|
|
707
|
+
"content-type": "application/json",
|
|
708
|
+
};
|
|
709
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
710
|
+
"/backend/{AppId}/storage/{BackendEnvironmentName}/details";
|
|
711
|
+
if (input.AppId !== undefined) {
|
|
712
|
+
const labelValue = input.AppId;
|
|
713
|
+
if (labelValue.length <= 0) {
|
|
714
|
+
throw new Error("Empty value provided for input HTTP label: AppId.");
|
|
715
|
+
}
|
|
716
|
+
resolvedPath = resolvedPath.replace("{AppId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
throw new Error("No value provided for input HTTP label: AppId.");
|
|
720
|
+
}
|
|
721
|
+
if (input.BackendEnvironmentName !== undefined) {
|
|
722
|
+
const labelValue = input.BackendEnvironmentName;
|
|
723
|
+
if (labelValue.length <= 0) {
|
|
724
|
+
throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
|
|
725
|
+
}
|
|
726
|
+
resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
|
|
730
|
+
}
|
|
731
|
+
let body;
|
|
732
|
+
body = JSON.stringify({
|
|
733
|
+
...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
|
|
734
|
+
});
|
|
735
|
+
return new protocol_http_1.HttpRequest({
|
|
736
|
+
protocol,
|
|
737
|
+
hostname,
|
|
738
|
+
port,
|
|
739
|
+
method: "POST",
|
|
740
|
+
headers,
|
|
741
|
+
path: resolvedPath,
|
|
742
|
+
body,
|
|
743
|
+
});
|
|
744
|
+
};
|
|
745
|
+
exports.serializeAws_restJson1GetBackendStorageCommand = serializeAws_restJson1GetBackendStorageCommand;
|
|
623
746
|
const serializeAws_restJson1GetTokenCommand = async (input, context) => {
|
|
624
747
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
625
748
|
const headers = {};
|
|
@@ -703,6 +826,49 @@ const serializeAws_restJson1ImportBackendAuthCommand = async (input, context) =>
|
|
|
703
826
|
});
|
|
704
827
|
};
|
|
705
828
|
exports.serializeAws_restJson1ImportBackendAuthCommand = serializeAws_restJson1ImportBackendAuthCommand;
|
|
829
|
+
const serializeAws_restJson1ImportBackendStorageCommand = async (input, context) => {
|
|
830
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
831
|
+
const headers = {
|
|
832
|
+
"content-type": "application/json",
|
|
833
|
+
};
|
|
834
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
835
|
+
"/backend/{AppId}/storage/{BackendEnvironmentName}/import";
|
|
836
|
+
if (input.AppId !== undefined) {
|
|
837
|
+
const labelValue = input.AppId;
|
|
838
|
+
if (labelValue.length <= 0) {
|
|
839
|
+
throw new Error("Empty value provided for input HTTP label: AppId.");
|
|
840
|
+
}
|
|
841
|
+
resolvedPath = resolvedPath.replace("{AppId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
842
|
+
}
|
|
843
|
+
else {
|
|
844
|
+
throw new Error("No value provided for input HTTP label: AppId.");
|
|
845
|
+
}
|
|
846
|
+
if (input.BackendEnvironmentName !== undefined) {
|
|
847
|
+
const labelValue = input.BackendEnvironmentName;
|
|
848
|
+
if (labelValue.length <= 0) {
|
|
849
|
+
throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
|
|
850
|
+
}
|
|
851
|
+
resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
|
|
855
|
+
}
|
|
856
|
+
let body;
|
|
857
|
+
body = JSON.stringify({
|
|
858
|
+
...(input.BucketName !== undefined && input.BucketName !== null && { bucketName: input.BucketName }),
|
|
859
|
+
...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
|
|
860
|
+
});
|
|
861
|
+
return new protocol_http_1.HttpRequest({
|
|
862
|
+
protocol,
|
|
863
|
+
hostname,
|
|
864
|
+
port,
|
|
865
|
+
method: "POST",
|
|
866
|
+
headers,
|
|
867
|
+
path: resolvedPath,
|
|
868
|
+
body,
|
|
869
|
+
});
|
|
870
|
+
};
|
|
871
|
+
exports.serializeAws_restJson1ImportBackendStorageCommand = serializeAws_restJson1ImportBackendStorageCommand;
|
|
706
872
|
const serializeAws_restJson1ListBackendJobsCommand = async (input, context) => {
|
|
707
873
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
708
874
|
const headers = {
|
|
@@ -749,6 +915,27 @@ const serializeAws_restJson1ListBackendJobsCommand = async (input, context) => {
|
|
|
749
915
|
});
|
|
750
916
|
};
|
|
751
917
|
exports.serializeAws_restJson1ListBackendJobsCommand = serializeAws_restJson1ListBackendJobsCommand;
|
|
918
|
+
const serializeAws_restJson1ListS3BucketsCommand = async (input, context) => {
|
|
919
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
920
|
+
const headers = {
|
|
921
|
+
"content-type": "application/json",
|
|
922
|
+
};
|
|
923
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/s3Buckets";
|
|
924
|
+
let body;
|
|
925
|
+
body = JSON.stringify({
|
|
926
|
+
...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }),
|
|
927
|
+
});
|
|
928
|
+
return new protocol_http_1.HttpRequest({
|
|
929
|
+
protocol,
|
|
930
|
+
hostname,
|
|
931
|
+
port,
|
|
932
|
+
method: "POST",
|
|
933
|
+
headers,
|
|
934
|
+
path: resolvedPath,
|
|
935
|
+
body,
|
|
936
|
+
});
|
|
937
|
+
};
|
|
938
|
+
exports.serializeAws_restJson1ListS3BucketsCommand = serializeAws_restJson1ListS3BucketsCommand;
|
|
752
939
|
const serializeAws_restJson1RemoveAllBackendsCommand = async (input, context) => {
|
|
753
940
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
754
941
|
const headers = {
|
|
@@ -986,6 +1173,52 @@ const serializeAws_restJson1UpdateBackendJobCommand = async (input, context) =>
|
|
|
986
1173
|
});
|
|
987
1174
|
};
|
|
988
1175
|
exports.serializeAws_restJson1UpdateBackendJobCommand = serializeAws_restJson1UpdateBackendJobCommand;
|
|
1176
|
+
const serializeAws_restJson1UpdateBackendStorageCommand = async (input, context) => {
|
|
1177
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1178
|
+
const headers = {
|
|
1179
|
+
"content-type": "application/json",
|
|
1180
|
+
};
|
|
1181
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
1182
|
+
"/backend/{AppId}/storage/{BackendEnvironmentName}";
|
|
1183
|
+
if (input.AppId !== undefined) {
|
|
1184
|
+
const labelValue = input.AppId;
|
|
1185
|
+
if (labelValue.length <= 0) {
|
|
1186
|
+
throw new Error("Empty value provided for input HTTP label: AppId.");
|
|
1187
|
+
}
|
|
1188
|
+
resolvedPath = resolvedPath.replace("{AppId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
throw new Error("No value provided for input HTTP label: AppId.");
|
|
1192
|
+
}
|
|
1193
|
+
if (input.BackendEnvironmentName !== undefined) {
|
|
1194
|
+
const labelValue = input.BackendEnvironmentName;
|
|
1195
|
+
if (labelValue.length <= 0) {
|
|
1196
|
+
throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
|
|
1197
|
+
}
|
|
1198
|
+
resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1199
|
+
}
|
|
1200
|
+
else {
|
|
1201
|
+
throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
|
|
1202
|
+
}
|
|
1203
|
+
let body;
|
|
1204
|
+
body = JSON.stringify({
|
|
1205
|
+
...(input.ResourceConfig !== undefined &&
|
|
1206
|
+
input.ResourceConfig !== null && {
|
|
1207
|
+
resourceConfig: serializeAws_restJson1UpdateBackendStorageResourceConfig(input.ResourceConfig, context),
|
|
1208
|
+
}),
|
|
1209
|
+
...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
|
|
1210
|
+
});
|
|
1211
|
+
return new protocol_http_1.HttpRequest({
|
|
1212
|
+
protocol,
|
|
1213
|
+
hostname,
|
|
1214
|
+
port,
|
|
1215
|
+
method: "POST",
|
|
1216
|
+
headers,
|
|
1217
|
+
path: resolvedPath,
|
|
1218
|
+
body,
|
|
1219
|
+
});
|
|
1220
|
+
};
|
|
1221
|
+
exports.serializeAws_restJson1UpdateBackendStorageCommand = serializeAws_restJson1UpdateBackendStorageCommand;
|
|
989
1222
|
const deserializeAws_restJson1CloneBackendCommand = async (output, context) => {
|
|
990
1223
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
991
1224
|
return deserializeAws_restJson1CloneBackendCommandError(output, context);
|
|
@@ -1438,34 +1671,34 @@ const deserializeAws_restJson1CreateBackendConfigCommandError = async (output, c
|
|
|
1438
1671
|
delete response.Message;
|
|
1439
1672
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
1440
1673
|
};
|
|
1441
|
-
const
|
|
1674
|
+
const deserializeAws_restJson1CreateBackendStorageCommand = async (output, context) => {
|
|
1442
1675
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1443
|
-
return
|
|
1676
|
+
return deserializeAws_restJson1CreateBackendStorageCommandError(output, context);
|
|
1444
1677
|
}
|
|
1445
1678
|
const contents = {
|
|
1446
1679
|
$metadata: deserializeMetadata(output),
|
|
1447
1680
|
AppId: undefined,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1681
|
+
BackendEnvironmentName: undefined,
|
|
1682
|
+
JobId: undefined,
|
|
1683
|
+
Status: undefined,
|
|
1451
1684
|
};
|
|
1452
1685
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1453
1686
|
if (data.appId !== undefined && data.appId !== null) {
|
|
1454
1687
|
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
1455
1688
|
}
|
|
1456
|
-
if (data.
|
|
1457
|
-
contents.
|
|
1689
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
1690
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
1458
1691
|
}
|
|
1459
|
-
if (data.
|
|
1460
|
-
contents.
|
|
1692
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
1693
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
1461
1694
|
}
|
|
1462
|
-
if (data.
|
|
1463
|
-
contents.
|
|
1695
|
+
if (data.status !== undefined && data.status !== null) {
|
|
1696
|
+
contents.Status = smithy_client_1.expectString(data.status);
|
|
1464
1697
|
}
|
|
1465
1698
|
return Promise.resolve(contents);
|
|
1466
1699
|
};
|
|
1467
|
-
exports.
|
|
1468
|
-
const
|
|
1700
|
+
exports.deserializeAws_restJson1CreateBackendStorageCommand = deserializeAws_restJson1CreateBackendStorageCommand;
|
|
1701
|
+
const deserializeAws_restJson1CreateBackendStorageCommandError = async (output, context) => {
|
|
1469
1702
|
const parsedOutput = {
|
|
1470
1703
|
...output,
|
|
1471
1704
|
body: await parseBody(output.body, context),
|
|
@@ -1522,33 +1755,117 @@ const deserializeAws_restJson1CreateTokenCommandError = async (output, context)
|
|
|
1522
1755
|
delete response.Message;
|
|
1523
1756
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
1524
1757
|
};
|
|
1525
|
-
const
|
|
1758
|
+
const deserializeAws_restJson1CreateTokenCommand = async (output, context) => {
|
|
1526
1759
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1527
|
-
return
|
|
1760
|
+
return deserializeAws_restJson1CreateTokenCommandError(output, context);
|
|
1528
1761
|
}
|
|
1529
1762
|
const contents = {
|
|
1530
1763
|
$metadata: deserializeMetadata(output),
|
|
1531
1764
|
AppId: undefined,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
Operation: undefined,
|
|
1536
|
-
Status: undefined,
|
|
1765
|
+
ChallengeCode: undefined,
|
|
1766
|
+
SessionId: undefined,
|
|
1767
|
+
Ttl: undefined,
|
|
1537
1768
|
};
|
|
1538
1769
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1539
1770
|
if (data.appId !== undefined && data.appId !== null) {
|
|
1540
1771
|
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
1541
1772
|
}
|
|
1542
|
-
if (data.
|
|
1543
|
-
contents.
|
|
1773
|
+
if (data.challengeCode !== undefined && data.challengeCode !== null) {
|
|
1774
|
+
contents.ChallengeCode = smithy_client_1.expectString(data.challengeCode);
|
|
1544
1775
|
}
|
|
1545
|
-
if (data.
|
|
1546
|
-
contents.
|
|
1776
|
+
if (data.sessionId !== undefined && data.sessionId !== null) {
|
|
1777
|
+
contents.SessionId = smithy_client_1.expectString(data.sessionId);
|
|
1547
1778
|
}
|
|
1548
|
-
if (data.
|
|
1549
|
-
contents.
|
|
1779
|
+
if (data.ttl !== undefined && data.ttl !== null) {
|
|
1780
|
+
contents.Ttl = smithy_client_1.expectString(data.ttl);
|
|
1550
1781
|
}
|
|
1551
|
-
|
|
1782
|
+
return Promise.resolve(contents);
|
|
1783
|
+
};
|
|
1784
|
+
exports.deserializeAws_restJson1CreateTokenCommand = deserializeAws_restJson1CreateTokenCommand;
|
|
1785
|
+
const deserializeAws_restJson1CreateTokenCommandError = async (output, context) => {
|
|
1786
|
+
const parsedOutput = {
|
|
1787
|
+
...output,
|
|
1788
|
+
body: await parseBody(output.body, context),
|
|
1789
|
+
};
|
|
1790
|
+
let response;
|
|
1791
|
+
let errorCode = "UnknownError";
|
|
1792
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1793
|
+
switch (errorCode) {
|
|
1794
|
+
case "BadRequestException":
|
|
1795
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
1796
|
+
response = {
|
|
1797
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
1798
|
+
name: errorCode,
|
|
1799
|
+
$metadata: deserializeMetadata(output),
|
|
1800
|
+
};
|
|
1801
|
+
break;
|
|
1802
|
+
case "GatewayTimeoutException":
|
|
1803
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
1804
|
+
response = {
|
|
1805
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
1806
|
+
name: errorCode,
|
|
1807
|
+
$metadata: deserializeMetadata(output),
|
|
1808
|
+
};
|
|
1809
|
+
break;
|
|
1810
|
+
case "NotFoundException":
|
|
1811
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
1812
|
+
response = {
|
|
1813
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
1814
|
+
name: errorCode,
|
|
1815
|
+
$metadata: deserializeMetadata(output),
|
|
1816
|
+
};
|
|
1817
|
+
break;
|
|
1818
|
+
case "TooManyRequestsException":
|
|
1819
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
1820
|
+
response = {
|
|
1821
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1822
|
+
name: errorCode,
|
|
1823
|
+
$metadata: deserializeMetadata(output),
|
|
1824
|
+
};
|
|
1825
|
+
break;
|
|
1826
|
+
default:
|
|
1827
|
+
const parsedBody = parsedOutput.body;
|
|
1828
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1829
|
+
response = {
|
|
1830
|
+
...parsedBody,
|
|
1831
|
+
name: `${errorCode}`,
|
|
1832
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1833
|
+
$fault: "client",
|
|
1834
|
+
$metadata: deserializeMetadata(output),
|
|
1835
|
+
};
|
|
1836
|
+
}
|
|
1837
|
+
const message = response.message || response.Message || errorCode;
|
|
1838
|
+
response.message = message;
|
|
1839
|
+
delete response.Message;
|
|
1840
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1841
|
+
};
|
|
1842
|
+
const deserializeAws_restJson1DeleteBackendCommand = async (output, context) => {
|
|
1843
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1844
|
+
return deserializeAws_restJson1DeleteBackendCommandError(output, context);
|
|
1845
|
+
}
|
|
1846
|
+
const contents = {
|
|
1847
|
+
$metadata: deserializeMetadata(output),
|
|
1848
|
+
AppId: undefined,
|
|
1849
|
+
BackendEnvironmentName: undefined,
|
|
1850
|
+
Error: undefined,
|
|
1851
|
+
JobId: undefined,
|
|
1852
|
+
Operation: undefined,
|
|
1853
|
+
Status: undefined,
|
|
1854
|
+
};
|
|
1855
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1856
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
1857
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
1858
|
+
}
|
|
1859
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
1860
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
1861
|
+
}
|
|
1862
|
+
if (data.error !== undefined && data.error !== null) {
|
|
1863
|
+
contents.Error = smithy_client_1.expectString(data.error);
|
|
1864
|
+
}
|
|
1865
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
1866
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
1867
|
+
}
|
|
1868
|
+
if (data.operation !== undefined && data.operation !== null) {
|
|
1552
1869
|
contents.Operation = smithy_client_1.expectString(data.operation);
|
|
1553
1870
|
}
|
|
1554
1871
|
if (data.status !== undefined && data.status !== null) {
|
|
@@ -1798,6 +2115,90 @@ const deserializeAws_restJson1DeleteBackendAuthCommandError = async (output, con
|
|
|
1798
2115
|
delete response.Message;
|
|
1799
2116
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
1800
2117
|
};
|
|
2118
|
+
const deserializeAws_restJson1DeleteBackendStorageCommand = async (output, context) => {
|
|
2119
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2120
|
+
return deserializeAws_restJson1DeleteBackendStorageCommandError(output, context);
|
|
2121
|
+
}
|
|
2122
|
+
const contents = {
|
|
2123
|
+
$metadata: deserializeMetadata(output),
|
|
2124
|
+
AppId: undefined,
|
|
2125
|
+
BackendEnvironmentName: undefined,
|
|
2126
|
+
JobId: undefined,
|
|
2127
|
+
Status: undefined,
|
|
2128
|
+
};
|
|
2129
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2130
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
2131
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2132
|
+
}
|
|
2133
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2134
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2135
|
+
}
|
|
2136
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
2137
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
2138
|
+
}
|
|
2139
|
+
if (data.status !== undefined && data.status !== null) {
|
|
2140
|
+
contents.Status = smithy_client_1.expectString(data.status);
|
|
2141
|
+
}
|
|
2142
|
+
return Promise.resolve(contents);
|
|
2143
|
+
};
|
|
2144
|
+
exports.deserializeAws_restJson1DeleteBackendStorageCommand = deserializeAws_restJson1DeleteBackendStorageCommand;
|
|
2145
|
+
const deserializeAws_restJson1DeleteBackendStorageCommandError = async (output, context) => {
|
|
2146
|
+
const parsedOutput = {
|
|
2147
|
+
...output,
|
|
2148
|
+
body: await parseBody(output.body, context),
|
|
2149
|
+
};
|
|
2150
|
+
let response;
|
|
2151
|
+
let errorCode = "UnknownError";
|
|
2152
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2153
|
+
switch (errorCode) {
|
|
2154
|
+
case "BadRequestException":
|
|
2155
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
2156
|
+
response = {
|
|
2157
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
2158
|
+
name: errorCode,
|
|
2159
|
+
$metadata: deserializeMetadata(output),
|
|
2160
|
+
};
|
|
2161
|
+
break;
|
|
2162
|
+
case "GatewayTimeoutException":
|
|
2163
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
2164
|
+
response = {
|
|
2165
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
2166
|
+
name: errorCode,
|
|
2167
|
+
$metadata: deserializeMetadata(output),
|
|
2168
|
+
};
|
|
2169
|
+
break;
|
|
2170
|
+
case "NotFoundException":
|
|
2171
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
2172
|
+
response = {
|
|
2173
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
2174
|
+
name: errorCode,
|
|
2175
|
+
$metadata: deserializeMetadata(output),
|
|
2176
|
+
};
|
|
2177
|
+
break;
|
|
2178
|
+
case "TooManyRequestsException":
|
|
2179
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
2180
|
+
response = {
|
|
2181
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2182
|
+
name: errorCode,
|
|
2183
|
+
$metadata: deserializeMetadata(output),
|
|
2184
|
+
};
|
|
2185
|
+
break;
|
|
2186
|
+
default:
|
|
2187
|
+
const parsedBody = parsedOutput.body;
|
|
2188
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2189
|
+
response = {
|
|
2190
|
+
...parsedBody,
|
|
2191
|
+
name: `${errorCode}`,
|
|
2192
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2193
|
+
$fault: "client",
|
|
2194
|
+
$metadata: deserializeMetadata(output),
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
const message = response.message || response.Message || errorCode;
|
|
2198
|
+
response.message = message;
|
|
2199
|
+
delete response.Message;
|
|
2200
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2201
|
+
};
|
|
1801
2202
|
const deserializeAws_restJson1DeleteTokenCommand = async (output, context) => {
|
|
1802
2203
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1803
2204
|
return deserializeAws_restJson1DeleteTokenCommandError(output, context);
|
|
@@ -2229,31 +2630,299 @@ const deserializeAws_restJson1GetBackendAuthCommand = async (output, context) =>
|
|
|
2229
2630
|
const contents = {
|
|
2230
2631
|
$metadata: deserializeMetadata(output),
|
|
2231
2632
|
AppId: undefined,
|
|
2232
|
-
BackendEnvironmentName: undefined,
|
|
2233
|
-
Error: undefined,
|
|
2234
|
-
ResourceConfig: undefined,
|
|
2235
|
-
ResourceName: undefined,
|
|
2633
|
+
BackendEnvironmentName: undefined,
|
|
2634
|
+
Error: undefined,
|
|
2635
|
+
ResourceConfig: undefined,
|
|
2636
|
+
ResourceName: undefined,
|
|
2637
|
+
};
|
|
2638
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2639
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
2640
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2641
|
+
}
|
|
2642
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2643
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2644
|
+
}
|
|
2645
|
+
if (data.error !== undefined && data.error !== null) {
|
|
2646
|
+
contents.Error = smithy_client_1.expectString(data.error);
|
|
2647
|
+
}
|
|
2648
|
+
if (data.resourceConfig !== undefined && data.resourceConfig !== null) {
|
|
2649
|
+
contents.ResourceConfig = deserializeAws_restJson1CreateBackendAuthResourceConfig(data.resourceConfig, context);
|
|
2650
|
+
}
|
|
2651
|
+
if (data.resourceName !== undefined && data.resourceName !== null) {
|
|
2652
|
+
contents.ResourceName = smithy_client_1.expectString(data.resourceName);
|
|
2653
|
+
}
|
|
2654
|
+
return Promise.resolve(contents);
|
|
2655
|
+
};
|
|
2656
|
+
exports.deserializeAws_restJson1GetBackendAuthCommand = deserializeAws_restJson1GetBackendAuthCommand;
|
|
2657
|
+
const deserializeAws_restJson1GetBackendAuthCommandError = async (output, context) => {
|
|
2658
|
+
const parsedOutput = {
|
|
2659
|
+
...output,
|
|
2660
|
+
body: await parseBody(output.body, context),
|
|
2661
|
+
};
|
|
2662
|
+
let response;
|
|
2663
|
+
let errorCode = "UnknownError";
|
|
2664
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2665
|
+
switch (errorCode) {
|
|
2666
|
+
case "BadRequestException":
|
|
2667
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
2668
|
+
response = {
|
|
2669
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
2670
|
+
name: errorCode,
|
|
2671
|
+
$metadata: deserializeMetadata(output),
|
|
2672
|
+
};
|
|
2673
|
+
break;
|
|
2674
|
+
case "GatewayTimeoutException":
|
|
2675
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
2676
|
+
response = {
|
|
2677
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
2678
|
+
name: errorCode,
|
|
2679
|
+
$metadata: deserializeMetadata(output),
|
|
2680
|
+
};
|
|
2681
|
+
break;
|
|
2682
|
+
case "NotFoundException":
|
|
2683
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
2684
|
+
response = {
|
|
2685
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
2686
|
+
name: errorCode,
|
|
2687
|
+
$metadata: deserializeMetadata(output),
|
|
2688
|
+
};
|
|
2689
|
+
break;
|
|
2690
|
+
case "TooManyRequestsException":
|
|
2691
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
2692
|
+
response = {
|
|
2693
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2694
|
+
name: errorCode,
|
|
2695
|
+
$metadata: deserializeMetadata(output),
|
|
2696
|
+
};
|
|
2697
|
+
break;
|
|
2698
|
+
default:
|
|
2699
|
+
const parsedBody = parsedOutput.body;
|
|
2700
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2701
|
+
response = {
|
|
2702
|
+
...parsedBody,
|
|
2703
|
+
name: `${errorCode}`,
|
|
2704
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2705
|
+
$fault: "client",
|
|
2706
|
+
$metadata: deserializeMetadata(output),
|
|
2707
|
+
};
|
|
2708
|
+
}
|
|
2709
|
+
const message = response.message || response.Message || errorCode;
|
|
2710
|
+
response.message = message;
|
|
2711
|
+
delete response.Message;
|
|
2712
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2713
|
+
};
|
|
2714
|
+
const deserializeAws_restJson1GetBackendJobCommand = async (output, context) => {
|
|
2715
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2716
|
+
return deserializeAws_restJson1GetBackendJobCommandError(output, context);
|
|
2717
|
+
}
|
|
2718
|
+
const contents = {
|
|
2719
|
+
$metadata: deserializeMetadata(output),
|
|
2720
|
+
AppId: undefined,
|
|
2721
|
+
BackendEnvironmentName: undefined,
|
|
2722
|
+
CreateTime: undefined,
|
|
2723
|
+
Error: undefined,
|
|
2724
|
+
JobId: undefined,
|
|
2725
|
+
Operation: undefined,
|
|
2726
|
+
Status: undefined,
|
|
2727
|
+
UpdateTime: undefined,
|
|
2728
|
+
};
|
|
2729
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2730
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
2731
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2732
|
+
}
|
|
2733
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2734
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2735
|
+
}
|
|
2736
|
+
if (data.createTime !== undefined && data.createTime !== null) {
|
|
2737
|
+
contents.CreateTime = smithy_client_1.expectString(data.createTime);
|
|
2738
|
+
}
|
|
2739
|
+
if (data.error !== undefined && data.error !== null) {
|
|
2740
|
+
contents.Error = smithy_client_1.expectString(data.error);
|
|
2741
|
+
}
|
|
2742
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
2743
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
2744
|
+
}
|
|
2745
|
+
if (data.operation !== undefined && data.operation !== null) {
|
|
2746
|
+
contents.Operation = smithy_client_1.expectString(data.operation);
|
|
2747
|
+
}
|
|
2748
|
+
if (data.status !== undefined && data.status !== null) {
|
|
2749
|
+
contents.Status = smithy_client_1.expectString(data.status);
|
|
2750
|
+
}
|
|
2751
|
+
if (data.updateTime !== undefined && data.updateTime !== null) {
|
|
2752
|
+
contents.UpdateTime = smithy_client_1.expectString(data.updateTime);
|
|
2753
|
+
}
|
|
2754
|
+
return Promise.resolve(contents);
|
|
2755
|
+
};
|
|
2756
|
+
exports.deserializeAws_restJson1GetBackendJobCommand = deserializeAws_restJson1GetBackendJobCommand;
|
|
2757
|
+
const deserializeAws_restJson1GetBackendJobCommandError = async (output, context) => {
|
|
2758
|
+
const parsedOutput = {
|
|
2759
|
+
...output,
|
|
2760
|
+
body: await parseBody(output.body, context),
|
|
2761
|
+
};
|
|
2762
|
+
let response;
|
|
2763
|
+
let errorCode = "UnknownError";
|
|
2764
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2765
|
+
switch (errorCode) {
|
|
2766
|
+
case "BadRequestException":
|
|
2767
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
2768
|
+
response = {
|
|
2769
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
2770
|
+
name: errorCode,
|
|
2771
|
+
$metadata: deserializeMetadata(output),
|
|
2772
|
+
};
|
|
2773
|
+
break;
|
|
2774
|
+
case "GatewayTimeoutException":
|
|
2775
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
2776
|
+
response = {
|
|
2777
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
2778
|
+
name: errorCode,
|
|
2779
|
+
$metadata: deserializeMetadata(output),
|
|
2780
|
+
};
|
|
2781
|
+
break;
|
|
2782
|
+
case "NotFoundException":
|
|
2783
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
2784
|
+
response = {
|
|
2785
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
2786
|
+
name: errorCode,
|
|
2787
|
+
$metadata: deserializeMetadata(output),
|
|
2788
|
+
};
|
|
2789
|
+
break;
|
|
2790
|
+
case "TooManyRequestsException":
|
|
2791
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
2792
|
+
response = {
|
|
2793
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2794
|
+
name: errorCode,
|
|
2795
|
+
$metadata: deserializeMetadata(output),
|
|
2796
|
+
};
|
|
2797
|
+
break;
|
|
2798
|
+
default:
|
|
2799
|
+
const parsedBody = parsedOutput.body;
|
|
2800
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2801
|
+
response = {
|
|
2802
|
+
...parsedBody,
|
|
2803
|
+
name: `${errorCode}`,
|
|
2804
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2805
|
+
$fault: "client",
|
|
2806
|
+
$metadata: deserializeMetadata(output),
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
const message = response.message || response.Message || errorCode;
|
|
2810
|
+
response.message = message;
|
|
2811
|
+
delete response.Message;
|
|
2812
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2813
|
+
};
|
|
2814
|
+
const deserializeAws_restJson1GetBackendStorageCommand = async (output, context) => {
|
|
2815
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2816
|
+
return deserializeAws_restJson1GetBackendStorageCommandError(output, context);
|
|
2817
|
+
}
|
|
2818
|
+
const contents = {
|
|
2819
|
+
$metadata: deserializeMetadata(output),
|
|
2820
|
+
AppId: undefined,
|
|
2821
|
+
BackendEnvironmentName: undefined,
|
|
2822
|
+
ResourceConfig: undefined,
|
|
2823
|
+
ResourceName: undefined,
|
|
2824
|
+
};
|
|
2825
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2826
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
2827
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2828
|
+
}
|
|
2829
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2830
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2831
|
+
}
|
|
2832
|
+
if (data.resourceConfig !== undefined && data.resourceConfig !== null) {
|
|
2833
|
+
contents.ResourceConfig = deserializeAws_restJson1GetBackendStorageResourceConfig(data.resourceConfig, context);
|
|
2834
|
+
}
|
|
2835
|
+
if (data.resourceName !== undefined && data.resourceName !== null) {
|
|
2836
|
+
contents.ResourceName = smithy_client_1.expectString(data.resourceName);
|
|
2837
|
+
}
|
|
2838
|
+
return Promise.resolve(contents);
|
|
2839
|
+
};
|
|
2840
|
+
exports.deserializeAws_restJson1GetBackendStorageCommand = deserializeAws_restJson1GetBackendStorageCommand;
|
|
2841
|
+
const deserializeAws_restJson1GetBackendStorageCommandError = async (output, context) => {
|
|
2842
|
+
const parsedOutput = {
|
|
2843
|
+
...output,
|
|
2844
|
+
body: await parseBody(output.body, context),
|
|
2845
|
+
};
|
|
2846
|
+
let response;
|
|
2847
|
+
let errorCode = "UnknownError";
|
|
2848
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2849
|
+
switch (errorCode) {
|
|
2850
|
+
case "BadRequestException":
|
|
2851
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
2852
|
+
response = {
|
|
2853
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
2854
|
+
name: errorCode,
|
|
2855
|
+
$metadata: deserializeMetadata(output),
|
|
2856
|
+
};
|
|
2857
|
+
break;
|
|
2858
|
+
case "GatewayTimeoutException":
|
|
2859
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
2860
|
+
response = {
|
|
2861
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
2862
|
+
name: errorCode,
|
|
2863
|
+
$metadata: deserializeMetadata(output),
|
|
2864
|
+
};
|
|
2865
|
+
break;
|
|
2866
|
+
case "NotFoundException":
|
|
2867
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
2868
|
+
response = {
|
|
2869
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
2870
|
+
name: errorCode,
|
|
2871
|
+
$metadata: deserializeMetadata(output),
|
|
2872
|
+
};
|
|
2873
|
+
break;
|
|
2874
|
+
case "TooManyRequestsException":
|
|
2875
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
2876
|
+
response = {
|
|
2877
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2878
|
+
name: errorCode,
|
|
2879
|
+
$metadata: deserializeMetadata(output),
|
|
2880
|
+
};
|
|
2881
|
+
break;
|
|
2882
|
+
default:
|
|
2883
|
+
const parsedBody = parsedOutput.body;
|
|
2884
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2885
|
+
response = {
|
|
2886
|
+
...parsedBody,
|
|
2887
|
+
name: `${errorCode}`,
|
|
2888
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2889
|
+
$fault: "client",
|
|
2890
|
+
$metadata: deserializeMetadata(output),
|
|
2891
|
+
};
|
|
2892
|
+
}
|
|
2893
|
+
const message = response.message || response.Message || errorCode;
|
|
2894
|
+
response.message = message;
|
|
2895
|
+
delete response.Message;
|
|
2896
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2897
|
+
};
|
|
2898
|
+
const deserializeAws_restJson1GetTokenCommand = async (output, context) => {
|
|
2899
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2900
|
+
return deserializeAws_restJson1GetTokenCommandError(output, context);
|
|
2901
|
+
}
|
|
2902
|
+
const contents = {
|
|
2903
|
+
$metadata: deserializeMetadata(output),
|
|
2904
|
+
AppId: undefined,
|
|
2905
|
+
ChallengeCode: undefined,
|
|
2906
|
+
SessionId: undefined,
|
|
2907
|
+
Ttl: undefined,
|
|
2236
2908
|
};
|
|
2237
2909
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2238
2910
|
if (data.appId !== undefined && data.appId !== null) {
|
|
2239
2911
|
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2240
2912
|
}
|
|
2241
|
-
if (data.
|
|
2242
|
-
contents.
|
|
2243
|
-
}
|
|
2244
|
-
if (data.error !== undefined && data.error !== null) {
|
|
2245
|
-
contents.Error = smithy_client_1.expectString(data.error);
|
|
2913
|
+
if (data.challengeCode !== undefined && data.challengeCode !== null) {
|
|
2914
|
+
contents.ChallengeCode = smithy_client_1.expectString(data.challengeCode);
|
|
2246
2915
|
}
|
|
2247
|
-
if (data.
|
|
2248
|
-
contents.
|
|
2916
|
+
if (data.sessionId !== undefined && data.sessionId !== null) {
|
|
2917
|
+
contents.SessionId = smithy_client_1.expectString(data.sessionId);
|
|
2249
2918
|
}
|
|
2250
|
-
if (data.
|
|
2251
|
-
contents.
|
|
2919
|
+
if (data.ttl !== undefined && data.ttl !== null) {
|
|
2920
|
+
contents.Ttl = smithy_client_1.expectString(data.ttl);
|
|
2252
2921
|
}
|
|
2253
2922
|
return Promise.resolve(contents);
|
|
2254
2923
|
};
|
|
2255
|
-
exports.
|
|
2256
|
-
const
|
|
2924
|
+
exports.deserializeAws_restJson1GetTokenCommand = deserializeAws_restJson1GetTokenCommand;
|
|
2925
|
+
const deserializeAws_restJson1GetTokenCommandError = async (output, context) => {
|
|
2257
2926
|
const parsedOutput = {
|
|
2258
2927
|
...output,
|
|
2259
2928
|
body: await parseBody(output.body, context),
|
|
@@ -2310,20 +2979,18 @@ const deserializeAws_restJson1GetBackendAuthCommandError = async (output, contex
|
|
|
2310
2979
|
delete response.Message;
|
|
2311
2980
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
2312
2981
|
};
|
|
2313
|
-
const
|
|
2982
|
+
const deserializeAws_restJson1ImportBackendAuthCommand = async (output, context) => {
|
|
2314
2983
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2315
|
-
return
|
|
2984
|
+
return deserializeAws_restJson1ImportBackendAuthCommandError(output, context);
|
|
2316
2985
|
}
|
|
2317
2986
|
const contents = {
|
|
2318
2987
|
$metadata: deserializeMetadata(output),
|
|
2319
2988
|
AppId: undefined,
|
|
2320
2989
|
BackendEnvironmentName: undefined,
|
|
2321
|
-
CreateTime: undefined,
|
|
2322
2990
|
Error: undefined,
|
|
2323
2991
|
JobId: undefined,
|
|
2324
2992
|
Operation: undefined,
|
|
2325
2993
|
Status: undefined,
|
|
2326
|
-
UpdateTime: undefined,
|
|
2327
2994
|
};
|
|
2328
2995
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2329
2996
|
if (data.appId !== undefined && data.appId !== null) {
|
|
@@ -2332,9 +2999,6 @@ const deserializeAws_restJson1GetBackendJobCommand = async (output, context) =>
|
|
|
2332
2999
|
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2333
3000
|
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2334
3001
|
}
|
|
2335
|
-
if (data.createTime !== undefined && data.createTime !== null) {
|
|
2336
|
-
contents.CreateTime = smithy_client_1.expectString(data.createTime);
|
|
2337
|
-
}
|
|
2338
3002
|
if (data.error !== undefined && data.error !== null) {
|
|
2339
3003
|
contents.Error = smithy_client_1.expectString(data.error);
|
|
2340
3004
|
}
|
|
@@ -2347,13 +3011,10 @@ const deserializeAws_restJson1GetBackendJobCommand = async (output, context) =>
|
|
|
2347
3011
|
if (data.status !== undefined && data.status !== null) {
|
|
2348
3012
|
contents.Status = smithy_client_1.expectString(data.status);
|
|
2349
3013
|
}
|
|
2350
|
-
if (data.updateTime !== undefined && data.updateTime !== null) {
|
|
2351
|
-
contents.UpdateTime = smithy_client_1.expectString(data.updateTime);
|
|
2352
|
-
}
|
|
2353
3014
|
return Promise.resolve(contents);
|
|
2354
3015
|
};
|
|
2355
|
-
exports.
|
|
2356
|
-
const
|
|
3016
|
+
exports.deserializeAws_restJson1ImportBackendAuthCommand = deserializeAws_restJson1ImportBackendAuthCommand;
|
|
3017
|
+
const deserializeAws_restJson1ImportBackendAuthCommandError = async (output, context) => {
|
|
2357
3018
|
const parsedOutput = {
|
|
2358
3019
|
...output,
|
|
2359
3020
|
body: await parseBody(output.body, context),
|
|
@@ -2410,34 +3071,34 @@ const deserializeAws_restJson1GetBackendJobCommandError = async (output, context
|
|
|
2410
3071
|
delete response.Message;
|
|
2411
3072
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
2412
3073
|
};
|
|
2413
|
-
const
|
|
3074
|
+
const deserializeAws_restJson1ImportBackendStorageCommand = async (output, context) => {
|
|
2414
3075
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2415
|
-
return
|
|
3076
|
+
return deserializeAws_restJson1ImportBackendStorageCommandError(output, context);
|
|
2416
3077
|
}
|
|
2417
3078
|
const contents = {
|
|
2418
3079
|
$metadata: deserializeMetadata(output),
|
|
2419
3080
|
AppId: undefined,
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
3081
|
+
BackendEnvironmentName: undefined,
|
|
3082
|
+
JobId: undefined,
|
|
3083
|
+
Status: undefined,
|
|
2423
3084
|
};
|
|
2424
3085
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2425
3086
|
if (data.appId !== undefined && data.appId !== null) {
|
|
2426
3087
|
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
2427
3088
|
}
|
|
2428
|
-
if (data.
|
|
2429
|
-
contents.
|
|
3089
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
3090
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2430
3091
|
}
|
|
2431
|
-
if (data.
|
|
2432
|
-
contents.
|
|
3092
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
3093
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
2433
3094
|
}
|
|
2434
|
-
if (data.
|
|
2435
|
-
contents.
|
|
3095
|
+
if (data.status !== undefined && data.status !== null) {
|
|
3096
|
+
contents.Status = smithy_client_1.expectString(data.status);
|
|
2436
3097
|
}
|
|
2437
3098
|
return Promise.resolve(contents);
|
|
2438
3099
|
};
|
|
2439
|
-
exports.
|
|
2440
|
-
const
|
|
3100
|
+
exports.deserializeAws_restJson1ImportBackendStorageCommand = deserializeAws_restJson1ImportBackendStorageCommand;
|
|
3101
|
+
const deserializeAws_restJson1ImportBackendStorageCommandError = async (output, context) => {
|
|
2441
3102
|
const parsedOutput = {
|
|
2442
3103
|
...output,
|
|
2443
3104
|
body: await parseBody(output.body, context),
|
|
@@ -2494,42 +3155,26 @@ const deserializeAws_restJson1GetTokenCommandError = async (output, context) =>
|
|
|
2494
3155
|
delete response.Message;
|
|
2495
3156
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
2496
3157
|
};
|
|
2497
|
-
const
|
|
3158
|
+
const deserializeAws_restJson1ListBackendJobsCommand = async (output, context) => {
|
|
2498
3159
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2499
|
-
return
|
|
3160
|
+
return deserializeAws_restJson1ListBackendJobsCommandError(output, context);
|
|
2500
3161
|
}
|
|
2501
3162
|
const contents = {
|
|
2502
3163
|
$metadata: deserializeMetadata(output),
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
Error: undefined,
|
|
2506
|
-
JobId: undefined,
|
|
2507
|
-
Operation: undefined,
|
|
2508
|
-
Status: undefined,
|
|
3164
|
+
Jobs: undefined,
|
|
3165
|
+
NextToken: undefined,
|
|
2509
3166
|
};
|
|
2510
3167
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2511
|
-
if (data.
|
|
2512
|
-
contents.
|
|
2513
|
-
}
|
|
2514
|
-
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
2515
|
-
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
2516
|
-
}
|
|
2517
|
-
if (data.error !== undefined && data.error !== null) {
|
|
2518
|
-
contents.Error = smithy_client_1.expectString(data.error);
|
|
2519
|
-
}
|
|
2520
|
-
if (data.jobId !== undefined && data.jobId !== null) {
|
|
2521
|
-
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
2522
|
-
}
|
|
2523
|
-
if (data.operation !== undefined && data.operation !== null) {
|
|
2524
|
-
contents.Operation = smithy_client_1.expectString(data.operation);
|
|
3168
|
+
if (data.jobs !== undefined && data.jobs !== null) {
|
|
3169
|
+
contents.Jobs = deserializeAws_restJson1ListOfBackendJobRespObj(data.jobs, context);
|
|
2525
3170
|
}
|
|
2526
|
-
if (data.
|
|
2527
|
-
contents.
|
|
3171
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
3172
|
+
contents.NextToken = smithy_client_1.expectString(data.nextToken);
|
|
2528
3173
|
}
|
|
2529
3174
|
return Promise.resolve(contents);
|
|
2530
3175
|
};
|
|
2531
|
-
exports.
|
|
2532
|
-
const
|
|
3176
|
+
exports.deserializeAws_restJson1ListBackendJobsCommand = deserializeAws_restJson1ListBackendJobsCommand;
|
|
3177
|
+
const deserializeAws_restJson1ListBackendJobsCommandError = async (output, context) => {
|
|
2533
3178
|
const parsedOutput = {
|
|
2534
3179
|
...output,
|
|
2535
3180
|
body: await parseBody(output.body, context),
|
|
@@ -2586,26 +3231,26 @@ const deserializeAws_restJson1ImportBackendAuthCommandError = async (output, con
|
|
|
2586
3231
|
delete response.Message;
|
|
2587
3232
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
2588
3233
|
};
|
|
2589
|
-
const
|
|
3234
|
+
const deserializeAws_restJson1ListS3BucketsCommand = async (output, context) => {
|
|
2590
3235
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2591
|
-
return
|
|
3236
|
+
return deserializeAws_restJson1ListS3BucketsCommandError(output, context);
|
|
2592
3237
|
}
|
|
2593
3238
|
const contents = {
|
|
2594
3239
|
$metadata: deserializeMetadata(output),
|
|
2595
|
-
|
|
3240
|
+
Buckets: undefined,
|
|
2596
3241
|
NextToken: undefined,
|
|
2597
3242
|
};
|
|
2598
3243
|
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2599
|
-
if (data.
|
|
2600
|
-
contents.
|
|
3244
|
+
if (data.buckets !== undefined && data.buckets !== null) {
|
|
3245
|
+
contents.Buckets = deserializeAws_restJson1ListOfS3BucketInfo(data.buckets, context);
|
|
2601
3246
|
}
|
|
2602
3247
|
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2603
3248
|
contents.NextToken = smithy_client_1.expectString(data.nextToken);
|
|
2604
3249
|
}
|
|
2605
3250
|
return Promise.resolve(contents);
|
|
2606
3251
|
};
|
|
2607
|
-
exports.
|
|
2608
|
-
const
|
|
3252
|
+
exports.deserializeAws_restJson1ListS3BucketsCommand = deserializeAws_restJson1ListS3BucketsCommand;
|
|
3253
|
+
const deserializeAws_restJson1ListS3BucketsCommandError = async (output, context) => {
|
|
2609
3254
|
const parsedOutput = {
|
|
2610
3255
|
...output,
|
|
2611
3256
|
body: await parseBody(output.body, context),
|
|
@@ -3190,6 +3835,90 @@ const deserializeAws_restJson1UpdateBackendJobCommandError = async (output, cont
|
|
|
3190
3835
|
delete response.Message;
|
|
3191
3836
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
3192
3837
|
};
|
|
3838
|
+
const deserializeAws_restJson1UpdateBackendStorageCommand = async (output, context) => {
|
|
3839
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3840
|
+
return deserializeAws_restJson1UpdateBackendStorageCommandError(output, context);
|
|
3841
|
+
}
|
|
3842
|
+
const contents = {
|
|
3843
|
+
$metadata: deserializeMetadata(output),
|
|
3844
|
+
AppId: undefined,
|
|
3845
|
+
BackendEnvironmentName: undefined,
|
|
3846
|
+
JobId: undefined,
|
|
3847
|
+
Status: undefined,
|
|
3848
|
+
};
|
|
3849
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
3850
|
+
if (data.appId !== undefined && data.appId !== null) {
|
|
3851
|
+
contents.AppId = smithy_client_1.expectString(data.appId);
|
|
3852
|
+
}
|
|
3853
|
+
if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
|
|
3854
|
+
contents.BackendEnvironmentName = smithy_client_1.expectString(data.backendEnvironmentName);
|
|
3855
|
+
}
|
|
3856
|
+
if (data.jobId !== undefined && data.jobId !== null) {
|
|
3857
|
+
contents.JobId = smithy_client_1.expectString(data.jobId);
|
|
3858
|
+
}
|
|
3859
|
+
if (data.status !== undefined && data.status !== null) {
|
|
3860
|
+
contents.Status = smithy_client_1.expectString(data.status);
|
|
3861
|
+
}
|
|
3862
|
+
return Promise.resolve(contents);
|
|
3863
|
+
};
|
|
3864
|
+
exports.deserializeAws_restJson1UpdateBackendStorageCommand = deserializeAws_restJson1UpdateBackendStorageCommand;
|
|
3865
|
+
const deserializeAws_restJson1UpdateBackendStorageCommandError = async (output, context) => {
|
|
3866
|
+
const parsedOutput = {
|
|
3867
|
+
...output,
|
|
3868
|
+
body: await parseBody(output.body, context),
|
|
3869
|
+
};
|
|
3870
|
+
let response;
|
|
3871
|
+
let errorCode = "UnknownError";
|
|
3872
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3873
|
+
switch (errorCode) {
|
|
3874
|
+
case "BadRequestException":
|
|
3875
|
+
case "com.amazonaws.amplifybackend#BadRequestException":
|
|
3876
|
+
response = {
|
|
3877
|
+
...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
|
|
3878
|
+
name: errorCode,
|
|
3879
|
+
$metadata: deserializeMetadata(output),
|
|
3880
|
+
};
|
|
3881
|
+
break;
|
|
3882
|
+
case "GatewayTimeoutException":
|
|
3883
|
+
case "com.amazonaws.amplifybackend#GatewayTimeoutException":
|
|
3884
|
+
response = {
|
|
3885
|
+
...(await deserializeAws_restJson1GatewayTimeoutExceptionResponse(parsedOutput, context)),
|
|
3886
|
+
name: errorCode,
|
|
3887
|
+
$metadata: deserializeMetadata(output),
|
|
3888
|
+
};
|
|
3889
|
+
break;
|
|
3890
|
+
case "NotFoundException":
|
|
3891
|
+
case "com.amazonaws.amplifybackend#NotFoundException":
|
|
3892
|
+
response = {
|
|
3893
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
3894
|
+
name: errorCode,
|
|
3895
|
+
$metadata: deserializeMetadata(output),
|
|
3896
|
+
};
|
|
3897
|
+
break;
|
|
3898
|
+
case "TooManyRequestsException":
|
|
3899
|
+
case "com.amazonaws.amplifybackend#TooManyRequestsException":
|
|
3900
|
+
response = {
|
|
3901
|
+
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
3902
|
+
name: errorCode,
|
|
3903
|
+
$metadata: deserializeMetadata(output),
|
|
3904
|
+
};
|
|
3905
|
+
break;
|
|
3906
|
+
default:
|
|
3907
|
+
const parsedBody = parsedOutput.body;
|
|
3908
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3909
|
+
response = {
|
|
3910
|
+
...parsedBody,
|
|
3911
|
+
name: `${errorCode}`,
|
|
3912
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3913
|
+
$fault: "client",
|
|
3914
|
+
$metadata: deserializeMetadata(output),
|
|
3915
|
+
};
|
|
3916
|
+
}
|
|
3917
|
+
const message = response.message || response.Message || errorCode;
|
|
3918
|
+
response.message = message;
|
|
3919
|
+
delete response.Message;
|
|
3920
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3921
|
+
};
|
|
3193
3922
|
const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
|
|
3194
3923
|
const contents = {
|
|
3195
3924
|
name: "BadRequestException",
|
|
@@ -3316,6 +4045,18 @@ const serializeAws_restJson1BackendAuthSocialProviderConfig = (input, context) =
|
|
|
3316
4045
|
...(input.ClientSecret !== undefined && input.ClientSecret !== null && { client_secret: input.ClientSecret }),
|
|
3317
4046
|
};
|
|
3318
4047
|
};
|
|
4048
|
+
const serializeAws_restJson1BackendStoragePermissions = (input, context) => {
|
|
4049
|
+
return {
|
|
4050
|
+
...(input.Authenticated !== undefined &&
|
|
4051
|
+
input.Authenticated !== null && {
|
|
4052
|
+
authenticated: serializeAws_restJson1ListOfAuthenticatedElement(input.Authenticated, context),
|
|
4053
|
+
}),
|
|
4054
|
+
...(input.UnAuthenticated !== undefined &&
|
|
4055
|
+
input.UnAuthenticated !== null && {
|
|
4056
|
+
unAuthenticated: serializeAws_restJson1ListOfUnAuthenticatedElement(input.UnAuthenticated, context),
|
|
4057
|
+
}),
|
|
4058
|
+
};
|
|
4059
|
+
};
|
|
3319
4060
|
const serializeAws_restJson1CreateBackendAuthForgotPasswordConfig = (input, context) => {
|
|
3320
4061
|
return {
|
|
3321
4062
|
...(input.DeliveryMethod !== undefined &&
|
|
@@ -3412,6 +4153,16 @@ const serializeAws_restJson1CreateBackendAuthUserPoolConfig = (input, context) =
|
|
|
3412
4153
|
...(input.UserPoolName !== undefined && input.UserPoolName !== null && { userPoolName: input.UserPoolName }),
|
|
3413
4154
|
};
|
|
3414
4155
|
};
|
|
4156
|
+
const serializeAws_restJson1CreateBackendStorageResourceConfig = (input, context) => {
|
|
4157
|
+
return {
|
|
4158
|
+
...(input.BucketName !== undefined && input.BucketName !== null && { bucketName: input.BucketName }),
|
|
4159
|
+
...(input.Permissions !== undefined &&
|
|
4160
|
+
input.Permissions !== null && {
|
|
4161
|
+
permissions: serializeAws_restJson1BackendStoragePermissions(input.Permissions, context),
|
|
4162
|
+
}),
|
|
4163
|
+
...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
|
|
4164
|
+
};
|
|
4165
|
+
};
|
|
3415
4166
|
const serializeAws_restJson1EmailSettings = (input, context) => {
|
|
3416
4167
|
return {
|
|
3417
4168
|
...(input.EmailMessage !== undefined && input.EmailMessage !== null && { emailMessage: input.EmailMessage }),
|
|
@@ -3438,6 +4189,16 @@ const serializeAws_restJson1ListOfAdditionalConstraintsElement = (input, context
|
|
|
3438
4189
|
return entry;
|
|
3439
4190
|
});
|
|
3440
4191
|
};
|
|
4192
|
+
const serializeAws_restJson1ListOfAuthenticatedElement = (input, context) => {
|
|
4193
|
+
return input
|
|
4194
|
+
.filter((e) => e != null)
|
|
4195
|
+
.map((entry) => {
|
|
4196
|
+
if (entry === null) {
|
|
4197
|
+
return null;
|
|
4198
|
+
}
|
|
4199
|
+
return entry;
|
|
4200
|
+
});
|
|
4201
|
+
};
|
|
3441
4202
|
const serializeAws_restJson1ListOfBackendAPIAuthType = (input, context) => {
|
|
3442
4203
|
return input
|
|
3443
4204
|
.filter((e) => e != null)
|
|
@@ -3478,6 +4239,16 @@ const serializeAws_restJson1ListOfRequiredSignUpAttributesElement = (input, cont
|
|
|
3478
4239
|
return entry;
|
|
3479
4240
|
});
|
|
3480
4241
|
};
|
|
4242
|
+
const serializeAws_restJson1ListOfUnAuthenticatedElement = (input, context) => {
|
|
4243
|
+
return input
|
|
4244
|
+
.filter((e) => e != null)
|
|
4245
|
+
.map((entry) => {
|
|
4246
|
+
if (entry === null) {
|
|
4247
|
+
return null;
|
|
4248
|
+
}
|
|
4249
|
+
return entry;
|
|
4250
|
+
});
|
|
4251
|
+
};
|
|
3481
4252
|
const serializeAws_restJson1LoginAuthConfigReqObj = (input, context) => {
|
|
3482
4253
|
return {
|
|
3483
4254
|
...(input.AwsCognitoIdentityPoolId !== undefined &&
|
|
@@ -3613,6 +4384,15 @@ const serializeAws_restJson1UpdateBackendAuthUserPoolConfig = (input, context) =
|
|
|
3613
4384
|
}),
|
|
3614
4385
|
};
|
|
3615
4386
|
};
|
|
4387
|
+
const serializeAws_restJson1UpdateBackendStorageResourceConfig = (input, context) => {
|
|
4388
|
+
return {
|
|
4389
|
+
...(input.Permissions !== undefined &&
|
|
4390
|
+
input.Permissions !== null && {
|
|
4391
|
+
permissions: serializeAws_restJson1BackendStoragePermissions(input.Permissions, context),
|
|
4392
|
+
}),
|
|
4393
|
+
...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
|
|
4394
|
+
};
|
|
4395
|
+
};
|
|
3616
4396
|
const deserializeAws_restJson1BackendAPIAppSyncAuthSettings = (output, context) => {
|
|
3617
4397
|
return {
|
|
3618
4398
|
CognitoUserPoolId: smithy_client_1.expectString(output.cognitoUserPoolId),
|
|
@@ -3680,6 +4460,16 @@ const deserializeAws_restJson1BackendJobRespObj = (output, context) => {
|
|
|
3680
4460
|
UpdateTime: smithy_client_1.expectString(output.updateTime),
|
|
3681
4461
|
};
|
|
3682
4462
|
};
|
|
4463
|
+
const deserializeAws_restJson1BackendStoragePermissions = (output, context) => {
|
|
4464
|
+
return {
|
|
4465
|
+
Authenticated: output.authenticated !== undefined && output.authenticated !== null
|
|
4466
|
+
? deserializeAws_restJson1ListOfAuthenticatedElement(output.authenticated, context)
|
|
4467
|
+
: undefined,
|
|
4468
|
+
UnAuthenticated: output.unAuthenticated !== undefined && output.unAuthenticated !== null
|
|
4469
|
+
? deserializeAws_restJson1ListOfUnAuthenticatedElement(output.unAuthenticated, context)
|
|
4470
|
+
: undefined,
|
|
4471
|
+
};
|
|
4472
|
+
};
|
|
3683
4473
|
const deserializeAws_restJson1CreateBackendAuthForgotPasswordConfig = (output, context) => {
|
|
3684
4474
|
return {
|
|
3685
4475
|
DeliveryMethod: smithy_client_1.expectString(output.deliveryMethod),
|
|
@@ -3770,6 +4560,16 @@ const deserializeAws_restJson1EmailSettings = (output, context) => {
|
|
|
3770
4560
|
EmailSubject: smithy_client_1.expectString(output.emailSubject),
|
|
3771
4561
|
};
|
|
3772
4562
|
};
|
|
4563
|
+
const deserializeAws_restJson1GetBackendStorageResourceConfig = (output, context) => {
|
|
4564
|
+
return {
|
|
4565
|
+
BucketName: smithy_client_1.expectString(output.bucketName),
|
|
4566
|
+
Imported: smithy_client_1.expectBoolean(output.imported),
|
|
4567
|
+
Permissions: output.permissions !== undefined && output.permissions !== null
|
|
4568
|
+
? deserializeAws_restJson1BackendStoragePermissions(output.permissions, context)
|
|
4569
|
+
: undefined,
|
|
4570
|
+
ServiceName: smithy_client_1.expectString(output.serviceName),
|
|
4571
|
+
};
|
|
4572
|
+
};
|
|
3773
4573
|
const deserializeAws_restJson1ListOf__string = (output, context) => {
|
|
3774
4574
|
return (output || [])
|
|
3775
4575
|
.filter((e) => e != null)
|
|
@@ -3790,6 +4590,16 @@ const deserializeAws_restJson1ListOfAdditionalConstraintsElement = (output, cont
|
|
|
3790
4590
|
return smithy_client_1.expectString(entry);
|
|
3791
4591
|
});
|
|
3792
4592
|
};
|
|
4593
|
+
const deserializeAws_restJson1ListOfAuthenticatedElement = (output, context) => {
|
|
4594
|
+
return (output || [])
|
|
4595
|
+
.filter((e) => e != null)
|
|
4596
|
+
.map((entry) => {
|
|
4597
|
+
if (entry === null) {
|
|
4598
|
+
return null;
|
|
4599
|
+
}
|
|
4600
|
+
return smithy_client_1.expectString(entry);
|
|
4601
|
+
});
|
|
4602
|
+
};
|
|
3793
4603
|
const deserializeAws_restJson1ListOfBackendAPIAuthType = (output, context) => {
|
|
3794
4604
|
return (output || [])
|
|
3795
4605
|
.filter((e) => e != null)
|
|
@@ -3840,6 +4650,26 @@ const deserializeAws_restJson1ListOfRequiredSignUpAttributesElement = (output, c
|
|
|
3840
4650
|
return smithy_client_1.expectString(entry);
|
|
3841
4651
|
});
|
|
3842
4652
|
};
|
|
4653
|
+
const deserializeAws_restJson1ListOfS3BucketInfo = (output, context) => {
|
|
4654
|
+
return (output || [])
|
|
4655
|
+
.filter((e) => e != null)
|
|
4656
|
+
.map((entry) => {
|
|
4657
|
+
if (entry === null) {
|
|
4658
|
+
return null;
|
|
4659
|
+
}
|
|
4660
|
+
return deserializeAws_restJson1S3BucketInfo(entry, context);
|
|
4661
|
+
});
|
|
4662
|
+
};
|
|
4663
|
+
const deserializeAws_restJson1ListOfUnAuthenticatedElement = (output, context) => {
|
|
4664
|
+
return (output || [])
|
|
4665
|
+
.filter((e) => e != null)
|
|
4666
|
+
.map((entry) => {
|
|
4667
|
+
if (entry === null) {
|
|
4668
|
+
return null;
|
|
4669
|
+
}
|
|
4670
|
+
return smithy_client_1.expectString(entry);
|
|
4671
|
+
});
|
|
4672
|
+
};
|
|
3843
4673
|
const deserializeAws_restJson1LoginAuthConfigReqObj = (output, context) => {
|
|
3844
4674
|
return {
|
|
3845
4675
|
AwsCognitoIdentityPoolId: smithy_client_1.expectString(output.aws_cognito_identity_pool_id),
|
|
@@ -3848,6 +4678,12 @@ const deserializeAws_restJson1LoginAuthConfigReqObj = (output, context) => {
|
|
|
3848
4678
|
AwsUserPoolsWebClientId: smithy_client_1.expectString(output.aws_user_pools_web_client_id),
|
|
3849
4679
|
};
|
|
3850
4680
|
};
|
|
4681
|
+
const deserializeAws_restJson1S3BucketInfo = (output, context) => {
|
|
4682
|
+
return {
|
|
4683
|
+
CreationDate: smithy_client_1.expectString(output.creationDate),
|
|
4684
|
+
Name: smithy_client_1.expectString(output.name),
|
|
4685
|
+
};
|
|
4686
|
+
};
|
|
3851
4687
|
const deserializeAws_restJson1Settings = (output, context) => {
|
|
3852
4688
|
return {
|
|
3853
4689
|
MfaTypes: output.mfaTypes !== undefined && output.mfaTypes !== null
|