@aws-sdk/client-forecastquery 3.150.0 → 3.159.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 CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.159.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.158.0...v3.159.0) (2022-08-26)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-forecastquery
9
+
10
+
11
+
12
+
13
+
14
+ # [3.155.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.154.0...v3.155.0) (2022-08-22)
15
+
16
+
17
+ ### Features
18
+
19
+ * **client-forecastquery:** releasing What-If Analysis APIs ([f9cb16a](https://github.com/aws/aws-sdk-js-v3/commit/f9cb16a3a5278a2e8738dd41ca6e42befca3ac97))
20
+
21
+
22
+
23
+
24
+
25
+ # [3.154.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.153.0...v3.154.0) (2022-08-19)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/client-forecastquery
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.150.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.149.0...v3.150.0) (2022-08-15)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-forecastquery
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Forecastquery = void 0;
4
4
  const QueryForecastCommand_1 = require("./commands/QueryForecastCommand");
5
+ const QueryWhatIfForecastCommand_1 = require("./commands/QueryWhatIfForecastCommand");
5
6
  const ForecastqueryClient_1 = require("./ForecastqueryClient");
6
7
  class Forecastquery extends ForecastqueryClient_1.ForecastqueryClient {
7
8
  queryForecast(args, optionsOrCb, cb) {
@@ -18,5 +19,19 @@ class Forecastquery extends ForecastqueryClient_1.ForecastqueryClient {
18
19
  return this.send(command, optionsOrCb);
19
20
  }
20
21
  }
22
+ queryWhatIfForecast(args, optionsOrCb, cb) {
23
+ const command = new QueryWhatIfForecastCommand_1.QueryWhatIfForecastCommand(args);
24
+ if (typeof optionsOrCb === "function") {
25
+ this.send(command, optionsOrCb);
26
+ }
27
+ else if (typeof cb === "function") {
28
+ if (typeof optionsOrCb !== "object")
29
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
30
+ this.send(command, optionsOrCb || {}, cb);
31
+ }
32
+ else {
33
+ return this.send(command, optionsOrCb);
34
+ }
35
+ }
21
36
  }
22
37
  exports.Forecastquery = Forecastquery;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryWhatIfForecastCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
+ class QueryWhatIfForecastCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "ForecastqueryClient";
18
+ const commandName = "QueryWhatIfForecastCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.QueryWhatIfForecastRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.QueryWhatIfForecastResponseFilterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_json1_1_1.serializeAws_json1_1QueryWhatIfForecastCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_json1_1_1.deserializeAws_json1_1QueryWhatIfForecastCommand)(output, context);
34
+ }
35
+ }
36
+ exports.QueryWhatIfForecastCommand = QueryWhatIfForecastCommand;
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./QueryForecastCommand"), exports);
5
+ tslib_1.__exportStar(require("./QueryWhatIfForecastCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryForecastResponseFilterSensitiveLog = exports.ForecastFilterSensitiveLog = exports.DataPointFilterSensitiveLog = exports.QueryForecastRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.ResourceInUseException = exports.LimitExceededException = exports.InvalidNextTokenException = exports.InvalidInputException = void 0;
3
+ exports.QueryWhatIfForecastResponseFilterSensitiveLog = exports.QueryWhatIfForecastRequestFilterSensitiveLog = exports.QueryForecastResponseFilterSensitiveLog = exports.ForecastFilterSensitiveLog = exports.DataPointFilterSensitiveLog = exports.QueryForecastRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.ResourceInUseException = exports.LimitExceededException = exports.InvalidNextTokenException = exports.InvalidInputException = void 0;
4
4
  const ForecastqueryServiceException_1 = require("./ForecastqueryServiceException");
5
5
  class InvalidInputException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
6
6
  constructor(opts) {
@@ -88,3 +88,11 @@ const QueryForecastResponseFilterSensitiveLog = (obj) => ({
88
88
  ...obj,
89
89
  });
90
90
  exports.QueryForecastResponseFilterSensitiveLog = QueryForecastResponseFilterSensitiveLog;
91
+ const QueryWhatIfForecastRequestFilterSensitiveLog = (obj) => ({
92
+ ...obj,
93
+ });
94
+ exports.QueryWhatIfForecastRequestFilterSensitiveLog = QueryWhatIfForecastRequestFilterSensitiveLog;
95
+ const QueryWhatIfForecastResponseFilterSensitiveLog = (obj) => ({
96
+ ...obj,
97
+ });
98
+ exports.QueryWhatIfForecastResponseFilterSensitiveLog = QueryWhatIfForecastResponseFilterSensitiveLog;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_json1_1QueryForecastCommand = exports.serializeAws_json1_1QueryForecastCommand = void 0;
3
+ exports.deserializeAws_json1_1QueryWhatIfForecastCommand = exports.deserializeAws_json1_1QueryForecastCommand = exports.serializeAws_json1_1QueryWhatIfForecastCommand = exports.serializeAws_json1_1QueryForecastCommand = 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");
@@ -15,6 +15,16 @@ const serializeAws_json1_1QueryForecastCommand = async (input, context) => {
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  exports.serializeAws_json1_1QueryForecastCommand = serializeAws_json1_1QueryForecastCommand;
18
+ const serializeAws_json1_1QueryWhatIfForecastCommand = async (input, context) => {
19
+ const headers = {
20
+ "content-type": "application/x-amz-json-1.1",
21
+ "x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
22
+ };
23
+ let body;
24
+ body = JSON.stringify(serializeAws_json1_1QueryWhatIfForecastRequest(input, context));
25
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
+ };
27
+ exports.serializeAws_json1_1QueryWhatIfForecastCommand = serializeAws_json1_1QueryWhatIfForecastCommand;
18
28
  const deserializeAws_json1_1QueryForecastCommand = async (output, context) => {
19
29
  if (output.statusCode >= 300) {
20
30
  return deserializeAws_json1_1QueryForecastCommandError(output, context);
@@ -61,6 +71,52 @@ const deserializeAws_json1_1QueryForecastCommandError = async (output, context)
61
71
  });
62
72
  }
63
73
  };
74
+ const deserializeAws_json1_1QueryWhatIfForecastCommand = async (output, context) => {
75
+ if (output.statusCode >= 300) {
76
+ return deserializeAws_json1_1QueryWhatIfForecastCommandError(output, context);
77
+ }
78
+ const data = await parseBody(output.body, context);
79
+ let contents = {};
80
+ contents = deserializeAws_json1_1QueryWhatIfForecastResponse(data, context);
81
+ const response = {
82
+ $metadata: deserializeMetadata(output),
83
+ ...contents,
84
+ };
85
+ return Promise.resolve(response);
86
+ };
87
+ exports.deserializeAws_json1_1QueryWhatIfForecastCommand = deserializeAws_json1_1QueryWhatIfForecastCommand;
88
+ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async (output, context) => {
89
+ const parsedOutput = {
90
+ ...output,
91
+ body: await parseBody(output.body, context),
92
+ };
93
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
94
+ switch (errorCode) {
95
+ case "InvalidInputException":
96
+ case "com.amazonaws.forecastquery#InvalidInputException":
97
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
98
+ case "InvalidNextTokenException":
99
+ case "com.amazonaws.forecastquery#InvalidNextTokenException":
100
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
101
+ case "LimitExceededException":
102
+ case "com.amazonaws.forecastquery#LimitExceededException":
103
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
104
+ case "ResourceInUseException":
105
+ case "com.amazonaws.forecastquery#ResourceInUseException":
106
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
107
+ case "ResourceNotFoundException":
108
+ case "com.amazonaws.forecastquery#ResourceNotFoundException":
109
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
110
+ default:
111
+ const parsedBody = parsedOutput.body;
112
+ (0, smithy_client_1.throwDefaultError)({
113
+ output,
114
+ parsedBody,
115
+ exceptionCtor: ForecastqueryServiceException_1.ForecastqueryServiceException,
116
+ errorCode,
117
+ });
118
+ }
119
+ };
64
120
  const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
65
121
  const body = parsedOutput.body;
66
122
  const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
@@ -126,6 +182,15 @@ const serializeAws_json1_1QueryForecastRequest = (input, context) => {
126
182
  ...(input.StartDate != null && { StartDate: input.StartDate }),
127
183
  };
128
184
  };
185
+ const serializeAws_json1_1QueryWhatIfForecastRequest = (input, context) => {
186
+ return {
187
+ ...(input.EndDate != null && { EndDate: input.EndDate }),
188
+ ...(input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
189
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
190
+ ...(input.StartDate != null && { StartDate: input.StartDate }),
191
+ ...(input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }),
192
+ };
193
+ };
129
194
  const deserializeAws_json1_1DataPoint = (output, context) => {
130
195
  return {
131
196
  Timestamp: (0, smithy_client_1.expectString)(output.Timestamp),
@@ -168,6 +233,11 @@ const deserializeAws_json1_1QueryForecastResponse = (output, context) => {
168
233
  Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
169
234
  };
170
235
  };
236
+ const deserializeAws_json1_1QueryWhatIfForecastResponse = (output, context) => {
237
+ return {
238
+ Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
239
+ };
240
+ };
171
241
  const deserializeAws_json1_1ResourceInUseException = (output, context) => {
172
242
  return {
173
243
  Message: (0, smithy_client_1.expectString)(output.Message),
@@ -1,5 +1,6 @@
1
1
  import { __extends } from "tslib";
2
2
  import { QueryForecastCommand, } from "./commands/QueryForecastCommand";
3
+ import { QueryWhatIfForecastCommand, } from "./commands/QueryWhatIfForecastCommand";
3
4
  import { ForecastqueryClient } from "./ForecastqueryClient";
4
5
  var Forecastquery = (function (_super) {
5
6
  __extends(Forecastquery, _super);
@@ -20,6 +21,20 @@ var Forecastquery = (function (_super) {
20
21
  return this.send(command, optionsOrCb);
21
22
  }
22
23
  };
24
+ Forecastquery.prototype.queryWhatIfForecast = function (args, optionsOrCb, cb) {
25
+ var command = new QueryWhatIfForecastCommand(args);
26
+ if (typeof optionsOrCb === "function") {
27
+ this.send(command, optionsOrCb);
28
+ }
29
+ else if (typeof cb === "function") {
30
+ if (typeof optionsOrCb !== "object")
31
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
32
+ this.send(command, optionsOrCb || {}, cb);
33
+ }
34
+ else {
35
+ return this.send(command, optionsOrCb);
36
+ }
37
+ };
23
38
  return Forecastquery;
24
39
  }(ForecastqueryClient));
25
40
  export { Forecastquery };
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { QueryWhatIfForecastRequestFilterSensitiveLog, QueryWhatIfForecastResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_json1_1QueryWhatIfForecastCommand, serializeAws_json1_1QueryWhatIfForecastCommand, } from "../protocols/Aws_json1_1";
6
+ var QueryWhatIfForecastCommand = (function (_super) {
7
+ __extends(QueryWhatIfForecastCommand, _super);
8
+ function QueryWhatIfForecastCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ QueryWhatIfForecastCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "ForecastqueryClient";
18
+ var commandName = "QueryWhatIfForecastCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: QueryWhatIfForecastRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: QueryWhatIfForecastResponseFilterSensitiveLog,
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ QueryWhatIfForecastCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_json1_1QueryWhatIfForecastCommand(input, context);
33
+ };
34
+ QueryWhatIfForecastCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_json1_1QueryWhatIfForecastCommand(output, context);
36
+ };
37
+ return QueryWhatIfForecastCommand;
38
+ }($Command));
39
+ export { QueryWhatIfForecastCommand };
@@ -1 +1,2 @@
1
1
  export * from "./QueryForecastCommand";
2
+ export * from "./QueryWhatIfForecastCommand";
@@ -69,3 +69,5 @@ export var QueryForecastRequestFilterSensitiveLog = function (obj) { return (__a
69
69
  export var DataPointFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
70
70
  export var ForecastFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
71
71
  export var QueryForecastResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
72
+ export var QueryWhatIfForecastRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
73
+ export var QueryWhatIfForecastResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -14,6 +14,17 @@ export var serializeAws_json1_1QueryForecastCommand = function (input, context)
14
14
  return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
15
  });
16
16
  }); };
17
+ export var serializeAws_json1_1QueryWhatIfForecastCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
+ var headers, body;
19
+ return __generator(this, function (_a) {
20
+ headers = {
21
+ "content-type": "application/x-amz-json-1.1",
22
+ "x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast",
23
+ };
24
+ body = JSON.stringify(serializeAws_json1_1QueryWhatIfForecastRequest(input, context));
25
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
+ });
27
+ }); };
17
28
  export var deserializeAws_json1_1QueryForecastCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
18
29
  var data, contents, response;
19
30
  return __generator(this, function (_a) {
@@ -81,6 +92,73 @@ var deserializeAws_json1_1QueryForecastCommandError = function (output, context)
81
92
  }
82
93
  });
83
94
  }); };
95
+ export var deserializeAws_json1_1QueryWhatIfForecastCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
96
+ var data, contents, response;
97
+ return __generator(this, function (_a) {
98
+ switch (_a.label) {
99
+ case 0:
100
+ if (output.statusCode >= 300) {
101
+ return [2, deserializeAws_json1_1QueryWhatIfForecastCommandError(output, context)];
102
+ }
103
+ return [4, parseBody(output.body, context)];
104
+ case 1:
105
+ data = _a.sent();
106
+ contents = {};
107
+ contents = deserializeAws_json1_1QueryWhatIfForecastResponse(data, context);
108
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
109
+ return [2, Promise.resolve(response)];
110
+ }
111
+ });
112
+ }); };
113
+ var deserializeAws_json1_1QueryWhatIfForecastCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
114
+ var parsedOutput, _a, errorCode, _b, parsedBody;
115
+ var _c;
116
+ return __generator(this, function (_d) {
117
+ switch (_d.label) {
118
+ case 0:
119
+ _a = [__assign({}, output)];
120
+ _c = {};
121
+ return [4, parseBody(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
+ }); };
84
162
  var deserializeAws_json1_1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
85
163
  var body, deserialized, exception;
86
164
  return __generator(this, function (_a) {
@@ -139,6 +217,9 @@ var serializeAws_json1_1Filters = function (input, context) {
139
217
  var serializeAws_json1_1QueryForecastRequest = function (input, context) {
140
218
  return __assign(__assign(__assign(__assign(__assign({}, (input.EndDate != null && { EndDate: input.EndDate })), (input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) })), (input.ForecastArn != null && { ForecastArn: input.ForecastArn })), (input.NextToken != null && { NextToken: input.NextToken })), (input.StartDate != null && { StartDate: input.StartDate }));
141
219
  };
220
+ var serializeAws_json1_1QueryWhatIfForecastRequest = function (input, context) {
221
+ return __assign(__assign(__assign(__assign(__assign({}, (input.EndDate != null && { EndDate: input.EndDate })), (input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) })), (input.NextToken != null && { NextToken: input.NextToken })), (input.StartDate != null && { StartDate: input.StartDate })), (input.WhatIfForecastArn != null && { WhatIfForecastArn: input.WhatIfForecastArn }));
222
+ };
142
223
  var deserializeAws_json1_1DataPoint = function (output, context) {
143
224
  return {
144
225
  Timestamp: __expectString(output.Timestamp),
@@ -180,6 +261,11 @@ var deserializeAws_json1_1QueryForecastResponse = function (output, context) {
180
261
  Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
181
262
  };
182
263
  };
264
+ var deserializeAws_json1_1QueryWhatIfForecastResponse = function (output, context) {
265
+ return {
266
+ Forecast: output.Forecast != null ? deserializeAws_json1_1Forecast(output.Forecast, context) : undefined,
267
+ };
268
+ };
183
269
  var deserializeAws_json1_1ResourceInUseException = function (output, context) {
184
270
  return {
185
271
  Message: __expectString(output.Message),
@@ -1,5 +1,6 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "./commands/QueryForecastCommand";
3
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "./commands/QueryWhatIfForecastCommand";
3
4
  import { ForecastqueryClient } from "./ForecastqueryClient";
4
5
  /**
5
6
  * <p>Provides APIs for creating and managing Amazon Forecast resources.</p>
@@ -22,4 +23,10 @@ export declare class Forecastquery extends ForecastqueryClient {
22
23
  queryForecast(args: QueryForecastCommandInput, options?: __HttpHandlerOptions): Promise<QueryForecastCommandOutput>;
23
24
  queryForecast(args: QueryForecastCommandInput, cb: (err: any, data?: QueryForecastCommandOutput) => void): void;
24
25
  queryForecast(args: QueryForecastCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryForecastCommandOutput) => void): void;
26
+ /**
27
+ * <p>Retrieves a what-if forecast.</p>
28
+ */
29
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, options?: __HttpHandlerOptions): Promise<QueryWhatIfForecastCommandOutput>;
30
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, cb: (err: any, data?: QueryWhatIfForecastCommandOutput) => void): void;
31
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryWhatIfForecastCommandOutput) => void): void;
25
32
  }
@@ -7,8 +7,9 @@ import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
7
7
  import { Client as __Client, DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client";
8
8
  import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
9
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "./commands/QueryForecastCommand";
10
- export declare type ServiceInputTypes = QueryForecastCommandInput;
11
- export declare type ServiceOutputTypes = QueryForecastCommandOutput;
10
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "./commands/QueryWhatIfForecastCommand";
11
+ export declare type ServiceInputTypes = QueryForecastCommandInput | QueryWhatIfForecastCommandInput;
12
+ export declare type ServiceOutputTypes = QueryForecastCommandOutput | QueryWhatIfForecastCommandOutput;
12
13
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
13
14
  /**
14
15
  * The HTTP handler to use. Fetch in browser and Https in Nodejs.
@@ -0,0 +1,35 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { ForecastqueryClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ForecastqueryClient";
4
+ import { QueryWhatIfForecastRequest, QueryWhatIfForecastResponse } from "../models/models_0";
5
+ export interface QueryWhatIfForecastCommandInput extends QueryWhatIfForecastRequest {
6
+ }
7
+ export interface QueryWhatIfForecastCommandOutput extends QueryWhatIfForecastResponse, __MetadataBearer {
8
+ }
9
+ /**
10
+ * <p>Retrieves a what-if forecast.</p>
11
+ * @example
12
+ * Use a bare-bones client and the command you need to make an API call.
13
+ * ```javascript
14
+ * import { ForecastqueryClient, QueryWhatIfForecastCommand } from "@aws-sdk/client-forecastquery"; // ES Modules import
15
+ * // const { ForecastqueryClient, QueryWhatIfForecastCommand } = require("@aws-sdk/client-forecastquery"); // CommonJS import
16
+ * const client = new ForecastqueryClient(config);
17
+ * const command = new QueryWhatIfForecastCommand(input);
18
+ * const response = await client.send(command);
19
+ * ```
20
+ *
21
+ * @see {@link QueryWhatIfForecastCommandInput} for command's `input` shape.
22
+ * @see {@link QueryWhatIfForecastCommandOutput} for command's `response` shape.
23
+ * @see {@link ForecastqueryClientResolvedConfig | config} for ForecastqueryClient's `config` shape.
24
+ *
25
+ */
26
+ export declare class QueryWhatIfForecastCommand extends $Command<QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput, ForecastqueryClientResolvedConfig> {
27
+ readonly input: QueryWhatIfForecastCommandInput;
28
+ constructor(input: QueryWhatIfForecastCommandInput);
29
+ /**
30
+ * @internal
31
+ */
32
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: ForecastqueryClientResolvedConfig, options?: __HttpHandlerOptions): Handler<QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput>;
33
+ private serialize;
34
+ private deserialize;
35
+ }
@@ -1 +1,2 @@
1
1
  export * from "./QueryForecastCommand";
2
+ export * from "./QueryWhatIfForecastCommand";
@@ -103,6 +103,8 @@ export interface Forecast {
103
103
  * <p>p90</p>
104
104
  * </li>
105
105
  * </ul>
106
+ * <p>The default setting is <code>["0.1", "0.5", "0.9"]</code>. Use the optional <code>ForecastTypes</code> parameter of the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateForecast.html">CreateForecast</a> operation to change the values. The values will vary depending on how this is set, with a minimum of <code>1</code> and a maximum of <code>5.</code>
107
+ * </p>
106
108
  */
107
109
  Predictions?: Record<string, DataPoint[]>;
108
110
  }
@@ -137,6 +139,44 @@ export declare class ResourceNotFoundException extends __BaseException {
137
139
  */
138
140
  constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
139
141
  }
142
+ export interface QueryWhatIfForecastRequest {
143
+ /**
144
+ * <p>The Amazon Resource Name (ARN) of the what-if forecast to query.</p>
145
+ */
146
+ WhatIfForecastArn: string | undefined;
147
+ /**
148
+ * <p>The start date for the what-if forecast. Specify the date using this format: yyyy-MM-dd'T'HH:mm:ss
149
+ * (ISO 8601 format). For example, 2015-01-01T08:00:00.</p>
150
+ */
151
+ StartDate?: string;
152
+ /**
153
+ * <p>The end date for the what-if forecast. Specify the date using this format: yyyy-MM-dd'T'HH:mm:ss
154
+ * (ISO 8601 format). For example, 2015-01-01T20:00:00. </p>
155
+ */
156
+ EndDate?: string;
157
+ /**
158
+ * <p>The filtering criteria to apply when retrieving the forecast. For example, to get the
159
+ * forecast for <code>client_21</code> in the electricity usage dataset, specify the
160
+ * following:</p>
161
+ * <p>
162
+ * <code>{"item_id" : "client_21"}</code>
163
+ * </p>
164
+ * <p>To get the full what-if forecast, use the <a href="https://docs.aws.amazon.com/en_us/forecast/latest/dg/API_CreateWhatIfForecastExport.html">CreateForecastExportJob</a> operation.</p>
165
+ */
166
+ Filters: Record<string, string> | undefined;
167
+ /**
168
+ * <p>If the result of the previous request was truncated, the response includes a
169
+ * <code>NextToken</code>. To retrieve the next set of results, use the token in the next
170
+ * request. Tokens expire after 24 hours.</p>
171
+ */
172
+ NextToken?: string;
173
+ }
174
+ export interface QueryWhatIfForecastResponse {
175
+ /**
176
+ * <p>Provides information about a forecast. Returned as part of the <a>QueryForecast</a> response.</p>
177
+ */
178
+ Forecast?: Forecast;
179
+ }
140
180
  /**
141
181
  * @internal
142
182
  */
@@ -153,3 +193,11 @@ export declare const ForecastFilterSensitiveLog: (obj: Forecast) => any;
153
193
  * @internal
154
194
  */
155
195
  export declare const QueryForecastResponseFilterSensitiveLog: (obj: QueryForecastResponse) => any;
196
+ /**
197
+ * @internal
198
+ */
199
+ export declare const QueryWhatIfForecastRequestFilterSensitiveLog: (obj: QueryWhatIfForecastRequest) => any;
200
+ /**
201
+ * @internal
202
+ */
203
+ export declare const QueryWhatIfForecastResponseFilterSensitiveLog: (obj: QueryWhatIfForecastResponse) => any;
@@ -1,5 +1,8 @@
1
1
  import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
2
  import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
3
3
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "../commands/QueryForecastCommand";
4
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "../commands/QueryWhatIfForecastCommand";
4
5
  export declare const serializeAws_json1_1QueryForecastCommand: (input: QueryForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
6
+ export declare const serializeAws_json1_1QueryWhatIfForecastCommand: (input: QueryWhatIfForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
5
7
  export declare const deserializeAws_json1_1QueryForecastCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryForecastCommandOutput>;
8
+ export declare const deserializeAws_json1_1QueryWhatIfForecastCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryWhatIfForecastCommandOutput>;
@@ -1,5 +1,6 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "./commands/QueryForecastCommand";
3
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "./commands/QueryWhatIfForecastCommand";
3
4
  import { ForecastqueryClient } from "./ForecastqueryClient";
4
5
 
5
6
  export declare class Forecastquery extends ForecastqueryClient {
@@ -7,4 +8,8 @@ export declare class Forecastquery extends ForecastqueryClient {
7
8
  queryForecast(args: QueryForecastCommandInput, options?: __HttpHandlerOptions): Promise<QueryForecastCommandOutput>;
8
9
  queryForecast(args: QueryForecastCommandInput, cb: (err: any, data?: QueryForecastCommandOutput) => void): void;
9
10
  queryForecast(args: QueryForecastCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryForecastCommandOutput) => void): void;
11
+
12
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, options?: __HttpHandlerOptions): Promise<QueryWhatIfForecastCommandOutput>;
13
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, cb: (err: any, data?: QueryWhatIfForecastCommandOutput) => void): void;
14
+ queryWhatIfForecast(args: QueryWhatIfForecastCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryWhatIfForecastCommandOutput) => void): void;
10
15
  }
@@ -7,8 +7,9 @@ import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
7
7
  import { Client as __Client, DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client";
8
8
  import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
9
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "./commands/QueryForecastCommand";
10
- export declare type ServiceInputTypes = QueryForecastCommandInput;
11
- export declare type ServiceOutputTypes = QueryForecastCommandOutput;
10
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "./commands/QueryWhatIfForecastCommand";
11
+ export declare type ServiceInputTypes = QueryForecastCommandInput | QueryWhatIfForecastCommandInput;
12
+ export declare type ServiceOutputTypes = QueryForecastCommandOutput | QueryWhatIfForecastCommandOutput;
12
13
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
13
14
 
14
15
  requestHandler?: __HttpHandler;
@@ -0,0 +1,17 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { ForecastqueryClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ForecastqueryClient";
4
+ import { QueryWhatIfForecastRequest, QueryWhatIfForecastResponse } from "../models/models_0";
5
+ export interface QueryWhatIfForecastCommandInput extends QueryWhatIfForecastRequest {
6
+ }
7
+ export interface QueryWhatIfForecastCommandOutput extends QueryWhatIfForecastResponse, __MetadataBearer {
8
+ }
9
+
10
+ export declare class QueryWhatIfForecastCommand extends $Command<QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput, ForecastqueryClientResolvedConfig> {
11
+ readonly input: QueryWhatIfForecastCommandInput;
12
+ constructor(input: QueryWhatIfForecastCommandInput);
13
+
14
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: ForecastqueryClientResolvedConfig, options?: __HttpHandlerOptions): Handler<QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput>;
15
+ private serialize;
16
+ private deserialize;
17
+ }
@@ -1 +1,2 @@
1
1
  export * from "./QueryForecastCommand";
2
+ export * from "./QueryWhatIfForecastCommand";
@@ -68,6 +68,22 @@ export declare class ResourceNotFoundException extends __BaseException {
68
68
 
69
69
  constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
70
70
  }
71
+ export interface QueryWhatIfForecastRequest {
72
+
73
+ WhatIfForecastArn: string | undefined;
74
+
75
+ StartDate?: string;
76
+
77
+ EndDate?: string;
78
+
79
+ Filters: Record<string, string> | undefined;
80
+
81
+ NextToken?: string;
82
+ }
83
+ export interface QueryWhatIfForecastResponse {
84
+
85
+ Forecast?: Forecast;
86
+ }
71
87
 
72
88
  export declare const QueryForecastRequestFilterSensitiveLog: (obj: QueryForecastRequest) => any;
73
89
 
@@ -76,3 +92,7 @@ export declare const DataPointFilterSensitiveLog: (obj: DataPoint) => any;
76
92
  export declare const ForecastFilterSensitiveLog: (obj: Forecast) => any;
77
93
 
78
94
  export declare const QueryForecastResponseFilterSensitiveLog: (obj: QueryForecastResponse) => any;
95
+
96
+ export declare const QueryWhatIfForecastRequestFilterSensitiveLog: (obj: QueryWhatIfForecastRequest) => any;
97
+
98
+ export declare const QueryWhatIfForecastResponseFilterSensitiveLog: (obj: QueryWhatIfForecastResponse) => any;
@@ -1,5 +1,8 @@
1
1
  import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
2
  import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
3
3
  import { QueryForecastCommandInput, QueryForecastCommandOutput } from "../commands/QueryForecastCommand";
4
+ import { QueryWhatIfForecastCommandInput, QueryWhatIfForecastCommandOutput } from "../commands/QueryWhatIfForecastCommand";
4
5
  export declare const serializeAws_json1_1QueryForecastCommand: (input: QueryForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
6
+ export declare const serializeAws_json1_1QueryWhatIfForecastCommand: (input: QueryWhatIfForecastCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
5
7
  export declare const deserializeAws_json1_1QueryForecastCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryForecastCommandOutput>;
8
+ export declare const deserializeAws_json1_1QueryWhatIfForecastCommand: (output: __HttpResponse, context: __SerdeContext) => 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.150.0",
4
+ "version": "3.159.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",
@@ -18,35 +18,35 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.150.0",
22
- "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.150.0",
24
- "@aws-sdk/fetch-http-handler": "3.131.0",
25
- "@aws-sdk/hash-node": "3.127.0",
26
- "@aws-sdk/invalid-dependency": "3.127.0",
27
- "@aws-sdk/middleware-content-length": "3.127.0",
28
- "@aws-sdk/middleware-host-header": "3.127.0",
29
- "@aws-sdk/middleware-logger": "3.127.0",
30
- "@aws-sdk/middleware-recursion-detection": "3.127.0",
31
- "@aws-sdk/middleware-retry": "3.127.0",
32
- "@aws-sdk/middleware-serde": "3.127.0",
33
- "@aws-sdk/middleware-signing": "3.130.0",
34
- "@aws-sdk/middleware-stack": "3.127.0",
35
- "@aws-sdk/middleware-user-agent": "3.127.0",
36
- "@aws-sdk/node-config-provider": "3.127.0",
37
- "@aws-sdk/node-http-handler": "3.127.0",
38
- "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.142.0",
40
- "@aws-sdk/types": "3.127.0",
41
- "@aws-sdk/url-parser": "3.127.0",
21
+ "@aws-sdk/client-sts": "3.159.0",
22
+ "@aws-sdk/config-resolver": "3.159.0",
23
+ "@aws-sdk/credential-provider-node": "3.159.0",
24
+ "@aws-sdk/fetch-http-handler": "3.159.0",
25
+ "@aws-sdk/hash-node": "3.159.0",
26
+ "@aws-sdk/invalid-dependency": "3.159.0",
27
+ "@aws-sdk/middleware-content-length": "3.159.0",
28
+ "@aws-sdk/middleware-host-header": "3.159.0",
29
+ "@aws-sdk/middleware-logger": "3.159.0",
30
+ "@aws-sdk/middleware-recursion-detection": "3.159.0",
31
+ "@aws-sdk/middleware-retry": "3.159.0",
32
+ "@aws-sdk/middleware-serde": "3.159.0",
33
+ "@aws-sdk/middleware-signing": "3.159.0",
34
+ "@aws-sdk/middleware-stack": "3.159.0",
35
+ "@aws-sdk/middleware-user-agent": "3.159.0",
36
+ "@aws-sdk/node-config-provider": "3.159.0",
37
+ "@aws-sdk/node-http-handler": "3.159.0",
38
+ "@aws-sdk/protocol-http": "3.159.0",
39
+ "@aws-sdk/smithy-client": "3.159.0",
40
+ "@aws-sdk/types": "3.159.0",
41
+ "@aws-sdk/url-parser": "3.159.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
- "@aws-sdk/util-body-length-browser": "3.55.0",
44
+ "@aws-sdk/util-body-length-browser": "3.154.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
- "@aws-sdk/util-user-agent-browser": "3.127.0",
49
- "@aws-sdk/util-user-agent-node": "3.127.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.159.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.159.0",
48
+ "@aws-sdk/util-user-agent-browser": "3.159.0",
49
+ "@aws-sdk/util-user-agent-node": "3.159.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",
51
51
  "@aws-sdk/util-utf8-node": "3.109.0",
52
52
  "tslib": "^2.3.1"