dynamodbstreams.d.ts (19436B)
1 import {Request} from '../lib/request'; 2 import {Response} from '../lib/response'; 3 import {AWSError} from '../lib/error'; 4 import {Service} from '../lib/service'; 5 import {ServiceConfigurationOptions} from '../lib/service'; 6 import {ConfigBase as Config} from '../lib/config'; 7 interface Blob {} 8 declare class DynamoDBStreams extends Service { 9 /** 10 * Constructs a service object. This object has one method for each API operation. 11 */ 12 constructor(options?: DynamoDBStreams.Types.ClientConfiguration) 13 config: Config & DynamoDBStreams.Types.ClientConfiguration; 14 /** 15 * Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table. You can call DescribeStream at a maximum rate of 10 times per second. Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data. 16 */ 17 describeStream(params: DynamoDBStreams.Types.DescribeStreamInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>; 18 /** 19 * Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table. You can call DescribeStream at a maximum rate of 10 times per second. Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data. 20 */ 21 describeStream(callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>; 22 /** 23 * Retrieves the stream records from a given shard. Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records. GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes first. 24 */ 25 getRecords(params: DynamoDBStreams.Types.GetRecordsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>; 26 /** 27 * Retrieves the stream records from a given shard. Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records. GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes first. 28 */ 29 getRecords(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>; 30 /** 31 * Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent GetRecords request to read the stream records from the shard. A shard iterator expires 15 minutes after it is returned to the requester. 32 */ 33 getShardIterator(params: DynamoDBStreams.Types.GetShardIteratorInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>; 34 /** 35 * Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent GetRecords request to read the stream records from the shard. A shard iterator expires 15 minutes after it is returned to the requester. 36 */ 37 getShardIterator(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>; 38 /** 39 * Returns an array of stream ARNs associated with the current account and endpoint. If the TableName parameter is present, then ListStreams will return only the streams ARNs for that table. You can call ListStreams at a maximum rate of 5 times per second. 40 */ 41 listStreams(params: DynamoDBStreams.Types.ListStreamsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>; 42 /** 43 * Returns an array of stream ARNs associated with the current account and endpoint. If the TableName parameter is present, then ListStreams will return only the streams ARNs for that table. You can call ListStreams at a maximum rate of 5 times per second. 44 */ 45 listStreams(callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>; 46 } 47 declare namespace DynamoDBStreams.Types { 48 export type AttributeMap = {[key: string]: AttributeValue}; 49 export type AttributeName = string; 50 export interface AttributeValue { 51 /** 52 * A String data type. 53 */ 54 S?: StringAttributeValue; 55 /** 56 * A Number data type. 57 */ 58 N?: NumberAttributeValue; 59 /** 60 * A Binary data type. 61 */ 62 B?: BinaryAttributeValue; 63 /** 64 * A String Set data type. 65 */ 66 SS?: StringSetAttributeValue; 67 /** 68 * A Number Set data type. 69 */ 70 NS?: NumberSetAttributeValue; 71 /** 72 * A Binary Set data type. 73 */ 74 BS?: BinarySetAttributeValue; 75 /** 76 * A Map data type. 77 */ 78 M?: MapAttributeValue; 79 /** 80 * A List data type. 81 */ 82 L?: ListAttributeValue; 83 /** 84 * A Null data type. 85 */ 86 NULL?: NullAttributeValue; 87 /** 88 * A Boolean data type. 89 */ 90 BOOL?: BooleanAttributeValue; 91 } 92 export type BinaryAttributeValue = Buffer|Uint8Array|Blob|string; 93 export type BinarySetAttributeValue = BinaryAttributeValue[]; 94 export type BooleanAttributeValue = boolean; 95 export type _Date = Date; 96 export interface DescribeStreamInput { 97 /** 98 * The Amazon Resource Name (ARN) for the stream. 99 */ 100 StreamArn: StreamArn; 101 /** 102 * The maximum number of shard objects to return. The upper limit is 100. 103 */ 104 Limit?: PositiveIntegerObject; 105 /** 106 * The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation. 107 */ 108 ExclusiveStartShardId?: ShardId; 109 } 110 export interface DescribeStreamOutput { 111 /** 112 * A complete description of the stream, including its creation date and time, the DynamoDB table associated with the stream, the shard IDs within the stream, and the beginning and ending sequence numbers of stream records within the shards. 113 */ 114 StreamDescription?: StreamDescription; 115 } 116 export type ErrorMessage = string; 117 export interface GetRecordsInput { 118 /** 119 * A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard. 120 */ 121 ShardIterator: ShardIterator; 122 /** 123 * The maximum number of records to return from the shard. The upper limit is 1000. 124 */ 125 Limit?: PositiveIntegerObject; 126 } 127 export interface GetRecordsOutput { 128 /** 129 * The stream records from the shard, which were retrieved using the shard iterator. 130 */ 131 Records?: RecordList; 132 /** 133 * The next position in the shard from which to start sequentially reading stream records. If set to null, the shard has been closed and the requested iterator will not return any more data. 134 */ 135 NextShardIterator?: ShardIterator; 136 } 137 export interface GetShardIteratorInput { 138 /** 139 * The Amazon Resource Name (ARN) for the stream. 140 */ 141 StreamArn: StreamArn; 142 /** 143 * The identifier of the shard. The iterator will be returned for this shard ID. 144 */ 145 ShardId: ShardId; 146 /** 147 * Determines how the shard iterator is used to start reading stream records from the shard: AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number. AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number. TRIM_HORIZON - Start reading at the last (untrimmed) stream record, which is the oldest record in the shard. In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. LATEST - Start reading just after the most recent stream record in the shard, so that you always read the most recent data in the shard. 148 */ 149 ShardIteratorType: ShardIteratorType; 150 /** 151 * The sequence number of a stream record in the shard from which to start reading. 152 */ 153 SequenceNumber?: SequenceNumber; 154 } 155 export interface GetShardIteratorOutput { 156 /** 157 * The position in the shard from which to start reading stream records sequentially. A shard iterator specifies this position using the sequence number of a stream record in a shard. 158 */ 159 ShardIterator?: ShardIterator; 160 } 161 export type KeySchema = KeySchemaElement[]; 162 export type KeySchemaAttributeName = string; 163 export interface KeySchemaElement { 164 /** 165 * The name of a key attribute. 166 */ 167 AttributeName: KeySchemaAttributeName; 168 /** 169 * The attribute data, consisting of the data type and the attribute value itself. 170 */ 171 KeyType: KeyType; 172 } 173 export type KeyType = "HASH"|"RANGE"|string; 174 export type ListAttributeValue = AttributeValue[]; 175 export interface ListStreamsInput { 176 /** 177 * If this parameter is provided, then only the streams associated with this table name are returned. 178 */ 179 TableName?: TableName; 180 /** 181 * The maximum number of streams to return. The upper limit is 100. 182 */ 183 Limit?: PositiveIntegerObject; 184 /** 185 * The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedStreamArn in the previous operation. 186 */ 187 ExclusiveStartStreamArn?: StreamArn; 188 } 189 export interface ListStreamsOutput { 190 /** 191 * A list of stream descriptors associated with the current account and endpoint. 192 */ 193 Streams?: StreamList; 194 /** 195 * The stream ARN of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedStreamArn is empty, then the "last page" of results has been processed and there is no more data to be retrieved. If LastEvaluatedStreamArn is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedStreamArn is empty. 196 */ 197 LastEvaluatedStreamArn?: StreamArn; 198 } 199 export type MapAttributeValue = {[key: string]: AttributeValue}; 200 export type NullAttributeValue = boolean; 201 export type NumberAttributeValue = string; 202 export type NumberSetAttributeValue = NumberAttributeValue[]; 203 export type OperationType = "INSERT"|"MODIFY"|"REMOVE"|string; 204 export type PositiveIntegerObject = number; 205 export type PositiveLongObject = number; 206 export interface Record { 207 /** 208 * A globally unique identifier for the event that was recorded in this stream record. 209 */ 210 eventID?: String; 211 /** 212 * The type of data modification that was performed on the DynamoDB table: INSERT - a new item was added to the table. MODIFY - one or more of an existing item's attributes were modified. REMOVE - the item was deleted from the table 213 */ 214 eventName?: OperationType; 215 /** 216 * The version number of the stream record format. This number is updated whenever the structure of Record is modified. Client applications must not assume that eventVersion will remain at a particular value, as this number is subject to change at any time. In general, eventVersion will only increase as the low-level DynamoDB Streams API evolves. 217 */ 218 eventVersion?: String; 219 /** 220 * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb. 221 */ 222 eventSource?: String; 223 /** 224 * The region in which the GetRecords request was received. 225 */ 226 awsRegion?: String; 227 /** 228 * The main body of the stream record, containing all of the DynamoDB-specific fields. 229 */ 230 dynamodb?: StreamRecord; 231 } 232 export type RecordList = Record[]; 233 export type SequenceNumber = string; 234 export interface SequenceNumberRange { 235 /** 236 * The first sequence number. 237 */ 238 StartingSequenceNumber?: SequenceNumber; 239 /** 240 * The last sequence number. 241 */ 242 EndingSequenceNumber?: SequenceNumber; 243 } 244 export interface Shard { 245 /** 246 * The system-generated identifier for this shard. 247 */ 248 ShardId?: ShardId; 249 /** 250 * The range of possible sequence numbers for the shard. 251 */ 252 SequenceNumberRange?: SequenceNumberRange; 253 /** 254 * The shard ID of the current shard's parent. 255 */ 256 ParentShardId?: ShardId; 257 } 258 export type ShardDescriptionList = Shard[]; 259 export type ShardId = string; 260 export type ShardIterator = string; 261 export type ShardIteratorType = "TRIM_HORIZON"|"LATEST"|"AT_SEQUENCE_NUMBER"|"AFTER_SEQUENCE_NUMBER"|string; 262 export interface Stream { 263 /** 264 * The Amazon Resource Name (ARN) for the stream. 265 */ 266 StreamArn?: StreamArn; 267 /** 268 * The DynamoDB table with which the stream is associated. 269 */ 270 TableName?: TableName; 271 /** 272 * A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the AWS customer ID. the table name the StreamLabel 273 */ 274 StreamLabel?: String; 275 } 276 export type StreamArn = string; 277 export interface StreamDescription { 278 /** 279 * The Amazon Resource Name (ARN) for the stream. 280 */ 281 StreamArn?: StreamArn; 282 /** 283 * A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the AWS customer ID. the table name the StreamLabel 284 */ 285 StreamLabel?: String; 286 /** 287 * Indicates the current status of the stream: ENABLING - Streams is currently being enabled on the DynamoDB table. ENABLED - the stream is enabled. DISABLING - Streams is currently being disabled on the DynamoDB table. DISABLED - the stream is disabled. 288 */ 289 StreamStatus?: StreamStatus; 290 /** 291 * Indicates the format of the records within this stream: KEYS_ONLY - only the key attributes of items that were modified in the DynamoDB table. NEW_IMAGE - entire items from the table, as they appeared after they were modified. OLD_IMAGE - entire items from the table, as they appeared before they were modified. NEW_AND_OLD_IMAGES - both the new and the old images of the items from the table. 292 */ 293 StreamViewType?: StreamViewType; 294 /** 295 * The date and time when the request to create this stream was issued. 296 */ 297 CreationRequestDateTime?: _Date; 298 /** 299 * The DynamoDB table with which the stream is associated. 300 */ 301 TableName?: TableName; 302 /** 303 * The key attribute(s) of the stream's DynamoDB table. 304 */ 305 KeySchema?: KeySchema; 306 /** 307 * The shards that comprise the stream. 308 */ 309 Shards?: ShardDescriptionList; 310 /** 311 * The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedShardId is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved. If LastEvaluatedShardId is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedShardId is empty. 312 */ 313 LastEvaluatedShardId?: ShardId; 314 } 315 export type StreamList = Stream[]; 316 export interface StreamRecord { 317 /** 318 * The approximate date and time when the stream record was created, in UNIX epoch time format. 319 */ 320 ApproximateCreationDateTime?: _Date; 321 /** 322 * The primary key attribute(s) for the DynamoDB item that was modified. 323 */ 324 Keys?: AttributeMap; 325 /** 326 * The item in the DynamoDB table as it appeared after it was modified. 327 */ 328 NewImage?: AttributeMap; 329 /** 330 * The item in the DynamoDB table as it appeared before it was modified. 331 */ 332 OldImage?: AttributeMap; 333 /** 334 * The sequence number of the stream record. 335 */ 336 SequenceNumber?: SequenceNumber; 337 /** 338 * The size of the stream record, in bytes. 339 */ 340 SizeBytes?: PositiveLongObject; 341 /** 342 * The type of data from the modified DynamoDB item that was captured in this stream record: KEYS_ONLY - only the key attributes of the modified item. NEW_IMAGE - the entire item, as it appeared after it was modified. OLD_IMAGE - the entire item, as it appeared before it was modified. NEW_AND_OLD_IMAGES - both the new and the old item images of the item. 343 */ 344 StreamViewType?: StreamViewType; 345 } 346 export type StreamStatus = "ENABLING"|"ENABLED"|"DISABLING"|"DISABLED"|string; 347 export type StreamViewType = "NEW_IMAGE"|"OLD_IMAGE"|"NEW_AND_OLD_IMAGES"|"KEYS_ONLY"|string; 348 export type String = string; 349 export type StringAttributeValue = string; 350 export type StringSetAttributeValue = StringAttributeValue[]; 351 export type TableName = string; 352 /** 353 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. 354 */ 355 export type apiVersion = "2012-08-10"|"latest"|string; 356 export interface ClientApiVersions { 357 /** 358 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. 359 */ 360 apiVersion?: apiVersion; 361 } 362 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions; 363 } 364 export = DynamoDBStreams;