@aws-sdk/client-forecastquery 3.310.0 → 3.315.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.
|
@@ -6,22 +6,16 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
|
6
6
|
const ForecastqueryServiceException_1 = require("../models/ForecastqueryServiceException");
|
|
7
7
|
const models_0_1 = require("../models/models_0");
|
|
8
8
|
const se_QueryForecastCommand = async (input, context) => {
|
|
9
|
-
const headers =
|
|
10
|
-
"content-type": "application/x-amz-json-1.1",
|
|
11
|
-
"x-amz-target": "AmazonForecastRuntime.QueryForecast",
|
|
12
|
-
};
|
|
9
|
+
const headers = sharedHeaders("QueryForecast");
|
|
13
10
|
let body;
|
|
14
|
-
body = JSON.stringify(
|
|
11
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
15
12
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
16
13
|
};
|
|
17
14
|
exports.se_QueryForecastCommand = se_QueryForecastCommand;
|
|
18
15
|
const se_QueryWhatIfForecastCommand = async (input, context) => {
|
|
19
|
-
const headers =
|
|
20
|
-
"content-type": "application/x-amz-json-1.1",
|
|
21
|
-
"x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
|
|
22
|
-
};
|
|
16
|
+
const headers = sharedHeaders("QueryWhatIfForecast");
|
|
23
17
|
let body;
|
|
24
|
-
body = JSON.stringify(
|
|
18
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
25
19
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
26
20
|
};
|
|
27
21
|
exports.se_QueryWhatIfForecastCommand = se_QueryWhatIfForecastCommand;
|
|
@@ -36,7 +30,7 @@ const de_QueryForecastCommand = async (output, context) => {
|
|
|
36
30
|
$metadata: deserializeMetadata(output),
|
|
37
31
|
...contents,
|
|
38
32
|
};
|
|
39
|
-
return
|
|
33
|
+
return response;
|
|
40
34
|
};
|
|
41
35
|
exports.de_QueryForecastCommand = de_QueryForecastCommand;
|
|
42
36
|
const de_QueryForecastCommandError = async (output, context) => {
|
|
@@ -63,10 +57,9 @@ const de_QueryForecastCommandError = async (output, context) => {
|
|
|
63
57
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
64
58
|
default:
|
|
65
59
|
const parsedBody = parsedOutput.body;
|
|
66
|
-
|
|
60
|
+
return throwDefaultError({
|
|
67
61
|
output,
|
|
68
62
|
parsedBody,
|
|
69
|
-
exceptionCtor: ForecastqueryServiceException_1.ForecastqueryServiceException,
|
|
70
63
|
errorCode,
|
|
71
64
|
});
|
|
72
65
|
}
|
|
@@ -82,7 +75,7 @@ const de_QueryWhatIfForecastCommand = async (output, context) => {
|
|
|
82
75
|
$metadata: deserializeMetadata(output),
|
|
83
76
|
...contents,
|
|
84
77
|
};
|
|
85
|
-
return
|
|
78
|
+
return response;
|
|
86
79
|
};
|
|
87
80
|
exports.de_QueryWhatIfForecastCommand = de_QueryWhatIfForecastCommand;
|
|
88
81
|
const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
@@ -109,17 +102,16 @@ const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
|
109
102
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
110
103
|
default:
|
|
111
104
|
const parsedBody = parsedOutput.body;
|
|
112
|
-
|
|
105
|
+
return throwDefaultError({
|
|
113
106
|
output,
|
|
114
107
|
parsedBody,
|
|
115
|
-
exceptionCtor: ForecastqueryServiceException_1.ForecastqueryServiceException,
|
|
116
108
|
errorCode,
|
|
117
109
|
});
|
|
118
110
|
}
|
|
119
111
|
};
|
|
120
112
|
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
121
113
|
const body = parsedOutput.body;
|
|
122
|
-
const deserialized =
|
|
114
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
123
115
|
const exception = new models_0_1.InvalidInputException({
|
|
124
116
|
$metadata: deserializeMetadata(parsedOutput),
|
|
125
117
|
...deserialized,
|
|
@@ -128,7 +120,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
|
128
120
|
};
|
|
129
121
|
const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
130
122
|
const body = parsedOutput.body;
|
|
131
|
-
const deserialized =
|
|
123
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
132
124
|
const exception = new models_0_1.InvalidNextTokenException({
|
|
133
125
|
$metadata: deserializeMetadata(parsedOutput),
|
|
134
126
|
...deserialized,
|
|
@@ -137,7 +129,7 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
|
137
129
|
};
|
|
138
130
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
139
131
|
const body = parsedOutput.body;
|
|
140
|
-
const deserialized =
|
|
132
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
141
133
|
const exception = new models_0_1.LimitExceededException({
|
|
142
134
|
$metadata: deserializeMetadata(parsedOutput),
|
|
143
135
|
...deserialized,
|
|
@@ -146,7 +138,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
|
146
138
|
};
|
|
147
139
|
const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
148
140
|
const body = parsedOutput.body;
|
|
149
|
-
const deserialized =
|
|
141
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
150
142
|
const exception = new models_0_1.ResourceInUseException({
|
|
151
143
|
$metadata: deserializeMetadata(parsedOutput),
|
|
152
144
|
...deserialized,
|
|
@@ -155,65 +147,23 @@ const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
|
155
147
|
};
|
|
156
148
|
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
157
149
|
const body = parsedOutput.body;
|
|
158
|
-
const deserialized =
|
|
150
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
159
151
|
const exception = new models_0_1.ResourceNotFoundException({
|
|
160
152
|
$metadata: deserializeMetadata(parsedOutput),
|
|
161
153
|
...deserialized,
|
|
162
154
|
});
|
|
163
155
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
164
156
|
};
|
|
165
|
-
const se_Filters = (input, context) => {
|
|
166
|
-
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
167
|
-
if (value === null) {
|
|
168
|
-
return acc;
|
|
169
|
-
}
|
|
170
|
-
acc[key] = value;
|
|
171
|
-
return acc;
|
|
172
|
-
}, {});
|
|
173
|
-
};
|
|
174
|
-
const se_QueryForecastRequest = (input, context) => {
|
|
175
|
-
return {
|
|
176
|
-
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
177
|
-
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
178
|
-
...(input.ForecastArn != null && { ForecastArn: input.ForecastArn }),
|
|
179
|
-
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
180
|
-
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
const se_QueryWhatIfForecastRequest = (input, context) => {
|
|
184
|
-
return {
|
|
185
|
-
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
186
|
-
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
187
|
-
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
188
|
-
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
189
|
-
...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
157
|
const de_DataPoint = (output, context) => {
|
|
193
|
-
return {
|
|
194
|
-
Timestamp:
|
|
195
|
-
Value:
|
|
196
|
-
};
|
|
158
|
+
return (0, smithy_client_1.take)(output, {
|
|
159
|
+
Timestamp: smithy_client_1.expectString,
|
|
160
|
+
Value: smithy_client_1.limitedParseDouble,
|
|
161
|
+
});
|
|
197
162
|
};
|
|
198
163
|
const de_Forecast = (output, context) => {
|
|
199
|
-
return {
|
|
200
|
-
Predictions:
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
const de_InvalidInputException = (output, context) => {
|
|
204
|
-
return {
|
|
205
|
-
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
const de_InvalidNextTokenException = (output, context) => {
|
|
209
|
-
return {
|
|
210
|
-
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
const de_LimitExceededException = (output, context) => {
|
|
214
|
-
return {
|
|
215
|
-
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
216
|
-
};
|
|
164
|
+
return (0, smithy_client_1.take)(output, {
|
|
165
|
+
Predictions: (_) => de_Predictions(_, context),
|
|
166
|
+
});
|
|
217
167
|
};
|
|
218
168
|
const de_Predictions = (output, context) => {
|
|
219
169
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
@@ -225,32 +175,19 @@ const de_Predictions = (output, context) => {
|
|
|
225
175
|
}, {});
|
|
226
176
|
};
|
|
227
177
|
const de_QueryForecastResponse = (output, context) => {
|
|
228
|
-
return {
|
|
229
|
-
Forecast:
|
|
230
|
-
};
|
|
178
|
+
return (0, smithy_client_1.take)(output, {
|
|
179
|
+
Forecast: (_) => de_Forecast(_, context),
|
|
180
|
+
});
|
|
231
181
|
};
|
|
232
182
|
const de_QueryWhatIfForecastResponse = (output, context) => {
|
|
233
|
-
return {
|
|
234
|
-
Forecast:
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
const de_ResourceInUseException = (output, context) => {
|
|
238
|
-
return {
|
|
239
|
-
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
const de_ResourceNotFoundException = (output, context) => {
|
|
243
|
-
return {
|
|
244
|
-
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
245
|
-
};
|
|
183
|
+
return (0, smithy_client_1.take)(output, {
|
|
184
|
+
Forecast: (_) => de_Forecast(_, context),
|
|
185
|
+
});
|
|
246
186
|
};
|
|
247
187
|
const de_TimeSeries = (output, context) => {
|
|
248
188
|
const retVal = (output || [])
|
|
249
189
|
.filter((e) => e != null)
|
|
250
190
|
.map((entry) => {
|
|
251
|
-
if (entry === null) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
191
|
return de_DataPoint(entry, context);
|
|
255
192
|
});
|
|
256
193
|
return retVal;
|
|
@@ -268,6 +205,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
268
205
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
269
206
|
};
|
|
270
207
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
208
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(ForecastqueryServiceException_1.ForecastqueryServiceException);
|
|
271
209
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
272
210
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
273
211
|
const contents = {
|
|
@@ -286,6 +224,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
286
224
|
}
|
|
287
225
|
return new protocol_http_1.HttpRequest(contents);
|
|
288
226
|
};
|
|
227
|
+
function sharedHeaders(operation) {
|
|
228
|
+
return {
|
|
229
|
+
"content-type": "application/x-amz-json-1.1",
|
|
230
|
+
"x-amz-target": `AmazonForecastRuntime.${operation}`,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
289
233
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
290
234
|
if (encoded.length) {
|
|
291
235
|
return JSON.parse(encoded);
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
-
import { decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble,
|
|
2
|
+
import { _json, decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble, take, withBaseException, } from "@aws-sdk/smithy-client";
|
|
3
3
|
import { ForecastqueryServiceException as __BaseException } from "../models/ForecastqueryServiceException";
|
|
4
4
|
import { InvalidInputException, InvalidNextTokenException, LimitExceededException, ResourceInUseException, ResourceNotFoundException, } from "../models/models_0";
|
|
5
5
|
export const se_QueryForecastCommand = async (input, context) => {
|
|
6
|
-
const headers =
|
|
7
|
-
"content-type": "application/x-amz-json-1.1",
|
|
8
|
-
"x-amz-target": "AmazonForecastRuntime.QueryForecast",
|
|
9
|
-
};
|
|
6
|
+
const headers = sharedHeaders("QueryForecast");
|
|
10
7
|
let body;
|
|
11
|
-
body = JSON.stringify(
|
|
8
|
+
body = JSON.stringify(_json(input));
|
|
12
9
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
10
|
};
|
|
14
11
|
export const se_QueryWhatIfForecastCommand = async (input, context) => {
|
|
15
|
-
const headers =
|
|
16
|
-
"content-type": "application/x-amz-json-1.1",
|
|
17
|
-
"x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
|
|
18
|
-
};
|
|
12
|
+
const headers = sharedHeaders("QueryWhatIfForecast");
|
|
19
13
|
let body;
|
|
20
|
-
body = JSON.stringify(
|
|
14
|
+
body = JSON.stringify(_json(input));
|
|
21
15
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
16
|
};
|
|
23
17
|
export const de_QueryForecastCommand = async (output, context) => {
|
|
@@ -31,7 +25,7 @@ export const de_QueryForecastCommand = async (output, context) => {
|
|
|
31
25
|
$metadata: deserializeMetadata(output),
|
|
32
26
|
...contents,
|
|
33
27
|
};
|
|
34
|
-
return
|
|
28
|
+
return response;
|
|
35
29
|
};
|
|
36
30
|
const de_QueryForecastCommandError = async (output, context) => {
|
|
37
31
|
const parsedOutput = {
|
|
@@ -57,10 +51,9 @@ const de_QueryForecastCommandError = async (output, context) => {
|
|
|
57
51
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
58
52
|
default:
|
|
59
53
|
const parsedBody = parsedOutput.body;
|
|
60
|
-
throwDefaultError({
|
|
54
|
+
return throwDefaultError({
|
|
61
55
|
output,
|
|
62
56
|
parsedBody,
|
|
63
|
-
exceptionCtor: __BaseException,
|
|
64
57
|
errorCode,
|
|
65
58
|
});
|
|
66
59
|
}
|
|
@@ -76,7 +69,7 @@ export const de_QueryWhatIfForecastCommand = async (output, context) => {
|
|
|
76
69
|
$metadata: deserializeMetadata(output),
|
|
77
70
|
...contents,
|
|
78
71
|
};
|
|
79
|
-
return
|
|
72
|
+
return response;
|
|
80
73
|
};
|
|
81
74
|
const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
82
75
|
const parsedOutput = {
|
|
@@ -102,17 +95,16 @@ const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
|
102
95
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
103
96
|
default:
|
|
104
97
|
const parsedBody = parsedOutput.body;
|
|
105
|
-
throwDefaultError({
|
|
98
|
+
return throwDefaultError({
|
|
106
99
|
output,
|
|
107
100
|
parsedBody,
|
|
108
|
-
exceptionCtor: __BaseException,
|
|
109
101
|
errorCode,
|
|
110
102
|
});
|
|
111
103
|
}
|
|
112
104
|
};
|
|
113
105
|
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
114
106
|
const body = parsedOutput.body;
|
|
115
|
-
const deserialized =
|
|
107
|
+
const deserialized = _json(body);
|
|
116
108
|
const exception = new InvalidInputException({
|
|
117
109
|
$metadata: deserializeMetadata(parsedOutput),
|
|
118
110
|
...deserialized,
|
|
@@ -121,7 +113,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
|
121
113
|
};
|
|
122
114
|
const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
123
115
|
const body = parsedOutput.body;
|
|
124
|
-
const deserialized =
|
|
116
|
+
const deserialized = _json(body);
|
|
125
117
|
const exception = new InvalidNextTokenException({
|
|
126
118
|
$metadata: deserializeMetadata(parsedOutput),
|
|
127
119
|
...deserialized,
|
|
@@ -130,7 +122,7 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
|
130
122
|
};
|
|
131
123
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
132
124
|
const body = parsedOutput.body;
|
|
133
|
-
const deserialized =
|
|
125
|
+
const deserialized = _json(body);
|
|
134
126
|
const exception = new LimitExceededException({
|
|
135
127
|
$metadata: deserializeMetadata(parsedOutput),
|
|
136
128
|
...deserialized,
|
|
@@ -139,7 +131,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
|
139
131
|
};
|
|
140
132
|
const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
141
133
|
const body = parsedOutput.body;
|
|
142
|
-
const deserialized =
|
|
134
|
+
const deserialized = _json(body);
|
|
143
135
|
const exception = new ResourceInUseException({
|
|
144
136
|
$metadata: deserializeMetadata(parsedOutput),
|
|
145
137
|
...deserialized,
|
|
@@ -148,65 +140,23 @@ const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
|
148
140
|
};
|
|
149
141
|
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
150
142
|
const body = parsedOutput.body;
|
|
151
|
-
const deserialized =
|
|
143
|
+
const deserialized = _json(body);
|
|
152
144
|
const exception = new ResourceNotFoundException({
|
|
153
145
|
$metadata: deserializeMetadata(parsedOutput),
|
|
154
146
|
...deserialized,
|
|
155
147
|
});
|
|
156
148
|
return __decorateServiceException(exception, body);
|
|
157
149
|
};
|
|
158
|
-
const se_Filters = (input, context) => {
|
|
159
|
-
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
160
|
-
if (value === null) {
|
|
161
|
-
return acc;
|
|
162
|
-
}
|
|
163
|
-
acc[key] = value;
|
|
164
|
-
return acc;
|
|
165
|
-
}, {});
|
|
166
|
-
};
|
|
167
|
-
const se_QueryForecastRequest = (input, context) => {
|
|
168
|
-
return {
|
|
169
|
-
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
170
|
-
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
171
|
-
...(input.ForecastArn != null && { ForecastArn: input.ForecastArn }),
|
|
172
|
-
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
173
|
-
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
const se_QueryWhatIfForecastRequest = (input, context) => {
|
|
177
|
-
return {
|
|
178
|
-
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
179
|
-
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
180
|
-
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
181
|
-
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
182
|
-
...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
150
|
const de_DataPoint = (output, context) => {
|
|
186
|
-
return {
|
|
187
|
-
Timestamp: __expectString
|
|
188
|
-
Value: __limitedParseDouble
|
|
189
|
-
};
|
|
151
|
+
return take(output, {
|
|
152
|
+
Timestamp: __expectString,
|
|
153
|
+
Value: __limitedParseDouble,
|
|
154
|
+
});
|
|
190
155
|
};
|
|
191
156
|
const de_Forecast = (output, context) => {
|
|
192
|
-
return {
|
|
193
|
-
Predictions:
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
const de_InvalidInputException = (output, context) => {
|
|
197
|
-
return {
|
|
198
|
-
Message: __expectString(output.Message),
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
const de_InvalidNextTokenException = (output, context) => {
|
|
202
|
-
return {
|
|
203
|
-
Message: __expectString(output.Message),
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
const de_LimitExceededException = (output, context) => {
|
|
207
|
-
return {
|
|
208
|
-
Message: __expectString(output.Message),
|
|
209
|
-
};
|
|
157
|
+
return take(output, {
|
|
158
|
+
Predictions: (_) => de_Predictions(_, context),
|
|
159
|
+
});
|
|
210
160
|
};
|
|
211
161
|
const de_Predictions = (output, context) => {
|
|
212
162
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
@@ -218,32 +168,19 @@ const de_Predictions = (output, context) => {
|
|
|
218
168
|
}, {});
|
|
219
169
|
};
|
|
220
170
|
const de_QueryForecastResponse = (output, context) => {
|
|
221
|
-
return {
|
|
222
|
-
Forecast:
|
|
223
|
-
};
|
|
171
|
+
return take(output, {
|
|
172
|
+
Forecast: (_) => de_Forecast(_, context),
|
|
173
|
+
});
|
|
224
174
|
};
|
|
225
175
|
const de_QueryWhatIfForecastResponse = (output, context) => {
|
|
226
|
-
return {
|
|
227
|
-
Forecast:
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
const de_ResourceInUseException = (output, context) => {
|
|
231
|
-
return {
|
|
232
|
-
Message: __expectString(output.Message),
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
const de_ResourceNotFoundException = (output, context) => {
|
|
236
|
-
return {
|
|
237
|
-
Message: __expectString(output.Message),
|
|
238
|
-
};
|
|
176
|
+
return take(output, {
|
|
177
|
+
Forecast: (_) => de_Forecast(_, context),
|
|
178
|
+
});
|
|
239
179
|
};
|
|
240
180
|
const de_TimeSeries = (output, context) => {
|
|
241
181
|
const retVal = (output || [])
|
|
242
182
|
.filter((e) => e != null)
|
|
243
183
|
.map((entry) => {
|
|
244
|
-
if (entry === null) {
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
184
|
return de_DataPoint(entry, context);
|
|
248
185
|
});
|
|
249
186
|
return retVal;
|
|
@@ -261,6 +198,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
261
198
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
262
199
|
};
|
|
263
200
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
201
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
264
202
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
265
203
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
266
204
|
const contents = {
|
|
@@ -279,6 +217,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
279
217
|
}
|
|
280
218
|
return new __HttpRequest(contents);
|
|
281
219
|
};
|
|
220
|
+
function sharedHeaders(operation) {
|
|
221
|
+
return {
|
|
222
|
+
"content-type": "application/x-amz-json-1.1",
|
|
223
|
+
"x-amz-target": `AmazonForecastRuntime.${operation}`,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
282
226
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
283
227
|
if (encoded.length) {
|
|
284
228
|
return JSON.parse(encoded);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-forecastquery",
|
|
3
3
|
"description": "AWS SDK for JavaScript Forecastquery Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.315.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
24
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
+
"@aws-sdk/client-sts": "3.315.0",
|
|
25
25
|
"@aws-sdk/config-resolver": "3.310.0",
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
26
|
+
"@aws-sdk/credential-provider-node": "3.315.0",
|
|
27
27
|
"@aws-sdk/fetch-http-handler": "3.310.0",
|
|
28
28
|
"@aws-sdk/hash-node": "3.310.0",
|
|
29
29
|
"@aws-sdk/invalid-dependency": "3.310.0",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@aws-sdk/node-config-provider": "3.310.0",
|
|
41
41
|
"@aws-sdk/node-http-handler": "3.310.0",
|
|
42
42
|
"@aws-sdk/protocol-http": "3.310.0",
|
|
43
|
-
"@aws-sdk/smithy-client": "3.
|
|
43
|
+
"@aws-sdk/smithy-client": "3.315.0",
|
|
44
44
|
"@aws-sdk/types": "3.310.0",
|
|
45
45
|
"@aws-sdk/url-parser": "3.310.0",
|
|
46
46
|
"@aws-sdk/util-base64": "3.310.0",
|
|
47
47
|
"@aws-sdk/util-body-length-browser": "3.310.0",
|
|
48
48
|
"@aws-sdk/util-body-length-node": "3.310.0",
|
|
49
|
-
"@aws-sdk/util-defaults-mode-browser": "3.
|
|
50
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
49
|
+
"@aws-sdk/util-defaults-mode-browser": "3.315.0",
|
|
50
|
+
"@aws-sdk/util-defaults-mode-node": "3.315.0",
|
|
51
51
|
"@aws-sdk/util-endpoints": "3.310.0",
|
|
52
52
|
"@aws-sdk/util-retry": "3.310.0",
|
|
53
53
|
"@aws-sdk/util-user-agent-browser": "3.310.0",
|