@aws-sdk/client-forecastquery 3.303.0 → 3.309.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/dist-cjs/commands/QueryForecastCommand.js +2 -2
- package/dist-cjs/commands/QueryWhatIfForecastCommand.js +2 -2
- package/dist-cjs/protocols/Aws_json1_1.js +58 -58
- package/dist-es/commands/QueryForecastCommand.js +3 -3
- package/dist-es/commands/QueryWhatIfForecastCommand.js +3 -3
- package/dist-es/protocols/Aws_json1_1.js +53 -53
- package/dist-types/protocols/Aws_json1_1.d.ts +16 -4
- package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +4 -4
- package/package.json +29 -29
|
@@ -36,10 +36,10 @@ class QueryForecastCommand extends smithy_client_1.Command {
|
|
|
36
36
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
37
37
|
}
|
|
38
38
|
serialize(input, context) {
|
|
39
|
-
return (0, Aws_json1_1_1.
|
|
39
|
+
return (0, Aws_json1_1_1.se_QueryForecastCommand)(input, context);
|
|
40
40
|
}
|
|
41
41
|
deserialize(output, context) {
|
|
42
|
-
return (0, Aws_json1_1_1.
|
|
42
|
+
return (0, Aws_json1_1_1.de_QueryForecastCommand)(output, context);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
exports.QueryForecastCommand = QueryForecastCommand;
|
|
@@ -36,10 +36,10 @@ class QueryWhatIfForecastCommand extends smithy_client_1.Command {
|
|
|
36
36
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
37
37
|
}
|
|
38
38
|
serialize(input, context) {
|
|
39
|
-
return (0, Aws_json1_1_1.
|
|
39
|
+
return (0, Aws_json1_1_1.se_QueryWhatIfForecastCommand)(input, context);
|
|
40
40
|
}
|
|
41
41
|
deserialize(output, context) {
|
|
42
|
-
return (0, Aws_json1_1_1.
|
|
42
|
+
return (0, Aws_json1_1_1.de_QueryWhatIfForecastCommand)(output, context);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
exports.QueryWhatIfForecastCommand = QueryWhatIfForecastCommand;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.de_QueryWhatIfForecastCommand = exports.de_QueryForecastCommand = exports.se_QueryWhatIfForecastCommand = exports.se_QueryForecastCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
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
|
-
const
|
|
8
|
+
const se_QueryForecastCommand = async (input, context) => {
|
|
9
9
|
const headers = {
|
|
10
10
|
"content-type": "application/x-amz-json-1.1",
|
|
11
11
|
"x-amz-target": "AmazonForecastRuntime.QueryForecast",
|
|
12
12
|
};
|
|
13
13
|
let body;
|
|
14
|
-
body = JSON.stringify(
|
|
14
|
+
body = JSON.stringify(se_QueryForecastRequest(input, context));
|
|
15
15
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
16
16
|
};
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
17
|
+
exports.se_QueryForecastCommand = se_QueryForecastCommand;
|
|
18
|
+
const se_QueryWhatIfForecastCommand = async (input, context) => {
|
|
19
19
|
const headers = {
|
|
20
20
|
"content-type": "application/x-amz-json-1.1",
|
|
21
21
|
"x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
|
|
22
22
|
};
|
|
23
23
|
let body;
|
|
24
|
-
body = JSON.stringify(
|
|
24
|
+
body = JSON.stringify(se_QueryWhatIfForecastRequest(input, context));
|
|
25
25
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
28
|
-
const
|
|
27
|
+
exports.se_QueryWhatIfForecastCommand = se_QueryWhatIfForecastCommand;
|
|
28
|
+
const de_QueryForecastCommand = async (output, context) => {
|
|
29
29
|
if (output.statusCode >= 300) {
|
|
30
|
-
return
|
|
30
|
+
return de_QueryForecastCommandError(output, context);
|
|
31
31
|
}
|
|
32
32
|
const data = await parseBody(output.body, context);
|
|
33
33
|
let contents = {};
|
|
34
|
-
contents =
|
|
34
|
+
contents = de_QueryForecastResponse(data, context);
|
|
35
35
|
const response = {
|
|
36
36
|
$metadata: deserializeMetadata(output),
|
|
37
37
|
...contents,
|
|
38
38
|
};
|
|
39
39
|
return Promise.resolve(response);
|
|
40
40
|
};
|
|
41
|
-
exports.
|
|
42
|
-
const
|
|
41
|
+
exports.de_QueryForecastCommand = de_QueryForecastCommand;
|
|
42
|
+
const de_QueryForecastCommandError = async (output, context) => {
|
|
43
43
|
const parsedOutput = {
|
|
44
44
|
...output,
|
|
45
45
|
body: await parseErrorBody(output.body, context),
|
|
@@ -48,19 +48,19 @@ const deserializeAws_json1_1QueryForecastCommandError = async (output, context)
|
|
|
48
48
|
switch (errorCode) {
|
|
49
49
|
case "InvalidInputException":
|
|
50
50
|
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
51
|
-
throw await
|
|
51
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
52
52
|
case "InvalidNextTokenException":
|
|
53
53
|
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
54
|
-
throw await
|
|
54
|
+
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
55
55
|
case "LimitExceededException":
|
|
56
56
|
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
57
|
-
throw await
|
|
57
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
58
58
|
case "ResourceInUseException":
|
|
59
59
|
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
60
|
-
throw await
|
|
60
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
61
61
|
case "ResourceNotFoundException":
|
|
62
62
|
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
63
|
-
throw await
|
|
63
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
64
64
|
default:
|
|
65
65
|
const parsedBody = parsedOutput.body;
|
|
66
66
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -71,21 +71,21 @@ const deserializeAws_json1_1QueryForecastCommandError = async (output, context)
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
const
|
|
74
|
+
const de_QueryWhatIfForecastCommand = async (output, context) => {
|
|
75
75
|
if (output.statusCode >= 300) {
|
|
76
|
-
return
|
|
76
|
+
return de_QueryWhatIfForecastCommandError(output, context);
|
|
77
77
|
}
|
|
78
78
|
const data = await parseBody(output.body, context);
|
|
79
79
|
let contents = {};
|
|
80
|
-
contents =
|
|
80
|
+
contents = de_QueryWhatIfForecastResponse(data, context);
|
|
81
81
|
const response = {
|
|
82
82
|
$metadata: deserializeMetadata(output),
|
|
83
83
|
...contents,
|
|
84
84
|
};
|
|
85
85
|
return Promise.resolve(response);
|
|
86
86
|
};
|
|
87
|
-
exports.
|
|
88
|
-
const
|
|
87
|
+
exports.de_QueryWhatIfForecastCommand = de_QueryWhatIfForecastCommand;
|
|
88
|
+
const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
89
89
|
const parsedOutput = {
|
|
90
90
|
...output,
|
|
91
91
|
body: await parseErrorBody(output.body, context),
|
|
@@ -94,19 +94,19 @@ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, con
|
|
|
94
94
|
switch (errorCode) {
|
|
95
95
|
case "InvalidInputException":
|
|
96
96
|
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
97
|
-
throw await
|
|
97
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
98
98
|
case "InvalidNextTokenException":
|
|
99
99
|
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
100
|
-
throw await
|
|
100
|
+
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
101
101
|
case "LimitExceededException":
|
|
102
102
|
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
103
|
-
throw await
|
|
103
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
104
104
|
case "ResourceInUseException":
|
|
105
105
|
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
106
|
-
throw await
|
|
106
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
107
107
|
case "ResourceNotFoundException":
|
|
108
108
|
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
109
|
-
throw await
|
|
109
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
110
110
|
default:
|
|
111
111
|
const parsedBody = parsedOutput.body;
|
|
112
112
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -117,52 +117,52 @@ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, con
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
const
|
|
120
|
+
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
121
121
|
const body = parsedOutput.body;
|
|
122
|
-
const deserialized =
|
|
122
|
+
const deserialized = de_InvalidInputException(body, context);
|
|
123
123
|
const exception = new models_0_1.InvalidInputException({
|
|
124
124
|
$metadata: deserializeMetadata(parsedOutput),
|
|
125
125
|
...deserialized,
|
|
126
126
|
});
|
|
127
127
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
128
128
|
};
|
|
129
|
-
const
|
|
129
|
+
const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
130
130
|
const body = parsedOutput.body;
|
|
131
|
-
const deserialized =
|
|
131
|
+
const deserialized = de_InvalidNextTokenException(body, context);
|
|
132
132
|
const exception = new models_0_1.InvalidNextTokenException({
|
|
133
133
|
$metadata: deserializeMetadata(parsedOutput),
|
|
134
134
|
...deserialized,
|
|
135
135
|
});
|
|
136
136
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
137
137
|
};
|
|
138
|
-
const
|
|
138
|
+
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
139
139
|
const body = parsedOutput.body;
|
|
140
|
-
const deserialized =
|
|
140
|
+
const deserialized = de_LimitExceededException(body, context);
|
|
141
141
|
const exception = new models_0_1.LimitExceededException({
|
|
142
142
|
$metadata: deserializeMetadata(parsedOutput),
|
|
143
143
|
...deserialized,
|
|
144
144
|
});
|
|
145
145
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
146
146
|
};
|
|
147
|
-
const
|
|
147
|
+
const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
148
148
|
const body = parsedOutput.body;
|
|
149
|
-
const deserialized =
|
|
149
|
+
const deserialized = de_ResourceInUseException(body, context);
|
|
150
150
|
const exception = new models_0_1.ResourceInUseException({
|
|
151
151
|
$metadata: deserializeMetadata(parsedOutput),
|
|
152
152
|
...deserialized,
|
|
153
153
|
});
|
|
154
154
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
155
155
|
};
|
|
156
|
-
const
|
|
156
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
157
157
|
const body = parsedOutput.body;
|
|
158
|
-
const deserialized =
|
|
158
|
+
const deserialized = de_ResourceNotFoundException(body, context);
|
|
159
159
|
const exception = new models_0_1.ResourceNotFoundException({
|
|
160
160
|
$metadata: deserializeMetadata(parsedOutput),
|
|
161
161
|
...deserialized,
|
|
162
162
|
});
|
|
163
163
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
164
164
|
};
|
|
165
|
-
const
|
|
165
|
+
const se_Filters = (input, context) => {
|
|
166
166
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
167
167
|
if (value === null) {
|
|
168
168
|
return acc;
|
|
@@ -171,87 +171,87 @@ const serializeAws_json1_1Filters = (input, context) => {
|
|
|
171
171
|
return acc;
|
|
172
172
|
}, {});
|
|
173
173
|
};
|
|
174
|
-
const
|
|
174
|
+
const se_QueryForecastRequest = (input, context) => {
|
|
175
175
|
return {
|
|
176
176
|
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
177
|
-
...(input.Filters != null && { Filters:
|
|
177
|
+
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
178
178
|
...(input.ForecastArn != null && { ForecastArn: input.ForecastArn }),
|
|
179
179
|
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
180
180
|
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
181
181
|
};
|
|
182
182
|
};
|
|
183
|
-
const
|
|
183
|
+
const se_QueryWhatIfForecastRequest = (input, context) => {
|
|
184
184
|
return {
|
|
185
185
|
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
186
|
-
...(input.Filters != null && { Filters:
|
|
186
|
+
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
187
187
|
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
188
188
|
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
189
189
|
...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
|
|
190
190
|
};
|
|
191
191
|
};
|
|
192
|
-
const
|
|
192
|
+
const de_DataPoint = (output, context) => {
|
|
193
193
|
return {
|
|
194
194
|
Timestamp: (0, smithy_client_1.expectString)(output.Timestamp),
|
|
195
195
|
Value: (0, smithy_client_1.limitedParseDouble)(output.Value),
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
|
-
const
|
|
198
|
+
const de_Forecast = (output, context) => {
|
|
199
199
|
return {
|
|
200
|
-
Predictions: output.Predictions != null ?
|
|
200
|
+
Predictions: output.Predictions != null ? de_Predictions(output.Predictions, context) : undefined,
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
|
-
const
|
|
203
|
+
const de_InvalidInputException = (output, context) => {
|
|
204
204
|
return {
|
|
205
205
|
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
|
-
const
|
|
208
|
+
const de_InvalidNextTokenException = (output, context) => {
|
|
209
209
|
return {
|
|
210
210
|
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
|
-
const
|
|
213
|
+
const de_LimitExceededException = (output, context) => {
|
|
214
214
|
return {
|
|
215
215
|
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
|
-
const
|
|
218
|
+
const de_Predictions = (output, context) => {
|
|
219
219
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
220
220
|
if (value === null) {
|
|
221
221
|
return acc;
|
|
222
222
|
}
|
|
223
|
-
acc[key] =
|
|
223
|
+
acc[key] = de_TimeSeries(value, context);
|
|
224
224
|
return acc;
|
|
225
225
|
}, {});
|
|
226
226
|
};
|
|
227
|
-
const
|
|
227
|
+
const de_QueryForecastResponse = (output, context) => {
|
|
228
228
|
return {
|
|
229
|
-
Forecast: output.Forecast != null ?
|
|
229
|
+
Forecast: output.Forecast != null ? de_Forecast(output.Forecast, context) : undefined,
|
|
230
230
|
};
|
|
231
231
|
};
|
|
232
|
-
const
|
|
232
|
+
const de_QueryWhatIfForecastResponse = (output, context) => {
|
|
233
233
|
return {
|
|
234
|
-
Forecast: output.Forecast != null ?
|
|
234
|
+
Forecast: output.Forecast != null ? de_Forecast(output.Forecast, context) : undefined,
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
|
-
const
|
|
237
|
+
const de_ResourceInUseException = (output, context) => {
|
|
238
238
|
return {
|
|
239
239
|
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
240
240
|
};
|
|
241
241
|
};
|
|
242
|
-
const
|
|
242
|
+
const de_ResourceNotFoundException = (output, context) => {
|
|
243
243
|
return {
|
|
244
244
|
Message: (0, smithy_client_1.expectString)(output.Message),
|
|
245
245
|
};
|
|
246
246
|
};
|
|
247
|
-
const
|
|
247
|
+
const de_TimeSeries = (output, context) => {
|
|
248
248
|
const retVal = (output || [])
|
|
249
249
|
.filter((e) => e != null)
|
|
250
250
|
.map((entry) => {
|
|
251
251
|
if (entry === null) {
|
|
252
252
|
return null;
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return de_DataPoint(entry, context);
|
|
255
255
|
});
|
|
256
256
|
return retVal;
|
|
257
257
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
2
|
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
-
import {
|
|
4
|
+
import { de_QueryForecastCommand, se_QueryForecastCommand } from "../protocols/Aws_json1_1";
|
|
5
5
|
export class QueryForecastCommand extends $Command {
|
|
6
6
|
static getEndpointParameterInstructions() {
|
|
7
7
|
return {
|
|
@@ -33,9 +33,9 @@ export class QueryForecastCommand extends $Command {
|
|
|
33
33
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
34
34
|
}
|
|
35
35
|
serialize(input, context) {
|
|
36
|
-
return
|
|
36
|
+
return se_QueryForecastCommand(input, context);
|
|
37
37
|
}
|
|
38
38
|
deserialize(output, context) {
|
|
39
|
-
return
|
|
39
|
+
return de_QueryForecastCommand(output, context);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
2
|
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
-
import {
|
|
4
|
+
import { de_QueryWhatIfForecastCommand, se_QueryWhatIfForecastCommand } from "../protocols/Aws_json1_1";
|
|
5
5
|
export class QueryWhatIfForecastCommand extends $Command {
|
|
6
6
|
static getEndpointParameterInstructions() {
|
|
7
7
|
return {
|
|
@@ -33,9 +33,9 @@ export class QueryWhatIfForecastCommand extends $Command {
|
|
|
33
33
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
34
34
|
}
|
|
35
35
|
serialize(input, context) {
|
|
36
|
-
return
|
|
36
|
+
return se_QueryWhatIfForecastCommand(input, context);
|
|
37
37
|
}
|
|
38
38
|
deserialize(output, context) {
|
|
39
|
-
return
|
|
39
|
+
return de_QueryWhatIfForecastCommand(output, context);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -2,38 +2,38 @@ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
|
2
2
|
import { decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble, throwDefaultError, } 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
|
-
export const
|
|
5
|
+
export const se_QueryForecastCommand = async (input, context) => {
|
|
6
6
|
const headers = {
|
|
7
7
|
"content-type": "application/x-amz-json-1.1",
|
|
8
8
|
"x-amz-target": "AmazonForecastRuntime.QueryForecast",
|
|
9
9
|
};
|
|
10
10
|
let body;
|
|
11
|
-
body = JSON.stringify(
|
|
11
|
+
body = JSON.stringify(se_QueryForecastRequest(input, context));
|
|
12
12
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
13
|
};
|
|
14
|
-
export const
|
|
14
|
+
export const se_QueryWhatIfForecastCommand = async (input, context) => {
|
|
15
15
|
const headers = {
|
|
16
16
|
"content-type": "application/x-amz-json-1.1",
|
|
17
17
|
"x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
|
|
18
18
|
};
|
|
19
19
|
let body;
|
|
20
|
-
body = JSON.stringify(
|
|
20
|
+
body = JSON.stringify(se_QueryWhatIfForecastRequest(input, context));
|
|
21
21
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
22
|
};
|
|
23
|
-
export const
|
|
23
|
+
export const de_QueryForecastCommand = async (output, context) => {
|
|
24
24
|
if (output.statusCode >= 300) {
|
|
25
|
-
return
|
|
25
|
+
return de_QueryForecastCommandError(output, context);
|
|
26
26
|
}
|
|
27
27
|
const data = await parseBody(output.body, context);
|
|
28
28
|
let contents = {};
|
|
29
|
-
contents =
|
|
29
|
+
contents = de_QueryForecastResponse(data, context);
|
|
30
30
|
const response = {
|
|
31
31
|
$metadata: deserializeMetadata(output),
|
|
32
32
|
...contents,
|
|
33
33
|
};
|
|
34
34
|
return Promise.resolve(response);
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const de_QueryForecastCommandError = async (output, context) => {
|
|
37
37
|
const parsedOutput = {
|
|
38
38
|
...output,
|
|
39
39
|
body: await parseErrorBody(output.body, context),
|
|
@@ -42,19 +42,19 @@ const deserializeAws_json1_1QueryForecastCommandError = async (output, context)
|
|
|
42
42
|
switch (errorCode) {
|
|
43
43
|
case "InvalidInputException":
|
|
44
44
|
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
45
|
-
throw await
|
|
45
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
46
46
|
case "InvalidNextTokenException":
|
|
47
47
|
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
48
|
-
throw await
|
|
48
|
+
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
49
49
|
case "LimitExceededException":
|
|
50
50
|
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
51
|
-
throw await
|
|
51
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
52
52
|
case "ResourceInUseException":
|
|
53
53
|
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
54
|
-
throw await
|
|
54
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
55
55
|
case "ResourceNotFoundException":
|
|
56
56
|
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
57
|
-
throw await
|
|
57
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
58
58
|
default:
|
|
59
59
|
const parsedBody = parsedOutput.body;
|
|
60
60
|
throwDefaultError({
|
|
@@ -65,20 +65,20 @@ const deserializeAws_json1_1QueryForecastCommandError = async (output, context)
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
export const
|
|
68
|
+
export const de_QueryWhatIfForecastCommand = async (output, context) => {
|
|
69
69
|
if (output.statusCode >= 300) {
|
|
70
|
-
return
|
|
70
|
+
return de_QueryWhatIfForecastCommandError(output, context);
|
|
71
71
|
}
|
|
72
72
|
const data = await parseBody(output.body, context);
|
|
73
73
|
let contents = {};
|
|
74
|
-
contents =
|
|
74
|
+
contents = de_QueryWhatIfForecastResponse(data, context);
|
|
75
75
|
const response = {
|
|
76
76
|
$metadata: deserializeMetadata(output),
|
|
77
77
|
...contents,
|
|
78
78
|
};
|
|
79
79
|
return Promise.resolve(response);
|
|
80
80
|
};
|
|
81
|
-
const
|
|
81
|
+
const de_QueryWhatIfForecastCommandError = async (output, context) => {
|
|
82
82
|
const parsedOutput = {
|
|
83
83
|
...output,
|
|
84
84
|
body: await parseErrorBody(output.body, context),
|
|
@@ -87,19 +87,19 @@ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, con
|
|
|
87
87
|
switch (errorCode) {
|
|
88
88
|
case "InvalidInputException":
|
|
89
89
|
case "com.amazonaws.forecastquery#InvalidInputException":
|
|
90
|
-
throw await
|
|
90
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
91
91
|
case "InvalidNextTokenException":
|
|
92
92
|
case "com.amazonaws.forecastquery#InvalidNextTokenException":
|
|
93
|
-
throw await
|
|
93
|
+
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
94
94
|
case "LimitExceededException":
|
|
95
95
|
case "com.amazonaws.forecastquery#LimitExceededException":
|
|
96
|
-
throw await
|
|
96
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
97
97
|
case "ResourceInUseException":
|
|
98
98
|
case "com.amazonaws.forecastquery#ResourceInUseException":
|
|
99
|
-
throw await
|
|
99
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
100
100
|
case "ResourceNotFoundException":
|
|
101
101
|
case "com.amazonaws.forecastquery#ResourceNotFoundException":
|
|
102
|
-
throw await
|
|
102
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
103
103
|
default:
|
|
104
104
|
const parsedBody = parsedOutput.body;
|
|
105
105
|
throwDefaultError({
|
|
@@ -110,52 +110,52 @@ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, con
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
const
|
|
113
|
+
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
114
114
|
const body = parsedOutput.body;
|
|
115
|
-
const deserialized =
|
|
115
|
+
const deserialized = de_InvalidInputException(body, context);
|
|
116
116
|
const exception = new InvalidInputException({
|
|
117
117
|
$metadata: deserializeMetadata(parsedOutput),
|
|
118
118
|
...deserialized,
|
|
119
119
|
});
|
|
120
120
|
return __decorateServiceException(exception, body);
|
|
121
121
|
};
|
|
122
|
-
const
|
|
122
|
+
const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
123
123
|
const body = parsedOutput.body;
|
|
124
|
-
const deserialized =
|
|
124
|
+
const deserialized = de_InvalidNextTokenException(body, context);
|
|
125
125
|
const exception = new InvalidNextTokenException({
|
|
126
126
|
$metadata: deserializeMetadata(parsedOutput),
|
|
127
127
|
...deserialized,
|
|
128
128
|
});
|
|
129
129
|
return __decorateServiceException(exception, body);
|
|
130
130
|
};
|
|
131
|
-
const
|
|
131
|
+
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
132
132
|
const body = parsedOutput.body;
|
|
133
|
-
const deserialized =
|
|
133
|
+
const deserialized = de_LimitExceededException(body, context);
|
|
134
134
|
const exception = new LimitExceededException({
|
|
135
135
|
$metadata: deserializeMetadata(parsedOutput),
|
|
136
136
|
...deserialized,
|
|
137
137
|
});
|
|
138
138
|
return __decorateServiceException(exception, body);
|
|
139
139
|
};
|
|
140
|
-
const
|
|
140
|
+
const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
141
141
|
const body = parsedOutput.body;
|
|
142
|
-
const deserialized =
|
|
142
|
+
const deserialized = de_ResourceInUseException(body, context);
|
|
143
143
|
const exception = new ResourceInUseException({
|
|
144
144
|
$metadata: deserializeMetadata(parsedOutput),
|
|
145
145
|
...deserialized,
|
|
146
146
|
});
|
|
147
147
|
return __decorateServiceException(exception, body);
|
|
148
148
|
};
|
|
149
|
-
const
|
|
149
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
150
150
|
const body = parsedOutput.body;
|
|
151
|
-
const deserialized =
|
|
151
|
+
const deserialized = de_ResourceNotFoundException(body, context);
|
|
152
152
|
const exception = new ResourceNotFoundException({
|
|
153
153
|
$metadata: deserializeMetadata(parsedOutput),
|
|
154
154
|
...deserialized,
|
|
155
155
|
});
|
|
156
156
|
return __decorateServiceException(exception, body);
|
|
157
157
|
};
|
|
158
|
-
const
|
|
158
|
+
const se_Filters = (input, context) => {
|
|
159
159
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
160
160
|
if (value === null) {
|
|
161
161
|
return acc;
|
|
@@ -164,87 +164,87 @@ const serializeAws_json1_1Filters = (input, context) => {
|
|
|
164
164
|
return acc;
|
|
165
165
|
}, {});
|
|
166
166
|
};
|
|
167
|
-
const
|
|
167
|
+
const se_QueryForecastRequest = (input, context) => {
|
|
168
168
|
return {
|
|
169
169
|
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
170
|
-
...(input.Filters != null && { Filters:
|
|
170
|
+
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
171
171
|
...(input.ForecastArn != null && { ForecastArn: input.ForecastArn }),
|
|
172
172
|
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
173
173
|
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
174
174
|
};
|
|
175
175
|
};
|
|
176
|
-
const
|
|
176
|
+
const se_QueryWhatIfForecastRequest = (input, context) => {
|
|
177
177
|
return {
|
|
178
178
|
...(input.EndDate != null && { EndDate: input.EndDate }),
|
|
179
|
-
...(input.Filters != null && { Filters:
|
|
179
|
+
...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
|
|
180
180
|
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
181
181
|
...(input.StartDate != null && { StartDate: input.StartDate }),
|
|
182
182
|
...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
|
-
const
|
|
185
|
+
const de_DataPoint = (output, context) => {
|
|
186
186
|
return {
|
|
187
187
|
Timestamp: __expectString(output.Timestamp),
|
|
188
188
|
Value: __limitedParseDouble(output.Value),
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
|
-
const
|
|
191
|
+
const de_Forecast = (output, context) => {
|
|
192
192
|
return {
|
|
193
|
-
Predictions: output.Predictions != null ?
|
|
193
|
+
Predictions: output.Predictions != null ? de_Predictions(output.Predictions, context) : undefined,
|
|
194
194
|
};
|
|
195
195
|
};
|
|
196
|
-
const
|
|
196
|
+
const de_InvalidInputException = (output, context) => {
|
|
197
197
|
return {
|
|
198
198
|
Message: __expectString(output.Message),
|
|
199
199
|
};
|
|
200
200
|
};
|
|
201
|
-
const
|
|
201
|
+
const de_InvalidNextTokenException = (output, context) => {
|
|
202
202
|
return {
|
|
203
203
|
Message: __expectString(output.Message),
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
|
-
const
|
|
206
|
+
const de_LimitExceededException = (output, context) => {
|
|
207
207
|
return {
|
|
208
208
|
Message: __expectString(output.Message),
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
const
|
|
211
|
+
const de_Predictions = (output, context) => {
|
|
212
212
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
213
213
|
if (value === null) {
|
|
214
214
|
return acc;
|
|
215
215
|
}
|
|
216
|
-
acc[key] =
|
|
216
|
+
acc[key] = de_TimeSeries(value, context);
|
|
217
217
|
return acc;
|
|
218
218
|
}, {});
|
|
219
219
|
};
|
|
220
|
-
const
|
|
220
|
+
const de_QueryForecastResponse = (output, context) => {
|
|
221
221
|
return {
|
|
222
|
-
Forecast: output.Forecast != null ?
|
|
222
|
+
Forecast: output.Forecast != null ? de_Forecast(output.Forecast, context) : undefined,
|
|
223
223
|
};
|
|
224
224
|
};
|
|
225
|
-
const
|
|
225
|
+
const de_QueryWhatIfForecastResponse = (output, context) => {
|
|
226
226
|
return {
|
|
227
|
-
Forecast: output.Forecast != null ?
|
|
227
|
+
Forecast: output.Forecast != null ? de_Forecast(output.Forecast, context) : undefined,
|
|
228
228
|
};
|
|
229
229
|
};
|
|
230
|
-
const
|
|
230
|
+
const de_ResourceInUseException = (output, context) => {
|
|
231
231
|
return {
|
|
232
232
|
Message: __expectString(output.Message),
|
|
233
233
|
};
|
|
234
234
|
};
|
|
235
|
-
const
|
|
235
|
+
const de_ResourceNotFoundException = (output, context) => {
|
|
236
236
|
return {
|
|
237
237
|
Message: __expectString(output.Message),
|
|
238
238
|
};
|
|
239
239
|
};
|
|
240
|
-
const
|
|
240
|
+
const de_TimeSeries = (output, context) => {
|
|
241
241
|
const retVal = (output || [])
|
|
242
242
|
.filter((e) => e != null)
|
|
243
243
|
.map((entry) => {
|
|
244
244
|
if (entry === null) {
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return de_DataPoint(entry, context);
|
|
248
248
|
});
|
|
249
249
|
return retVal;
|
|
250
250
|
};
|
|
@@ -2,7 +2,19 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@a
|
|
|
2
2
|
import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
|
|
3
3
|
import { QueryForecastCommandInput, QueryForecastCommandOutput } from "../commands/QueryForecastCommand";
|
|
4
4
|
import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "../commands/QueryWhatIfForecastCommand";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
5
|
+
/**
|
|
6
|
+
* serializeAws_json1_1QueryForecastCommand
|
|
7
|
+
*/
|
|
8
|
+
export declare const se_QueryForecastCommand: (input: QueryForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
9
|
+
/**
|
|
10
|
+
* serializeAws_json1_1QueryWhatIfForecastCommand
|
|
11
|
+
*/
|
|
12
|
+
export declare const se_QueryWhatIfForecastCommand: (input: QueryWhatIfForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
13
|
+
/**
|
|
14
|
+
* deserializeAws_json1_1QueryForecastCommand
|
|
15
|
+
*/
|
|
16
|
+
export declare const de_QueryForecastCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryForecastCommandOutput>;
|
|
17
|
+
/**
|
|
18
|
+
* deserializeAws_json1_1QueryWhatIfForecastCommand
|
|
19
|
+
*/
|
|
20
|
+
export declare const de_QueryWhatIfForecastCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryWhatIfForecastCommandOutput>;
|
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
QueryWhatIfForecastCommandInput,
|
|
12
12
|
QueryWhatIfForecastCommandOutput,
|
|
13
13
|
} from "../commands/QueryWhatIfForecastCommand";
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const se_QueryForecastCommand: (
|
|
15
15
|
input: QueryForecastCommandInput,
|
|
16
16
|
context: __SerdeContext
|
|
17
17
|
) => Promise<__HttpRequest>;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const se_QueryWhatIfForecastCommand: (
|
|
19
19
|
input: QueryWhatIfForecastCommandInput,
|
|
20
20
|
context: __SerdeContext
|
|
21
21
|
) => Promise<__HttpRequest>;
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const de_QueryForecastCommand: (
|
|
23
23
|
output: __HttpResponse,
|
|
24
24
|
context: __SerdeContext
|
|
25
25
|
) => Promise<QueryForecastCommandOutput>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const de_QueryWhatIfForecastCommand: (
|
|
27
27
|
output: __HttpResponse,
|
|
28
28
|
context: __SerdeContext
|
|
29
29
|
) => Promise<QueryWhatIfForecastCommandOutput>;
|
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.309.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,37 +21,37 @@
|
|
|
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.
|
|
25
|
-
"@aws-sdk/config-resolver": "3.
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
27
|
-
"@aws-sdk/fetch-http-handler": "3.
|
|
28
|
-
"@aws-sdk/hash-node": "3.
|
|
29
|
-
"@aws-sdk/invalid-dependency": "3.
|
|
30
|
-
"@aws-sdk/middleware-content-length": "3.
|
|
31
|
-
"@aws-sdk/middleware-endpoint": "3.
|
|
32
|
-
"@aws-sdk/middleware-host-header": "3.
|
|
33
|
-
"@aws-sdk/middleware-logger": "3.
|
|
34
|
-
"@aws-sdk/middleware-recursion-detection": "3.
|
|
35
|
-
"@aws-sdk/middleware-retry": "3.
|
|
36
|
-
"@aws-sdk/middleware-serde": "3.
|
|
37
|
-
"@aws-sdk/middleware-signing": "3.
|
|
38
|
-
"@aws-sdk/middleware-stack": "3.
|
|
39
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
40
|
-
"@aws-sdk/node-config-provider": "3.
|
|
41
|
-
"@aws-sdk/node-http-handler": "3.
|
|
42
|
-
"@aws-sdk/protocol-http": "3.
|
|
43
|
-
"@aws-sdk/smithy-client": "3.
|
|
44
|
-
"@aws-sdk/types": "3.
|
|
45
|
-
"@aws-sdk/url-parser": "3.
|
|
24
|
+
"@aws-sdk/client-sts": "3.309.0",
|
|
25
|
+
"@aws-sdk/config-resolver": "3.306.0",
|
|
26
|
+
"@aws-sdk/credential-provider-node": "3.309.0",
|
|
27
|
+
"@aws-sdk/fetch-http-handler": "3.306.0",
|
|
28
|
+
"@aws-sdk/hash-node": "3.306.0",
|
|
29
|
+
"@aws-sdk/invalid-dependency": "3.306.0",
|
|
30
|
+
"@aws-sdk/middleware-content-length": "3.306.0",
|
|
31
|
+
"@aws-sdk/middleware-endpoint": "3.306.0",
|
|
32
|
+
"@aws-sdk/middleware-host-header": "3.306.0",
|
|
33
|
+
"@aws-sdk/middleware-logger": "3.306.0",
|
|
34
|
+
"@aws-sdk/middleware-recursion-detection": "3.306.0",
|
|
35
|
+
"@aws-sdk/middleware-retry": "3.306.0",
|
|
36
|
+
"@aws-sdk/middleware-serde": "3.306.0",
|
|
37
|
+
"@aws-sdk/middleware-signing": "3.306.0",
|
|
38
|
+
"@aws-sdk/middleware-stack": "3.306.0",
|
|
39
|
+
"@aws-sdk/middleware-user-agent": "3.306.0",
|
|
40
|
+
"@aws-sdk/node-config-provider": "3.306.0",
|
|
41
|
+
"@aws-sdk/node-http-handler": "3.306.0",
|
|
42
|
+
"@aws-sdk/protocol-http": "3.306.0",
|
|
43
|
+
"@aws-sdk/smithy-client": "3.309.0",
|
|
44
|
+
"@aws-sdk/types": "3.306.0",
|
|
45
|
+
"@aws-sdk/url-parser": "3.306.0",
|
|
46
46
|
"@aws-sdk/util-base64": "3.303.0",
|
|
47
47
|
"@aws-sdk/util-body-length-browser": "3.303.0",
|
|
48
48
|
"@aws-sdk/util-body-length-node": "3.303.0",
|
|
49
|
-
"@aws-sdk/util-defaults-mode-browser": "3.
|
|
50
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
51
|
-
"@aws-sdk/util-endpoints": "3.
|
|
52
|
-
"@aws-sdk/util-retry": "3.
|
|
53
|
-
"@aws-sdk/util-user-agent-browser": "3.
|
|
54
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
49
|
+
"@aws-sdk/util-defaults-mode-browser": "3.309.0",
|
|
50
|
+
"@aws-sdk/util-defaults-mode-node": "3.309.0",
|
|
51
|
+
"@aws-sdk/util-endpoints": "3.306.0",
|
|
52
|
+
"@aws-sdk/util-retry": "3.306.0",
|
|
53
|
+
"@aws-sdk/util-user-agent-browser": "3.306.0",
|
|
54
|
+
"@aws-sdk/util-user-agent-node": "3.306.0",
|
|
55
55
|
"@aws-sdk/util-utf8": "3.303.0",
|
|
56
56
|
"tslib": "^2.5.0"
|
|
57
57
|
},
|