@aws-sdk/client-license-manager-linux-subscriptions 3.310.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,11 +32,11 @@ const se_ListLinuxSubscriptionInstancesCommand = async (input, context) => {
32
32
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
33
33
  "/subscription/ListLinuxSubscriptionInstances";
34
34
  let body;
35
- body = JSON.stringify({
36
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
37
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
38
- ...(input.NextToken != null && { NextToken: input.NextToken }),
39
- });
35
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
36
+ Filters: (_) => (0, smithy_client_1._json)(_),
37
+ MaxResults: [],
38
+ NextToken: [],
39
+ }));
40
40
  return new protocol_http_1.HttpRequest({
41
41
  protocol,
42
42
  hostname,
@@ -55,11 +55,11 @@ const se_ListLinuxSubscriptionsCommand = async (input, context) => {
55
55
  };
56
56
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subscription/ListLinuxSubscriptions";
57
57
  let body;
58
- body = JSON.stringify({
59
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
60
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
61
- ...(input.NextToken != null && { NextToken: input.NextToken }),
62
- });
58
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
59
+ Filters: (_) => (0, smithy_client_1._json)(_),
60
+ MaxResults: [],
61
+ NextToken: [],
62
+ }));
63
63
  return new protocol_http_1.HttpRequest({
64
64
  protocol,
65
65
  hostname,
@@ -78,15 +78,11 @@ const se_UpdateServiceSettingsCommand = async (input, context) => {
78
78
  };
79
79
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subscription/UpdateServiceSettings";
80
80
  let body;
81
- body = JSON.stringify({
82
- ...(input.AllowUpdate != null && { AllowUpdate: input.AllowUpdate }),
83
- ...(input.LinuxSubscriptionsDiscovery != null && {
84
- LinuxSubscriptionsDiscovery: input.LinuxSubscriptionsDiscovery,
85
- }),
86
- ...(input.LinuxSubscriptionsDiscoverySettings != null && {
87
- LinuxSubscriptionsDiscoverySettings: se_LinuxSubscriptionsDiscoverySettings(input.LinuxSubscriptionsDiscoverySettings, context),
88
- }),
89
- });
81
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
82
+ AllowUpdate: [],
83
+ LinuxSubscriptionsDiscovery: [],
84
+ LinuxSubscriptionsDiscoverySettings: (_) => (0, smithy_client_1._json)(_),
85
+ }));
90
86
  return new protocol_http_1.HttpRequest({
91
87
  protocol,
92
88
  hostname,
@@ -102,25 +98,18 @@ const de_GetServiceSettingsCommand = async (output, context) => {
102
98
  if (output.statusCode !== 200 && output.statusCode >= 300) {
103
99
  return de_GetServiceSettingsCommandError(output, context);
104
100
  }
105
- const contents = map({
101
+ const contents = (0, smithy_client_1.map)({
106
102
  $metadata: deserializeMetadata(output),
107
103
  });
108
104
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
109
- if (data.HomeRegions != null) {
110
- contents.HomeRegions = de_StringList(data.HomeRegions, context);
111
- }
112
- if (data.LinuxSubscriptionsDiscovery != null) {
113
- contents.LinuxSubscriptionsDiscovery = (0, smithy_client_1.expectString)(data.LinuxSubscriptionsDiscovery);
114
- }
115
- if (data.LinuxSubscriptionsDiscoverySettings != null) {
116
- contents.LinuxSubscriptionsDiscoverySettings = de_LinuxSubscriptionsDiscoverySettings(data.LinuxSubscriptionsDiscoverySettings, context);
117
- }
118
- if (data.Status != null) {
119
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
120
- }
121
- if (data.StatusMessage != null) {
122
- contents.StatusMessage = de_StringMap(data.StatusMessage, context);
123
- }
105
+ const doc = (0, smithy_client_1.take)(data, {
106
+ HomeRegions: smithy_client_1._json,
107
+ LinuxSubscriptionsDiscovery: smithy_client_1.expectString,
108
+ LinuxSubscriptionsDiscoverySettings: smithy_client_1._json,
109
+ Status: smithy_client_1.expectString,
110
+ StatusMessage: smithy_client_1._json,
111
+ });
112
+ Object.assign(contents, doc);
124
113
  return contents;
125
114
  };
126
115
  exports.de_GetServiceSettingsCommand = de_GetServiceSettingsCommand;
@@ -142,10 +131,9 @@ const de_GetServiceSettingsCommandError = async (output, context) => {
142
131
  throw await de_ValidationExceptionRes(parsedOutput, context);
143
132
  default:
144
133
  const parsedBody = parsedOutput.body;
145
- (0, smithy_client_1.throwDefaultError)({
134
+ return throwDefaultError({
146
135
  output,
147
136
  parsedBody,
148
- exceptionCtor: LicenseManagerLinuxSubscriptionsServiceException_1.LicenseManagerLinuxSubscriptionsServiceException,
149
137
  errorCode,
150
138
  });
151
139
  }
@@ -154,16 +142,15 @@ const de_ListLinuxSubscriptionInstancesCommand = async (output, context) => {
154
142
  if (output.statusCode !== 200 && output.statusCode >= 300) {
155
143
  return de_ListLinuxSubscriptionInstancesCommandError(output, context);
156
144
  }
157
- const contents = map({
145
+ const contents = (0, smithy_client_1.map)({
158
146
  $metadata: deserializeMetadata(output),
159
147
  });
160
148
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
161
- if (data.Instances != null) {
162
- contents.Instances = de_InstanceList(data.Instances, context);
163
- }
164
- if (data.NextToken != null) {
165
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
166
- }
149
+ const doc = (0, smithy_client_1.take)(data, {
150
+ Instances: smithy_client_1._json,
151
+ NextToken: smithy_client_1.expectString,
152
+ });
153
+ Object.assign(contents, doc);
167
154
  return contents;
168
155
  };
169
156
  exports.de_ListLinuxSubscriptionInstancesCommand = de_ListLinuxSubscriptionInstancesCommand;
@@ -185,10 +172,9 @@ const de_ListLinuxSubscriptionInstancesCommandError = async (output, context) =>
185
172
  throw await de_ValidationExceptionRes(parsedOutput, context);
186
173
  default:
187
174
  const parsedBody = parsedOutput.body;
188
- (0, smithy_client_1.throwDefaultError)({
175
+ return throwDefaultError({
189
176
  output,
190
177
  parsedBody,
191
- exceptionCtor: LicenseManagerLinuxSubscriptionsServiceException_1.LicenseManagerLinuxSubscriptionsServiceException,
192
178
  errorCode,
193
179
  });
194
180
  }
@@ -197,16 +183,15 @@ const de_ListLinuxSubscriptionsCommand = async (output, context) => {
197
183
  if (output.statusCode !== 200 && output.statusCode >= 300) {
198
184
  return de_ListLinuxSubscriptionsCommandError(output, context);
199
185
  }
200
- const contents = map({
186
+ const contents = (0, smithy_client_1.map)({
201
187
  $metadata: deserializeMetadata(output),
202
188
  });
203
189
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
204
- if (data.NextToken != null) {
205
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
206
- }
207
- if (data.Subscriptions != null) {
208
- contents.Subscriptions = de_SubscriptionList(data.Subscriptions, context);
209
- }
190
+ const doc = (0, smithy_client_1.take)(data, {
191
+ NextToken: smithy_client_1.expectString,
192
+ Subscriptions: smithy_client_1._json,
193
+ });
194
+ Object.assign(contents, doc);
210
195
  return contents;
211
196
  };
212
197
  exports.de_ListLinuxSubscriptionsCommand = de_ListLinuxSubscriptionsCommand;
@@ -228,10 +213,9 @@ const de_ListLinuxSubscriptionsCommandError = async (output, context) => {
228
213
  throw await de_ValidationExceptionRes(parsedOutput, context);
229
214
  default:
230
215
  const parsedBody = parsedOutput.body;
231
- (0, smithy_client_1.throwDefaultError)({
216
+ return throwDefaultError({
232
217
  output,
233
218
  parsedBody,
234
- exceptionCtor: LicenseManagerLinuxSubscriptionsServiceException_1.LicenseManagerLinuxSubscriptionsServiceException,
235
219
  errorCode,
236
220
  });
237
221
  }
@@ -240,25 +224,18 @@ const de_UpdateServiceSettingsCommand = async (output, context) => {
240
224
  if (output.statusCode !== 200 && output.statusCode >= 300) {
241
225
  return de_UpdateServiceSettingsCommandError(output, context);
242
226
  }
243
- const contents = map({
227
+ const contents = (0, smithy_client_1.map)({
244
228
  $metadata: deserializeMetadata(output),
245
229
  });
246
230
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
247
- if (data.HomeRegions != null) {
248
- contents.HomeRegions = de_StringList(data.HomeRegions, context);
249
- }
250
- if (data.LinuxSubscriptionsDiscovery != null) {
251
- contents.LinuxSubscriptionsDiscovery = (0, smithy_client_1.expectString)(data.LinuxSubscriptionsDiscovery);
252
- }
253
- if (data.LinuxSubscriptionsDiscoverySettings != null) {
254
- contents.LinuxSubscriptionsDiscoverySettings = de_LinuxSubscriptionsDiscoverySettings(data.LinuxSubscriptionsDiscoverySettings, context);
255
- }
256
- if (data.Status != null) {
257
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
258
- }
259
- if (data.StatusMessage != null) {
260
- contents.StatusMessage = de_StringMap(data.StatusMessage, context);
261
- }
231
+ const doc = (0, smithy_client_1.take)(data, {
232
+ HomeRegions: smithy_client_1._json,
233
+ LinuxSubscriptionsDiscovery: smithy_client_1.expectString,
234
+ LinuxSubscriptionsDiscoverySettings: smithy_client_1._json,
235
+ Status: smithy_client_1.expectString,
236
+ StatusMessage: smithy_client_1._json,
237
+ });
238
+ Object.assign(contents, doc);
262
239
  return contents;
263
240
  };
264
241
  exports.de_UpdateServiceSettingsCommand = de_UpdateServiceSettingsCommand;
@@ -280,21 +257,21 @@ const de_UpdateServiceSettingsCommandError = async (output, context) => {
280
257
  throw await de_ValidationExceptionRes(parsedOutput, context);
281
258
  default:
282
259
  const parsedBody = parsedOutput.body;
283
- (0, smithy_client_1.throwDefaultError)({
260
+ return throwDefaultError({
284
261
  output,
285
262
  parsedBody,
286
- exceptionCtor: LicenseManagerLinuxSubscriptionsServiceException_1.LicenseManagerLinuxSubscriptionsServiceException,
287
263
  errorCode,
288
264
  });
289
265
  }
290
266
  };
291
- const map = smithy_client_1.map;
267
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(LicenseManagerLinuxSubscriptionsServiceException_1.LicenseManagerLinuxSubscriptionsServiceException);
292
268
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
293
- const contents = map({});
269
+ const contents = (0, smithy_client_1.map)({});
294
270
  const data = parsedOutput.body;
295
- if (data.message != null) {
296
- contents.message = (0, smithy_client_1.expectString)(data.message);
297
- }
271
+ const doc = (0, smithy_client_1.take)(data, {
272
+ message: smithy_client_1.expectString,
273
+ });
274
+ Object.assign(contents, doc);
298
275
  const exception = new models_0_1.InternalServerException({
299
276
  $metadata: deserializeMetadata(parsedOutput),
300
277
  ...contents,
@@ -302,11 +279,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
302
279
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
303
280
  };
304
281
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
305
- const contents = map({});
282
+ const contents = (0, smithy_client_1.map)({});
306
283
  const data = parsedOutput.body;
307
- if (data.message != null) {
308
- contents.message = (0, smithy_client_1.expectString)(data.message);
309
- }
284
+ const doc = (0, smithy_client_1.take)(data, {
285
+ message: smithy_client_1.expectString,
286
+ });
287
+ Object.assign(contents, doc);
310
288
  const exception = new models_0_1.ThrottlingException({
311
289
  $metadata: deserializeMetadata(parsedOutput),
312
290
  ...contents,
@@ -314,124 +292,18 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
314
292
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
315
293
  };
316
294
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
317
- const contents = map({});
295
+ const contents = (0, smithy_client_1.map)({});
318
296
  const data = parsedOutput.body;
319
- if (data.message != null) {
320
- contents.message = (0, smithy_client_1.expectString)(data.message);
321
- }
297
+ const doc = (0, smithy_client_1.take)(data, {
298
+ message: smithy_client_1.expectString,
299
+ });
300
+ Object.assign(contents, doc);
322
301
  const exception = new models_0_1.ValidationException({
323
302
  $metadata: deserializeMetadata(parsedOutput),
324
303
  ...contents,
325
304
  });
326
305
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
327
306
  };
328
- const se_Filter = (input, context) => {
329
- return {
330
- ...(input.Name != null && { Name: input.Name }),
331
- ...(input.Operator != null && { Operator: input.Operator }),
332
- ...(input.Values != null && { Values: se_StringList(input.Values, context) }),
333
- };
334
- };
335
- const se_FilterList = (input, context) => {
336
- return input
337
- .filter((e) => e != null)
338
- .map((entry) => {
339
- return se_Filter(entry, context);
340
- });
341
- };
342
- const se_LinuxSubscriptionsDiscoverySettings = (input, context) => {
343
- return {
344
- ...(input.OrganizationIntegration != null && { OrganizationIntegration: input.OrganizationIntegration }),
345
- ...(input.SourceRegions != null && { SourceRegions: se_StringList(input.SourceRegions, context) }),
346
- };
347
- };
348
- const se_StringList = (input, context) => {
349
- return input
350
- .filter((e) => e != null)
351
- .map((entry) => {
352
- return entry;
353
- });
354
- };
355
- const de_Instance = (output, context) => {
356
- return {
357
- AccountID: (0, smithy_client_1.expectString)(output.AccountID),
358
- AmiId: (0, smithy_client_1.expectString)(output.AmiId),
359
- InstanceID: (0, smithy_client_1.expectString)(output.InstanceID),
360
- InstanceType: (0, smithy_client_1.expectString)(output.InstanceType),
361
- LastUpdatedTime: (0, smithy_client_1.expectString)(output.LastUpdatedTime),
362
- ProductCode: output.ProductCode != null ? de_ProductCodeList(output.ProductCode, context) : undefined,
363
- Region: (0, smithy_client_1.expectString)(output.Region),
364
- Status: (0, smithy_client_1.expectString)(output.Status),
365
- SubscriptionName: (0, smithy_client_1.expectString)(output.SubscriptionName),
366
- UsageOperation: (0, smithy_client_1.expectString)(output.UsageOperation),
367
- };
368
- };
369
- const de_InstanceList = (output, context) => {
370
- const retVal = (output || [])
371
- .filter((e) => e != null)
372
- .map((entry) => {
373
- if (entry === null) {
374
- return null;
375
- }
376
- return de_Instance(entry, context);
377
- });
378
- return retVal;
379
- };
380
- const de_LinuxSubscriptionsDiscoverySettings = (output, context) => {
381
- return {
382
- OrganizationIntegration: (0, smithy_client_1.expectString)(output.OrganizationIntegration),
383
- SourceRegions: output.SourceRegions != null ? de_StringList(output.SourceRegions, context) : undefined,
384
- };
385
- };
386
- const de_ProductCodeList = (output, context) => {
387
- const retVal = (output || [])
388
- .filter((e) => e != null)
389
- .map((entry) => {
390
- if (entry === null) {
391
- return null;
392
- }
393
- return (0, smithy_client_1.expectString)(entry);
394
- });
395
- return retVal;
396
- };
397
- const de_StringList = (output, context) => {
398
- const retVal = (output || [])
399
- .filter((e) => e != null)
400
- .map((entry) => {
401
- if (entry === null) {
402
- return null;
403
- }
404
- return (0, smithy_client_1.expectString)(entry);
405
- });
406
- return retVal;
407
- };
408
- const de_StringMap = (output, context) => {
409
- return Object.entries(output).reduce((acc, [key, value]) => {
410
- if (value === null) {
411
- return acc;
412
- }
413
- acc[key] = (0, smithy_client_1.expectString)(value);
414
- return acc;
415
- }, {});
416
- };
417
- const de_Subscription = (output, context) => {
418
- return {
419
- InstanceCount: (0, smithy_client_1.expectLong)(output.InstanceCount),
420
- Name: (0, smithy_client_1.expectString)(output.Name),
421
- Type: (0, smithy_client_1.expectString)(output.Type),
422
- };
423
- };
424
- const de_SubscriptionList = (output, context) => {
425
- const retVal = (output || [])
426
- .filter((e) => e != null)
427
- .map((entry) => {
428
- if (entry === null) {
429
- return null;
430
- }
431
- return de_Subscription(entry, context);
432
- });
433
- return retVal;
434
- };
435
307
  const deserializeMetadata = (output) => ({
436
308
  httpStatusCode: output.statusCode,
437
309
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { LicenseManagerLinuxSubscriptionsServiceException as __BaseException } from "../models/LicenseManagerLinuxSubscriptionsServiceException";
4
4
  import { InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
5
5
  export const se_GetServiceSettingsCommand = async (input, context) => {
@@ -28,11 +28,11 @@ export const se_ListLinuxSubscriptionInstancesCommand = async (input, context) =
28
28
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
29
29
  "/subscription/ListLinuxSubscriptionInstances";
30
30
  let body;
31
- body = JSON.stringify({
32
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
33
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
34
- ...(input.NextToken != null && { NextToken: input.NextToken }),
35
- });
31
+ body = JSON.stringify(take(input, {
32
+ Filters: (_) => _json(_),
33
+ MaxResults: [],
34
+ NextToken: [],
35
+ }));
36
36
  return new __HttpRequest({
37
37
  protocol,
38
38
  hostname,
@@ -50,11 +50,11 @@ export const se_ListLinuxSubscriptionsCommand = async (input, context) => {
50
50
  };
51
51
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subscription/ListLinuxSubscriptions";
52
52
  let body;
53
- body = JSON.stringify({
54
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
55
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
56
- ...(input.NextToken != null && { NextToken: input.NextToken }),
57
- });
53
+ body = JSON.stringify(take(input, {
54
+ Filters: (_) => _json(_),
55
+ MaxResults: [],
56
+ NextToken: [],
57
+ }));
58
58
  return new __HttpRequest({
59
59
  protocol,
60
60
  hostname,
@@ -72,15 +72,11 @@ export const se_UpdateServiceSettingsCommand = async (input, context) => {
72
72
  };
73
73
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subscription/UpdateServiceSettings";
74
74
  let body;
75
- body = JSON.stringify({
76
- ...(input.AllowUpdate != null && { AllowUpdate: input.AllowUpdate }),
77
- ...(input.LinuxSubscriptionsDiscovery != null && {
78
- LinuxSubscriptionsDiscovery: input.LinuxSubscriptionsDiscovery,
79
- }),
80
- ...(input.LinuxSubscriptionsDiscoverySettings != null && {
81
- LinuxSubscriptionsDiscoverySettings: se_LinuxSubscriptionsDiscoverySettings(input.LinuxSubscriptionsDiscoverySettings, context),
82
- }),
83
- });
75
+ body = JSON.stringify(take(input, {
76
+ AllowUpdate: [],
77
+ LinuxSubscriptionsDiscovery: [],
78
+ LinuxSubscriptionsDiscoverySettings: (_) => _json(_),
79
+ }));
84
80
  return new __HttpRequest({
85
81
  protocol,
86
82
  hostname,
@@ -99,21 +95,14 @@ export const de_GetServiceSettingsCommand = async (output, context) => {
99
95
  $metadata: deserializeMetadata(output),
100
96
  });
101
97
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
102
- if (data.HomeRegions != null) {
103
- contents.HomeRegions = de_StringList(data.HomeRegions, context);
104
- }
105
- if (data.LinuxSubscriptionsDiscovery != null) {
106
- contents.LinuxSubscriptionsDiscovery = __expectString(data.LinuxSubscriptionsDiscovery);
107
- }
108
- if (data.LinuxSubscriptionsDiscoverySettings != null) {
109
- contents.LinuxSubscriptionsDiscoverySettings = de_LinuxSubscriptionsDiscoverySettings(data.LinuxSubscriptionsDiscoverySettings, context);
110
- }
111
- if (data.Status != null) {
112
- contents.Status = __expectString(data.Status);
113
- }
114
- if (data.StatusMessage != null) {
115
- contents.StatusMessage = de_StringMap(data.StatusMessage, context);
116
- }
98
+ const doc = take(data, {
99
+ HomeRegions: _json,
100
+ LinuxSubscriptionsDiscovery: __expectString,
101
+ LinuxSubscriptionsDiscoverySettings: _json,
102
+ Status: __expectString,
103
+ StatusMessage: _json,
104
+ });
105
+ Object.assign(contents, doc);
117
106
  return contents;
118
107
  };
119
108
  const de_GetServiceSettingsCommandError = async (output, context) => {
@@ -134,10 +123,9 @@ const de_GetServiceSettingsCommandError = async (output, context) => {
134
123
  throw await de_ValidationExceptionRes(parsedOutput, context);
135
124
  default:
136
125
  const parsedBody = parsedOutput.body;
137
- throwDefaultError({
126
+ return throwDefaultError({
138
127
  output,
139
128
  parsedBody,
140
- exceptionCtor: __BaseException,
141
129
  errorCode,
142
130
  });
143
131
  }
@@ -150,12 +138,11 @@ export const de_ListLinuxSubscriptionInstancesCommand = async (output, context)
150
138
  $metadata: deserializeMetadata(output),
151
139
  });
152
140
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
153
- if (data.Instances != null) {
154
- contents.Instances = de_InstanceList(data.Instances, context);
155
- }
156
- if (data.NextToken != null) {
157
- contents.NextToken = __expectString(data.NextToken);
158
- }
141
+ const doc = take(data, {
142
+ Instances: _json,
143
+ NextToken: __expectString,
144
+ });
145
+ Object.assign(contents, doc);
159
146
  return contents;
160
147
  };
161
148
  const de_ListLinuxSubscriptionInstancesCommandError = async (output, context) => {
@@ -176,10 +163,9 @@ const de_ListLinuxSubscriptionInstancesCommandError = async (output, context) =>
176
163
  throw await de_ValidationExceptionRes(parsedOutput, context);
177
164
  default:
178
165
  const parsedBody = parsedOutput.body;
179
- throwDefaultError({
166
+ return throwDefaultError({
180
167
  output,
181
168
  parsedBody,
182
- exceptionCtor: __BaseException,
183
169
  errorCode,
184
170
  });
185
171
  }
@@ -192,12 +178,11 @@ export const de_ListLinuxSubscriptionsCommand = async (output, context) => {
192
178
  $metadata: deserializeMetadata(output),
193
179
  });
194
180
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
195
- if (data.NextToken != null) {
196
- contents.NextToken = __expectString(data.NextToken);
197
- }
198
- if (data.Subscriptions != null) {
199
- contents.Subscriptions = de_SubscriptionList(data.Subscriptions, context);
200
- }
181
+ const doc = take(data, {
182
+ NextToken: __expectString,
183
+ Subscriptions: _json,
184
+ });
185
+ Object.assign(contents, doc);
201
186
  return contents;
202
187
  };
203
188
  const de_ListLinuxSubscriptionsCommandError = async (output, context) => {
@@ -218,10 +203,9 @@ const de_ListLinuxSubscriptionsCommandError = async (output, context) => {
218
203
  throw await de_ValidationExceptionRes(parsedOutput, context);
219
204
  default:
220
205
  const parsedBody = parsedOutput.body;
221
- throwDefaultError({
206
+ return throwDefaultError({
222
207
  output,
223
208
  parsedBody,
224
- exceptionCtor: __BaseException,
225
209
  errorCode,
226
210
  });
227
211
  }
@@ -234,21 +218,14 @@ export const de_UpdateServiceSettingsCommand = async (output, context) => {
234
218
  $metadata: deserializeMetadata(output),
235
219
  });
236
220
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
237
- if (data.HomeRegions != null) {
238
- contents.HomeRegions = de_StringList(data.HomeRegions, context);
239
- }
240
- if (data.LinuxSubscriptionsDiscovery != null) {
241
- contents.LinuxSubscriptionsDiscovery = __expectString(data.LinuxSubscriptionsDiscovery);
242
- }
243
- if (data.LinuxSubscriptionsDiscoverySettings != null) {
244
- contents.LinuxSubscriptionsDiscoverySettings = de_LinuxSubscriptionsDiscoverySettings(data.LinuxSubscriptionsDiscoverySettings, context);
245
- }
246
- if (data.Status != null) {
247
- contents.Status = __expectString(data.Status);
248
- }
249
- if (data.StatusMessage != null) {
250
- contents.StatusMessage = de_StringMap(data.StatusMessage, context);
251
- }
221
+ const doc = take(data, {
222
+ HomeRegions: _json,
223
+ LinuxSubscriptionsDiscovery: __expectString,
224
+ LinuxSubscriptionsDiscoverySettings: _json,
225
+ Status: __expectString,
226
+ StatusMessage: _json,
227
+ });
228
+ Object.assign(contents, doc);
252
229
  return contents;
253
230
  };
254
231
  const de_UpdateServiceSettingsCommandError = async (output, context) => {
@@ -269,21 +246,21 @@ const de_UpdateServiceSettingsCommandError = async (output, context) => {
269
246
  throw await de_ValidationExceptionRes(parsedOutput, context);
270
247
  default:
271
248
  const parsedBody = parsedOutput.body;
272
- throwDefaultError({
249
+ return throwDefaultError({
273
250
  output,
274
251
  parsedBody,
275
- exceptionCtor: __BaseException,
276
252
  errorCode,
277
253
  });
278
254
  }
279
255
  };
280
- const map = __map;
256
+ const throwDefaultError = withBaseException(__BaseException);
281
257
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
282
258
  const contents = map({});
283
259
  const data = parsedOutput.body;
284
- if (data.message != null) {
285
- contents.message = __expectString(data.message);
286
- }
260
+ const doc = take(data, {
261
+ message: __expectString,
262
+ });
263
+ Object.assign(contents, doc);
287
264
  const exception = new InternalServerException({
288
265
  $metadata: deserializeMetadata(parsedOutput),
289
266
  ...contents,
@@ -293,9 +270,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
293
270
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
294
271
  const contents = map({});
295
272
  const data = parsedOutput.body;
296
- if (data.message != null) {
297
- contents.message = __expectString(data.message);
298
- }
273
+ const doc = take(data, {
274
+ message: __expectString,
275
+ });
276
+ Object.assign(contents, doc);
299
277
  const exception = new ThrottlingException({
300
278
  $metadata: deserializeMetadata(parsedOutput),
301
279
  ...contents,
@@ -305,122 +283,16 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
305
283
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
306
284
  const contents = map({});
307
285
  const data = parsedOutput.body;
308
- if (data.message != null) {
309
- contents.message = __expectString(data.message);
310
- }
286
+ const doc = take(data, {
287
+ message: __expectString,
288
+ });
289
+ Object.assign(contents, doc);
311
290
  const exception = new ValidationException({
312
291
  $metadata: deserializeMetadata(parsedOutput),
313
292
  ...contents,
314
293
  });
315
294
  return __decorateServiceException(exception, parsedOutput.body);
316
295
  };
317
- const se_Filter = (input, context) => {
318
- return {
319
- ...(input.Name != null && { Name: input.Name }),
320
- ...(input.Operator != null && { Operator: input.Operator }),
321
- ...(input.Values != null && { Values: se_StringList(input.Values, context) }),
322
- };
323
- };
324
- const se_FilterList = (input, context) => {
325
- return input
326
- .filter((e) => e != null)
327
- .map((entry) => {
328
- return se_Filter(entry, context);
329
- });
330
- };
331
- const se_LinuxSubscriptionsDiscoverySettings = (input, context) => {
332
- return {
333
- ...(input.OrganizationIntegration != null && { OrganizationIntegration: input.OrganizationIntegration }),
334
- ...(input.SourceRegions != null && { SourceRegions: se_StringList(input.SourceRegions, context) }),
335
- };
336
- };
337
- const se_StringList = (input, context) => {
338
- return input
339
- .filter((e) => e != null)
340
- .map((entry) => {
341
- return entry;
342
- });
343
- };
344
- const de_Instance = (output, context) => {
345
- return {
346
- AccountID: __expectString(output.AccountID),
347
- AmiId: __expectString(output.AmiId),
348
- InstanceID: __expectString(output.InstanceID),
349
- InstanceType: __expectString(output.InstanceType),
350
- LastUpdatedTime: __expectString(output.LastUpdatedTime),
351
- ProductCode: output.ProductCode != null ? de_ProductCodeList(output.ProductCode, context) : undefined,
352
- Region: __expectString(output.Region),
353
- Status: __expectString(output.Status),
354
- SubscriptionName: __expectString(output.SubscriptionName),
355
- UsageOperation: __expectString(output.UsageOperation),
356
- };
357
- };
358
- const de_InstanceList = (output, context) => {
359
- const retVal = (output || [])
360
- .filter((e) => e != null)
361
- .map((entry) => {
362
- if (entry === null) {
363
- return null;
364
- }
365
- return de_Instance(entry, context);
366
- });
367
- return retVal;
368
- };
369
- const de_LinuxSubscriptionsDiscoverySettings = (output, context) => {
370
- return {
371
- OrganizationIntegration: __expectString(output.OrganizationIntegration),
372
- SourceRegions: output.SourceRegions != null ? de_StringList(output.SourceRegions, context) : undefined,
373
- };
374
- };
375
- const de_ProductCodeList = (output, context) => {
376
- const retVal = (output || [])
377
- .filter((e) => e != null)
378
- .map((entry) => {
379
- if (entry === null) {
380
- return null;
381
- }
382
- return __expectString(entry);
383
- });
384
- return retVal;
385
- };
386
- const de_StringList = (output, context) => {
387
- const retVal = (output || [])
388
- .filter((e) => e != null)
389
- .map((entry) => {
390
- if (entry === null) {
391
- return null;
392
- }
393
- return __expectString(entry);
394
- });
395
- return retVal;
396
- };
397
- const de_StringMap = (output, context) => {
398
- return Object.entries(output).reduce((acc, [key, value]) => {
399
- if (value === null) {
400
- return acc;
401
- }
402
- acc[key] = __expectString(value);
403
- return acc;
404
- }, {});
405
- };
406
- const de_Subscription = (output, context) => {
407
- return {
408
- InstanceCount: __expectLong(output.InstanceCount),
409
- Name: __expectString(output.Name),
410
- Type: __expectString(output.Type),
411
- };
412
- };
413
- const de_SubscriptionList = (output, context) => {
414
- const retVal = (output || [])
415
- .filter((e) => e != null)
416
- .map((entry) => {
417
- if (entry === null) {
418
- return null;
419
- }
420
- return de_Subscription(entry, context);
421
- });
422
- return retVal;
423
- };
424
296
  const deserializeMetadata = (output) => ({
425
297
  httpStatusCode: output.statusCode,
426
298
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-license-manager-linux-subscriptions",
3
3
  "description": "AWS SDK for JavaScript License Manager Linux Subscriptions Client for Node.js, Browser and React Native",
4
- "version": "3.310.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.310.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",