@aws-sdk/client-forecastquery 3.312.0 → 3.315.0

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