@aws-sdk/client-cloudtrail-data 3.927.0 → 3.929.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -6,6 +6,7 @@ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detect
6
6
  var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
7
  var configResolver = require('@smithy/config-resolver');
8
8
  var core = require('@smithy/core');
9
+ var schema = require('@smithy/core/schema');
9
10
  var middlewareContentLength = require('@smithy/middleware-content-length');
10
11
  var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
12
  var middlewareRetry = require('@smithy/middleware-retry');
@@ -14,8 +15,6 @@ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
15
  var runtimeConfig = require('./runtimeConfig');
15
16
  var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
17
  var protocolHttp = require('@smithy/protocol-http');
17
- var middlewareSerde = require('@smithy/middleware-serde');
18
- var core$1 = require('@aws-sdk/core');
19
18
 
20
19
  const resolveClientEndpointParameters = (options) => {
21
20
  return Object.assign(options, {
@@ -91,6 +90,7 @@ class CloudTrailDataClient extends smithyClient.Client {
91
90
  const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
91
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
92
  this.config = _config_8;
93
+ this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
94
94
  this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
95
  this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
96
  this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
@@ -110,14 +110,14 @@ class CloudTrailDataClient extends smithyClient.Client {
110
110
  }
111
111
  }
112
112
 
113
- class CloudTrailDataServiceException extends smithyClient.ServiceException {
113
+ let CloudTrailDataServiceException$1 = class CloudTrailDataServiceException extends smithyClient.ServiceException {
114
114
  constructor(options) {
115
115
  super(options);
116
116
  Object.setPrototypeOf(this, CloudTrailDataServiceException.prototype);
117
117
  }
118
- }
118
+ };
119
119
 
120
- class ChannelInsufficientPermission extends CloudTrailDataServiceException {
120
+ let ChannelInsufficientPermission$1 = class ChannelInsufficientPermission extends CloudTrailDataServiceException$1 {
121
121
  name = "ChannelInsufficientPermission";
122
122
  $fault = "client";
123
123
  constructor(opts) {
@@ -128,8 +128,8 @@ class ChannelInsufficientPermission extends CloudTrailDataServiceException {
128
128
  });
129
129
  Object.setPrototypeOf(this, ChannelInsufficientPermission.prototype);
130
130
  }
131
- }
132
- class ChannelNotFound extends CloudTrailDataServiceException {
131
+ };
132
+ let ChannelNotFound$1 = class ChannelNotFound extends CloudTrailDataServiceException$1 {
133
133
  name = "ChannelNotFound";
134
134
  $fault = "client";
135
135
  constructor(opts) {
@@ -140,8 +140,8 @@ class ChannelNotFound extends CloudTrailDataServiceException {
140
140
  });
141
141
  Object.setPrototypeOf(this, ChannelNotFound.prototype);
142
142
  }
143
- }
144
- class ChannelUnsupportedSchema extends CloudTrailDataServiceException {
143
+ };
144
+ let ChannelUnsupportedSchema$1 = class ChannelUnsupportedSchema extends CloudTrailDataServiceException$1 {
145
145
  name = "ChannelUnsupportedSchema";
146
146
  $fault = "client";
147
147
  constructor(opts) {
@@ -152,8 +152,8 @@ class ChannelUnsupportedSchema extends CloudTrailDataServiceException {
152
152
  });
153
153
  Object.setPrototypeOf(this, ChannelUnsupportedSchema.prototype);
154
154
  }
155
- }
156
- class DuplicatedAuditEventId extends CloudTrailDataServiceException {
155
+ };
156
+ let DuplicatedAuditEventId$1 = class DuplicatedAuditEventId extends CloudTrailDataServiceException$1 {
157
157
  name = "DuplicatedAuditEventId";
158
158
  $fault = "client";
159
159
  constructor(opts) {
@@ -164,8 +164,8 @@ class DuplicatedAuditEventId extends CloudTrailDataServiceException {
164
164
  });
165
165
  Object.setPrototypeOf(this, DuplicatedAuditEventId.prototype);
166
166
  }
167
- }
168
- class InvalidChannelARN extends CloudTrailDataServiceException {
167
+ };
168
+ let InvalidChannelARN$1 = class InvalidChannelARN extends CloudTrailDataServiceException$1 {
169
169
  name = "InvalidChannelARN";
170
170
  $fault = "client";
171
171
  constructor(opts) {
@@ -176,8 +176,8 @@ class InvalidChannelARN extends CloudTrailDataServiceException {
176
176
  });
177
177
  Object.setPrototypeOf(this, InvalidChannelARN.prototype);
178
178
  }
179
- }
180
- class UnsupportedOperationException extends CloudTrailDataServiceException {
179
+ };
180
+ let UnsupportedOperationException$1 = class UnsupportedOperationException extends CloudTrailDataServiceException$1 {
181
181
  name = "UnsupportedOperationException";
182
182
  $fault = "client";
183
183
  constructor(opts) {
@@ -188,176 +188,165 @@ class UnsupportedOperationException extends CloudTrailDataServiceException {
188
188
  });
189
189
  Object.setPrototypeOf(this, UnsupportedOperationException.prototype);
190
190
  }
191
- }
192
-
193
- const se_PutAuditEventsCommand = async (input, context) => {
194
- const b = core.requestBuilder(input, context);
195
- const headers = {
196
- "content-type": "application/json",
197
- };
198
- b.bp("/PutAuditEvents");
199
- const query = smithyClient.map({
200
- [_cA]: [, smithyClient.expectNonNull(input[_cA], `channelArn`)],
201
- [_eI]: [, input[_eI]],
202
- });
203
- let body;
204
- body = JSON.stringify(smithyClient.take(input, {
205
- auditEvents: (_) => smithyClient._json(_),
206
- }));
207
- b.m("POST").h(headers).q(query).b(body);
208
- return b.build();
209
191
  };
210
- const de_PutAuditEventsCommand = async (output, context) => {
211
- if (output.statusCode !== 200 && output.statusCode >= 300) {
212
- return de_CommandError(output, context);
213
- }
214
- const contents = smithyClient.map({
215
- $metadata: deserializeMetadata(output),
216
- });
217
- const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
218
- const doc = smithyClient.take(data, {
219
- failed: smithyClient._json,
220
- successful: smithyClient._json,
221
- });
222
- Object.assign(contents, doc);
223
- return contents;
224
- };
225
- const de_CommandError = async (output, context) => {
226
- const parsedOutput = {
227
- ...output,
228
- body: await core$1.parseJsonErrorBody(output.body, context),
229
- };
230
- const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
231
- switch (errorCode) {
232
- case "ChannelInsufficientPermission":
233
- case "com.amazonaws.cloudtraildata#ChannelInsufficientPermission":
234
- throw await de_ChannelInsufficientPermissionRes(parsedOutput);
235
- case "ChannelNotFound":
236
- case "com.amazonaws.cloudtraildata#ChannelNotFound":
237
- throw await de_ChannelNotFoundRes(parsedOutput);
238
- case "ChannelUnsupportedSchema":
239
- case "com.amazonaws.cloudtraildata#ChannelUnsupportedSchema":
240
- throw await de_ChannelUnsupportedSchemaRes(parsedOutput);
241
- case "DuplicatedAuditEventId":
242
- case "com.amazonaws.cloudtraildata#DuplicatedAuditEventId":
243
- throw await de_DuplicatedAuditEventIdRes(parsedOutput);
244
- case "InvalidChannelARN":
245
- case "com.amazonaws.cloudtraildata#InvalidChannelARN":
246
- throw await de_InvalidChannelARNRes(parsedOutput);
247
- case "UnsupportedOperationException":
248
- case "com.amazonaws.cloudtraildata#UnsupportedOperationException":
249
- throw await de_UnsupportedOperationExceptionRes(parsedOutput);
250
- default:
251
- const parsedBody = parsedOutput.body;
252
- return throwDefaultError({
253
- output,
254
- parsedBody,
255
- errorCode,
256
- });
257
- }
258
- };
259
- const throwDefaultError = smithyClient.withBaseException(CloudTrailDataServiceException);
260
- const de_ChannelInsufficientPermissionRes = async (parsedOutput, context) => {
261
- const contents = smithyClient.map({});
262
- const data = parsedOutput.body;
263
- const doc = smithyClient.take(data, {
264
- message: smithyClient.expectString,
265
- });
266
- Object.assign(contents, doc);
267
- const exception = new ChannelInsufficientPermission({
268
- $metadata: deserializeMetadata(parsedOutput),
269
- ...contents,
270
- });
271
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
272
- };
273
- const de_ChannelNotFoundRes = async (parsedOutput, context) => {
274
- const contents = smithyClient.map({});
275
- const data = parsedOutput.body;
276
- const doc = smithyClient.take(data, {
277
- message: smithyClient.expectString,
278
- });
279
- Object.assign(contents, doc);
280
- const exception = new ChannelNotFound({
281
- $metadata: deserializeMetadata(parsedOutput),
282
- ...contents,
283
- });
284
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
285
- };
286
- const de_ChannelUnsupportedSchemaRes = async (parsedOutput, context) => {
287
- const contents = smithyClient.map({});
288
- const data = parsedOutput.body;
289
- const doc = smithyClient.take(data, {
290
- message: smithyClient.expectString,
291
- });
292
- Object.assign(contents, doc);
293
- const exception = new ChannelUnsupportedSchema({
294
- $metadata: deserializeMetadata(parsedOutput),
295
- ...contents,
296
- });
297
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
298
- };
299
- const de_DuplicatedAuditEventIdRes = async (parsedOutput, context) => {
300
- const contents = smithyClient.map({});
301
- const data = parsedOutput.body;
302
- const doc = smithyClient.take(data, {
303
- message: smithyClient.expectString,
304
- });
305
- Object.assign(contents, doc);
306
- const exception = new DuplicatedAuditEventId({
307
- $metadata: deserializeMetadata(parsedOutput),
308
- ...contents,
309
- });
310
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
311
- };
312
- const de_InvalidChannelARNRes = async (parsedOutput, context) => {
313
- const contents = smithyClient.map({});
314
- const data = parsedOutput.body;
315
- const doc = smithyClient.take(data, {
316
- message: smithyClient.expectString,
317
- });
318
- Object.assign(contents, doc);
319
- const exception = new InvalidChannelARN({
320
- $metadata: deserializeMetadata(parsedOutput),
321
- ...contents,
322
- });
323
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
324
- };
325
- const de_UnsupportedOperationExceptionRes = async (parsedOutput, context) => {
326
- const contents = smithyClient.map({});
327
- const data = parsedOutput.body;
328
- const doc = smithyClient.take(data, {
329
- message: smithyClient.expectString,
330
- });
331
- Object.assign(contents, doc);
332
- const exception = new UnsupportedOperationException({
333
- $metadata: deserializeMetadata(parsedOutput),
334
- ...contents,
335
- });
336
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
337
- };
338
- const deserializeMetadata = (output) => ({
339
- httpStatusCode: output.statusCode,
340
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
341
- extendedRequestId: output.headers["x-amz-id-2"],
342
- cfId: output.headers["x-amz-cf-id"],
343
- });
192
+
193
+ const _AE = "AuditEvent";
194
+ const _AERE = "AuditEventResultEntry";
195
+ const _AEREu = "AuditEventResultEntries";
196
+ const _AEu = "AuditEvents";
197
+ const _CIP = "ChannelInsufficientPermission";
198
+ const _CNF = "ChannelNotFound";
199
+ const _CUS = "ChannelUnsupportedSchema";
200
+ const _DAEI = "DuplicatedAuditEventId";
201
+ const _ICARN = "InvalidChannelARN";
202
+ const _PAE = "PutAuditEvents";
203
+ const _PAER = "PutAuditEventsRequest";
204
+ const _PAERu = "PutAuditEventsResponse";
205
+ const _REE = "ResultErrorEntry";
206
+ const _REEe = "ResultErrorEntries";
207
+ const _UOE = "UnsupportedOperationException";
208
+ const _aE = "auditEvents";
209
+ const _c = "client";
344
210
  const _cA = "channelArn";
211
+ const _e = "error";
212
+ const _eC = "errorCode";
213
+ const _eD = "eventData";
214
+ const _eDC = "eventDataChecksum";
345
215
  const _eI = "externalId";
216
+ const _eID = "eventID";
217
+ const _eM = "errorMessage";
218
+ const _f = "failed";
219
+ const _h = "http";
220
+ const _hQ = "httpQuery";
221
+ const _i = "id";
222
+ const _m = "message";
223
+ const _s = "successful";
224
+ const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.cloudtraildata";
225
+ const n0 = "com.amazonaws.cloudtraildata";
226
+ var AuditEvent = [3, n0, _AE, 0, [_i, _eD, _eDC], [0, 0, 0]];
227
+ var AuditEventResultEntry = [3, n0, _AERE, 0, [_i, _eID], [0, 0]];
228
+ var ChannelInsufficientPermission = [
229
+ -3,
230
+ n0,
231
+ _CIP,
232
+ {
233
+ [_e]: _c,
234
+ },
235
+ [_m],
236
+ [0],
237
+ ];
238
+ schema.TypeRegistry.for(n0).registerError(ChannelInsufficientPermission, ChannelInsufficientPermission$1);
239
+ var ChannelNotFound = [
240
+ -3,
241
+ n0,
242
+ _CNF,
243
+ {
244
+ [_e]: _c,
245
+ },
246
+ [_m],
247
+ [0],
248
+ ];
249
+ schema.TypeRegistry.for(n0).registerError(ChannelNotFound, ChannelNotFound$1);
250
+ var ChannelUnsupportedSchema = [
251
+ -3,
252
+ n0,
253
+ _CUS,
254
+ {
255
+ [_e]: _c,
256
+ },
257
+ [_m],
258
+ [0],
259
+ ];
260
+ schema.TypeRegistry.for(n0).registerError(ChannelUnsupportedSchema, ChannelUnsupportedSchema$1);
261
+ var DuplicatedAuditEventId = [
262
+ -3,
263
+ n0,
264
+ _DAEI,
265
+ {
266
+ [_e]: _c,
267
+ },
268
+ [_m],
269
+ [0],
270
+ ];
271
+ schema.TypeRegistry.for(n0).registerError(DuplicatedAuditEventId, DuplicatedAuditEventId$1);
272
+ var InvalidChannelARN = [
273
+ -3,
274
+ n0,
275
+ _ICARN,
276
+ {
277
+ [_e]: _c,
278
+ },
279
+ [_m],
280
+ [0],
281
+ ];
282
+ schema.TypeRegistry.for(n0).registerError(InvalidChannelARN, InvalidChannelARN$1);
283
+ var PutAuditEventsRequest = [
284
+ 3,
285
+ n0,
286
+ _PAER,
287
+ 0,
288
+ [_aE, _cA, _eI],
289
+ [
290
+ () => AuditEvents,
291
+ [
292
+ 0,
293
+ {
294
+ [_hQ]: _cA,
295
+ },
296
+ ],
297
+ [
298
+ 0,
299
+ {
300
+ [_hQ]: _eI,
301
+ },
302
+ ],
303
+ ],
304
+ ];
305
+ var PutAuditEventsResponse = [
306
+ 3,
307
+ n0,
308
+ _PAERu,
309
+ 0,
310
+ [_s, _f],
311
+ [() => AuditEventResultEntries, () => ResultErrorEntries],
312
+ ];
313
+ var ResultErrorEntry = [3, n0, _REE, 0, [_i, _eC, _eM], [0, 0, 0]];
314
+ var UnsupportedOperationException = [
315
+ -3,
316
+ n0,
317
+ _UOE,
318
+ {
319
+ [_e]: _c,
320
+ },
321
+ [_m],
322
+ [0],
323
+ ];
324
+ schema.TypeRegistry.for(n0).registerError(UnsupportedOperationException, UnsupportedOperationException$1);
325
+ var CloudTrailDataServiceException = [-3, _sm, "CloudTrailDataServiceException", 0, [], []];
326
+ schema.TypeRegistry.for(_sm).registerError(CloudTrailDataServiceException, CloudTrailDataServiceException$1);
327
+ var AuditEventResultEntries = [1, n0, _AEREu, 0, () => AuditEventResultEntry];
328
+ var AuditEvents = [1, n0, _AEu, 0, () => AuditEvent];
329
+ var ResultErrorEntries = [1, n0, _REEe, 0, () => ResultErrorEntry];
330
+ var PutAuditEvents = [
331
+ 9,
332
+ n0,
333
+ _PAE,
334
+ {
335
+ [_h]: ["POST", "/PutAuditEvents", 200],
336
+ },
337
+ () => PutAuditEventsRequest,
338
+ () => PutAuditEventsResponse,
339
+ ];
346
340
 
347
341
  class PutAuditEventsCommand extends smithyClient.Command
348
342
  .classBuilder()
349
343
  .ep(commonParams)
350
344
  .m(function (Command, cs, config, o) {
351
- return [
352
- middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
353
- middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
354
- ];
345
+ return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
355
346
  })
356
347
  .s("CloudTrailDataService", "PutAuditEvents", {})
357
348
  .n("CloudTrailDataClient", "PutAuditEventsCommand")
358
- .f(void 0, void 0)
359
- .ser(se_PutAuditEventsCommand)
360
- .de(de_PutAuditEventsCommand)
349
+ .sc(PutAuditEvents)
361
350
  .build() {
362
351
  }
363
352
 
@@ -376,13 +365,13 @@ Object.defineProperty(exports, "__Client", {
376
365
  enumerable: true,
377
366
  get: function () { return smithyClient.Client; }
378
367
  });
379
- exports.ChannelInsufficientPermission = ChannelInsufficientPermission;
380
- exports.ChannelNotFound = ChannelNotFound;
381
- exports.ChannelUnsupportedSchema = ChannelUnsupportedSchema;
368
+ exports.ChannelInsufficientPermission = ChannelInsufficientPermission$1;
369
+ exports.ChannelNotFound = ChannelNotFound$1;
370
+ exports.ChannelUnsupportedSchema = ChannelUnsupportedSchema$1;
382
371
  exports.CloudTrailData = CloudTrailData;
383
372
  exports.CloudTrailDataClient = CloudTrailDataClient;
384
- exports.CloudTrailDataServiceException = CloudTrailDataServiceException;
385
- exports.DuplicatedAuditEventId = DuplicatedAuditEventId;
386
- exports.InvalidChannelARN = InvalidChannelARN;
373
+ exports.CloudTrailDataServiceException = CloudTrailDataServiceException$1;
374
+ exports.DuplicatedAuditEventId = DuplicatedAuditEventId$1;
375
+ exports.InvalidChannelARN = InvalidChannelARN$1;
387
376
  exports.PutAuditEventsCommand = PutAuditEventsCommand;
388
- exports.UnsupportedOperationException = UnsupportedOperationException;
377
+ exports.UnsupportedOperationException = UnsupportedOperationException$1;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
4
  const core_1 = require("@aws-sdk/core");
5
+ const protocols_1 = require("@aws-sdk/core/protocols");
5
6
  const smithy_client_1 = require("@smithy/smithy-client");
6
7
  const url_parser_1 = require("@smithy/url-parser");
7
8
  const util_base64_1 = require("@smithy/util-base64");
@@ -25,6 +26,7 @@ const getRuntimeConfig = (config) => {
25
26
  },
26
27
  ],
27
28
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
29
+ protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.cloudtraildata" }),
28
30
  serviceId: config?.serviceId ?? "CloudTrail Data",
29
31
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
30
32
  utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
@@ -4,6 +4,7 @@ import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detec
4
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
5
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
6
  import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
+ import { getSchemaSerdePlugin } from "@smithy/core/schema";
7
8
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
9
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
10
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
@@ -28,6 +29,7 @@ export class CloudTrailDataClient extends __Client {
28
29
  const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
29
30
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
30
31
  this.config = _config_8;
32
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
31
33
  this.middlewareStack.use(getUserAgentPlugin(this.config));
32
34
  this.middlewareStack.use(getRetryPlugin(this.config));
33
35
  this.middlewareStack.use(getContentLengthPlugin(this.config));
@@ -1,22 +1,16 @@
1
1
  import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
2
  import { Command as $Command } from "@smithy/smithy-client";
4
3
  import { commonParams } from "../endpoint/EndpointParameters";
5
- import { de_PutAuditEventsCommand, se_PutAuditEventsCommand } from "../protocols/Aws_restJson1";
4
+ import { PutAuditEvents } from "../schemas/schemas_0";
6
5
  export { $Command };
7
6
  export class PutAuditEventsCommand extends $Command
8
7
  .classBuilder()
9
8
  .ep(commonParams)
10
9
  .m(function (Command, cs, config, o) {
11
- return [
12
- getSerdePlugin(config, this.serialize, this.deserialize),
13
- getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
15
11
  })
16
12
  .s("CloudTrailDataService", "PutAuditEvents", {})
17
13
  .n("CloudTrailDataClient", "PutAuditEventsCommand")
18
- .f(void 0, void 0)
19
- .ser(se_PutAuditEventsCommand)
20
- .de(de_PutAuditEventsCommand)
14
+ .sc(PutAuditEvents)
21
15
  .build() {
22
16
  }
@@ -1,4 +1,5 @@
1
1
  import { AwsSdkSigV4Signer } from "@aws-sdk/core";
2
+ import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols";
2
3
  import { NoOpLogger } from "@smithy/smithy-client";
3
4
  import { parseUrl } from "@smithy/url-parser";
4
5
  import { fromBase64, toBase64 } from "@smithy/util-base64";
@@ -22,6 +23,7 @@ export const getRuntimeConfig = (config) => {
22
23
  },
23
24
  ],
24
25
  logger: config?.logger ?? new NoOpLogger(),
26
+ protocol: config?.protocol ?? new AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.cloudtraildata" }),
25
27
  serviceId: config?.serviceId ?? "CloudTrail Data",
26
28
  urlParser: config?.urlParser ?? parseUrl,
27
29
  utf8Decoder: config?.utf8Decoder ?? fromUtf8,
@@ -0,0 +1,150 @@
1
+ const _AE = "AuditEvent";
2
+ const _AERE = "AuditEventResultEntry";
3
+ const _AEREu = "AuditEventResultEntries";
4
+ const _AEu = "AuditEvents";
5
+ const _CIP = "ChannelInsufficientPermission";
6
+ const _CNF = "ChannelNotFound";
7
+ const _CUS = "ChannelUnsupportedSchema";
8
+ const _DAEI = "DuplicatedAuditEventId";
9
+ const _ICARN = "InvalidChannelARN";
10
+ const _PAE = "PutAuditEvents";
11
+ const _PAER = "PutAuditEventsRequest";
12
+ const _PAERu = "PutAuditEventsResponse";
13
+ const _REE = "ResultErrorEntry";
14
+ const _REEe = "ResultErrorEntries";
15
+ const _UOE = "UnsupportedOperationException";
16
+ const _aE = "auditEvents";
17
+ const _c = "client";
18
+ const _cA = "channelArn";
19
+ const _e = "error";
20
+ const _eC = "errorCode";
21
+ const _eD = "eventData";
22
+ const _eDC = "eventDataChecksum";
23
+ const _eI = "externalId";
24
+ const _eID = "eventID";
25
+ const _eM = "errorMessage";
26
+ const _f = "failed";
27
+ const _h = "http";
28
+ const _hQ = "httpQuery";
29
+ const _i = "id";
30
+ const _m = "message";
31
+ const _s = "successful";
32
+ const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.cloudtraildata";
33
+ const n0 = "com.amazonaws.cloudtraildata";
34
+ import { TypeRegistry } from "@smithy/core/schema";
35
+ import { CloudTrailDataServiceException as __CloudTrailDataServiceException } from "../models/CloudTrailDataServiceException";
36
+ import { ChannelInsufficientPermission as __ChannelInsufficientPermission, ChannelNotFound as __ChannelNotFound, ChannelUnsupportedSchema as __ChannelUnsupportedSchema, DuplicatedAuditEventId as __DuplicatedAuditEventId, InvalidChannelARN as __InvalidChannelARN, UnsupportedOperationException as __UnsupportedOperationException, } from "../models/index";
37
+ export var AuditEvent = [3, n0, _AE, 0, [_i, _eD, _eDC], [0, 0, 0]];
38
+ export var AuditEventResultEntry = [3, n0, _AERE, 0, [_i, _eID], [0, 0]];
39
+ export var ChannelInsufficientPermission = [
40
+ -3,
41
+ n0,
42
+ _CIP,
43
+ {
44
+ [_e]: _c,
45
+ },
46
+ [_m],
47
+ [0],
48
+ ];
49
+ TypeRegistry.for(n0).registerError(ChannelInsufficientPermission, __ChannelInsufficientPermission);
50
+ export var ChannelNotFound = [
51
+ -3,
52
+ n0,
53
+ _CNF,
54
+ {
55
+ [_e]: _c,
56
+ },
57
+ [_m],
58
+ [0],
59
+ ];
60
+ TypeRegistry.for(n0).registerError(ChannelNotFound, __ChannelNotFound);
61
+ export var ChannelUnsupportedSchema = [
62
+ -3,
63
+ n0,
64
+ _CUS,
65
+ {
66
+ [_e]: _c,
67
+ },
68
+ [_m],
69
+ [0],
70
+ ];
71
+ TypeRegistry.for(n0).registerError(ChannelUnsupportedSchema, __ChannelUnsupportedSchema);
72
+ export var DuplicatedAuditEventId = [
73
+ -3,
74
+ n0,
75
+ _DAEI,
76
+ {
77
+ [_e]: _c,
78
+ },
79
+ [_m],
80
+ [0],
81
+ ];
82
+ TypeRegistry.for(n0).registerError(DuplicatedAuditEventId, __DuplicatedAuditEventId);
83
+ export var InvalidChannelARN = [
84
+ -3,
85
+ n0,
86
+ _ICARN,
87
+ {
88
+ [_e]: _c,
89
+ },
90
+ [_m],
91
+ [0],
92
+ ];
93
+ TypeRegistry.for(n0).registerError(InvalidChannelARN, __InvalidChannelARN);
94
+ export var PutAuditEventsRequest = [
95
+ 3,
96
+ n0,
97
+ _PAER,
98
+ 0,
99
+ [_aE, _cA, _eI],
100
+ [
101
+ () => AuditEvents,
102
+ [
103
+ 0,
104
+ {
105
+ [_hQ]: _cA,
106
+ },
107
+ ],
108
+ [
109
+ 0,
110
+ {
111
+ [_hQ]: _eI,
112
+ },
113
+ ],
114
+ ],
115
+ ];
116
+ export var PutAuditEventsResponse = [
117
+ 3,
118
+ n0,
119
+ _PAERu,
120
+ 0,
121
+ [_s, _f],
122
+ [() => AuditEventResultEntries, () => ResultErrorEntries],
123
+ ];
124
+ export var ResultErrorEntry = [3, n0, _REE, 0, [_i, _eC, _eM], [0, 0, 0]];
125
+ export var UnsupportedOperationException = [
126
+ -3,
127
+ n0,
128
+ _UOE,
129
+ {
130
+ [_e]: _c,
131
+ },
132
+ [_m],
133
+ [0],
134
+ ];
135
+ TypeRegistry.for(n0).registerError(UnsupportedOperationException, __UnsupportedOperationException);
136
+ export var CloudTrailDataServiceException = [-3, _sm, "CloudTrailDataServiceException", 0, [], []];
137
+ TypeRegistry.for(_sm).registerError(CloudTrailDataServiceException, __CloudTrailDataServiceException);
138
+ export var AuditEventResultEntries = [1, n0, _AEREu, 0, () => AuditEventResultEntry];
139
+ export var AuditEvents = [1, n0, _AEu, 0, () => AuditEvent];
140
+ export var ResultErrorEntries = [1, n0, _REEe, 0, () => ResultErrorEntry];
141
+ export var PutAuditEvents = [
142
+ 9,
143
+ n0,
144
+ _PAE,
145
+ {
146
+ [_h]: ["POST", "/PutAuditEvents", 200],
147
+ },
148
+ () => PutAuditEventsRequest,
149
+ () => PutAuditEventsResponse,
150
+ ];
@@ -5,7 +5,7 @@ import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-
5
5
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
6
6
  import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
7
7
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
8
- import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
8
+ import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, ClientProtocol, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, HttpRequest, HttpResponse, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
9
  import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
10
10
  import { PutAuditEventsCommandInput, PutAuditEventsCommandOutput } from "./commands/PutAuditEventsCommand";
11
11
  import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
@@ -142,6 +142,15 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
142
142
  * Optional extensions
143
143
  */
144
144
  extensions?: RuntimeExtension[];
145
+ /**
146
+ * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON)
147
+ * may be overridden. A default will always be set by the client.
148
+ * Available options depend on the service's supported protocols and will not be validated by
149
+ * the client.
150
+ * @alpha
151
+ *
152
+ */
153
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
145
154
  /**
146
155
  * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
147
156
  */
@@ -29,6 +29,7 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
29
29
  profile?: string;
30
30
  logger: import("@smithy/types").Logger;
31
31
  extensions: import("./runtimeExtensions").RuntimeExtension[];
32
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
32
33
  customUserAgent?: string | import("@smithy/types").UserAgent;
33
34
  userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
34
35
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
@@ -31,6 +31,7 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
31
31
  profile?: string;
32
32
  logger: import("@smithy/types").Logger;
33
33
  extensions: import("./runtimeExtensions").RuntimeExtension[];
34
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
34
35
  customUserAgent?: string | import("@smithy/types").UserAgent;
35
36
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
36
37
  endpoint?: ((string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>) & (string | import("@smithy/types").Provider<string> | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>)) | undefined;
@@ -27,6 +27,7 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
27
27
  retryMode: string | import("@smithy/types").Provider<string>;
28
28
  logger: import("@smithy/types").Logger;
29
29
  extensions: import("./runtimeExtensions").RuntimeExtension[];
30
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
30
31
  defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
31
32
  customUserAgent?: string | import("@smithy/types").UserAgent;
32
33
  userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
@@ -14,6 +14,7 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
14
14
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").CloudTrailDataHttpAuthSchemeProvider;
15
15
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
16
16
  logger: import("@smithy/types").Logger;
17
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
17
18
  serviceId: string;
18
19
  urlParser: import("@smithy/types").UrlParser;
19
20
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,17 @@
1
+ import { StaticErrorSchema, StaticListSchema, StaticOperationSchema, StaticStructureSchema } from "@smithy/types";
2
+ export declare var AuditEvent: StaticStructureSchema;
3
+ export declare var AuditEventResultEntry: StaticStructureSchema;
4
+ export declare var ChannelInsufficientPermission: StaticErrorSchema;
5
+ export declare var ChannelNotFound: StaticErrorSchema;
6
+ export declare var ChannelUnsupportedSchema: StaticErrorSchema;
7
+ export declare var DuplicatedAuditEventId: StaticErrorSchema;
8
+ export declare var InvalidChannelARN: StaticErrorSchema;
9
+ export declare var PutAuditEventsRequest: StaticStructureSchema;
10
+ export declare var PutAuditEventsResponse: StaticStructureSchema;
11
+ export declare var ResultErrorEntry: StaticStructureSchema;
12
+ export declare var UnsupportedOperationException: StaticErrorSchema;
13
+ export declare var CloudTrailDataServiceException: StaticErrorSchema;
14
+ export declare var AuditEventResultEntries: StaticListSchema;
15
+ export declare var AuditEvents: StaticListSchema;
16
+ export declare var ResultErrorEntries: StaticListSchema;
17
+ export declare var PutAuditEvents: StaticOperationSchema;
@@ -30,10 +30,13 @@ import {
30
30
  BodyLengthCalculator as __BodyLengthCalculator,
31
31
  CheckOptionalClientConfig as __CheckOptionalClientConfig,
32
32
  ChecksumConstructor as __ChecksumConstructor,
33
+ ClientProtocol,
33
34
  Decoder as __Decoder,
34
35
  Encoder as __Encoder,
35
36
  HashConstructor as __HashConstructor,
36
37
  HttpHandlerOptions as __HttpHandlerOptions,
38
+ HttpRequest,
39
+ HttpResponse,
37
40
  Logger as __Logger,
38
41
  Provider as __Provider,
39
42
  Provider,
@@ -82,6 +85,7 @@ export interface ClientDefaults
82
85
  retryMode?: string | __Provider<string>;
83
86
  logger?: __Logger;
84
87
  extensions?: RuntimeExtension[];
88
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
85
89
  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
86
90
  }
87
91
  export type CloudTrailDataClientConfigType = Partial<
@@ -38,6 +38,10 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
38
38
  profile?: string;
39
39
  logger: import("@smithy/types").Logger;
40
40
  extensions: import("./runtimeExtensions").RuntimeExtension[];
41
+ protocol: import("@smithy/types").ClientProtocol<
42
+ import("@smithy/types").HttpRequest,
43
+ import("@smithy/types").HttpResponse
44
+ >;
41
45
  customUserAgent?: string | import("@smithy/types").UserAgent;
42
46
  userAgentAppId?:
43
47
  | string
@@ -38,6 +38,10 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
38
38
  profile?: string;
39
39
  logger: import("@smithy/types").Logger;
40
40
  extensions: import("./runtimeExtensions").RuntimeExtension[];
41
+ protocol: import("@smithy/types").ClientProtocol<
42
+ import("@smithy/types").HttpRequest,
43
+ import("@smithy/types").HttpResponse
44
+ >;
41
45
  customUserAgent?: string | import("@smithy/types").UserAgent;
42
46
  retryStrategy?:
43
47
  | import("@smithy/types").RetryStrategy
@@ -37,6 +37,10 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
37
37
  retryMode: string | import("@smithy/types").Provider<string>;
38
38
  logger: import("@smithy/types").Logger;
39
39
  extensions: import("./runtimeExtensions").RuntimeExtension[];
40
+ protocol: import("@smithy/types").ClientProtocol<
41
+ import("@smithy/types").HttpRequest,
42
+ import("@smithy/types").HttpResponse
43
+ >;
40
44
  defaultsMode:
41
45
  | import("@smithy/smithy-client").DefaultsMode
42
46
  | import("@smithy/types").Provider<
@@ -14,6 +14,10 @@ export declare const getRuntimeConfig: (config: CloudTrailDataClientConfig) => {
14
14
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").CloudTrailDataHttpAuthSchemeProvider;
15
15
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
16
16
  logger: import("@smithy/types").Logger;
17
+ protocol: import("@smithy/types").ClientProtocol<
18
+ import("@smithy/types").HttpRequest,
19
+ import("@smithy/types").HttpResponse
20
+ >;
17
21
  serviceId: string;
18
22
  urlParser: import("@smithy/types").UrlParser;
19
23
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,22 @@
1
+ import {
2
+ StaticErrorSchema,
3
+ StaticListSchema,
4
+ StaticOperationSchema,
5
+ StaticStructureSchema,
6
+ } from "@smithy/types";
7
+ export declare var AuditEvent: StaticStructureSchema;
8
+ export declare var AuditEventResultEntry: StaticStructureSchema;
9
+ export declare var ChannelInsufficientPermission: StaticErrorSchema;
10
+ export declare var ChannelNotFound: StaticErrorSchema;
11
+ export declare var ChannelUnsupportedSchema: StaticErrorSchema;
12
+ export declare var DuplicatedAuditEventId: StaticErrorSchema;
13
+ export declare var InvalidChannelARN: StaticErrorSchema;
14
+ export declare var PutAuditEventsRequest: StaticStructureSchema;
15
+ export declare var PutAuditEventsResponse: StaticStructureSchema;
16
+ export declare var ResultErrorEntry: StaticStructureSchema;
17
+ export declare var UnsupportedOperationException: StaticErrorSchema;
18
+ export declare var CloudTrailDataServiceException: StaticErrorSchema;
19
+ export declare var AuditEventResultEntries: StaticListSchema;
20
+ export declare var AuditEvents: StaticListSchema;
21
+ export declare var ResultErrorEntries: StaticListSchema;
22
+ export declare var PutAuditEvents: StaticOperationSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudtrail-data",
3
3
  "description": "AWS SDK for JavaScript Cloudtrail Data Client for Node.js, Browser and React Native",
4
- "version": "3.927.0",
4
+ "version": "3.929.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-cloudtrail-data",
@@ -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.927.0",
24
- "@aws-sdk/credential-provider-node": "3.927.0",
23
+ "@aws-sdk/core": "3.928.0",
24
+ "@aws-sdk/credential-provider-node": "3.929.0",
25
25
  "@aws-sdk/middleware-host-header": "3.922.0",
26
26
  "@aws-sdk/middleware-logger": "3.922.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.922.0",
28
- "@aws-sdk/middleware-user-agent": "3.927.0",
28
+ "@aws-sdk/middleware-user-agent": "3.928.0",
29
29
  "@aws-sdk/region-config-resolver": "3.925.0",
30
30
  "@aws-sdk/types": "3.922.0",
31
31
  "@aws-sdk/util-endpoints": "3.922.0",
32
32
  "@aws-sdk/util-user-agent-browser": "3.922.0",
33
- "@aws-sdk/util-user-agent-node": "3.927.0",
33
+ "@aws-sdk/util-user-agent-node": "3.928.0",
34
34
  "@smithy/config-resolver": "^4.4.2",
35
35
  "@smithy/core": "^3.17.2",
36
36
  "@smithy/fetch-http-handler": "^5.3.5",
@@ -1,159 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
4
- import { CloudTrailDataServiceException as __BaseException } from "../models/CloudTrailDataServiceException";
5
- import { ChannelInsufficientPermission, ChannelNotFound, ChannelUnsupportedSchema, DuplicatedAuditEventId, InvalidChannelARN, UnsupportedOperationException, } from "../models/models_0";
6
- export const se_PutAuditEventsCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- b.bp("/PutAuditEvents");
12
- const query = map({
13
- [_cA]: [, __expectNonNull(input[_cA], `channelArn`)],
14
- [_eI]: [, input[_eI]],
15
- });
16
- let body;
17
- body = JSON.stringify(take(input, {
18
- auditEvents: (_) => _json(_),
19
- }));
20
- b.m("POST").h(headers).q(query).b(body);
21
- return b.build();
22
- };
23
- export const de_PutAuditEventsCommand = async (output, context) => {
24
- if (output.statusCode !== 200 && output.statusCode >= 300) {
25
- return de_CommandError(output, context);
26
- }
27
- const contents = map({
28
- $metadata: deserializeMetadata(output),
29
- });
30
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
31
- const doc = take(data, {
32
- failed: _json,
33
- successful: _json,
34
- });
35
- Object.assign(contents, doc);
36
- return contents;
37
- };
38
- const de_CommandError = async (output, context) => {
39
- const parsedOutput = {
40
- ...output,
41
- body: await parseErrorBody(output.body, context),
42
- };
43
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
44
- switch (errorCode) {
45
- case "ChannelInsufficientPermission":
46
- case "com.amazonaws.cloudtraildata#ChannelInsufficientPermission":
47
- throw await de_ChannelInsufficientPermissionRes(parsedOutput, context);
48
- case "ChannelNotFound":
49
- case "com.amazonaws.cloudtraildata#ChannelNotFound":
50
- throw await de_ChannelNotFoundRes(parsedOutput, context);
51
- case "ChannelUnsupportedSchema":
52
- case "com.amazonaws.cloudtraildata#ChannelUnsupportedSchema":
53
- throw await de_ChannelUnsupportedSchemaRes(parsedOutput, context);
54
- case "DuplicatedAuditEventId":
55
- case "com.amazonaws.cloudtraildata#DuplicatedAuditEventId":
56
- throw await de_DuplicatedAuditEventIdRes(parsedOutput, context);
57
- case "InvalidChannelARN":
58
- case "com.amazonaws.cloudtraildata#InvalidChannelARN":
59
- throw await de_InvalidChannelARNRes(parsedOutput, context);
60
- case "UnsupportedOperationException":
61
- case "com.amazonaws.cloudtraildata#UnsupportedOperationException":
62
- throw await de_UnsupportedOperationExceptionRes(parsedOutput, context);
63
- default:
64
- const parsedBody = parsedOutput.body;
65
- return throwDefaultError({
66
- output,
67
- parsedBody,
68
- errorCode,
69
- });
70
- }
71
- };
72
- const throwDefaultError = withBaseException(__BaseException);
73
- const de_ChannelInsufficientPermissionRes = async (parsedOutput, context) => {
74
- const contents = map({});
75
- const data = parsedOutput.body;
76
- const doc = take(data, {
77
- message: __expectString,
78
- });
79
- Object.assign(contents, doc);
80
- const exception = new ChannelInsufficientPermission({
81
- $metadata: deserializeMetadata(parsedOutput),
82
- ...contents,
83
- });
84
- return __decorateServiceException(exception, parsedOutput.body);
85
- };
86
- const de_ChannelNotFoundRes = async (parsedOutput, context) => {
87
- const contents = map({});
88
- const data = parsedOutput.body;
89
- const doc = take(data, {
90
- message: __expectString,
91
- });
92
- Object.assign(contents, doc);
93
- const exception = new ChannelNotFound({
94
- $metadata: deserializeMetadata(parsedOutput),
95
- ...contents,
96
- });
97
- return __decorateServiceException(exception, parsedOutput.body);
98
- };
99
- const de_ChannelUnsupportedSchemaRes = async (parsedOutput, context) => {
100
- const contents = map({});
101
- const data = parsedOutput.body;
102
- const doc = take(data, {
103
- message: __expectString,
104
- });
105
- Object.assign(contents, doc);
106
- const exception = new ChannelUnsupportedSchema({
107
- $metadata: deserializeMetadata(parsedOutput),
108
- ...contents,
109
- });
110
- return __decorateServiceException(exception, parsedOutput.body);
111
- };
112
- const de_DuplicatedAuditEventIdRes = async (parsedOutput, context) => {
113
- const contents = map({});
114
- const data = parsedOutput.body;
115
- const doc = take(data, {
116
- message: __expectString,
117
- });
118
- Object.assign(contents, doc);
119
- const exception = new DuplicatedAuditEventId({
120
- $metadata: deserializeMetadata(parsedOutput),
121
- ...contents,
122
- });
123
- return __decorateServiceException(exception, parsedOutput.body);
124
- };
125
- const de_InvalidChannelARNRes = async (parsedOutput, context) => {
126
- const contents = map({});
127
- const data = parsedOutput.body;
128
- const doc = take(data, {
129
- message: __expectString,
130
- });
131
- Object.assign(contents, doc);
132
- const exception = new InvalidChannelARN({
133
- $metadata: deserializeMetadata(parsedOutput),
134
- ...contents,
135
- });
136
- return __decorateServiceException(exception, parsedOutput.body);
137
- };
138
- const de_UnsupportedOperationExceptionRes = async (parsedOutput, context) => {
139
- const contents = map({});
140
- const data = parsedOutput.body;
141
- const doc = take(data, {
142
- message: __expectString,
143
- });
144
- Object.assign(contents, doc);
145
- const exception = new UnsupportedOperationException({
146
- $metadata: deserializeMetadata(parsedOutput),
147
- ...contents,
148
- });
149
- return __decorateServiceException(exception, parsedOutput.body);
150
- };
151
- const deserializeMetadata = (output) => ({
152
- httpStatusCode: output.statusCode,
153
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
154
- extendedRequestId: output.headers["x-amz-id-2"],
155
- cfId: output.headers["x-amz-cf-id"],
156
- });
157
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
158
- const _cA = "channelArn";
159
- const _eI = "externalId";
@@ -1,11 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2
- import { SerdeContext as __SerdeContext } from "@smithy/types";
3
- import { PutAuditEventsCommandInput, PutAuditEventsCommandOutput } from "../commands/PutAuditEventsCommand";
4
- /**
5
- * serializeAws_restJson1PutAuditEventsCommand
6
- */
7
- export declare const se_PutAuditEventsCommand: (input: PutAuditEventsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
8
- /**
9
- * deserializeAws_restJson1PutAuditEventsCommand
10
- */
11
- export declare const de_PutAuditEventsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<PutAuditEventsCommandOutput>;
@@ -1,17 +0,0 @@
1
- import {
2
- HttpRequest as __HttpRequest,
3
- HttpResponse as __HttpResponse,
4
- } from "@smithy/protocol-http";
5
- import { SerdeContext as __SerdeContext } from "@smithy/types";
6
- import {
7
- PutAuditEventsCommandInput,
8
- PutAuditEventsCommandOutput,
9
- } from "../commands/PutAuditEventsCommand";
10
- export declare const se_PutAuditEventsCommand: (
11
- input: PutAuditEventsCommandInput,
12
- context: __SerdeContext
13
- ) => Promise<__HttpRequest>;
14
- export declare const de_PutAuditEventsCommand: (
15
- output: __HttpResponse,
16
- context: __SerdeContext
17
- ) => Promise<PutAuditEventsCommandOutput>;