@aws-sdk/client-forecastquery 3.901.0 → 3.906.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +400 -516
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,547 +1,431 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
20
2
 
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- Forecastquery: () => Forecastquery,
25
- ForecastqueryClient: () => ForecastqueryClient,
26
- ForecastqueryServiceException: () => ForecastqueryServiceException,
27
- InvalidInputException: () => InvalidInputException,
28
- InvalidNextTokenException: () => InvalidNextTokenException,
29
- LimitExceededException: () => LimitExceededException,
30
- QueryForecastCommand: () => QueryForecastCommand,
31
- QueryWhatIfForecastCommand: () => QueryWhatIfForecastCommand,
32
- ResourceInUseException: () => ResourceInUseException,
33
- ResourceNotFoundException: () => ResourceNotFoundException,
34
- __Client: () => import_smithy_client.Client
35
- });
36
- module.exports = __toCommonJS(index_exports);
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
37
19
 
38
- // src/ForecastqueryClient.ts
39
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
40
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
41
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
42
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
43
- var import_config_resolver = require("@smithy/config-resolver");
44
- var import_core = require("@smithy/core");
45
- var import_middleware_content_length = require("@smithy/middleware-content-length");
46
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
47
- var import_middleware_retry = require("@smithy/middleware-retry");
48
-
49
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "forecast",
25
+ });
26
+ };
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
32
+ };
50
33
 
51
- // src/endpoint/EndpointParameters.ts
52
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
53
- return Object.assign(options, {
54
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
55
- useFipsEndpoint: options.useFipsEndpoint ?? false,
56
- defaultSigningName: "forecast"
57
- });
58
- }, "resolveClientEndpointParameters");
59
- var commonParams = {
60
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61
- Endpoint: { type: "builtInParams", name: "endpoint" },
62
- Region: { type: "builtInParams", name: "region" },
63
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
64
71
  };
65
72
 
66
- // src/ForecastqueryClient.ts
67
- var import_runtimeConfig = require("././runtimeConfig");
73
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
74
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
75
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
76
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
77
+ };
68
78
 
69
- // src/runtimeExtensions.ts
70
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
71
- var import_protocol_http = require("@smithy/protocol-http");
72
- var import_smithy_client = require("@smithy/smithy-client");
79
+ class ForecastqueryClient extends smithyClient.Client {
80
+ config;
81
+ constructor(...[configuration]) {
82
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
83
+ super(_config_0);
84
+ this.initConfig = _config_0;
85
+ const _config_1 = resolveClientEndpointParameters(_config_0);
86
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
87
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
88
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
89
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
90
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
91
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
+ this.config = _config_8;
94
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
97
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
98
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
99
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
100
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
101
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultForecastqueryHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
107
+ }
108
+ destroy() {
109
+ super.destroy();
110
+ }
111
+ }
73
112
 
74
- // src/auth/httpAuthExtensionConfiguration.ts
75
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
76
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
77
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
78
- let _credentials = runtimeConfig.credentials;
79
- return {
80
- setHttpAuthScheme(httpAuthScheme) {
81
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
82
- if (index === -1) {
83
- _httpAuthSchemes.push(httpAuthScheme);
84
- } else {
85
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
86
- }
87
- },
88
- httpAuthSchemes() {
89
- return _httpAuthSchemes;
90
- },
91
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
92
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
93
- },
94
- httpAuthSchemeProvider() {
95
- return _httpAuthSchemeProvider;
96
- },
97
- setCredentials(credentials) {
98
- _credentials = credentials;
99
- },
100
- credentials() {
101
- return _credentials;
113
+ class ForecastqueryServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, ForecastqueryServiceException.prototype);
102
117
  }
103
- };
104
- }, "getHttpAuthExtensionConfiguration");
105
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
106
- return {
107
- httpAuthSchemes: config.httpAuthSchemes(),
108
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
109
- credentials: config.credentials()
110
- };
111
- }, "resolveHttpAuthRuntimeConfig");
118
+ }
112
119
 
113
- // src/runtimeExtensions.ts
114
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
115
- const extensionConfiguration = Object.assign(
116
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
117
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
118
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
119
- getHttpAuthExtensionConfiguration(runtimeConfig)
120
- );
121
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
122
- return Object.assign(
123
- runtimeConfig,
124
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
125
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
126
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
127
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
128
- );
129
- }, "resolveRuntimeExtensions");
120
+ class InvalidInputException extends ForecastqueryServiceException {
121
+ name = "InvalidInputException";
122
+ $fault = "client";
123
+ Message;
124
+ constructor(opts) {
125
+ super({
126
+ name: "InvalidInputException",
127
+ $fault: "client",
128
+ ...opts,
129
+ });
130
+ Object.setPrototypeOf(this, InvalidInputException.prototype);
131
+ this.Message = opts.Message;
132
+ }
133
+ }
134
+ class InvalidNextTokenException extends ForecastqueryServiceException {
135
+ name = "InvalidNextTokenException";
136
+ $fault = "client";
137
+ Message;
138
+ constructor(opts) {
139
+ super({
140
+ name: "InvalidNextTokenException",
141
+ $fault: "client",
142
+ ...opts,
143
+ });
144
+ Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
145
+ this.Message = opts.Message;
146
+ }
147
+ }
148
+ class LimitExceededException extends ForecastqueryServiceException {
149
+ name = "LimitExceededException";
150
+ $fault = "client";
151
+ Message;
152
+ constructor(opts) {
153
+ super({
154
+ name: "LimitExceededException",
155
+ $fault: "client",
156
+ ...opts,
157
+ });
158
+ Object.setPrototypeOf(this, LimitExceededException.prototype);
159
+ this.Message = opts.Message;
160
+ }
161
+ }
162
+ class ResourceInUseException extends ForecastqueryServiceException {
163
+ name = "ResourceInUseException";
164
+ $fault = "client";
165
+ Message;
166
+ constructor(opts) {
167
+ super({
168
+ name: "ResourceInUseException",
169
+ $fault: "client",
170
+ ...opts,
171
+ });
172
+ Object.setPrototypeOf(this, ResourceInUseException.prototype);
173
+ this.Message = opts.Message;
174
+ }
175
+ }
176
+ class ResourceNotFoundException extends ForecastqueryServiceException {
177
+ name = "ResourceNotFoundException";
178
+ $fault = "client";
179
+ Message;
180
+ constructor(opts) {
181
+ super({
182
+ name: "ResourceNotFoundException",
183
+ $fault: "client",
184
+ ...opts,
185
+ });
186
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
187
+ this.Message = opts.Message;
188
+ }
189
+ }
130
190
 
131
- // src/ForecastqueryClient.ts
132
- var ForecastqueryClient = class extends import_smithy_client.Client {
133
- static {
134
- __name(this, "ForecastqueryClient");
135
- }
136
- /**
137
- * The resolved configuration of ForecastqueryClient class. This is resolved and normalized from the {@link ForecastqueryClientConfig | constructor configuration interface}.
138
- */
139
- config;
140
- constructor(...[configuration]) {
141
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
142
- super(_config_0);
143
- this.initConfig = _config_0;
144
- const _config_1 = resolveClientEndpointParameters(_config_0);
145
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
146
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
147
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
148
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
149
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
150
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
151
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
152
- this.config = _config_8;
153
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
154
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
155
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
156
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
157
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
158
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
159
- this.middlewareStack.use(
160
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
161
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultForecastqueryHttpAuthSchemeParametersProvider,
162
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
163
- "aws.auth#sigv4": config.credentials
164
- }), "identityProviderConfigProvider")
165
- })
166
- );
167
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
168
- }
169
- /**
170
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
171
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
172
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
173
- */
174
- destroy() {
175
- super.destroy();
176
- }
191
+ const se_QueryForecastCommand = async (input, context) => {
192
+ const headers = sharedHeaders("QueryForecast");
193
+ let body;
194
+ body = JSON.stringify(smithyClient._json(input));
195
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
177
196
  };
178
-
179
- // src/Forecastquery.ts
180
-
181
-
182
- // src/commands/QueryForecastCommand.ts
183
-
184
- var import_middleware_serde = require("@smithy/middleware-serde");
185
-
186
-
187
- // src/protocols/Aws_json1_1.ts
188
- var import_core2 = require("@aws-sdk/core");
189
-
190
-
191
-
192
- // src/models/ForecastqueryServiceException.ts
193
-
194
- var ForecastqueryServiceException = class _ForecastqueryServiceException extends import_smithy_client.ServiceException {
195
- static {
196
- __name(this, "ForecastqueryServiceException");
197
- }
198
- /**
199
- * @internal
200
- */
201
- constructor(options) {
202
- super(options);
203
- Object.setPrototypeOf(this, _ForecastqueryServiceException.prototype);
204
- }
197
+ const se_QueryWhatIfForecastCommand = async (input, context) => {
198
+ const headers = sharedHeaders("QueryWhatIfForecast");
199
+ let body;
200
+ body = JSON.stringify(smithyClient._json(input));
201
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
205
202
  };
206
-
207
- // src/models/models_0.ts
208
- var InvalidInputException = class _InvalidInputException extends ForecastqueryServiceException {
209
- static {
210
- __name(this, "InvalidInputException");
211
- }
212
- name = "InvalidInputException";
213
- $fault = "client";
214
- Message;
215
- /**
216
- * @internal
217
- */
218
- constructor(opts) {
219
- super({
220
- name: "InvalidInputException",
221
- $fault: "client",
222
- ...opts
203
+ const de_QueryForecastCommand = async (output, context) => {
204
+ if (output.statusCode >= 300) {
205
+ return de_CommandError(output, context);
206
+ }
207
+ const data = await core$1.parseJsonBody(output.body, context);
208
+ let contents = {};
209
+ contents = de_QueryForecastResponse(data);
210
+ const response = {
211
+ $metadata: deserializeMetadata(output),
212
+ ...contents,
213
+ };
214
+ return response;
215
+ };
216
+ const de_QueryWhatIfForecastCommand = async (output, context) => {
217
+ if (output.statusCode >= 300) {
218
+ return de_CommandError(output, context);
219
+ }
220
+ const data = await core$1.parseJsonBody(output.body, context);
221
+ let contents = {};
222
+ contents = de_QueryWhatIfForecastResponse(data);
223
+ const response = {
224
+ $metadata: deserializeMetadata(output),
225
+ ...contents,
226
+ };
227
+ return response;
228
+ };
229
+ const de_CommandError = async (output, context) => {
230
+ const parsedOutput = {
231
+ ...output,
232
+ body: await core$1.parseJsonErrorBody(output.body, context),
233
+ };
234
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
235
+ switch (errorCode) {
236
+ case "InvalidInputException":
237
+ case "com.amazonaws.forecastquery#InvalidInputException":
238
+ throw await de_InvalidInputExceptionRes(parsedOutput);
239
+ case "InvalidNextTokenException":
240
+ case "com.amazonaws.forecastquery#InvalidNextTokenException":
241
+ throw await de_InvalidNextTokenExceptionRes(parsedOutput);
242
+ case "LimitExceededException":
243
+ case "com.amazonaws.forecastquery#LimitExceededException":
244
+ throw await de_LimitExceededExceptionRes(parsedOutput);
245
+ case "ResourceInUseException":
246
+ case "com.amazonaws.forecastquery#ResourceInUseException":
247
+ throw await de_ResourceInUseExceptionRes(parsedOutput);
248
+ case "ResourceNotFoundException":
249
+ case "com.amazonaws.forecastquery#ResourceNotFoundException":
250
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
251
+ default:
252
+ const parsedBody = parsedOutput.body;
253
+ return throwDefaultError({
254
+ output,
255
+ parsedBody,
256
+ errorCode,
257
+ });
258
+ }
259
+ };
260
+ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
261
+ const body = parsedOutput.body;
262
+ const deserialized = smithyClient._json(body);
263
+ const exception = new InvalidInputException({
264
+ $metadata: deserializeMetadata(parsedOutput),
265
+ ...deserialized,
223
266
  });
224
- Object.setPrototypeOf(this, _InvalidInputException.prototype);
225
- this.Message = opts.Message;
226
- }
267
+ return smithyClient.decorateServiceException(exception, body);
227
268
  };
228
- var InvalidNextTokenException = class _InvalidNextTokenException extends ForecastqueryServiceException {
229
- static {
230
- __name(this, "InvalidNextTokenException");
231
- }
232
- name = "InvalidNextTokenException";
233
- $fault = "client";
234
- Message;
235
- /**
236
- * @internal
237
- */
238
- constructor(opts) {
239
- super({
240
- name: "InvalidNextTokenException",
241
- $fault: "client",
242
- ...opts
269
+ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
270
+ const body = parsedOutput.body;
271
+ const deserialized = smithyClient._json(body);
272
+ const exception = new InvalidNextTokenException({
273
+ $metadata: deserializeMetadata(parsedOutput),
274
+ ...deserialized,
243
275
  });
244
- Object.setPrototypeOf(this, _InvalidNextTokenException.prototype);
245
- this.Message = opts.Message;
246
- }
276
+ return smithyClient.decorateServiceException(exception, body);
247
277
  };
248
- var LimitExceededException = class _LimitExceededException extends ForecastqueryServiceException {
249
- static {
250
- __name(this, "LimitExceededException");
251
- }
252
- name = "LimitExceededException";
253
- $fault = "client";
254
- Message;
255
- /**
256
- * @internal
257
- */
258
- constructor(opts) {
259
- super({
260
- name: "LimitExceededException",
261
- $fault: "client",
262
- ...opts
278
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
279
+ const body = parsedOutput.body;
280
+ const deserialized = smithyClient._json(body);
281
+ const exception = new LimitExceededException({
282
+ $metadata: deserializeMetadata(parsedOutput),
283
+ ...deserialized,
263
284
  });
264
- Object.setPrototypeOf(this, _LimitExceededException.prototype);
265
- this.Message = opts.Message;
266
- }
285
+ return smithyClient.decorateServiceException(exception, body);
267
286
  };
268
- var ResourceInUseException = class _ResourceInUseException extends ForecastqueryServiceException {
269
- static {
270
- __name(this, "ResourceInUseException");
271
- }
272
- name = "ResourceInUseException";
273
- $fault = "client";
274
- Message;
275
- /**
276
- * @internal
277
- */
278
- constructor(opts) {
279
- super({
280
- name: "ResourceInUseException",
281
- $fault: "client",
282
- ...opts
287
+ const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
288
+ const body = parsedOutput.body;
289
+ const deserialized = smithyClient._json(body);
290
+ const exception = new ResourceInUseException({
291
+ $metadata: deserializeMetadata(parsedOutput),
292
+ ...deserialized,
283
293
  });
284
- Object.setPrototypeOf(this, _ResourceInUseException.prototype);
285
- this.Message = opts.Message;
286
- }
294
+ return smithyClient.decorateServiceException(exception, body);
287
295
  };
288
- var ResourceNotFoundException = class _ResourceNotFoundException extends ForecastqueryServiceException {
289
- static {
290
- __name(this, "ResourceNotFoundException");
291
- }
292
- name = "ResourceNotFoundException";
293
- $fault = "client";
294
- Message;
295
- /**
296
- * @internal
297
- */
298
- constructor(opts) {
299
- super({
300
- name: "ResourceNotFoundException",
301
- $fault: "client",
302
- ...opts
296
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
297
+ const body = parsedOutput.body;
298
+ const deserialized = smithyClient._json(body);
299
+ const exception = new ResourceNotFoundException({
300
+ $metadata: deserializeMetadata(parsedOutput),
301
+ ...deserialized,
303
302
  });
304
- Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
305
- this.Message = opts.Message;
306
- }
303
+ return smithyClient.decorateServiceException(exception, body);
307
304
  };
308
-
309
- // src/protocols/Aws_json1_1.ts
310
- var se_QueryForecastCommand = /* @__PURE__ */ __name(async (input, context) => {
311
- const headers = sharedHeaders("QueryForecast");
312
- let body;
313
- body = JSON.stringify((0, import_smithy_client._json)(input));
314
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
315
- }, "se_QueryForecastCommand");
316
- var se_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (input, context) => {
317
- const headers = sharedHeaders("QueryWhatIfForecast");
318
- let body;
319
- body = JSON.stringify((0, import_smithy_client._json)(input));
320
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
321
- }, "se_QueryWhatIfForecastCommand");
322
- var de_QueryForecastCommand = /* @__PURE__ */ __name(async (output, context) => {
323
- if (output.statusCode >= 300) {
324
- return de_CommandError(output, context);
325
- }
326
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
327
- let contents = {};
328
- contents = de_QueryForecastResponse(data, context);
329
- const response = {
330
- $metadata: deserializeMetadata(output),
331
- ...contents
332
- };
333
- return response;
334
- }, "de_QueryForecastCommand");
335
- var de_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (output, context) => {
336
- if (output.statusCode >= 300) {
337
- return de_CommandError(output, context);
338
- }
339
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
340
- let contents = {};
341
- contents = de_QueryWhatIfForecastResponse(data, context);
342
- const response = {
343
- $metadata: deserializeMetadata(output),
344
- ...contents
345
- };
346
- return response;
347
- }, "de_QueryWhatIfForecastCommand");
348
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
349
- const parsedOutput = {
350
- ...output,
351
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
352
- };
353
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
354
- switch (errorCode) {
355
- case "InvalidInputException":
356
- case "com.amazonaws.forecastquery#InvalidInputException":
357
- throw await de_InvalidInputExceptionRes(parsedOutput, context);
358
- case "InvalidNextTokenException":
359
- case "com.amazonaws.forecastquery#InvalidNextTokenException":
360
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
361
- case "LimitExceededException":
362
- case "com.amazonaws.forecastquery#LimitExceededException":
363
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
364
- case "ResourceInUseException":
365
- case "com.amazonaws.forecastquery#ResourceInUseException":
366
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
367
- case "ResourceNotFoundException":
368
- case "com.amazonaws.forecastquery#ResourceNotFoundException":
369
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
370
- default:
371
- const parsedBody = parsedOutput.body;
372
- return throwDefaultError({
373
- output,
374
- parsedBody,
375
- errorCode
376
- });
377
- }
378
- }, "de_CommandError");
379
- var de_InvalidInputExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
380
- const body = parsedOutput.body;
381
- const deserialized = (0, import_smithy_client._json)(body);
382
- const exception = new InvalidInputException({
383
- $metadata: deserializeMetadata(parsedOutput),
384
- ...deserialized
385
- });
386
- return (0, import_smithy_client.decorateServiceException)(exception, body);
387
- }, "de_InvalidInputExceptionRes");
388
- var de_InvalidNextTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
389
- const body = parsedOutput.body;
390
- const deserialized = (0, import_smithy_client._json)(body);
391
- const exception = new InvalidNextTokenException({
392
- $metadata: deserializeMetadata(parsedOutput),
393
- ...deserialized
394
- });
395
- return (0, import_smithy_client.decorateServiceException)(exception, body);
396
- }, "de_InvalidNextTokenExceptionRes");
397
- var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
398
- const body = parsedOutput.body;
399
- const deserialized = (0, import_smithy_client._json)(body);
400
- const exception = new LimitExceededException({
401
- $metadata: deserializeMetadata(parsedOutput),
402
- ...deserialized
403
- });
404
- return (0, import_smithy_client.decorateServiceException)(exception, body);
405
- }, "de_LimitExceededExceptionRes");
406
- var de_ResourceInUseExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
407
- const body = parsedOutput.body;
408
- const deserialized = (0, import_smithy_client._json)(body);
409
- const exception = new ResourceInUseException({
410
- $metadata: deserializeMetadata(parsedOutput),
411
- ...deserialized
412
- });
413
- return (0, import_smithy_client.decorateServiceException)(exception, body);
414
- }, "de_ResourceInUseExceptionRes");
415
- var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
416
- const body = parsedOutput.body;
417
- const deserialized = (0, import_smithy_client._json)(body);
418
- const exception = new ResourceNotFoundException({
419
- $metadata: deserializeMetadata(parsedOutput),
420
- ...deserialized
421
- });
422
- return (0, import_smithy_client.decorateServiceException)(exception, body);
423
- }, "de_ResourceNotFoundExceptionRes");
424
- var de_DataPoint = /* @__PURE__ */ __name((output, context) => {
425
- return (0, import_smithy_client.take)(output, {
426
- Timestamp: import_smithy_client.expectString,
427
- Value: import_smithy_client.limitedParseDouble
428
- });
429
- }, "de_DataPoint");
430
- var de_Forecast = /* @__PURE__ */ __name((output, context) => {
431
- return (0, import_smithy_client.take)(output, {
432
- Predictions: /* @__PURE__ */ __name((_) => de_Predictions(_, context), "Predictions")
433
- });
434
- }, "de_Forecast");
435
- var de_Predictions = /* @__PURE__ */ __name((output, context) => {
436
- return Object.entries(output).reduce((acc, [key, value]) => {
437
- if (value === null) {
438
- return acc;
305
+ const de_DataPoint = (output, context) => {
306
+ return smithyClient.take(output, {
307
+ Timestamp: smithyClient.expectString,
308
+ Value: smithyClient.limitedParseDouble,
309
+ });
310
+ };
311
+ const de_Forecast = (output, context) => {
312
+ return smithyClient.take(output, {
313
+ Predictions: (_) => de_Predictions(_),
314
+ });
315
+ };
316
+ const de_Predictions = (output, context) => {
317
+ return Object.entries(output).reduce((acc, [key, value]) => {
318
+ if (value === null) {
319
+ return acc;
320
+ }
321
+ acc[key] = de_TimeSeries(value);
322
+ return acc;
323
+ }, {});
324
+ };
325
+ const de_QueryForecastResponse = (output, context) => {
326
+ return smithyClient.take(output, {
327
+ Forecast: (_) => de_Forecast(_),
328
+ });
329
+ };
330
+ const de_QueryWhatIfForecastResponse = (output, context) => {
331
+ return smithyClient.take(output, {
332
+ Forecast: (_) => de_Forecast(_),
333
+ });
334
+ };
335
+ const de_TimeSeries = (output, context) => {
336
+ const retVal = (output || [])
337
+ .filter((e) => e != null)
338
+ .map((entry) => {
339
+ return de_DataPoint(entry);
340
+ });
341
+ return retVal;
342
+ };
343
+ const deserializeMetadata = (output) => ({
344
+ httpStatusCode: output.statusCode,
345
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
346
+ extendedRequestId: output.headers["x-amz-id-2"],
347
+ cfId: output.headers["x-amz-cf-id"],
348
+ });
349
+ const throwDefaultError = smithyClient.withBaseException(ForecastqueryServiceException);
350
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
351
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
352
+ const contents = {
353
+ protocol,
354
+ hostname,
355
+ port,
356
+ method: "POST",
357
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
358
+ headers,
359
+ };
360
+ if (body !== undefined) {
361
+ contents.body = body;
439
362
  }
440
- acc[key] = de_TimeSeries(value, context);
441
- return acc;
442
- }, {});
443
- }, "de_Predictions");
444
- var de_QueryForecastResponse = /* @__PURE__ */ __name((output, context) => {
445
- return (0, import_smithy_client.take)(output, {
446
- Forecast: /* @__PURE__ */ __name((_) => de_Forecast(_, context), "Forecast")
447
- });
448
- }, "de_QueryForecastResponse");
449
- var de_QueryWhatIfForecastResponse = /* @__PURE__ */ __name((output, context) => {
450
- return (0, import_smithy_client.take)(output, {
451
- Forecast: /* @__PURE__ */ __name((_) => de_Forecast(_, context), "Forecast")
452
- });
453
- }, "de_QueryWhatIfForecastResponse");
454
- var de_TimeSeries = /* @__PURE__ */ __name((output, context) => {
455
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
456
- return de_DataPoint(entry, context);
457
- });
458
- return retVal;
459
- }, "de_TimeSeries");
460
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
461
- httpStatusCode: output.statusCode,
462
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
463
- extendedRequestId: output.headers["x-amz-id-2"],
464
- cfId: output.headers["x-amz-cf-id"]
465
- }), "deserializeMetadata");
466
- var throwDefaultError = (0, import_smithy_client.withBaseException)(ForecastqueryServiceException);
467
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
468
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
469
- const contents = {
470
- protocol,
471
- hostname,
472
- port,
473
- method: "POST",
474
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
475
- headers
476
- };
477
- if (resolvedHostname !== void 0) {
478
- contents.hostname = resolvedHostname;
479
- }
480
- if (body !== void 0) {
481
- contents.body = body;
482
- }
483
- return new import_protocol_http.HttpRequest(contents);
484
- }, "buildHttpRpcRequest");
363
+ return new protocolHttp.HttpRequest(contents);
364
+ };
485
365
  function sharedHeaders(operation) {
486
- return {
487
- "content-type": "application/x-amz-json-1.1",
488
- "x-amz-target": `AmazonForecastRuntime.${operation}`
489
- };
366
+ return {
367
+ "content-type": "application/x-amz-json-1.1",
368
+ "x-amz-target": `AmazonForecastRuntime.${operation}`,
369
+ };
490
370
  }
491
- __name(sharedHeaders, "sharedHeaders");
492
-
493
- // src/commands/QueryForecastCommand.ts
494
- var QueryForecastCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
495
- return [
496
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
497
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
498
- ];
499
- }).s("AmazonForecastRuntime", "QueryForecast", {}).n("ForecastqueryClient", "QueryForecastCommand").f(void 0, void 0).ser(se_QueryForecastCommand).de(de_QueryForecastCommand).build() {
500
- static {
501
- __name(this, "QueryForecastCommand");
502
- }
503
- };
504
-
505
- // src/commands/QueryWhatIfForecastCommand.ts
506
-
507
371
 
372
+ class QueryForecastCommand extends smithyClient.Command
373
+ .classBuilder()
374
+ .ep(commonParams)
375
+ .m(function (Command, cs, config, o) {
376
+ return [
377
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
378
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
379
+ ];
380
+ })
381
+ .s("AmazonForecastRuntime", "QueryForecast", {})
382
+ .n("ForecastqueryClient", "QueryForecastCommand")
383
+ .f(void 0, void 0)
384
+ .ser(se_QueryForecastCommand)
385
+ .de(de_QueryForecastCommand)
386
+ .build() {
387
+ }
508
388
 
509
- var QueryWhatIfForecastCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
510
- return [
511
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
512
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
513
- ];
514
- }).s("AmazonForecastRuntime", "QueryWhatIfForecast", {}).n("ForecastqueryClient", "QueryWhatIfForecastCommand").f(void 0, void 0).ser(se_QueryWhatIfForecastCommand).de(de_QueryWhatIfForecastCommand).build() {
515
- static {
516
- __name(this, "QueryWhatIfForecastCommand");
517
- }
518
- };
389
+ class QueryWhatIfForecastCommand extends smithyClient.Command
390
+ .classBuilder()
391
+ .ep(commonParams)
392
+ .m(function (Command, cs, config, o) {
393
+ return [
394
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
395
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
396
+ ];
397
+ })
398
+ .s("AmazonForecastRuntime", "QueryWhatIfForecast", {})
399
+ .n("ForecastqueryClient", "QueryWhatIfForecastCommand")
400
+ .f(void 0, void 0)
401
+ .ser(se_QueryWhatIfForecastCommand)
402
+ .de(de_QueryWhatIfForecastCommand)
403
+ .build() {
404
+ }
519
405
 
520
- // src/Forecastquery.ts
521
- var commands = {
522
- QueryForecastCommand,
523
- QueryWhatIfForecastCommand
406
+ const commands = {
407
+ QueryForecastCommand,
408
+ QueryWhatIfForecastCommand,
524
409
  };
525
- var Forecastquery = class extends ForecastqueryClient {
526
- static {
527
- __name(this, "Forecastquery");
528
- }
529
- };
530
- (0, import_smithy_client.createAggregatedClient)(commands, Forecastquery);
531
- // Annotate the CommonJS export names for ESM import in node:
410
+ class Forecastquery extends ForecastqueryClient {
411
+ }
412
+ smithyClient.createAggregatedClient(commands, Forecastquery);
532
413
 
533
- 0 && (module.exports = {
534
- ForecastqueryServiceException,
535
- __Client,
536
- ForecastqueryClient,
537
- Forecastquery,
538
- $Command,
539
- QueryForecastCommand,
540
- QueryWhatIfForecastCommand,
541
- InvalidInputException,
542
- InvalidNextTokenException,
543
- LimitExceededException,
544
- ResourceInUseException,
545
- ResourceNotFoundException
414
+ Object.defineProperty(exports, "$Command", {
415
+ enumerable: true,
416
+ get: function () { return smithyClient.Command; }
546
417
  });
547
-
418
+ Object.defineProperty(exports, "__Client", {
419
+ enumerable: true,
420
+ get: function () { return smithyClient.Client; }
421
+ });
422
+ exports.Forecastquery = Forecastquery;
423
+ exports.ForecastqueryClient = ForecastqueryClient;
424
+ exports.ForecastqueryServiceException = ForecastqueryServiceException;
425
+ exports.InvalidInputException = InvalidInputException;
426
+ exports.InvalidNextTokenException = InvalidNextTokenException;
427
+ exports.LimitExceededException = LimitExceededException;
428
+ exports.QueryForecastCommand = QueryForecastCommand;
429
+ exports.QueryWhatIfForecastCommand = QueryWhatIfForecastCommand;
430
+ exports.ResourceInUseException = ResourceInUseException;
431
+ exports.ResourceNotFoundException = ResourceNotFoundException;
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.901.0",
4
+ "version": "3.906.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-forecastquery",
@@ -20,17 +20,17 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.901.0",
24
- "@aws-sdk/credential-provider-node": "3.901.0",
23
+ "@aws-sdk/core": "3.906.0",
24
+ "@aws-sdk/credential-provider-node": "3.906.0",
25
25
  "@aws-sdk/middleware-host-header": "3.901.0",
26
26
  "@aws-sdk/middleware-logger": "3.901.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.901.0",
28
- "@aws-sdk/middleware-user-agent": "3.901.0",
28
+ "@aws-sdk/middleware-user-agent": "3.906.0",
29
29
  "@aws-sdk/region-config-resolver": "3.901.0",
30
30
  "@aws-sdk/types": "3.901.0",
31
31
  "@aws-sdk/util-endpoints": "3.901.0",
32
32
  "@aws-sdk/util-user-agent-browser": "3.901.0",
33
- "@aws-sdk/util-user-agent-node": "3.901.0",
33
+ "@aws-sdk/util-user-agent-node": "3.906.0",
34
34
  "@smithy/config-resolver": "^4.3.0",
35
35
  "@smithy/core": "^3.14.0",
36
36
  "@smithy/fetch-http-handler": "^5.3.0",