dynamodbstreams.d.ts
19.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
import {Request} from '../lib/request';
import {Response} from '../lib/response';
import {AWSError} from '../lib/error';
import {Service} from '../lib/service';
import {ServiceConfigurationOptions} from '../lib/service';
import {ConfigBase as Config} from '../lib/config';
interface Blob {}
declare class DynamoDBStreams extends Service {
/**
* Constructs a service object. This object has one method for each API operation.
*/
constructor(options?: DynamoDBStreams.Types.ClientConfiguration)
config: Config & DynamoDBStreams.Types.ClientConfiguration;
/**
* 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.
*/
describeStream(params: DynamoDBStreams.Types.DescribeStreamInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>;
/**
* 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.
*/
describeStream(callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>;
/**
* 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.
*/
getRecords(params: DynamoDBStreams.Types.GetRecordsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>;
/**
* 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.
*/
getRecords(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>;
/**
* 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.
*/
getShardIterator(params: DynamoDBStreams.Types.GetShardIteratorInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>;
/**
* 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.
*/
getShardIterator(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>;
/**
* 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.
*/
listStreams(params: DynamoDBStreams.Types.ListStreamsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>;
/**
* 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.
*/
listStreams(callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>;
}
declare namespace DynamoDBStreams {
export type AttributeMap = {[key: string]: AttributeValue};
export type AttributeName = string;
export interface AttributeValue {
/**
* A String data type.
*/
S?: StringAttributeValue;
/**
* A Number data type.
*/
N?: NumberAttributeValue;
/**
* A Binary data type.
*/
B?: BinaryAttributeValue;
/**
* A String Set data type.
*/
SS?: StringSetAttributeValue;
/**
* A Number Set data type.
*/
NS?: NumberSetAttributeValue;
/**
* A Binary Set data type.
*/
BS?: BinarySetAttributeValue;
/**
* A Map data type.
*/
M?: MapAttributeValue;
/**
* A List data type.
*/
L?: ListAttributeValue;
/**
* A Null data type.
*/
NULL?: NullAttributeValue;
/**
* A Boolean data type.
*/
BOOL?: BooleanAttributeValue;
}
export type BinaryAttributeValue = Buffer|Uint8Array|Blob|string;
export type BinarySetAttributeValue = BinaryAttributeValue[];
export type BooleanAttributeValue = boolean;
export type _Date = Date;
export interface DescribeStreamInput {
/**
* The Amazon Resource Name (ARN) for the stream.
*/
StreamArn: StreamArn;
/**
* The maximum number of shard objects to return. The upper limit is 100.
*/
Limit?: PositiveIntegerObject;
/**
* The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation.
*/
ExclusiveStartShardId?: ShardId;
}
export interface DescribeStreamOutput {
/**
* 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.
*/
StreamDescription?: StreamDescription;
}
export interface GetRecordsInput {
/**
* A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard.
*/
ShardIterator: ShardIterator;
/**
* The maximum number of records to return from the shard. The upper limit is 1000.
*/
Limit?: PositiveIntegerObject;
}
export interface GetRecordsOutput {
/**
* The stream records from the shard, which were retrieved using the shard iterator.
*/
Records?: RecordList;
/**
* 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.
*/
NextShardIterator?: ShardIterator;
}
export interface GetShardIteratorInput {
/**
* The Amazon Resource Name (ARN) for the stream.
*/
StreamArn: StreamArn;
/**
* The identifier of the shard. The iterator will be returned for this shard ID.
*/
ShardId: ShardId;
/**
* 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.
*/
ShardIteratorType: ShardIteratorType;
/**
* The sequence number of a stream record in the shard from which to start reading.
*/
SequenceNumber?: SequenceNumber;
}
export interface GetShardIteratorOutput {
/**
* 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.
*/
ShardIterator?: ShardIterator;
}
export interface Identity {
/**
* A unique identifier for the entity that made the call. For Time To Live, the principalId is "dynamodb.amazonaws.com".
*/
PrincipalId?: String;
/**
* The type of the identity. For Time To Live, the type is "Service".
*/
Type?: String;
}
export type KeySchema = KeySchemaElement[];
export type KeySchemaAttributeName = string;
export interface KeySchemaElement {
/**
* The name of a key attribute.
*/
AttributeName: KeySchemaAttributeName;
/**
* The attribute data, consisting of the data type and the attribute value itself.
*/
KeyType: KeyType;
}
export type KeyType = "HASH"|"RANGE"|string;
export type ListAttributeValue = AttributeValue[];
export interface ListStreamsInput {
/**
* If this parameter is provided, then only the streams associated with this table name are returned.
*/
TableName?: TableName;
/**
* The maximum number of streams to return. The upper limit is 100.
*/
Limit?: PositiveIntegerObject;
/**
* 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.
*/
ExclusiveStartStreamArn?: StreamArn;
}
export interface ListStreamsOutput {
/**
* A list of stream descriptors associated with the current account and endpoint.
*/
Streams?: StreamList;
/**
* 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.
*/
LastEvaluatedStreamArn?: StreamArn;
}
export type MapAttributeValue = {[key: string]: AttributeValue};
export type NullAttributeValue = boolean;
export type NumberAttributeValue = string;
export type NumberSetAttributeValue = NumberAttributeValue[];
export type OperationType = "INSERT"|"MODIFY"|"REMOVE"|string;
export type PositiveIntegerObject = number;
export type PositiveLongObject = number;
export interface Record {
/**
* A globally unique identifier for the event that was recorded in this stream record.
*/
eventID?: String;
/**
* 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
*/
eventName?: OperationType;
/**
* 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.
*/
eventVersion?: String;
/**
* The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb.
*/
eventSource?: String;
/**
* The region in which the GetRecords request was received.
*/
awsRegion?: String;
/**
* The main body of the stream record, containing all of the DynamoDB-specific fields.
*/
dynamodb?: StreamRecord;
/**
* Items that are deleted by the Time to Live process after expiration have the following fields: Records[].userIdentity.type "Service" Records[].userIdentity.principalId "dynamodb.amazonaws.com"
*/
userIdentity?: Identity;
}
export type RecordList = Record[];
export type SequenceNumber = string;
export interface SequenceNumberRange {
/**
* The first sequence number.
*/
StartingSequenceNumber?: SequenceNumber;
/**
* The last sequence number.
*/
EndingSequenceNumber?: SequenceNumber;
}
export interface Shard {
/**
* The system-generated identifier for this shard.
*/
ShardId?: ShardId;
/**
* The range of possible sequence numbers for the shard.
*/
SequenceNumberRange?: SequenceNumberRange;
/**
* The shard ID of the current shard's parent.
*/
ParentShardId?: ShardId;
}
export type ShardDescriptionList = Shard[];
export type ShardId = string;
export type ShardIterator = string;
export type ShardIteratorType = "TRIM_HORIZON"|"LATEST"|"AT_SEQUENCE_NUMBER"|"AFTER_SEQUENCE_NUMBER"|string;
export interface Stream {
/**
* The Amazon Resource Name (ARN) for the stream.
*/
StreamArn?: StreamArn;
/**
* The DynamoDB table with which the stream is associated.
*/
TableName?: TableName;
/**
* 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
*/
StreamLabel?: String;
}
export type StreamArn = string;
export interface StreamDescription {
/**
* The Amazon Resource Name (ARN) for the stream.
*/
StreamArn?: StreamArn;
/**
* 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
*/
StreamLabel?: String;
/**
* 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.
*/
StreamStatus?: StreamStatus;
/**
* 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.
*/
StreamViewType?: StreamViewType;
/**
* The date and time when the request to create this stream was issued.
*/
CreationRequestDateTime?: _Date;
/**
* The DynamoDB table with which the stream is associated.
*/
TableName?: TableName;
/**
* The key attribute(s) of the stream's DynamoDB table.
*/
KeySchema?: KeySchema;
/**
* The shards that comprise the stream.
*/
Shards?: ShardDescriptionList;
/**
* 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.
*/
LastEvaluatedShardId?: ShardId;
}
export type StreamList = Stream[];
export interface StreamRecord {
/**
* The approximate date and time when the stream record was created, in UNIX epoch time format.
*/
ApproximateCreationDateTime?: _Date;
/**
* The primary key attribute(s) for the DynamoDB item that was modified.
*/
Keys?: AttributeMap;
/**
* The item in the DynamoDB table as it appeared after it was modified.
*/
NewImage?: AttributeMap;
/**
* The item in the DynamoDB table as it appeared before it was modified.
*/
OldImage?: AttributeMap;
/**
* The sequence number of the stream record.
*/
SequenceNumber?: SequenceNumber;
/**
* The size of the stream record, in bytes.
*/
SizeBytes?: PositiveLongObject;
/**
* 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.
*/
StreamViewType?: StreamViewType;
}
export type StreamStatus = "ENABLING"|"ENABLED"|"DISABLING"|"DISABLED"|string;
export type StreamViewType = "NEW_IMAGE"|"OLD_IMAGE"|"NEW_AND_OLD_IMAGES"|"KEYS_ONLY"|string;
export type String = string;
export type StringAttributeValue = string;
export type StringSetAttributeValue = StringAttributeValue[];
export type TableName = string;
/**
* 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.
*/
export type apiVersion = "2012-08-10"|"latest"|string;
export interface ClientApiVersions {
/**
* 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.
*/
apiVersion?: apiVersion;
}
export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
/**
* Contains interfaces for use with the DynamoDBStreams client.
*/
export import Types = DynamoDBStreams;
}
export = DynamoDBStreams;