|
| 1 | +import { DynamoDBStreamsClient } from "./DynamoDBStreamsClient"; |
| 2 | +import { |
| 3 | + DescribeStreamCommand, |
| 4 | + DescribeStreamCommandInput, |
| 5 | + DescribeStreamCommandOutput |
| 6 | +} from "./commands/DescribeStreamCommand"; |
| 7 | +import { |
| 8 | + GetRecordsCommand, |
| 9 | + GetRecordsCommandInput, |
| 10 | + GetRecordsCommandOutput |
| 11 | +} from "./commands/GetRecordsCommand"; |
| 12 | +import { |
| 13 | + GetShardIteratorCommand, |
| 14 | + GetShardIteratorCommandInput, |
| 15 | + GetShardIteratorCommandOutput |
| 16 | +} from "./commands/GetShardIteratorCommand"; |
| 17 | +import { |
| 18 | + ListStreamsCommand, |
| 19 | + ListStreamsCommandInput, |
| 20 | + ListStreamsCommandOutput |
| 21 | +} from "./commands/ListStreamsCommand"; |
| 22 | +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; |
| 23 | + |
| 24 | +/** |
| 25 | + * |
| 26 | + * <fullname>Amazon DynamoDB</fullname> |
| 27 | + * |
| 28 | + * <p>Amazon DynamoDB Streams provides API actions for accessing streams and processing |
| 29 | + * stream records. To learn more about application development with Streams, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html">Capturing |
| 30 | + * Table Activity with DynamoDB Streams</a> in the Amazon DynamoDB Developer |
| 31 | + * Guide.</p> |
| 32 | + * |
| 33 | + * |
| 34 | + */ |
| 35 | +export class DynamoDBStreams extends DynamoDBStreamsClient { |
| 36 | + /** |
| 37 | + * |
| 38 | + * <p>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.</p> |
| 39 | + * <note> |
| 40 | + * <p>You can call <code>DescribeStream</code> at a maximum rate of 10 times per second.</p> |
| 41 | + * </note> |
| 42 | + * <p>Each shard in the stream has a <code>SequenceNumberRange</code> associated with it. If the |
| 43 | + * <code>SequenceNumberRange</code> has a <code>StartingSequenceNumber</code> but no |
| 44 | + * <code>EndingSequenceNumber</code>, then the shard is still open (able to receive more stream |
| 45 | + * records). If both <code>StartingSequenceNumber</code> and <code>EndingSequenceNumber</code> |
| 46 | + * are present, then that shard is closed and can no longer receive more data.</p> |
| 47 | + * |
| 48 | + * |
| 49 | + */ |
| 50 | + public describeStream( |
| 51 | + args: DescribeStreamCommandInput, |
| 52 | + options?: __HttpHandlerOptions |
| 53 | + ): Promise<DescribeStreamCommandOutput>; |
| 54 | + public describeStream( |
| 55 | + args: DescribeStreamCommandInput, |
| 56 | + cb: (err: any, data?: DescribeStreamCommandOutput) => void |
| 57 | + ): void; |
| 58 | + public describeStream( |
| 59 | + args: DescribeStreamCommandInput, |
| 60 | + options: __HttpHandlerOptions, |
| 61 | + cb: (err: any, data?: DescribeStreamCommandOutput) => void |
| 62 | + ): void; |
| 63 | + public describeStream( |
| 64 | + args: DescribeStreamCommandInput, |
| 65 | + optionsOrCb?: |
| 66 | + | __HttpHandlerOptions |
| 67 | + | ((err: any, data?: DescribeStreamCommandOutput) => void), |
| 68 | + cb?: (err: any, data?: DescribeStreamCommandOutput) => void |
| 69 | + ): Promise<DescribeStreamCommandOutput> | void { |
| 70 | + const command = new DescribeStreamCommand(args); |
| 71 | + if (typeof optionsOrCb === "function") { |
| 72 | + this.send(command, optionsOrCb); |
| 73 | + } else if (typeof cb === "function") { |
| 74 | + if (typeof optionsOrCb !== "object") |
| 75 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 76 | + this.send(command, optionsOrCb || {}, cb); |
| 77 | + } else { |
| 78 | + return this.send(command, optionsOrCb); |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * |
| 84 | + * <p>Retrieves the stream records from a given shard.</p> |
| 85 | + * <p>Specify a shard iterator using the <code>ShardIterator</code> parameter. The shard iterator |
| 86 | + * specifies the position in the shard from which you want to start reading stream records |
| 87 | + * sequentially. If there are no stream records available in the portion of the shard that the |
| 88 | + * iterator points to, <code>GetRecords</code> returns an empty list. Note that it might take |
| 89 | + * multiple calls to get to a portion of the shard that contains stream records.</p> |
| 90 | + * <note> |
| 91 | + * <p> |
| 92 | + * <code>GetRecords</code> can retrieve a maximum of 1 MB of data or 1000 stream records, |
| 93 | + * whichever comes first.</p> |
| 94 | + * </note> |
| 95 | + * |
| 96 | + * |
| 97 | + */ |
| 98 | + public getRecords( |
| 99 | + args: GetRecordsCommandInput, |
| 100 | + options?: __HttpHandlerOptions |
| 101 | + ): Promise<GetRecordsCommandOutput>; |
| 102 | + public getRecords( |
| 103 | + args: GetRecordsCommandInput, |
| 104 | + cb: (err: any, data?: GetRecordsCommandOutput) => void |
| 105 | + ): void; |
| 106 | + public getRecords( |
| 107 | + args: GetRecordsCommandInput, |
| 108 | + options: __HttpHandlerOptions, |
| 109 | + cb: (err: any, data?: GetRecordsCommandOutput) => void |
| 110 | + ): void; |
| 111 | + public getRecords( |
| 112 | + args: GetRecordsCommandInput, |
| 113 | + optionsOrCb?: |
| 114 | + | __HttpHandlerOptions |
| 115 | + | ((err: any, data?: GetRecordsCommandOutput) => void), |
| 116 | + cb?: (err: any, data?: GetRecordsCommandOutput) => void |
| 117 | + ): Promise<GetRecordsCommandOutput> | void { |
| 118 | + const command = new GetRecordsCommand(args); |
| 119 | + if (typeof optionsOrCb === "function") { |
| 120 | + this.send(command, optionsOrCb); |
| 121 | + } else if (typeof cb === "function") { |
| 122 | + if (typeof optionsOrCb !== "object") |
| 123 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 124 | + this.send(command, optionsOrCb || {}, cb); |
| 125 | + } else { |
| 126 | + return this.send(command, optionsOrCb); |
| 127 | + } |
| 128 | + } |
| 129 | + |
| 130 | + /** |
| 131 | + * |
| 132 | + * <p>Returns a shard iterator. A shard iterator provides information |
| 133 | + * about how to retrieve the stream records from within a shard. Use |
| 134 | + * the shard iterator in a subsequent |
| 135 | + * <code>GetRecords</code> request to read the stream records |
| 136 | + * from the shard.</p> |
| 137 | + * <note> |
| 138 | + * <p>A shard iterator expires 15 minutes after it is returned to the requester.</p> |
| 139 | + * </note> |
| 140 | + * |
| 141 | + * |
| 142 | + */ |
| 143 | + public getShardIterator( |
| 144 | + args: GetShardIteratorCommandInput, |
| 145 | + options?: __HttpHandlerOptions |
| 146 | + ): Promise<GetShardIteratorCommandOutput>; |
| 147 | + public getShardIterator( |
| 148 | + args: GetShardIteratorCommandInput, |
| 149 | + cb: (err: any, data?: GetShardIteratorCommandOutput) => void |
| 150 | + ): void; |
| 151 | + public getShardIterator( |
| 152 | + args: GetShardIteratorCommandInput, |
| 153 | + options: __HttpHandlerOptions, |
| 154 | + cb: (err: any, data?: GetShardIteratorCommandOutput) => void |
| 155 | + ): void; |
| 156 | + public getShardIterator( |
| 157 | + args: GetShardIteratorCommandInput, |
| 158 | + optionsOrCb?: |
| 159 | + | __HttpHandlerOptions |
| 160 | + | ((err: any, data?: GetShardIteratorCommandOutput) => void), |
| 161 | + cb?: (err: any, data?: GetShardIteratorCommandOutput) => void |
| 162 | + ): Promise<GetShardIteratorCommandOutput> | void { |
| 163 | + const command = new GetShardIteratorCommand(args); |
| 164 | + if (typeof optionsOrCb === "function") { |
| 165 | + this.send(command, optionsOrCb); |
| 166 | + } else if (typeof cb === "function") { |
| 167 | + if (typeof optionsOrCb !== "object") |
| 168 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 169 | + this.send(command, optionsOrCb || {}, cb); |
| 170 | + } else { |
| 171 | + return this.send(command, optionsOrCb); |
| 172 | + } |
| 173 | + } |
| 174 | + |
| 175 | + /** |
| 176 | + * |
| 177 | + * <p>Returns an array of stream ARNs associated with the current account and endpoint. If the |
| 178 | + * <code>TableName</code> parameter is present, then <code>ListStreams</code> will return only the |
| 179 | + * streams ARNs for that table.</p> |
| 180 | + * <note> |
| 181 | + * <p>You can call <code>ListStreams</code> at a maximum rate of 5 times per second.</p> |
| 182 | + * </note> |
| 183 | + * |
| 184 | + * |
| 185 | + */ |
| 186 | + public listStreams( |
| 187 | + args: ListStreamsCommandInput, |
| 188 | + options?: __HttpHandlerOptions |
| 189 | + ): Promise<ListStreamsCommandOutput>; |
| 190 | + public listStreams( |
| 191 | + args: ListStreamsCommandInput, |
| 192 | + cb: (err: any, data?: ListStreamsCommandOutput) => void |
| 193 | + ): void; |
| 194 | + public listStreams( |
| 195 | + args: ListStreamsCommandInput, |
| 196 | + options: __HttpHandlerOptions, |
| 197 | + cb: (err: any, data?: ListStreamsCommandOutput) => void |
| 198 | + ): void; |
| 199 | + public listStreams( |
| 200 | + args: ListStreamsCommandInput, |
| 201 | + optionsOrCb?: |
| 202 | + | __HttpHandlerOptions |
| 203 | + | ((err: any, data?: ListStreamsCommandOutput) => void), |
| 204 | + cb?: (err: any, data?: ListStreamsCommandOutput) => void |
| 205 | + ): Promise<ListStreamsCommandOutput> | void { |
| 206 | + const command = new ListStreamsCommand(args); |
| 207 | + if (typeof optionsOrCb === "function") { |
| 208 | + this.send(command, optionsOrCb); |
| 209 | + } else if (typeof cb === "function") { |
| 210 | + if (typeof optionsOrCb !== "object") |
| 211 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 212 | + this.send(command, optionsOrCb || {}, cb); |
| 213 | + } else { |
| 214 | + return this.send(command, optionsOrCb); |
| 215 | + } |
| 216 | + } |
| 217 | +} |
0 commit comments