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