@aws-sdk/client-forecastquery 3.185.0 → 3.188.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 +16 -0
- package/dist-es/Forecastquery.js +10 -17
- package/dist-es/ForecastqueryClient.js +22 -28
- package/dist-es/commands/QueryForecastCommand.js +21 -28
- package/dist-es/commands/QueryWhatIfForecastCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/ForecastqueryServiceException.js +5 -10
- package/dist-es/models/models_0.js +78 -67
- package/dist-es/protocols/Aws_json1_1.js +229 -287
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,285 +1,250 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { ForecastqueryServiceException as __BaseException } from "../models/ForecastqueryServiceException";
|
|
5
4
|
import { InvalidInputException, InvalidNextTokenException, LimitExceededException, ResourceInUseException, ResourceNotFoundException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
_c = {};
|
|
121
|
-
return [4, parseErrorBody(output.body, context)];
|
|
122
|
-
case 1:
|
|
123
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
124
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
125
|
-
_b = errorCode;
|
|
126
|
-
switch (_b) {
|
|
127
|
-
case "InvalidInputException": return [3, 2];
|
|
128
|
-
case "com.amazonaws.forecastquery#InvalidInputException": return [3, 2];
|
|
129
|
-
case "InvalidNextTokenException": return [3, 4];
|
|
130
|
-
case "com.amazonaws.forecastquery#InvalidNextTokenException": return [3, 4];
|
|
131
|
-
case "LimitExceededException": return [3, 6];
|
|
132
|
-
case "com.amazonaws.forecastquery#LimitExceededException": return [3, 6];
|
|
133
|
-
case "ResourceInUseException": return [3, 8];
|
|
134
|
-
case "com.amazonaws.forecastquery#ResourceInUseException": return [3, 8];
|
|
135
|
-
case "ResourceNotFoundException": return [3, 10];
|
|
136
|
-
case "com.amazonaws.forecastquery#ResourceNotFoundException": return [3, 10];
|
|
137
|
-
}
|
|
138
|
-
return [3, 12];
|
|
139
|
-
case 2: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
|
|
140
|
-
case 3: throw _d.sent();
|
|
141
|
-
case 4: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
|
|
142
|
-
case 5: throw _d.sent();
|
|
143
|
-
case 6: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
144
|
-
case 7: throw _d.sent();
|
|
145
|
-
case 8: return [4, deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)];
|
|
146
|
-
case 9: throw _d.sent();
|
|
147
|
-
case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
148
|
-
case 11: throw _d.sent();
|
|
149
|
-
case 12:
|
|
150
|
-
parsedBody = parsedOutput.body;
|
|
151
|
-
throwDefaultError({
|
|
152
|
-
output: output,
|
|
153
|
-
parsedBody: parsedBody,
|
|
154
|
-
exceptionCtor: __BaseException,
|
|
155
|
-
errorCode: errorCode,
|
|
156
|
-
});
|
|
157
|
-
_d.label = 13;
|
|
158
|
-
case 13: return [2];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}); };
|
|
162
|
-
var deserializeAws_json1_1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
163
|
-
var body, deserialized, exception;
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
body = parsedOutput.body;
|
|
166
|
-
deserialized = deserializeAws_json1_1InvalidInputException(body, context);
|
|
167
|
-
exception = new InvalidInputException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
168
|
-
return [2, __decorateServiceException(exception, body)];
|
|
5
|
+
export const serializeAws_json1_1QueryForecastCommand = async (input, context) => {
|
|
6
|
+
const headers = {
|
|
7
|
+
"content-type": "application/x-amz-json-1.1",
|
|
8
|
+
"x-amz-target": "AmazonForecastRuntime.QueryForecast",
|
|
9
|
+
};
|
|
10
|
+
let body;
|
|
11
|
+
body = JSON.stringify(serializeAws_json1_1QueryForecastRequest(input, context));
|
|
12
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
|
+
};
|
|
14
|
+
export const serializeAws_json1_1QueryWhatIfForecastCommand = async (input, context) => {
|
|
15
|
+
const headers = {
|
|
16
|
+
"content-type": "application/x-amz-json-1.1",
|
|
17
|
+
"x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
|
|
18
|
+
};
|
|
19
|
+
let body;
|
|
20
|
+
body = JSON.stringify(serializeAws_json1_1QueryWhatIfForecastRequest(input, context));
|
|
21
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
|
+
};
|
|
23
|
+
export const deserializeAws_json1_1QueryForecastCommand = async (output, context) => {
|
|
24
|
+
if (output.statusCode >= 300) {
|
|
25
|
+
return deserializeAws_json1_1QueryForecastCommandError(output, context);
|
|
26
|
+
}
|
|
27
|
+
const data = await parseBody(output.body, context);
|
|
28
|
+
let contents = {};
|
|
29
|
+
contents = deserializeAws_json1_1QueryForecastResponse(data, context);
|
|
30
|
+
const response = {
|
|
31
|
+
$metadata: deserializeMetadata(output),
|
|
32
|
+
...contents,
|
|
33
|
+
};
|
|
34
|
+
return Promise.resolve(response);
|
|
35
|
+
};
|
|
36
|
+
const deserializeAws_json1_1QueryForecastCommandError = async (output, context) => {
|
|
37
|
+
const parsedOutput = {
|
|
38
|
+
...output,
|
|
39
|
+
body: await parseErrorBody(output.body, context),
|
|
40
|
+
};
|
|
41
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
42
|
+
switch (errorCode) {
|
|
43
|
+
case "InvalidInputException":
|
|
44
|
+
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
45
|
+
throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
|
|
46
|
+
case "InvalidNextTokenException":
|
|
47
|
+
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
48
|
+
throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
|
|
49
|
+
case "LimitExceededException":
|
|
50
|
+
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
51
|
+
throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
|
|
52
|
+
case "ResourceInUseException":
|
|
53
|
+
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
54
|
+
throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
|
|
55
|
+
case "ResourceNotFoundException":
|
|
56
|
+
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
57
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
58
|
+
default:
|
|
59
|
+
const parsedBody = parsedOutput.body;
|
|
60
|
+
throwDefaultError({
|
|
61
|
+
output,
|
|
62
|
+
parsedBody,
|
|
63
|
+
exceptionCtor: __BaseException,
|
|
64
|
+
errorCode,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
export const deserializeAws_json1_1QueryWhatIfForecastCommand = async (output, context) => {
|
|
69
|
+
if (output.statusCode >= 300) {
|
|
70
|
+
return deserializeAws_json1_1QueryWhatIfForecastCommandError(output, context);
|
|
71
|
+
}
|
|
72
|
+
const data = await parseBody(output.body, context);
|
|
73
|
+
let contents = {};
|
|
74
|
+
contents = deserializeAws_json1_1QueryWhatIfForecastResponse(data, context);
|
|
75
|
+
const response = {
|
|
76
|
+
$metadata: deserializeMetadata(output),
|
|
77
|
+
...contents,
|
|
78
|
+
};
|
|
79
|
+
return Promise.resolve(response);
|
|
80
|
+
};
|
|
81
|
+
const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, context) => {
|
|
82
|
+
const parsedOutput = {
|
|
83
|
+
...output,
|
|
84
|
+
body: await parseErrorBody(output.body, context),
|
|
85
|
+
};
|
|
86
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
87
|
+
switch (errorCode) {
|
|
88
|
+
case "InvalidInputException":
|
|
89
|
+
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
90
|
+
throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
|
|
91
|
+
case "InvalidNextTokenException":
|
|
92
|
+
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
93
|
+
throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
|
|
94
|
+
case "LimitExceededException":
|
|
95
|
+
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
96
|
+
throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
|
|
97
|
+
case "ResourceInUseException":
|
|
98
|
+
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
99
|
+
throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
|
|
100
|
+
case "ResourceNotFoundException":
|
|
101
|
+
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
102
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
103
|
+
default:
|
|
104
|
+
const parsedBody = parsedOutput.body;
|
|
105
|
+
throwDefaultError({
|
|
106
|
+
output,
|
|
107
|
+
parsedBody,
|
|
108
|
+
exceptionCtor: __BaseException,
|
|
109
|
+
errorCode,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
|
|
114
|
+
const body = parsedOutput.body;
|
|
115
|
+
const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
|
|
116
|
+
const exception = new InvalidInputException({
|
|
117
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
118
|
+
...deserialized,
|
|
169
119
|
});
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
120
|
+
return __decorateServiceException(exception, body);
|
|
121
|
+
};
|
|
122
|
+
const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
|
|
123
|
+
const body = parsedOutput.body;
|
|
124
|
+
const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
|
|
125
|
+
const exception = new InvalidNextTokenException({
|
|
126
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
127
|
+
...deserialized,
|
|
178
128
|
});
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
129
|
+
return __decorateServiceException(exception, body);
|
|
130
|
+
};
|
|
131
|
+
const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
132
|
+
const body = parsedOutput.body;
|
|
133
|
+
const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
|
|
134
|
+
const exception = new LimitExceededException({
|
|
135
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
136
|
+
...deserialized,
|
|
187
137
|
});
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
138
|
+
return __decorateServiceException(exception, body);
|
|
139
|
+
};
|
|
140
|
+
const deserializeAws_json1_1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
|
|
141
|
+
const body = parsedOutput.body;
|
|
142
|
+
const deserialized = deserializeAws_json1_1ResourceInUseException(body, context);
|
|
143
|
+
const exception = new ResourceInUseException({
|
|
144
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
145
|
+
...deserialized,
|
|
196
146
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
147
|
+
return __decorateServiceException(exception, body);
|
|
148
|
+
};
|
|
149
|
+
const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
150
|
+
const body = parsedOutput.body;
|
|
151
|
+
const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
|
|
152
|
+
const exception = new ResourceNotFoundException({
|
|
153
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
154
|
+
...deserialized,
|
|
205
155
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
156
|
+
return __decorateServiceException(exception, body);
|
|
157
|
+
};
|
|
158
|
+
const serializeAws_json1_1Filters = (input, context) => {
|
|
159
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
211
160
|
if (value === null) {
|
|
212
161
|
return acc;
|
|
213
162
|
}
|
|
214
|
-
return
|
|
163
|
+
return {
|
|
164
|
+
...acc,
|
|
165
|
+
[key]: value,
|
|
166
|
+
};
|
|
215
167
|
}, {});
|
|
216
168
|
};
|
|
217
|
-
|
|
218
|
-
return
|
|
169
|
+
const serializeAws_json1_1QueryForecastRequest = (input, context) => {
|
|
170
|
+
return {
|
|
171
|
+
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
172
|
+
...(input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
|
|
173
|
+
...(input.ForecastArn != null && { ForecastArn: input.ForecastArn }),
|
|
174
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
175
|
+
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
176
|
+
};
|
|
219
177
|
};
|
|
220
|
-
|
|
221
|
-
return
|
|
178
|
+
const serializeAws_json1_1QueryWhatIfForecastRequest = (input, context) => {
|
|
179
|
+
return {
|
|
180
|
+
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
181
|
+
...(input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
|
|
182
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
183
|
+
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
184
|
+
...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
|
|
185
|
+
};
|
|
222
186
|
};
|
|
223
|
-
|
|
187
|
+
const deserializeAws_json1_1DataPoint = (output, context) => {
|
|
224
188
|
return {
|
|
225
189
|
Timestamp: __expectString(output.Timestamp),
|
|
226
190
|
Value: __limitedParseDouble(output.Value),
|
|
227
191
|
};
|
|
228
192
|
};
|
|
229
|
-
|
|
193
|
+
const deserializeAws_json1_1Forecast = (output, context) => {
|
|
230
194
|
return {
|
|
231
195
|
Predictions: output.Predictions != null ? deserializeAws_json1_1Predictions(output.Predictions, context) : undefined,
|
|
232
196
|
};
|
|
233
197
|
};
|
|
234
|
-
|
|
198
|
+
const deserializeAws_json1_1InvalidInputException = (output, context) => {
|
|
235
199
|
return {
|
|
236
200
|
Message: __expectString(output.Message),
|
|
237
201
|
};
|
|
238
202
|
};
|
|
239
|
-
|
|
203
|
+
const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
|
|
240
204
|
return {
|
|
241
205
|
Message: __expectString(output.Message),
|
|
242
206
|
};
|
|
243
207
|
};
|
|
244
|
-
|
|
208
|
+
const deserializeAws_json1_1LimitExceededException = (output, context) => {
|
|
245
209
|
return {
|
|
246
210
|
Message: __expectString(output.Message),
|
|
247
211
|
};
|
|
248
212
|
};
|
|
249
|
-
|
|
250
|
-
return Object.entries(output).reduce(
|
|
251
|
-
var _b;
|
|
252
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
213
|
+
const deserializeAws_json1_1Predictions = (output, context) => {
|
|
214
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
253
215
|
if (value === null) {
|
|
254
216
|
return acc;
|
|
255
217
|
}
|
|
256
|
-
return
|
|
218
|
+
return {
|
|
219
|
+
...acc,
|
|
220
|
+
[key]: deserializeAws_json1_1TimeSeries(value, context),
|
|
221
|
+
};
|
|
257
222
|
}, {});
|
|
258
223
|
};
|
|
259
|
-
|
|
224
|
+
const deserializeAws_json1_1QueryForecastResponse = (output, context) => {
|
|
260
225
|
return {
|
|
261
226
|
Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
|
|
262
227
|
};
|
|
263
228
|
};
|
|
264
|
-
|
|
229
|
+
const deserializeAws_json1_1QueryWhatIfForecastResponse = (output, context) => {
|
|
265
230
|
return {
|
|
266
231
|
Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
|
|
267
232
|
};
|
|
268
233
|
};
|
|
269
|
-
|
|
234
|
+
const deserializeAws_json1_1ResourceInUseException = (output, context) => {
|
|
270
235
|
return {
|
|
271
236
|
Message: __expectString(output.Message),
|
|
272
237
|
};
|
|
273
238
|
};
|
|
274
|
-
|
|
239
|
+
const deserializeAws_json1_1ResourceNotFoundException = (output, context) => {
|
|
275
240
|
return {
|
|
276
241
|
Message: __expectString(output.Message),
|
|
277
242
|
};
|
|
278
243
|
};
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
.filter(
|
|
282
|
-
.map(
|
|
244
|
+
const deserializeAws_json1_1TimeSeries = (output, context) => {
|
|
245
|
+
const retVal = (output || [])
|
|
246
|
+
.filter((e) => e != null)
|
|
247
|
+
.map((entry) => {
|
|
283
248
|
if (entry === null) {
|
|
284
249
|
return null;
|
|
285
250
|
}
|
|
@@ -287,75 +252,52 @@ var deserializeAws_json1_1TimeSeries = function (output, context) {
|
|
|
287
252
|
});
|
|
288
253
|
return retVal;
|
|
289
254
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
});
|
|
298
|
-
};
|
|
299
|
-
var collectBody = function (streamBody, context) {
|
|
300
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
255
|
+
const deserializeMetadata = (output) => ({
|
|
256
|
+
httpStatusCode: output.statusCode,
|
|
257
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
258
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
259
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
260
|
+
});
|
|
261
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
301
262
|
if (streamBody instanceof Uint8Array) {
|
|
302
263
|
return Promise.resolve(streamBody);
|
|
303
264
|
}
|
|
304
265
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
305
266
|
};
|
|
306
|
-
|
|
307
|
-
|
|
267
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
268
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
269
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
270
|
+
const contents = {
|
|
271
|
+
protocol,
|
|
272
|
+
hostname,
|
|
273
|
+
port,
|
|
274
|
+
method: "POST",
|
|
275
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
276
|
+
headers,
|
|
277
|
+
};
|
|
278
|
+
if (resolvedHostname !== undefined) {
|
|
279
|
+
contents.hostname = resolvedHostname;
|
|
280
|
+
}
|
|
281
|
+
if (body !== undefined) {
|
|
282
|
+
contents.body = body;
|
|
283
|
+
}
|
|
284
|
+
return new __HttpRequest(contents);
|
|
308
285
|
};
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
port: port,
|
|
320
|
-
method: "POST",
|
|
321
|
-
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
322
|
-
headers: headers,
|
|
323
|
-
};
|
|
324
|
-
if (resolvedHostname !== undefined) {
|
|
325
|
-
contents.hostname = resolvedHostname;
|
|
326
|
-
}
|
|
327
|
-
if (body !== undefined) {
|
|
328
|
-
contents.body = body;
|
|
329
|
-
}
|
|
330
|
-
return [2, new __HttpRequest(contents)];
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}); };
|
|
334
|
-
var parseBody = function (streamBody, context) {
|
|
335
|
-
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
336
|
-
if (encoded.length) {
|
|
337
|
-
return JSON.parse(encoded);
|
|
338
|
-
}
|
|
339
|
-
return {};
|
|
340
|
-
});
|
|
286
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
287
|
+
if (encoded.length) {
|
|
288
|
+
return JSON.parse(encoded);
|
|
289
|
+
}
|
|
290
|
+
return {};
|
|
291
|
+
});
|
|
292
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
293
|
+
const value = await parseBody(errorBody, context);
|
|
294
|
+
value.message = value.message ?? value.Message;
|
|
295
|
+
return value;
|
|
341
296
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
switch (_b.label) {
|
|
347
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
348
|
-
case 1:
|
|
349
|
-
value = _b.sent();
|
|
350
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
351
|
-
return [2, value];
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
}); };
|
|
355
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
356
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
357
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
358
|
-
var cleanValue = rawValue;
|
|
297
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
298
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
299
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
300
|
+
let cleanValue = rawValue;
|
|
359
301
|
if (typeof cleanValue === "number") {
|
|
360
302
|
cleanValue = cleanValue.toString();
|
|
361
303
|
}
|
|
@@ -370,7 +312,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
370
312
|
}
|
|
371
313
|
return cleanValue;
|
|
372
314
|
};
|
|
373
|
-
|
|
315
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
374
316
|
if (headerKey !== undefined) {
|
|
375
317
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
376
318
|
}
|