api.go 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package dynamodbstreams provides a client for Amazon DynamoDB Streams.
  3. package dynamodbstreams
  4. import (
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/service/dynamodb"
  9. )
  10. const opDescribeStream = "DescribeStream"
  11. // DescribeStreamRequest generates a "aws/request.Request" representing the
  12. // client's request for the DescribeStream operation. The "output" return
  13. // value can be used to capture response data after the request's "Send" method
  14. // is called.
  15. //
  16. // See DescribeStream for usage and error information.
  17. //
  18. // Creating a request object using this method should be used when you want to inject
  19. // custom logic into the request's lifecycle using a custom handler, or if you want to
  20. // access properties on the request object before or after sending the request. If
  21. // you just want the service response, call the DescribeStream method directly
  22. // instead.
  23. //
  24. // Note: You must call the "Send" method on the returned request object in order
  25. // to execute the request.
  26. //
  27. // // Example sending a request using the DescribeStreamRequest method.
  28. // req, resp := client.DescribeStreamRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. func (c *DynamoDBStreams) DescribeStreamRequest(input *DescribeStreamInput) (req *request.Request, output *DescribeStreamOutput) {
  36. op := &request.Operation{
  37. Name: opDescribeStream,
  38. HTTPMethod: "POST",
  39. HTTPPath: "/",
  40. }
  41. if input == nil {
  42. input = &DescribeStreamInput{}
  43. }
  44. req = c.newRequest(op, input, output)
  45. output = &DescribeStreamOutput{}
  46. req.Data = output
  47. return
  48. }
  49. // DescribeStream API operation for Amazon DynamoDB Streams.
  50. //
  51. // Returns information about a stream, including the current status of the stream,
  52. // its Amazon Resource Name (ARN), the composition of its shards, and its corresponding
  53. // DynamoDB table.
  54. //
  55. // You can call DescribeStream at a maximum rate of 10 times per second.
  56. //
  57. // Each shard in the stream has a SequenceNumberRange associated with it. If
  58. // the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber,
  59. // then the shard is still open (able to receive more stream records). If both
  60. // StartingSequenceNumber and EndingSequenceNumber are present, then that shard
  61. // is closed and can no longer receive more data.
  62. //
  63. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  64. // with awserr.Error's Code and Message methods to get detailed information about
  65. // the error.
  66. //
  67. // See the AWS API reference guide for Amazon DynamoDB Streams's
  68. // API operation DescribeStream for usage and error information.
  69. //
  70. // Returned Error Codes:
  71. // * ResourceNotFoundException
  72. // The operation tried to access a nonexistent stream.
  73. //
  74. // * InternalServerError
  75. // An error occurred on the server side.
  76. //
  77. func (c *DynamoDBStreams) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOutput, error) {
  78. req, out := c.DescribeStreamRequest(input)
  79. err := req.Send()
  80. return out, err
  81. }
  82. const opGetRecords = "GetRecords"
  83. // GetRecordsRequest generates a "aws/request.Request" representing the
  84. // client's request for the GetRecords operation. The "output" return
  85. // value can be used to capture response data after the request's "Send" method
  86. // is called.
  87. //
  88. // See GetRecords for usage and error information.
  89. //
  90. // Creating a request object using this method should be used when you want to inject
  91. // custom logic into the request's lifecycle using a custom handler, or if you want to
  92. // access properties on the request object before or after sending the request. If
  93. // you just want the service response, call the GetRecords method directly
  94. // instead.
  95. //
  96. // Note: You must call the "Send" method on the returned request object in order
  97. // to execute the request.
  98. //
  99. // // Example sending a request using the GetRecordsRequest method.
  100. // req, resp := client.GetRecordsRequest(params)
  101. //
  102. // err := req.Send()
  103. // if err == nil { // resp is now filled
  104. // fmt.Println(resp)
  105. // }
  106. //
  107. func (c *DynamoDBStreams) GetRecordsRequest(input *GetRecordsInput) (req *request.Request, output *GetRecordsOutput) {
  108. op := &request.Operation{
  109. Name: opGetRecords,
  110. HTTPMethod: "POST",
  111. HTTPPath: "/",
  112. }
  113. if input == nil {
  114. input = &GetRecordsInput{}
  115. }
  116. req = c.newRequest(op, input, output)
  117. output = &GetRecordsOutput{}
  118. req.Data = output
  119. return
  120. }
  121. // GetRecords API operation for Amazon DynamoDB Streams.
  122. //
  123. // Retrieves the stream records from a given shard.
  124. //
  125. // Specify a shard iterator using the ShardIterator parameter. The shard iterator
  126. // specifies the position in the shard from which you want to start reading
  127. // stream records sequentially. If there are no stream records available in
  128. // the portion of the shard that the iterator points to, GetRecords returns
  129. // an empty list. Note that it might take multiple calls to get to a portion
  130. // of the shard that contains stream records.
  131. //
  132. // GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records,
  133. // whichever comes first.
  134. //
  135. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  136. // with awserr.Error's Code and Message methods to get detailed information about
  137. // the error.
  138. //
  139. // See the AWS API reference guide for Amazon DynamoDB Streams's
  140. // API operation GetRecords for usage and error information.
  141. //
  142. // Returned Error Codes:
  143. // * ResourceNotFoundException
  144. // The operation tried to access a nonexistent stream.
  145. //
  146. // * LimitExceededException
  147. // Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
  148. // requests that receive this exception. Your request is eventually successful,
  149. // unless your retry queue is too large to finish. Reduce the frequency of requests
  150. // and use exponential backoff. For more information, go to Error Retries and
  151. // Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries)
  152. // in the Amazon DynamoDB Developer Guide.
  153. //
  154. // * InternalServerError
  155. // An error occurred on the server side.
  156. //
  157. // * ExpiredIteratorException
  158. // The shard iterator has expired and can no longer be used to retrieve stream
  159. // records. A shard iterator expires 15 minutes after it is retrieved using
  160. // the GetShardIterator action.
  161. //
  162. // * TrimmedDataAccessException
  163. // The operation attempted to read past the oldest stream record in a shard.
  164. //
  165. // In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records
  166. // whose age exceeds this limit are subject to removal (trimming) from the stream.
  167. // You might receive a TrimmedDataAccessException if:
  168. //
  169. // * You request a shard iterator with a sequence number older than the trim
  170. // point (24 hours).
  171. //
  172. // * You obtain a shard iterator, but before you use the iterator in a GetRecords
  173. // request, a stream record in the shard exceeds the 24 hour period and is
  174. // trimmed. This causes the iterator to access a record that no longer exists.
  175. //
  176. func (c *DynamoDBStreams) GetRecords(input *GetRecordsInput) (*GetRecordsOutput, error) {
  177. req, out := c.GetRecordsRequest(input)
  178. err := req.Send()
  179. return out, err
  180. }
  181. const opGetShardIterator = "GetShardIterator"
  182. // GetShardIteratorRequest generates a "aws/request.Request" representing the
  183. // client's request for the GetShardIterator operation. The "output" return
  184. // value can be used to capture response data after the request's "Send" method
  185. // is called.
  186. //
  187. // See GetShardIterator for usage and error information.
  188. //
  189. // Creating a request object using this method should be used when you want to inject
  190. // custom logic into the request's lifecycle using a custom handler, or if you want to
  191. // access properties on the request object before or after sending the request. If
  192. // you just want the service response, call the GetShardIterator method directly
  193. // instead.
  194. //
  195. // Note: You must call the "Send" method on the returned request object in order
  196. // to execute the request.
  197. //
  198. // // Example sending a request using the GetShardIteratorRequest method.
  199. // req, resp := client.GetShardIteratorRequest(params)
  200. //
  201. // err := req.Send()
  202. // if err == nil { // resp is now filled
  203. // fmt.Println(resp)
  204. // }
  205. //
  206. func (c *DynamoDBStreams) GetShardIteratorRequest(input *GetShardIteratorInput) (req *request.Request, output *GetShardIteratorOutput) {
  207. op := &request.Operation{
  208. Name: opGetShardIterator,
  209. HTTPMethod: "POST",
  210. HTTPPath: "/",
  211. }
  212. if input == nil {
  213. input = &GetShardIteratorInput{}
  214. }
  215. req = c.newRequest(op, input, output)
  216. output = &GetShardIteratorOutput{}
  217. req.Data = output
  218. return
  219. }
  220. // GetShardIterator API operation for Amazon DynamoDB Streams.
  221. //
  222. // Returns a shard iterator. A shard iterator provides information about how
  223. // to retrieve the stream records from within a shard. Use the shard iterator
  224. // in a subsequent GetRecords request to read the stream records from the shard.
  225. //
  226. // A shard iterator expires 15 minutes after it is returned to the requester.
  227. //
  228. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  229. // with awserr.Error's Code and Message methods to get detailed information about
  230. // the error.
  231. //
  232. // See the AWS API reference guide for Amazon DynamoDB Streams's
  233. // API operation GetShardIterator for usage and error information.
  234. //
  235. // Returned Error Codes:
  236. // * ResourceNotFoundException
  237. // The operation tried to access a nonexistent stream.
  238. //
  239. // * InternalServerError
  240. // An error occurred on the server side.
  241. //
  242. // * TrimmedDataAccessException
  243. // The operation attempted to read past the oldest stream record in a shard.
  244. //
  245. // In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records
  246. // whose age exceeds this limit are subject to removal (trimming) from the stream.
  247. // You might receive a TrimmedDataAccessException if:
  248. //
  249. // * You request a shard iterator with a sequence number older than the trim
  250. // point (24 hours).
  251. //
  252. // * You obtain a shard iterator, but before you use the iterator in a GetRecords
  253. // request, a stream record in the shard exceeds the 24 hour period and is
  254. // trimmed. This causes the iterator to access a record that no longer exists.
  255. //
  256. func (c *DynamoDBStreams) GetShardIterator(input *GetShardIteratorInput) (*GetShardIteratorOutput, error) {
  257. req, out := c.GetShardIteratorRequest(input)
  258. err := req.Send()
  259. return out, err
  260. }
  261. const opListStreams = "ListStreams"
  262. // ListStreamsRequest generates a "aws/request.Request" representing the
  263. // client's request for the ListStreams operation. The "output" return
  264. // value can be used to capture response data after the request's "Send" method
  265. // is called.
  266. //
  267. // See ListStreams for usage and error information.
  268. //
  269. // Creating a request object using this method should be used when you want to inject
  270. // custom logic into the request's lifecycle using a custom handler, or if you want to
  271. // access properties on the request object before or after sending the request. If
  272. // you just want the service response, call the ListStreams method directly
  273. // instead.
  274. //
  275. // Note: You must call the "Send" method on the returned request object in order
  276. // to execute the request.
  277. //
  278. // // Example sending a request using the ListStreamsRequest method.
  279. // req, resp := client.ListStreamsRequest(params)
  280. //
  281. // err := req.Send()
  282. // if err == nil { // resp is now filled
  283. // fmt.Println(resp)
  284. // }
  285. //
  286. func (c *DynamoDBStreams) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, output *ListStreamsOutput) {
  287. op := &request.Operation{
  288. Name: opListStreams,
  289. HTTPMethod: "POST",
  290. HTTPPath: "/",
  291. }
  292. if input == nil {
  293. input = &ListStreamsInput{}
  294. }
  295. req = c.newRequest(op, input, output)
  296. output = &ListStreamsOutput{}
  297. req.Data = output
  298. return
  299. }
  300. // ListStreams API operation for Amazon DynamoDB Streams.
  301. //
  302. // Returns an array of stream ARNs associated with the current account and endpoint.
  303. // If the TableName parameter is present, then ListStreams will return only
  304. // the streams ARNs for that table.
  305. //
  306. // You can call ListStreams at a maximum rate of 5 times per second.
  307. //
  308. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  309. // with awserr.Error's Code and Message methods to get detailed information about
  310. // the error.
  311. //
  312. // See the AWS API reference guide for Amazon DynamoDB Streams's
  313. // API operation ListStreams for usage and error information.
  314. //
  315. // Returned Error Codes:
  316. // * ResourceNotFoundException
  317. // The operation tried to access a nonexistent stream.
  318. //
  319. // * InternalServerError
  320. // An error occurred on the server side.
  321. //
  322. func (c *DynamoDBStreams) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) {
  323. req, out := c.ListStreamsRequest(input)
  324. err := req.Send()
  325. return out, err
  326. }
  327. // Represents the input of a DescribeStream operation.
  328. type DescribeStreamInput struct {
  329. _ struct{} `type:"structure"`
  330. // The shard ID of the first item that this operation will evaluate. Use the
  331. // value that was returned for LastEvaluatedShardId in the previous operation.
  332. ExclusiveStartShardId *string `min:"28" type:"string"`
  333. // The maximum number of shard objects to return. The upper limit is 100.
  334. Limit *int64 `min:"1" type:"integer"`
  335. // The Amazon Resource Name (ARN) for the stream.
  336. //
  337. // StreamArn is a required field
  338. StreamArn *string `min:"37" type:"string" required:"true"`
  339. }
  340. // String returns the string representation
  341. func (s DescribeStreamInput) String() string {
  342. return awsutil.Prettify(s)
  343. }
  344. // GoString returns the string representation
  345. func (s DescribeStreamInput) GoString() string {
  346. return s.String()
  347. }
  348. // Validate inspects the fields of the type to determine if they are valid.
  349. func (s *DescribeStreamInput) Validate() error {
  350. invalidParams := request.ErrInvalidParams{Context: "DescribeStreamInput"}
  351. if s.ExclusiveStartShardId != nil && len(*s.ExclusiveStartShardId) < 28 {
  352. invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartShardId", 28))
  353. }
  354. if s.Limit != nil && *s.Limit < 1 {
  355. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  356. }
  357. if s.StreamArn == nil {
  358. invalidParams.Add(request.NewErrParamRequired("StreamArn"))
  359. }
  360. if s.StreamArn != nil && len(*s.StreamArn) < 37 {
  361. invalidParams.Add(request.NewErrParamMinLen("StreamArn", 37))
  362. }
  363. if invalidParams.Len() > 0 {
  364. return invalidParams
  365. }
  366. return nil
  367. }
  368. // Represents the output of a DescribeStream operation.
  369. type DescribeStreamOutput struct {
  370. _ struct{} `type:"structure"`
  371. // A complete description of the stream, including its creation date and time,
  372. // the DynamoDB table associated with the stream, the shard IDs within the stream,
  373. // and the beginning and ending sequence numbers of stream records within the
  374. // shards.
  375. StreamDescription *StreamDescription `type:"structure"`
  376. }
  377. // String returns the string representation
  378. func (s DescribeStreamOutput) String() string {
  379. return awsutil.Prettify(s)
  380. }
  381. // GoString returns the string representation
  382. func (s DescribeStreamOutput) GoString() string {
  383. return s.String()
  384. }
  385. // Represents the input of a GetRecords operation.
  386. type GetRecordsInput struct {
  387. _ struct{} `type:"structure"`
  388. // The maximum number of records to return from the shard. The upper limit is
  389. // 1000.
  390. Limit *int64 `min:"1" type:"integer"`
  391. // A shard iterator that was retrieved from a previous GetShardIterator operation.
  392. // This iterator can be used to access the stream records in this shard.
  393. //
  394. // ShardIterator is a required field
  395. ShardIterator *string `min:"1" type:"string" required:"true"`
  396. }
  397. // String returns the string representation
  398. func (s GetRecordsInput) String() string {
  399. return awsutil.Prettify(s)
  400. }
  401. // GoString returns the string representation
  402. func (s GetRecordsInput) GoString() string {
  403. return s.String()
  404. }
  405. // Validate inspects the fields of the type to determine if they are valid.
  406. func (s *GetRecordsInput) Validate() error {
  407. invalidParams := request.ErrInvalidParams{Context: "GetRecordsInput"}
  408. if s.Limit != nil && *s.Limit < 1 {
  409. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  410. }
  411. if s.ShardIterator == nil {
  412. invalidParams.Add(request.NewErrParamRequired("ShardIterator"))
  413. }
  414. if s.ShardIterator != nil && len(*s.ShardIterator) < 1 {
  415. invalidParams.Add(request.NewErrParamMinLen("ShardIterator", 1))
  416. }
  417. if invalidParams.Len() > 0 {
  418. return invalidParams
  419. }
  420. return nil
  421. }
  422. // Represents the output of a GetRecords operation.
  423. type GetRecordsOutput struct {
  424. _ struct{} `type:"structure"`
  425. // The next position in the shard from which to start sequentially reading stream
  426. // records. If set to null, the shard has been closed and the requested iterator
  427. // will not return any more data.
  428. NextShardIterator *string `min:"1" type:"string"`
  429. // The stream records from the shard, which were retrieved using the shard iterator.
  430. Records []*Record `type:"list"`
  431. }
  432. // String returns the string representation
  433. func (s GetRecordsOutput) String() string {
  434. return awsutil.Prettify(s)
  435. }
  436. // GoString returns the string representation
  437. func (s GetRecordsOutput) GoString() string {
  438. return s.String()
  439. }
  440. // Represents the input of a GetShardIterator operation.
  441. type GetShardIteratorInput struct {
  442. _ struct{} `type:"structure"`
  443. // The sequence number of a stream record in the shard from which to start reading.
  444. SequenceNumber *string `min:"21" type:"string"`
  445. // The identifier of the shard. The iterator will be returned for this shard
  446. // ID.
  447. //
  448. // ShardId is a required field
  449. ShardId *string `min:"28" type:"string" required:"true"`
  450. // Determines how the shard iterator is used to start reading stream records
  451. // from the shard:
  452. //
  453. // * AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted
  454. // by a specific sequence number.
  455. //
  456. // * AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted
  457. // by a specific sequence number.
  458. //
  459. // * TRIM_HORIZON - Start reading at the last (untrimmed) stream record,
  460. // which is the oldest record in the shard. In DynamoDB Streams, there is
  461. // a 24 hour limit on data retention. Stream records whose age exceeds this
  462. // limit are subject to removal (trimming) from the stream.
  463. //
  464. // * LATEST - Start reading just after the most recent stream record in the
  465. // shard, so that you always read the most recent data in the shard.
  466. //
  467. // ShardIteratorType is a required field
  468. ShardIteratorType *string `type:"string" required:"true" enum:"ShardIteratorType"`
  469. // The Amazon Resource Name (ARN) for the stream.
  470. //
  471. // StreamArn is a required field
  472. StreamArn *string `min:"37" type:"string" required:"true"`
  473. }
  474. // String returns the string representation
  475. func (s GetShardIteratorInput) String() string {
  476. return awsutil.Prettify(s)
  477. }
  478. // GoString returns the string representation
  479. func (s GetShardIteratorInput) GoString() string {
  480. return s.String()
  481. }
  482. // Validate inspects the fields of the type to determine if they are valid.
  483. func (s *GetShardIteratorInput) Validate() error {
  484. invalidParams := request.ErrInvalidParams{Context: "GetShardIteratorInput"}
  485. if s.SequenceNumber != nil && len(*s.SequenceNumber) < 21 {
  486. invalidParams.Add(request.NewErrParamMinLen("SequenceNumber", 21))
  487. }
  488. if s.ShardId == nil {
  489. invalidParams.Add(request.NewErrParamRequired("ShardId"))
  490. }
  491. if s.ShardId != nil && len(*s.ShardId) < 28 {
  492. invalidParams.Add(request.NewErrParamMinLen("ShardId", 28))
  493. }
  494. if s.ShardIteratorType == nil {
  495. invalidParams.Add(request.NewErrParamRequired("ShardIteratorType"))
  496. }
  497. if s.StreamArn == nil {
  498. invalidParams.Add(request.NewErrParamRequired("StreamArn"))
  499. }
  500. if s.StreamArn != nil && len(*s.StreamArn) < 37 {
  501. invalidParams.Add(request.NewErrParamMinLen("StreamArn", 37))
  502. }
  503. if invalidParams.Len() > 0 {
  504. return invalidParams
  505. }
  506. return nil
  507. }
  508. // Represents the output of a GetShardIterator operation.
  509. type GetShardIteratorOutput struct {
  510. _ struct{} `type:"structure"`
  511. // The position in the shard from which to start reading stream records sequentially.
  512. // A shard iterator specifies this position using the sequence number of a stream
  513. // record in a shard.
  514. ShardIterator *string `min:"1" type:"string"`
  515. }
  516. // String returns the string representation
  517. func (s GetShardIteratorOutput) String() string {
  518. return awsutil.Prettify(s)
  519. }
  520. // GoString returns the string representation
  521. func (s GetShardIteratorOutput) GoString() string {
  522. return s.String()
  523. }
  524. // Represents the input of a ListStreams operation.
  525. type ListStreamsInput struct {
  526. _ struct{} `type:"structure"`
  527. // The ARN (Amazon Resource Name) of the first item that this operation will
  528. // evaluate. Use the value that was returned for LastEvaluatedStreamArn in the
  529. // previous operation.
  530. ExclusiveStartStreamArn *string `min:"37" type:"string"`
  531. // The maximum number of streams to return. The upper limit is 100.
  532. Limit *int64 `min:"1" type:"integer"`
  533. // If this parameter is provided, then only the streams associated with this
  534. // table name are returned.
  535. TableName *string `min:"3" type:"string"`
  536. }
  537. // String returns the string representation
  538. func (s ListStreamsInput) String() string {
  539. return awsutil.Prettify(s)
  540. }
  541. // GoString returns the string representation
  542. func (s ListStreamsInput) GoString() string {
  543. return s.String()
  544. }
  545. // Validate inspects the fields of the type to determine if they are valid.
  546. func (s *ListStreamsInput) Validate() error {
  547. invalidParams := request.ErrInvalidParams{Context: "ListStreamsInput"}
  548. if s.ExclusiveStartStreamArn != nil && len(*s.ExclusiveStartStreamArn) < 37 {
  549. invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartStreamArn", 37))
  550. }
  551. if s.Limit != nil && *s.Limit < 1 {
  552. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  553. }
  554. if s.TableName != nil && len(*s.TableName) < 3 {
  555. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  556. }
  557. if invalidParams.Len() > 0 {
  558. return invalidParams
  559. }
  560. return nil
  561. }
  562. // Represents the output of a ListStreams operation.
  563. type ListStreamsOutput struct {
  564. _ struct{} `type:"structure"`
  565. // The stream ARN of the item where the operation stopped, inclusive of the
  566. // previous result set. Use this value to start a new operation, excluding this
  567. // value in the new request.
  568. //
  569. // If LastEvaluatedStreamArn is empty, then the "last page" of results has been
  570. // processed and there is no more data to be retrieved.
  571. //
  572. // If LastEvaluatedStreamArn is not empty, it does not necessarily mean that
  573. // there is more data in the result set. The only way to know when you have
  574. // reached the end of the result set is when LastEvaluatedStreamArn is empty.
  575. LastEvaluatedStreamArn *string `min:"37" type:"string"`
  576. // A list of stream descriptors associated with the current account and endpoint.
  577. Streams []*Stream `type:"list"`
  578. }
  579. // String returns the string representation
  580. func (s ListStreamsOutput) String() string {
  581. return awsutil.Prettify(s)
  582. }
  583. // GoString returns the string representation
  584. func (s ListStreamsOutput) GoString() string {
  585. return s.String()
  586. }
  587. // A description of a unique event within a stream.
  588. type Record struct {
  589. _ struct{} `type:"structure"`
  590. // The region in which the GetRecords request was received.
  591. AwsRegion *string `locationName:"awsRegion" type:"string"`
  592. // The main body of the stream record, containing all of the DynamoDB-specific
  593. // fields.
  594. Dynamodb *StreamRecord `locationName:"dynamodb" type:"structure"`
  595. // A globally unique identifier for the event that was recorded in this stream
  596. // record.
  597. EventID *string `locationName:"eventID" type:"string"`
  598. // The type of data modification that was performed on the DynamoDB table:
  599. //
  600. // * INSERT - a new item was added to the table.
  601. //
  602. // * MODIFY - one or more of an existing item's attributes were modified.
  603. //
  604. // * REMOVE - the item was deleted from the table
  605. EventName *string `locationName:"eventName" type:"string" enum:"OperationType"`
  606. // The AWS service from which the stream record originated. For DynamoDB Streams,
  607. // this is aws:dynamodb.
  608. EventSource *string `locationName:"eventSource" type:"string"`
  609. // The version number of the stream record format. This number is updated whenever
  610. // the structure of Record is modified.
  611. //
  612. // Client applications must not assume that eventVersion will remain at a particular
  613. // value, as this number is subject to change at any time. In general, eventVersion
  614. // will only increase as the low-level DynamoDB Streams API evolves.
  615. EventVersion *string `locationName:"eventVersion" type:"string"`
  616. }
  617. // String returns the string representation
  618. func (s Record) String() string {
  619. return awsutil.Prettify(s)
  620. }
  621. // GoString returns the string representation
  622. func (s Record) GoString() string {
  623. return s.String()
  624. }
  625. // The beginning and ending sequence numbers for the stream records contained
  626. // within a shard.
  627. type SequenceNumberRange struct {
  628. _ struct{} `type:"structure"`
  629. // The last sequence number.
  630. EndingSequenceNumber *string `min:"21" type:"string"`
  631. // The first sequence number.
  632. StartingSequenceNumber *string `min:"21" type:"string"`
  633. }
  634. // String returns the string representation
  635. func (s SequenceNumberRange) String() string {
  636. return awsutil.Prettify(s)
  637. }
  638. // GoString returns the string representation
  639. func (s SequenceNumberRange) GoString() string {
  640. return s.String()
  641. }
  642. // A uniquely identified group of stream records within a stream.
  643. type Shard struct {
  644. _ struct{} `type:"structure"`
  645. // The shard ID of the current shard's parent.
  646. ParentShardId *string `min:"28" type:"string"`
  647. // The range of possible sequence numbers for the shard.
  648. SequenceNumberRange *SequenceNumberRange `type:"structure"`
  649. // The system-generated identifier for this shard.
  650. ShardId *string `min:"28" type:"string"`
  651. }
  652. // String returns the string representation
  653. func (s Shard) String() string {
  654. return awsutil.Prettify(s)
  655. }
  656. // GoString returns the string representation
  657. func (s Shard) GoString() string {
  658. return s.String()
  659. }
  660. // Represents all of the data describing a particular stream.
  661. type Stream struct {
  662. _ struct{} `type:"structure"`
  663. // The Amazon Resource Name (ARN) for the stream.
  664. StreamArn *string `min:"37" type:"string"`
  665. // A timestamp, in ISO 8601 format, for this stream.
  666. //
  667. // Note that LatestStreamLabel is not a unique identifier for the stream, because
  668. // it is possible that a stream from another table might have the same timestamp.
  669. // However, the combination of the following three elements is guaranteed to
  670. // be unique:
  671. //
  672. // * the AWS customer ID.
  673. //
  674. // * the table name
  675. //
  676. // * the StreamLabel
  677. StreamLabel *string `type:"string"`
  678. // The DynamoDB table with which the stream is associated.
  679. TableName *string `min:"3" type:"string"`
  680. }
  681. // String returns the string representation
  682. func (s Stream) String() string {
  683. return awsutil.Prettify(s)
  684. }
  685. // GoString returns the string representation
  686. func (s Stream) GoString() string {
  687. return s.String()
  688. }
  689. // Represents all of the data describing a particular stream.
  690. type StreamDescription struct {
  691. _ struct{} `type:"structure"`
  692. // The date and time when the request to create this stream was issued.
  693. CreationRequestDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  694. // The key attribute(s) of the stream's DynamoDB table.
  695. KeySchema []*dynamodb.KeySchemaElement `min:"1" type:"list"`
  696. // The shard ID of the item where the operation stopped, inclusive of the previous
  697. // result set. Use this value to start a new operation, excluding this value
  698. // in the new request.
  699. //
  700. // If LastEvaluatedShardId is empty, then the "last page" of results has been
  701. // processed and there is currently no more data to be retrieved.
  702. //
  703. // If LastEvaluatedShardId is not empty, it does not necessarily mean that there
  704. // is more data in the result set. The only way to know when you have reached
  705. // the end of the result set is when LastEvaluatedShardId is empty.
  706. LastEvaluatedShardId *string `min:"28" type:"string"`
  707. // The shards that comprise the stream.
  708. Shards []*Shard `type:"list"`
  709. // The Amazon Resource Name (ARN) for the stream.
  710. StreamArn *string `min:"37" type:"string"`
  711. // A timestamp, in ISO 8601 format, for this stream.
  712. //
  713. // Note that LatestStreamLabel is not a unique identifier for the stream, because
  714. // it is possible that a stream from another table might have the same timestamp.
  715. // However, the combination of the following three elements is guaranteed to
  716. // be unique:
  717. //
  718. // * the AWS customer ID.
  719. //
  720. // * the table name
  721. //
  722. // * the StreamLabel
  723. StreamLabel *string `type:"string"`
  724. // Indicates the current status of the stream:
  725. //
  726. // * ENABLING - Streams is currently being enabled on the DynamoDB table.
  727. //
  728. // * ENABLED - the stream is enabled.
  729. //
  730. // * DISABLING - Streams is currently being disabled on the DynamoDB table.
  731. //
  732. // * DISABLED - the stream is disabled.
  733. StreamStatus *string `type:"string" enum:"StreamStatus"`
  734. // Indicates the format of the records within this stream:
  735. //
  736. // * KEYS_ONLY - only the key attributes of items that were modified in the
  737. // DynamoDB table.
  738. //
  739. // * NEW_IMAGE - entire items from the table, as they appeared after they
  740. // were modified.
  741. //
  742. // * OLD_IMAGE - entire items from the table, as they appeared before they
  743. // were modified.
  744. //
  745. // * NEW_AND_OLD_IMAGES - both the new and the old images of the items from
  746. // the table.
  747. StreamViewType *string `type:"string" enum:"StreamViewType"`
  748. // The DynamoDB table with which the stream is associated.
  749. TableName *string `min:"3" type:"string"`
  750. }
  751. // String returns the string representation
  752. func (s StreamDescription) String() string {
  753. return awsutil.Prettify(s)
  754. }
  755. // GoString returns the string representation
  756. func (s StreamDescription) GoString() string {
  757. return s.String()
  758. }
  759. // A description of a single data modification that was performed on an item
  760. // in a DynamoDB table.
  761. type StreamRecord struct {
  762. _ struct{} `type:"structure"`
  763. // The approximate date and time when the stream record was created, in UNIX
  764. // epoch time (http://www.epochconverter.com/) format.
  765. ApproximateCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  766. // The primary key attribute(s) for the DynamoDB item that was modified.
  767. Keys map[string]*dynamodb.AttributeValue `type:"map"`
  768. // The item in the DynamoDB table as it appeared after it was modified.
  769. NewImage map[string]*dynamodb.AttributeValue `type:"map"`
  770. // The item in the DynamoDB table as it appeared before it was modified.
  771. OldImage map[string]*dynamodb.AttributeValue `type:"map"`
  772. // The sequence number of the stream record.
  773. SequenceNumber *string `min:"21" type:"string"`
  774. // The size of the stream record, in bytes.
  775. SizeBytes *int64 `min:"1" type:"long"`
  776. // The type of data from the modified DynamoDB item that was captured in this
  777. // stream record:
  778. //
  779. // * KEYS_ONLY - only the key attributes of the modified item.
  780. //
  781. // * NEW_IMAGE - the entire item, as it appeared after it was modified.
  782. //
  783. // * OLD_IMAGE - the entire item, as it appeared before it was modified.
  784. //
  785. // * NEW_AND_OLD_IMAGES - both the new and the old item images of the item.
  786. StreamViewType *string `type:"string" enum:"StreamViewType"`
  787. }
  788. // String returns the string representation
  789. func (s StreamRecord) String() string {
  790. return awsutil.Prettify(s)
  791. }
  792. // GoString returns the string representation
  793. func (s StreamRecord) GoString() string {
  794. return s.String()
  795. }
  796. const (
  797. // KeyTypeHash is a KeyType enum value
  798. KeyTypeHash = "HASH"
  799. // KeyTypeRange is a KeyType enum value
  800. KeyTypeRange = "RANGE"
  801. )
  802. const (
  803. // OperationTypeInsert is a OperationType enum value
  804. OperationTypeInsert = "INSERT"
  805. // OperationTypeModify is a OperationType enum value
  806. OperationTypeModify = "MODIFY"
  807. // OperationTypeRemove is a OperationType enum value
  808. OperationTypeRemove = "REMOVE"
  809. )
  810. const (
  811. // ShardIteratorTypeTrimHorizon is a ShardIteratorType enum value
  812. ShardIteratorTypeTrimHorizon = "TRIM_HORIZON"
  813. // ShardIteratorTypeLatest is a ShardIteratorType enum value
  814. ShardIteratorTypeLatest = "LATEST"
  815. // ShardIteratorTypeAtSequenceNumber is a ShardIteratorType enum value
  816. ShardIteratorTypeAtSequenceNumber = "AT_SEQUENCE_NUMBER"
  817. // ShardIteratorTypeAfterSequenceNumber is a ShardIteratorType enum value
  818. ShardIteratorTypeAfterSequenceNumber = "AFTER_SEQUENCE_NUMBER"
  819. )
  820. const (
  821. // StreamStatusEnabling is a StreamStatus enum value
  822. StreamStatusEnabling = "ENABLING"
  823. // StreamStatusEnabled is a StreamStatus enum value
  824. StreamStatusEnabled = "ENABLED"
  825. // StreamStatusDisabling is a StreamStatus enum value
  826. StreamStatusDisabling = "DISABLING"
  827. // StreamStatusDisabled is a StreamStatus enum value
  828. StreamStatusDisabled = "DISABLED"
  829. )
  830. const (
  831. // StreamViewTypeNewImage is a StreamViewType enum value
  832. StreamViewTypeNewImage = "NEW_IMAGE"
  833. // StreamViewTypeOldImage is a StreamViewType enum value
  834. StreamViewTypeOldImage = "OLD_IMAGE"
  835. // StreamViewTypeNewAndOldImages is a StreamViewType enum value
  836. StreamViewTypeNewAndOldImages = "NEW_AND_OLD_IMAGES"
  837. // StreamViewTypeKeysOnly is a StreamViewType enum value
  838. StreamViewTypeKeysOnly = "KEYS_ONLY"
  839. )