@aws-sdk/client-cloudtrail 3.162.0 → 3.168.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/CloudTrail.js +30 -0
  3. package/dist-cjs/commands/GetChannelCommand.js +36 -0
  4. package/dist-cjs/commands/ListChannelsCommand.js +36 -0
  5. package/dist-cjs/commands/index.js +2 -0
  6. package/dist-cjs/models/models_0.js +64 -3
  7. package/dist-cjs/pagination/ListChannelsPaginator.js +36 -0
  8. package/dist-cjs/pagination/index.js +1 -0
  9. package/dist-cjs/protocols/Aws_json1_1.js +204 -2
  10. package/dist-es/CloudTrail.js +30 -0
  11. package/dist-es/commands/GetChannelCommand.js +39 -0
  12. package/dist-es/commands/ListChannelsCommand.js +39 -0
  13. package/dist-es/commands/index.js +2 -0
  14. package/dist-es/models/models_0.js +38 -0
  15. package/dist-es/pagination/ListChannelsPaginator.js +75 -0
  16. package/dist-es/pagination/index.js +1 -0
  17. package/dist-es/protocols/Aws_json1_1.js +239 -1
  18. package/dist-types/CloudTrail.d.ts +19 -1
  19. package/dist-types/CloudTrailClient.d.ts +4 -2
  20. package/dist-types/commands/GetChannelCommand.d.ts +37 -0
  21. package/dist-types/commands/ListChannelsCommand.d.ts +37 -0
  22. package/dist-types/commands/UpdateEventDataStoreCommand.d.ts +1 -1
  23. package/dist-types/commands/index.d.ts +2 -0
  24. package/dist-types/models/models_0.d.ts +199 -5
  25. package/dist-types/pagination/ListChannelsPaginator.d.ts +4 -0
  26. package/dist-types/pagination/index.d.ts +1 -0
  27. package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
  28. package/dist-types/ts3.4/CloudTrail.d.ts +10 -0
  29. package/dist-types/ts3.4/CloudTrailClient.d.ts +4 -2
  30. package/dist-types/ts3.4/commands/GetChannelCommand.d.ts +17 -0
  31. package/dist-types/ts3.4/commands/ListChannelsCommand.d.ts +17 -0
  32. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  33. package/dist-types/ts3.4/models/models_0.d.ts +85 -0
  34. package/dist-types/ts3.4/pagination/ListChannelsPaginator.d.ts +4 -0
  35. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  36. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +6 -0
  37. package/package.json +34 -33
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_json1_1PutEventSelectorsCommand = exports.deserializeAws_json1_1LookupEventsCommand = exports.deserializeAws_json1_1ListTrailsCommand = exports.deserializeAws_json1_1ListTagsCommand = exports.deserializeAws_json1_1ListQueriesCommand = exports.deserializeAws_json1_1ListPublicKeysCommand = exports.deserializeAws_json1_1ListEventDataStoresCommand = exports.deserializeAws_json1_1GetTrailStatusCommand = exports.deserializeAws_json1_1GetTrailCommand = exports.deserializeAws_json1_1GetQueryResultsCommand = exports.deserializeAws_json1_1GetInsightSelectorsCommand = exports.deserializeAws_json1_1GetEventSelectorsCommand = exports.deserializeAws_json1_1GetEventDataStoreCommand = exports.deserializeAws_json1_1DescribeTrailsCommand = exports.deserializeAws_json1_1DescribeQueryCommand = exports.deserializeAws_json1_1DeleteTrailCommand = exports.deserializeAws_json1_1DeleteEventDataStoreCommand = exports.deserializeAws_json1_1CreateTrailCommand = exports.deserializeAws_json1_1CreateEventDataStoreCommand = exports.deserializeAws_json1_1CancelQueryCommand = exports.deserializeAws_json1_1AddTagsCommand = exports.serializeAws_json1_1UpdateTrailCommand = exports.serializeAws_json1_1UpdateEventDataStoreCommand = exports.serializeAws_json1_1StopLoggingCommand = exports.serializeAws_json1_1StartQueryCommand = exports.serializeAws_json1_1StartLoggingCommand = exports.serializeAws_json1_1RestoreEventDataStoreCommand = exports.serializeAws_json1_1RemoveTagsCommand = exports.serializeAws_json1_1PutInsightSelectorsCommand = exports.serializeAws_json1_1PutEventSelectorsCommand = exports.serializeAws_json1_1LookupEventsCommand = exports.serializeAws_json1_1ListTrailsCommand = exports.serializeAws_json1_1ListTagsCommand = exports.serializeAws_json1_1ListQueriesCommand = exports.serializeAws_json1_1ListPublicKeysCommand = exports.serializeAws_json1_1ListEventDataStoresCommand = exports.serializeAws_json1_1GetTrailStatusCommand = exports.serializeAws_json1_1GetTrailCommand = exports.serializeAws_json1_1GetQueryResultsCommand = exports.serializeAws_json1_1GetInsightSelectorsCommand = exports.serializeAws_json1_1GetEventSelectorsCommand = exports.serializeAws_json1_1GetEventDataStoreCommand = exports.serializeAws_json1_1DescribeTrailsCommand = exports.serializeAws_json1_1DescribeQueryCommand = exports.serializeAws_json1_1DeleteTrailCommand = exports.serializeAws_json1_1DeleteEventDataStoreCommand = exports.serializeAws_json1_1CreateTrailCommand = exports.serializeAws_json1_1CreateEventDataStoreCommand = exports.serializeAws_json1_1CancelQueryCommand = exports.serializeAws_json1_1AddTagsCommand = void 0;
4
- exports.deserializeAws_json1_1UpdateTrailCommand = exports.deserializeAws_json1_1UpdateEventDataStoreCommand = exports.deserializeAws_json1_1StopLoggingCommand = exports.deserializeAws_json1_1StartQueryCommand = exports.deserializeAws_json1_1StartLoggingCommand = exports.deserializeAws_json1_1RestoreEventDataStoreCommand = exports.deserializeAws_json1_1RemoveTagsCommand = exports.deserializeAws_json1_1PutInsightSelectorsCommand = void 0;
3
+ exports.deserializeAws_json1_1ListQueriesCommand = exports.deserializeAws_json1_1ListPublicKeysCommand = exports.deserializeAws_json1_1ListEventDataStoresCommand = exports.deserializeAws_json1_1ListChannelsCommand = exports.deserializeAws_json1_1GetTrailStatusCommand = exports.deserializeAws_json1_1GetTrailCommand = exports.deserializeAws_json1_1GetQueryResultsCommand = exports.deserializeAws_json1_1GetInsightSelectorsCommand = exports.deserializeAws_json1_1GetEventSelectorsCommand = exports.deserializeAws_json1_1GetEventDataStoreCommand = exports.deserializeAws_json1_1GetChannelCommand = exports.deserializeAws_json1_1DescribeTrailsCommand = exports.deserializeAws_json1_1DescribeQueryCommand = exports.deserializeAws_json1_1DeleteTrailCommand = exports.deserializeAws_json1_1DeleteEventDataStoreCommand = exports.deserializeAws_json1_1CreateTrailCommand = exports.deserializeAws_json1_1CreateEventDataStoreCommand = exports.deserializeAws_json1_1CancelQueryCommand = exports.deserializeAws_json1_1AddTagsCommand = exports.serializeAws_json1_1UpdateTrailCommand = exports.serializeAws_json1_1UpdateEventDataStoreCommand = exports.serializeAws_json1_1StopLoggingCommand = exports.serializeAws_json1_1StartQueryCommand = exports.serializeAws_json1_1StartLoggingCommand = exports.serializeAws_json1_1RestoreEventDataStoreCommand = exports.serializeAws_json1_1RemoveTagsCommand = exports.serializeAws_json1_1PutInsightSelectorsCommand = exports.serializeAws_json1_1PutEventSelectorsCommand = exports.serializeAws_json1_1LookupEventsCommand = exports.serializeAws_json1_1ListTrailsCommand = exports.serializeAws_json1_1ListTagsCommand = exports.serializeAws_json1_1ListQueriesCommand = exports.serializeAws_json1_1ListPublicKeysCommand = exports.serializeAws_json1_1ListEventDataStoresCommand = exports.serializeAws_json1_1ListChannelsCommand = exports.serializeAws_json1_1GetTrailStatusCommand = exports.serializeAws_json1_1GetTrailCommand = exports.serializeAws_json1_1GetQueryResultsCommand = exports.serializeAws_json1_1GetInsightSelectorsCommand = exports.serializeAws_json1_1GetEventSelectorsCommand = exports.serializeAws_json1_1GetEventDataStoreCommand = exports.serializeAws_json1_1GetChannelCommand = exports.serializeAws_json1_1DescribeTrailsCommand = exports.serializeAws_json1_1DescribeQueryCommand = exports.serializeAws_json1_1DeleteTrailCommand = exports.serializeAws_json1_1DeleteEventDataStoreCommand = exports.serializeAws_json1_1CreateTrailCommand = exports.serializeAws_json1_1CreateEventDataStoreCommand = exports.serializeAws_json1_1CancelQueryCommand = exports.serializeAws_json1_1AddTagsCommand = void 0;
4
+ exports.deserializeAws_json1_1UpdateTrailCommand = exports.deserializeAws_json1_1UpdateEventDataStoreCommand = exports.deserializeAws_json1_1StopLoggingCommand = exports.deserializeAws_json1_1StartQueryCommand = exports.deserializeAws_json1_1StartLoggingCommand = exports.deserializeAws_json1_1RestoreEventDataStoreCommand = exports.deserializeAws_json1_1RemoveTagsCommand = exports.deserializeAws_json1_1PutInsightSelectorsCommand = exports.deserializeAws_json1_1PutEventSelectorsCommand = exports.deserializeAws_json1_1LookupEventsCommand = exports.deserializeAws_json1_1ListTrailsCommand = exports.deserializeAws_json1_1ListTagsCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const CloudTrailServiceException_1 = require("../models/CloudTrailServiceException");
@@ -86,6 +86,16 @@ const serializeAws_json1_1DescribeTrailsCommand = async (input, context) => {
86
86
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
87
87
  };
88
88
  exports.serializeAws_json1_1DescribeTrailsCommand = serializeAws_json1_1DescribeTrailsCommand;
89
+ const serializeAws_json1_1GetChannelCommand = async (input, context) => {
90
+ const headers = {
91
+ "content-type": "application/x-amz-json-1.1",
92
+ "x-amz-target": "CloudTrail_20131101.GetChannel",
93
+ };
94
+ let body;
95
+ body = JSON.stringify(serializeAws_json1_1GetChannelRequest(input, context));
96
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
+ };
98
+ exports.serializeAws_json1_1GetChannelCommand = serializeAws_json1_1GetChannelCommand;
89
99
  const serializeAws_json1_1GetEventDataStoreCommand = async (input, context) => {
90
100
  const headers = {
91
101
  "content-type": "application/x-amz-json-1.1",
@@ -146,6 +156,16 @@ const serializeAws_json1_1GetTrailStatusCommand = async (input, context) => {
146
156
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
157
  };
148
158
  exports.serializeAws_json1_1GetTrailStatusCommand = serializeAws_json1_1GetTrailStatusCommand;
159
+ const serializeAws_json1_1ListChannelsCommand = async (input, context) => {
160
+ const headers = {
161
+ "content-type": "application/x-amz-json-1.1",
162
+ "x-amz-target": "CloudTrail_20131101.ListChannels",
163
+ };
164
+ let body;
165
+ body = JSON.stringify(serializeAws_json1_1ListChannelsRequest(input, context));
166
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
167
+ };
168
+ exports.serializeAws_json1_1ListChannelsCommand = serializeAws_json1_1ListChannelsCommand;
149
169
  const serializeAws_json1_1ListEventDataStoresCommand = async (input, context) => {
150
170
  const headers = {
151
171
  "content-type": "application/x-amz-json-1.1",
@@ -808,6 +828,49 @@ const deserializeAws_json1_1DescribeTrailsCommandError = async (output, context)
808
828
  });
809
829
  }
810
830
  };
831
+ const deserializeAws_json1_1GetChannelCommand = async (output, context) => {
832
+ if (output.statusCode >= 300) {
833
+ return deserializeAws_json1_1GetChannelCommandError(output, context);
834
+ }
835
+ const data = await parseBody(output.body, context);
836
+ let contents = {};
837
+ contents = deserializeAws_json1_1GetChannelResponse(data, context);
838
+ const response = {
839
+ $metadata: deserializeMetadata(output),
840
+ ...contents,
841
+ };
842
+ return Promise.resolve(response);
843
+ };
844
+ exports.deserializeAws_json1_1GetChannelCommand = deserializeAws_json1_1GetChannelCommand;
845
+ const deserializeAws_json1_1GetChannelCommandError = async (output, context) => {
846
+ const parsedOutput = {
847
+ ...output,
848
+ body: await parseBody(output.body, context),
849
+ };
850
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
851
+ switch (errorCode) {
852
+ case "ChannelARNInvalidException":
853
+ case "com.amazonaws.cloudtrail#ChannelARNInvalidException":
854
+ throw await deserializeAws_json1_1ChannelARNInvalidExceptionResponse(parsedOutput, context);
855
+ case "ChannelNotFoundException":
856
+ case "com.amazonaws.cloudtrail#ChannelNotFoundException":
857
+ throw await deserializeAws_json1_1ChannelNotFoundExceptionResponse(parsedOutput, context);
858
+ case "OperationNotPermittedException":
859
+ case "com.amazonaws.cloudtrail#OperationNotPermittedException":
860
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
861
+ case "UnsupportedOperationException":
862
+ case "com.amazonaws.cloudtrail#UnsupportedOperationException":
863
+ throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
864
+ default:
865
+ const parsedBody = parsedOutput.body;
866
+ (0, smithy_client_1.throwDefaultError)({
867
+ output,
868
+ parsedBody,
869
+ exceptionCtor: CloudTrailServiceException_1.CloudTrailServiceException,
870
+ errorCode,
871
+ });
872
+ }
873
+ };
811
874
  const deserializeAws_json1_1GetEventDataStoreCommand = async (output, context) => {
812
875
  if (output.statusCode >= 300) {
813
876
  return deserializeAws_json1_1GetEventDataStoreCommandError(output, context);
@@ -1087,6 +1150,46 @@ const deserializeAws_json1_1GetTrailStatusCommandError = async (output, context)
1087
1150
  });
1088
1151
  }
1089
1152
  };
1153
+ const deserializeAws_json1_1ListChannelsCommand = async (output, context) => {
1154
+ if (output.statusCode >= 300) {
1155
+ return deserializeAws_json1_1ListChannelsCommandError(output, context);
1156
+ }
1157
+ const data = await parseBody(output.body, context);
1158
+ let contents = {};
1159
+ contents = deserializeAws_json1_1ListChannelsResponse(data, context);
1160
+ const response = {
1161
+ $metadata: deserializeMetadata(output),
1162
+ ...contents,
1163
+ };
1164
+ return Promise.resolve(response);
1165
+ };
1166
+ exports.deserializeAws_json1_1ListChannelsCommand = deserializeAws_json1_1ListChannelsCommand;
1167
+ const deserializeAws_json1_1ListChannelsCommandError = async (output, context) => {
1168
+ const parsedOutput = {
1169
+ ...output,
1170
+ body: await parseBody(output.body, context),
1171
+ };
1172
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1173
+ switch (errorCode) {
1174
+ case "InvalidNextTokenException":
1175
+ case "com.amazonaws.cloudtrail#InvalidNextTokenException":
1176
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
1177
+ case "OperationNotPermittedException":
1178
+ case "com.amazonaws.cloudtrail#OperationNotPermittedException":
1179
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1180
+ case "UnsupportedOperationException":
1181
+ case "com.amazonaws.cloudtrail#UnsupportedOperationException":
1182
+ throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1183
+ default:
1184
+ const parsedBody = parsedOutput.body;
1185
+ (0, smithy_client_1.throwDefaultError)({
1186
+ output,
1187
+ parsedBody,
1188
+ exceptionCtor: CloudTrailServiceException_1.CloudTrailServiceException,
1189
+ errorCode,
1190
+ });
1191
+ }
1192
+ };
1090
1193
  const deserializeAws_json1_1ListEventDataStoresCommand = async (output, context) => {
1091
1194
  if (output.statusCode >= 300) {
1092
1195
  return deserializeAws_json1_1ListEventDataStoresCommandError(output, context);
@@ -1966,6 +2069,24 @@ const deserializeAws_json1_1UpdateTrailCommandError = async (output, context) =>
1966
2069
  });
1967
2070
  }
1968
2071
  };
2072
+ const deserializeAws_json1_1ChannelARNInvalidExceptionResponse = async (parsedOutput, context) => {
2073
+ const body = parsedOutput.body;
2074
+ const deserialized = deserializeAws_json1_1ChannelARNInvalidException(body, context);
2075
+ const exception = new models_0_1.ChannelARNInvalidException({
2076
+ $metadata: deserializeMetadata(parsedOutput),
2077
+ ...deserialized,
2078
+ });
2079
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
2080
+ };
2081
+ const deserializeAws_json1_1ChannelNotFoundExceptionResponse = async (parsedOutput, context) => {
2082
+ const body = parsedOutput.body;
2083
+ const deserialized = deserializeAws_json1_1ChannelNotFoundException(body, context);
2084
+ const exception = new models_0_1.ChannelNotFoundException({
2085
+ $metadata: deserializeMetadata(parsedOutput),
2086
+ ...deserialized,
2087
+ });
2088
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
2089
+ };
1969
2090
  const deserializeAws_json1_1CloudTrailAccessNotEnabledExceptionResponse = async (parsedOutput, context) => {
1970
2091
  const body = parsedOutput.body;
1971
2092
  const deserialized = deserializeAws_json1_1CloudTrailAccessNotEnabledException(body, context);
@@ -2634,6 +2755,11 @@ const serializeAws_json1_1ExcludeManagementEventSources = (input, context) => {
2634
2755
  return entry;
2635
2756
  });
2636
2757
  };
2758
+ const serializeAws_json1_1GetChannelRequest = (input, context) => {
2759
+ return {
2760
+ ...(input.Channel != null && { Channel: input.Channel }),
2761
+ };
2762
+ };
2637
2763
  const serializeAws_json1_1GetEventDataStoreRequest = (input, context) => {
2638
2764
  return {
2639
2765
  ...(input.EventDataStore != null && { EventDataStore: input.EventDataStore }),
@@ -2679,6 +2805,12 @@ const serializeAws_json1_1InsightSelectors = (input, context) => {
2679
2805
  return serializeAws_json1_1InsightSelector(entry, context);
2680
2806
  });
2681
2807
  };
2808
+ const serializeAws_json1_1ListChannelsRequest = (input, context) => {
2809
+ return {
2810
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
2811
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
2812
+ };
2813
+ };
2682
2814
  const serializeAws_json1_1ListEventDataStoresRequest = (input, context) => {
2683
2815
  return {
2684
2816
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -2899,6 +3031,33 @@ const deserializeAws_json1_1CancelQueryResponse = (output, context) => {
2899
3031
  QueryStatus: (0, smithy_client_1.expectString)(output.QueryStatus),
2900
3032
  };
2901
3033
  };
3034
+ const deserializeAws_json1_1Channel = (output, context) => {
3035
+ return {
3036
+ ChannelArn: (0, smithy_client_1.expectString)(output.ChannelArn),
3037
+ Name: (0, smithy_client_1.expectString)(output.Name),
3038
+ };
3039
+ };
3040
+ const deserializeAws_json1_1ChannelARNInvalidException = (output, context) => {
3041
+ return {
3042
+ Message: (0, smithy_client_1.expectString)(output.Message),
3043
+ };
3044
+ };
3045
+ const deserializeAws_json1_1ChannelNotFoundException = (output, context) => {
3046
+ return {
3047
+ Message: (0, smithy_client_1.expectString)(output.Message),
3048
+ };
3049
+ };
3050
+ const deserializeAws_json1_1Channels = (output, context) => {
3051
+ const retVal = (output || [])
3052
+ .filter((e) => e != null)
3053
+ .map((entry) => {
3054
+ if (entry === null) {
3055
+ return null;
3056
+ }
3057
+ return deserializeAws_json1_1Channel(entry, context);
3058
+ });
3059
+ return retVal;
3060
+ };
2902
3061
  const deserializeAws_json1_1CloudTrailAccessNotEnabledException = (output, context) => {
2903
3062
  return {
2904
3063
  Message: (0, smithy_client_1.expectString)(output.Message),
@@ -3012,6 +3171,23 @@ const deserializeAws_json1_1DescribeTrailsResponse = (output, context) => {
3012
3171
  trailList: output.trailList != null ? deserializeAws_json1_1TrailList(output.trailList, context) : undefined,
3013
3172
  };
3014
3173
  };
3174
+ const deserializeAws_json1_1Destination = (output, context) => {
3175
+ return {
3176
+ Location: (0, smithy_client_1.expectString)(output.Location),
3177
+ Type: (0, smithy_client_1.expectString)(output.Type),
3178
+ };
3179
+ };
3180
+ const deserializeAws_json1_1Destinations = (output, context) => {
3181
+ const retVal = (output || [])
3182
+ .filter((e) => e != null)
3183
+ .map((entry) => {
3184
+ if (entry === null) {
3185
+ return null;
3186
+ }
3187
+ return deserializeAws_json1_1Destination(entry, context);
3188
+ });
3189
+ return retVal;
3190
+ };
3015
3191
  const deserializeAws_json1_1Event = (output, context) => {
3016
3192
  return {
3017
3193
  AccessKeyId: (0, smithy_client_1.expectString)(output.AccessKeyId),
@@ -3124,6 +3300,15 @@ const deserializeAws_json1_1ExcludeManagementEventSources = (output, context) =>
3124
3300
  });
3125
3301
  return retVal;
3126
3302
  };
3303
+ const deserializeAws_json1_1GetChannelResponse = (output, context) => {
3304
+ return {
3305
+ ChannelArn: (0, smithy_client_1.expectString)(output.ChannelArn),
3306
+ Destinations: output.Destinations != null ? deserializeAws_json1_1Destinations(output.Destinations, context) : undefined,
3307
+ Name: (0, smithy_client_1.expectString)(output.Name),
3308
+ Source: (0, smithy_client_1.expectString)(output.Source),
3309
+ SourceConfig: output.SourceConfig != null ? deserializeAws_json1_1SourceConfig(output.SourceConfig, context) : undefined,
3310
+ };
3311
+ };
3127
3312
  const deserializeAws_json1_1GetEventDataStoreResponse = (output, context) => {
3128
3313
  return {
3129
3314
  AdvancedEventSelectors: output.AdvancedEventSelectors != null
@@ -3393,6 +3578,12 @@ const deserializeAws_json1_1KmsKeyNotFoundException = (output, context) => {
3393
3578
  Message: (0, smithy_client_1.expectString)(output.Message),
3394
3579
  };
3395
3580
  };
3581
+ const deserializeAws_json1_1ListChannelsResponse = (output, context) => {
3582
+ return {
3583
+ Channels: output.Channels != null ? deserializeAws_json1_1Channels(output.Channels, context) : undefined,
3584
+ NextToken: (0, smithy_client_1.expectString)(output.NextToken),
3585
+ };
3586
+ };
3396
3587
  const deserializeAws_json1_1ListEventDataStoresResponse = (output, context) => {
3397
3588
  return {
3398
3589
  EventDataStores: output.EventDataStores != null
@@ -3662,6 +3853,14 @@ const deserializeAws_json1_1S3BucketDoesNotExistException = (output, context) =>
3662
3853
  Message: (0, smithy_client_1.expectString)(output.Message),
3663
3854
  };
3664
3855
  };
3856
+ const deserializeAws_json1_1SourceConfig = (output, context) => {
3857
+ return {
3858
+ AdvancedEventSelectors: output.AdvancedEventSelectors != null
3859
+ ? deserializeAws_json1_1AdvancedEventSelectors(output.AdvancedEventSelectors, context)
3860
+ : undefined,
3861
+ ApplyToAllRegions: (0, smithy_client_1.expectBoolean)(output.ApplyToAllRegions),
3862
+ };
3863
+ };
3665
3864
  const deserializeAws_json1_1StartLoggingResponse = (output, context) => {
3666
3865
  return {};
3667
3866
  };
@@ -3848,6 +4047,9 @@ const loadRestJsonErrorCode = (output, data) => {
3848
4047
  if (typeof cleanValue === "number") {
3849
4048
  cleanValue = cleanValue.toString();
3850
4049
  }
4050
+ if (cleanValue.indexOf(",") >= 0) {
4051
+ cleanValue = cleanValue.split(",")[0];
4052
+ }
3851
4053
  if (cleanValue.indexOf(":") >= 0) {
3852
4054
  cleanValue = cleanValue.split(":")[0];
3853
4055
  }
@@ -8,12 +8,14 @@ import { DeleteEventDataStoreCommand, } from "./commands/DeleteEventDataStoreCom
8
8
  import { DeleteTrailCommand } from "./commands/DeleteTrailCommand";
9
9
  import { DescribeQueryCommand, } from "./commands/DescribeQueryCommand";
10
10
  import { DescribeTrailsCommand, } from "./commands/DescribeTrailsCommand";
11
+ import { GetChannelCommand } from "./commands/GetChannelCommand";
11
12
  import { GetEventDataStoreCommand, } from "./commands/GetEventDataStoreCommand";
12
13
  import { GetEventSelectorsCommand, } from "./commands/GetEventSelectorsCommand";
13
14
  import { GetInsightSelectorsCommand, } from "./commands/GetInsightSelectorsCommand";
14
15
  import { GetQueryResultsCommand, } from "./commands/GetQueryResultsCommand";
15
16
  import { GetTrailCommand } from "./commands/GetTrailCommand";
16
17
  import { GetTrailStatusCommand, } from "./commands/GetTrailStatusCommand";
18
+ import { ListChannelsCommand, } from "./commands/ListChannelsCommand";
17
19
  import { ListEventDataStoresCommand, } from "./commands/ListEventDataStoresCommand";
18
20
  import { ListPublicKeysCommand, } from "./commands/ListPublicKeysCommand";
19
21
  import { ListQueriesCommand } from "./commands/ListQueriesCommand";
@@ -146,6 +148,20 @@ var CloudTrail = (function (_super) {
146
148
  return this.send(command, optionsOrCb);
147
149
  }
148
150
  };
151
+ CloudTrail.prototype.getChannel = function (args, optionsOrCb, cb) {
152
+ var command = new GetChannelCommand(args);
153
+ if (typeof optionsOrCb === "function") {
154
+ this.send(command, optionsOrCb);
155
+ }
156
+ else if (typeof cb === "function") {
157
+ if (typeof optionsOrCb !== "object")
158
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
159
+ this.send(command, optionsOrCb || {}, cb);
160
+ }
161
+ else {
162
+ return this.send(command, optionsOrCb);
163
+ }
164
+ };
149
165
  CloudTrail.prototype.getEventDataStore = function (args, optionsOrCb, cb) {
150
166
  var command = new GetEventDataStoreCommand(args);
151
167
  if (typeof optionsOrCb === "function") {
@@ -230,6 +246,20 @@ var CloudTrail = (function (_super) {
230
246
  return this.send(command, optionsOrCb);
231
247
  }
232
248
  };
249
+ CloudTrail.prototype.listChannels = function (args, optionsOrCb, cb) {
250
+ var command = new ListChannelsCommand(args);
251
+ if (typeof optionsOrCb === "function") {
252
+ this.send(command, optionsOrCb);
253
+ }
254
+ else if (typeof cb === "function") {
255
+ if (typeof optionsOrCb !== "object")
256
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
257
+ this.send(command, optionsOrCb || {}, cb);
258
+ }
259
+ else {
260
+ return this.send(command, optionsOrCb);
261
+ }
262
+ };
233
263
  CloudTrail.prototype.listEventDataStores = function (args, optionsOrCb, cb) {
234
264
  var command = new ListEventDataStoresCommand(args);
235
265
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { GetChannelRequestFilterSensitiveLog, GetChannelResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_json1_1GetChannelCommand, serializeAws_json1_1GetChannelCommand, } from "../protocols/Aws_json1_1";
6
+ var GetChannelCommand = (function (_super) {
7
+ __extends(GetChannelCommand, _super);
8
+ function GetChannelCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ GetChannelCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "CloudTrailClient";
18
+ var commandName = "GetChannelCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: GetChannelRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: GetChannelResponseFilterSensitiveLog,
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ GetChannelCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_json1_1GetChannelCommand(input, context);
33
+ };
34
+ GetChannelCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_json1_1GetChannelCommand(output, context);
36
+ };
37
+ return GetChannelCommand;
38
+ }($Command));
39
+ export { GetChannelCommand };
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { ListChannelsRequestFilterSensitiveLog, ListChannelsResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_json1_1ListChannelsCommand, serializeAws_json1_1ListChannelsCommand, } from "../protocols/Aws_json1_1";
6
+ var ListChannelsCommand = (function (_super) {
7
+ __extends(ListChannelsCommand, _super);
8
+ function ListChannelsCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ ListChannelsCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "CloudTrailClient";
18
+ var commandName = "ListChannelsCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: ListChannelsRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: ListChannelsResponseFilterSensitiveLog,
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ ListChannelsCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_json1_1ListChannelsCommand(input, context);
33
+ };
34
+ ListChannelsCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_json1_1ListChannelsCommand(output, context);
36
+ };
37
+ return ListChannelsCommand;
38
+ }($Command));
39
+ export { ListChannelsCommand };
@@ -6,12 +6,14 @@ export * from "./DeleteEventDataStoreCommand";
6
6
  export * from "./DeleteTrailCommand";
7
7
  export * from "./DescribeQueryCommand";
8
8
  export * from "./DescribeTrailsCommand";
9
+ export * from "./GetChannelCommand";
9
10
  export * from "./GetEventDataStoreCommand";
10
11
  export * from "./GetEventSelectorsCommand";
11
12
  export * from "./GetInsightSelectorsCommand";
12
13
  export * from "./GetQueryResultsCommand";
13
14
  export * from "./GetTrailCommand";
14
15
  export * from "./GetTrailStatusCommand";
16
+ export * from "./ListChannelsCommand";
15
17
  export * from "./ListEventDataStoresCommand";
16
18
  export * from "./ListPublicKeysCommand";
17
19
  export * from "./ListQueriesCommand";
@@ -217,6 +217,32 @@ var QueryIdNotFoundException = (function (_super) {
217
217
  return QueryIdNotFoundException;
218
218
  }(__BaseException));
219
219
  export { QueryIdNotFoundException };
220
+ var ChannelARNInvalidException = (function (_super) {
221
+ __extends(ChannelARNInvalidException, _super);
222
+ function ChannelARNInvalidException(opts) {
223
+ var _this = _super.call(this, __assign({ name: "ChannelARNInvalidException", $fault: "client" }, opts)) || this;
224
+ _this.name = "ChannelARNInvalidException";
225
+ _this.$fault = "client";
226
+ Object.setPrototypeOf(_this, ChannelARNInvalidException.prototype);
227
+ _this.Message = opts.Message;
228
+ return _this;
229
+ }
230
+ return ChannelARNInvalidException;
231
+ }(__BaseException));
232
+ export { ChannelARNInvalidException };
233
+ var ChannelNotFoundException = (function (_super) {
234
+ __extends(ChannelNotFoundException, _super);
235
+ function ChannelNotFoundException(opts) {
236
+ var _this = _super.call(this, __assign({ name: "ChannelNotFoundException", $fault: "client" }, opts)) || this;
237
+ _this.name = "ChannelNotFoundException";
238
+ _this.$fault = "client";
239
+ Object.setPrototypeOf(_this, ChannelNotFoundException.prototype);
240
+ _this.Message = opts.Message;
241
+ return _this;
242
+ }
243
+ return ChannelNotFoundException;
244
+ }(__BaseException));
245
+ export { ChannelNotFoundException };
220
246
  var CloudTrailAccessNotEnabledException = (function (_super) {
221
247
  __extends(CloudTrailAccessNotEnabledException, _super);
222
248
  function CloudTrailAccessNotEnabledException(opts) {
@@ -587,6 +613,11 @@ var TrailNotFoundException = (function (_super) {
587
613
  return TrailNotFoundException;
588
614
  }(__BaseException));
589
615
  export { TrailNotFoundException };
616
+ export var DestinationType;
617
+ (function (DestinationType) {
618
+ DestinationType["AWS_SERVICE"] = "AWS_SERVICE";
619
+ DestinationType["EVENT_DATA_STORE"] = "EVENT_DATA_STORE";
620
+ })(DestinationType || (DestinationType = {}));
590
621
  export var ReadWriteType;
591
622
  (function (ReadWriteType) {
592
623
  ReadWriteType["All"] = "All";
@@ -802,6 +833,7 @@ export var AdvancedFieldSelectorFilterSensitiveLog = function (obj) { return (__
802
833
  export var AdvancedEventSelectorFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
803
834
  export var CancelQueryRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
804
835
  export var CancelQueryResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
836
+ export var ChannelFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
805
837
  export var CreateEventDataStoreRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
806
838
  export var CreateEventDataStoreResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
807
839
  export var CreateTrailRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -816,6 +848,10 @@ export var DescribeQueryResponseFilterSensitiveLog = function (obj) { return (__
816
848
  export var DescribeTrailsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
817
849
  export var TrailFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
818
850
  export var DescribeTrailsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
851
+ export var GetChannelRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
852
+ export var DestinationFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
853
+ export var SourceConfigFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
854
+ export var GetChannelResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
819
855
  export var GetEventDataStoreRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
820
856
  export var GetEventDataStoreResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
821
857
  export var GetEventSelectorsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -832,6 +868,8 @@ export var GetTrailRequestFilterSensitiveLog = function (obj) { return (__assign
832
868
  export var GetTrailResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
833
869
  export var GetTrailStatusRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
834
870
  export var GetTrailStatusResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
871
+ export var ListChannelsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
872
+ export var ListChannelsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
835
873
  export var ListEventDataStoresRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
836
874
  export var EventDataStoreFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
837
875
  export var ListEventDataStoresResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -0,0 +1,75 @@
1
+ import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
+ import { CloudTrail } from "../CloudTrail";
3
+ import { CloudTrailClient } from "../CloudTrailClient";
4
+ import { ListChannelsCommand, } from "../commands/ListChannelsCommand";
5
+ var makePagedClientRequest = function (client, input) {
6
+ var args = [];
7
+ for (var _i = 2; _i < arguments.length; _i++) {
8
+ args[_i - 2] = arguments[_i];
9
+ }
10
+ return __awaiter(void 0, void 0, void 0, function () {
11
+ return __generator(this, function (_a) {
12
+ switch (_a.label) {
13
+ case 0: return [4, client.send.apply(client, __spreadArray([new ListChannelsCommand(input)], __read(args), false))];
14
+ case 1: return [2, _a.sent()];
15
+ }
16
+ });
17
+ });
18
+ };
19
+ var makePagedRequest = function (client, input) {
20
+ var args = [];
21
+ for (var _i = 2; _i < arguments.length; _i++) {
22
+ args[_i - 2] = arguments[_i];
23
+ }
24
+ return __awaiter(void 0, void 0, void 0, function () {
25
+ return __generator(this, function (_a) {
26
+ switch (_a.label) {
27
+ case 0: return [4, client.listChannels.apply(client, __spreadArray([input], __read(args), false))];
28
+ case 1: return [2, _a.sent()];
29
+ }
30
+ });
31
+ });
32
+ };
33
+ export function paginateListChannels(config, input) {
34
+ var additionalArguments = [];
35
+ for (var _i = 2; _i < arguments.length; _i++) {
36
+ additionalArguments[_i - 2] = arguments[_i];
37
+ }
38
+ return __asyncGenerator(this, arguments, function paginateListChannels_1() {
39
+ var token, hasNext, page, prevToken;
40
+ return __generator(this, function (_a) {
41
+ switch (_a.label) {
42
+ case 0:
43
+ token = config.startingToken || undefined;
44
+ hasNext = true;
45
+ _a.label = 1;
46
+ case 1:
47
+ if (!hasNext) return [3, 9];
48
+ input.NextToken = token;
49
+ input["MaxResults"] = config.pageSize;
50
+ if (!(config.client instanceof CloudTrail)) return [3, 3];
51
+ return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
52
+ case 2:
53
+ page = _a.sent();
54
+ return [3, 6];
55
+ case 3:
56
+ if (!(config.client instanceof CloudTrailClient)) return [3, 5];
57
+ return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
58
+ case 4:
59
+ page = _a.sent();
60
+ return [3, 6];
61
+ case 5: throw new Error("Invalid client, expected CloudTrail | CloudTrailClient");
62
+ case 6: return [4, __await(page)];
63
+ case 7: return [4, _a.sent()];
64
+ case 8:
65
+ _a.sent();
66
+ prevToken = token;
67
+ token = page.NextToken;
68
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
69
+ return [3, 1];
70
+ case 9: return [4, __await(undefined)];
71
+ case 10: return [2, _a.sent()];
72
+ }
73
+ });
74
+ });
75
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./GetQueryResultsPaginator";
2
2
  export * from "./Interfaces";
3
+ export * from "./ListChannelsPaginator";
3
4
  export * from "./ListEventDataStoresPaginator";
4
5
  export * from "./ListPublicKeysPaginator";
5
6
  export * from "./ListQueriesPaginator";