api.go 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package kinesis provides a client for Amazon Kinesis.
  3. package kinesis
  4. import (
  5. "github.com/aws/aws-sdk-go/aws/awsutil"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. )
  8. const opAddTagsToStream = "AddTagsToStream"
  9. // AddTagsToStreamRequest generates a request for the AddTagsToStream operation.
  10. func (c *Kinesis) AddTagsToStreamRequest(input *AddTagsToStreamInput) (req *request.Request, output *AddTagsToStreamOutput) {
  11. op := &request.Operation{
  12. Name: opAddTagsToStream,
  13. HTTPMethod: "POST",
  14. HTTPPath: "/",
  15. }
  16. if input == nil {
  17. input = &AddTagsToStreamInput{}
  18. }
  19. req = c.newRequest(op, input, output)
  20. output = &AddTagsToStreamOutput{}
  21. req.Data = output
  22. return
  23. }
  24. // Adds or updates tags for the specified Amazon Kinesis stream. Each stream
  25. // can have up to 10 tags.
  26. //
  27. // If tags have already been assigned to the stream, AddTagsToStream overwrites
  28. // any existing tags that correspond to the specified tag keys.
  29. func (c *Kinesis) AddTagsToStream(input *AddTagsToStreamInput) (*AddTagsToStreamOutput, error) {
  30. req, out := c.AddTagsToStreamRequest(input)
  31. err := req.Send()
  32. return out, err
  33. }
  34. const opCreateStream = "CreateStream"
  35. // CreateStreamRequest generates a request for the CreateStream operation.
  36. func (c *Kinesis) CreateStreamRequest(input *CreateStreamInput) (req *request.Request, output *CreateStreamOutput) {
  37. op := &request.Operation{
  38. Name: opCreateStream,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &CreateStreamInput{}
  44. }
  45. req = c.newRequest(op, input, output)
  46. output = &CreateStreamOutput{}
  47. req.Data = output
  48. return
  49. }
  50. // Creates a Amazon Kinesis stream. A stream captures and transports data records
  51. // that are continuously emitted from different data sources or producers. Scale-out
  52. // within an Amazon Kinesis stream is explicitly supported by means of shards,
  53. // which are uniquely identified groups of data records in an Amazon Kinesis
  54. // stream.
  55. //
  56. // You specify and control the number of shards that a stream is composed of.
  57. // Each open shard can support up to 5 read transactions per second, up to a
  58. // maximum total of 2 MB of data read per second. Each shard can support up
  59. // to 1000 records written per second, up to a maximum total of 1 MB data written
  60. // per second. You can add shards to a stream if the amount of data input increases
  61. // and you can remove shards if the amount of data input decreases.
  62. //
  63. // The stream name identifies the stream. The name is scoped to the AWS account
  64. // used by the application. It is also scoped by region. That is, two streams
  65. // in two different accounts can have the same name, and two streams in the
  66. // same account, but in two different regions, can have the same name.
  67. //
  68. // CreateStream is an asynchronous operation. Upon receiving a CreateStream
  69. // request, Amazon Kinesis immediately returns and sets the stream status to
  70. // CREATING. After the stream is created, Amazon Kinesis sets the stream status
  71. // to ACTIVE. You should perform read and write operations only on an ACTIVE
  72. // stream.
  73. //
  74. // You receive a LimitExceededException when making a CreateStream request
  75. // if you try to do one of the following:
  76. //
  77. // Have more than five streams in the CREATING state at any point in time.
  78. // Create more shards than are authorized for your account. For the default
  79. // shard limit for an AWS account, see Amazon Kinesis Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html).
  80. // If you need to increase this limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)
  81. //
  82. // You can use DescribeStream to check the stream status, which is returned
  83. // in StreamStatus.
  84. //
  85. // CreateStream has a limit of 5 transactions per second per account.
  86. func (c *Kinesis) CreateStream(input *CreateStreamInput) (*CreateStreamOutput, error) {
  87. req, out := c.CreateStreamRequest(input)
  88. err := req.Send()
  89. return out, err
  90. }
  91. const opDeleteStream = "DeleteStream"
  92. // DeleteStreamRequest generates a request for the DeleteStream operation.
  93. func (c *Kinesis) DeleteStreamRequest(input *DeleteStreamInput) (req *request.Request, output *DeleteStreamOutput) {
  94. op := &request.Operation{
  95. Name: opDeleteStream,
  96. HTTPMethod: "POST",
  97. HTTPPath: "/",
  98. }
  99. if input == nil {
  100. input = &DeleteStreamInput{}
  101. }
  102. req = c.newRequest(op, input, output)
  103. output = &DeleteStreamOutput{}
  104. req.Data = output
  105. return
  106. }
  107. // Deletes a stream and all its shards and data. You must shut down any applications
  108. // that are operating on the stream before you delete the stream. If an application
  109. // attempts to operate on a deleted stream, it will receive the exception ResourceNotFoundException.
  110. //
  111. // If the stream is in the ACTIVE state, you can delete it. After a DeleteStream
  112. // request, the specified stream is in the DELETING state until Amazon Kinesis
  113. // completes the deletion.
  114. //
  115. // Note: Amazon Kinesis might continue to accept data read and write operations,
  116. // such as PutRecord, PutRecords, and GetRecords, on a stream in the DELETING
  117. // state until the stream deletion is complete.
  118. //
  119. // When you delete a stream, any shards in that stream are also deleted, and
  120. // any tags are dissociated from the stream.
  121. //
  122. // You can use the DescribeStream operation to check the state of the stream,
  123. // which is returned in StreamStatus.
  124. //
  125. // DeleteStream has a limit of 5 transactions per second per account.
  126. func (c *Kinesis) DeleteStream(input *DeleteStreamInput) (*DeleteStreamOutput, error) {
  127. req, out := c.DeleteStreamRequest(input)
  128. err := req.Send()
  129. return out, err
  130. }
  131. const opDescribeStream = "DescribeStream"
  132. // DescribeStreamRequest generates a request for the DescribeStream operation.
  133. func (c *Kinesis) DescribeStreamRequest(input *DescribeStreamInput) (req *request.Request, output *DescribeStreamOutput) {
  134. op := &request.Operation{
  135. Name: opDescribeStream,
  136. HTTPMethod: "POST",
  137. HTTPPath: "/",
  138. Paginator: &request.Paginator{
  139. InputTokens: []string{"ExclusiveStartShardId"},
  140. OutputTokens: []string{"StreamDescription.Shards[-1].ShardId"},
  141. LimitToken: "Limit",
  142. TruncationToken: "StreamDescription.HasMoreShards",
  143. },
  144. }
  145. if input == nil {
  146. input = &DescribeStreamInput{}
  147. }
  148. req = c.newRequest(op, input, output)
  149. output = &DescribeStreamOutput{}
  150. req.Data = output
  151. return
  152. }
  153. // Describes the specified stream.
  154. //
  155. // The information about the stream includes its current status, its Amazon
  156. // Resource Name (ARN), and an array of shard objects. For each shard object,
  157. // there is information about the hash key and sequence number ranges that the
  158. // shard spans, and the IDs of any earlier shards that played in a role in creating
  159. // the shard. A sequence number is the identifier associated with every record
  160. // ingested in the Amazon Kinesis stream. The sequence number is assigned when
  161. // a record is put into the stream.
  162. //
  163. // You can limit the number of returned shards using the Limit parameter. The
  164. // number of shards in a stream may be too large to return from a single call
  165. // to DescribeStream. You can detect this by using the HasMoreShards flag in
  166. // the returned output. HasMoreShards is set to true when there is more data
  167. // available.
  168. //
  169. // DescribeStream is a paginated operation. If there are more shards available,
  170. // you can request them using the shard ID of the last shard returned. Specify
  171. // this ID in the ExclusiveStartShardId parameter in a subsequent request to
  172. // DescribeStream.
  173. //
  174. // DescribeStream has a limit of 10 transactions per second per account.
  175. func (c *Kinesis) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOutput, error) {
  176. req, out := c.DescribeStreamRequest(input)
  177. err := req.Send()
  178. return out, err
  179. }
  180. func (c *Kinesis) DescribeStreamPages(input *DescribeStreamInput, fn func(p *DescribeStreamOutput, lastPage bool) (shouldContinue bool)) error {
  181. page, _ := c.DescribeStreamRequest(input)
  182. return page.EachPage(func(p interface{}, lastPage bool) bool {
  183. return fn(p.(*DescribeStreamOutput), lastPage)
  184. })
  185. }
  186. const opGetRecords = "GetRecords"
  187. // GetRecordsRequest generates a request for the GetRecords operation.
  188. func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Request, output *GetRecordsOutput) {
  189. op := &request.Operation{
  190. Name: opGetRecords,
  191. HTTPMethod: "POST",
  192. HTTPPath: "/",
  193. }
  194. if input == nil {
  195. input = &GetRecordsInput{}
  196. }
  197. req = c.newRequest(op, input, output)
  198. output = &GetRecordsOutput{}
  199. req.Data = output
  200. return
  201. }
  202. // Gets data records from a shard.
  203. //
  204. // Specify a shard iterator using the ShardIterator parameter. The shard iterator
  205. // specifies the position in the shard from which you want to start reading
  206. // data records sequentially. If there are no records available in the portion
  207. // of the shard that the iterator points to, GetRecords returns an empty list.
  208. // Note that it might take multiple calls to get to a portion of the shard that
  209. // contains records.
  210. //
  211. // You can scale by provisioning multiple shards. Your application should have
  212. // one thread per shard, each reading continuously from its stream. To read
  213. // from a stream continually, call GetRecords in a loop. Use GetShardIterator
  214. // to get the shard iterator to specify in the first GetRecords call. GetRecords
  215. // returns a new shard iterator in NextShardIterator. Specify the shard iterator
  216. // returned in NextShardIterator in subsequent calls to GetRecords. Note that
  217. // if the shard has been closed, the shard iterator can't return more data and
  218. // GetRecords returns null in NextShardIterator. You can terminate the loop
  219. // when the shard is closed, or when the shard iterator reaches the record with
  220. // the sequence number or other attribute that marks it as the last record to
  221. // process.
  222. //
  223. // Each data record can be up to 50 KB in size, and each shard can read up
  224. // to 2 MB per second. You can ensure that your calls don't exceed the maximum
  225. // supported size or throughput by using the Limit parameter to specify the
  226. // maximum number of records that GetRecords can return. Consider your average
  227. // record size when determining this limit. For example, if your average record
  228. // size is 40 KB, you can limit the data returned to about 1 MB per call by
  229. // specifying 25 as the limit.
  230. //
  231. // The size of the data returned by GetRecords will vary depending on the utilization
  232. // of the shard. The maximum size of data that GetRecords can return is 10 MB.
  233. // If a call returns this amount of data, subsequent calls made within the next
  234. // 5 seconds throw ProvisionedThroughputExceededException. If there is insufficient
  235. // provisioned throughput on the shard, subsequent calls made within the next
  236. // 1 second throw ProvisionedThroughputExceededException. Note that GetRecords
  237. // won't return any data when it throws an exception. For this reason, we recommend
  238. // that you wait one second between calls to GetRecords; however, it's possible
  239. // that the application will get exceptions for longer than 1 second.
  240. //
  241. // To detect whether the application is falling behind in processing, you can
  242. // use the MillisBehindLatest response attribute. You can also monitor the amount
  243. // of data in a stream using the CloudWatch metrics. For more information, see
  244. // Monitoring Amazon Kinesis with Amazon CloudWatch (http://docs.aws.amazon.com/kinesis/latest/dev/monitoring_with_cloudwatch.html)
  245. // in the Amazon Kinesis Developer Guide.
  246. func (c *Kinesis) GetRecords(input *GetRecordsInput) (*GetRecordsOutput, error) {
  247. req, out := c.GetRecordsRequest(input)
  248. err := req.Send()
  249. return out, err
  250. }
  251. const opGetShardIterator = "GetShardIterator"
  252. // GetShardIteratorRequest generates a request for the GetShardIterator operation.
  253. func (c *Kinesis) GetShardIteratorRequest(input *GetShardIteratorInput) (req *request.Request, output *GetShardIteratorOutput) {
  254. op := &request.Operation{
  255. Name: opGetShardIterator,
  256. HTTPMethod: "POST",
  257. HTTPPath: "/",
  258. }
  259. if input == nil {
  260. input = &GetShardIteratorInput{}
  261. }
  262. req = c.newRequest(op, input, output)
  263. output = &GetShardIteratorOutput{}
  264. req.Data = output
  265. return
  266. }
  267. // Gets a shard iterator. A shard iterator expires five minutes after it is
  268. // returned to the requester.
  269. //
  270. // A shard iterator specifies the position in the shard from which to start
  271. // reading data records sequentially. A shard iterator specifies this position
  272. // using the sequence number of a data record in a shard. A sequence number
  273. // is the identifier associated with every record ingested in the Amazon Kinesis
  274. // stream. The sequence number is assigned when a record is put into the stream.
  275. //
  276. // You must specify the shard iterator type. For example, you can set the ShardIteratorType
  277. // parameter to read exactly from the position denoted by a specific sequence
  278. // number by using the AT_SEQUENCE_NUMBER shard iterator type, or right after
  279. // the sequence number by using the AFTER_SEQUENCE_NUMBER shard iterator type,
  280. // using sequence numbers returned by earlier calls to PutRecord, PutRecords,
  281. // GetRecords, or DescribeStream. You can specify the shard iterator type TRIM_HORIZON
  282. // in the request to cause ShardIterator to point to the last untrimmed record
  283. // in the shard in the system, which is the oldest data record in the shard.
  284. // Or you can point to just after the most recent record in the shard, by using
  285. // the shard iterator type LATEST, so that you always read the most recent data
  286. // in the shard.
  287. //
  288. // When you repeatedly read from an Amazon Kinesis stream use a GetShardIterator
  289. // request to get the first shard iterator for use in your first GetRecords
  290. // request and then use the shard iterator returned by the GetRecords request
  291. // in NextShardIterator for subsequent reads. A new shard iterator is returned
  292. // by every GetRecords request in NextShardIterator, which you use in the ShardIterator
  293. // parameter of the next GetRecords request.
  294. //
  295. // If a GetShardIterator request is made too often, you receive a ProvisionedThroughputExceededException.
  296. // For more information about throughput limits, see GetRecords.
  297. //
  298. // If the shard is closed, the iterator can't return more data, and GetShardIterator
  299. // returns null for its ShardIterator. A shard can be closed using SplitShard
  300. // or MergeShards.
  301. //
  302. // GetShardIterator has a limit of 5 transactions per second per account per
  303. // open shard.
  304. func (c *Kinesis) GetShardIterator(input *GetShardIteratorInput) (*GetShardIteratorOutput, error) {
  305. req, out := c.GetShardIteratorRequest(input)
  306. err := req.Send()
  307. return out, err
  308. }
  309. const opListStreams = "ListStreams"
  310. // ListStreamsRequest generates a request for the ListStreams operation.
  311. func (c *Kinesis) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, output *ListStreamsOutput) {
  312. op := &request.Operation{
  313. Name: opListStreams,
  314. HTTPMethod: "POST",
  315. HTTPPath: "/",
  316. Paginator: &request.Paginator{
  317. InputTokens: []string{"ExclusiveStartStreamName"},
  318. OutputTokens: []string{"StreamNames[-1]"},
  319. LimitToken: "Limit",
  320. TruncationToken: "HasMoreStreams",
  321. },
  322. }
  323. if input == nil {
  324. input = &ListStreamsInput{}
  325. }
  326. req = c.newRequest(op, input, output)
  327. output = &ListStreamsOutput{}
  328. req.Data = output
  329. return
  330. }
  331. // Lists your streams.
  332. //
  333. // The number of streams may be too large to return from a single call to
  334. // ListStreams. You can limit the number of returned streams using the Limit
  335. // parameter. If you do not specify a value for the Limit parameter, Amazon
  336. // Kinesis uses the default limit, which is currently 10.
  337. //
  338. // You can detect if there are more streams available to list by using the
  339. // HasMoreStreams flag from the returned output. If there are more streams available,
  340. // you can request more streams by using the name of the last stream returned
  341. // by the ListStreams request in the ExclusiveStartStreamName parameter in a
  342. // subsequent request to ListStreams. The group of stream names returned by
  343. // the subsequent request is then added to the list. You can continue this process
  344. // until all the stream names have been collected in the list.
  345. //
  346. // ListStreams has a limit of 5 transactions per second per account.
  347. func (c *Kinesis) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) {
  348. req, out := c.ListStreamsRequest(input)
  349. err := req.Send()
  350. return out, err
  351. }
  352. func (c *Kinesis) ListStreamsPages(input *ListStreamsInput, fn func(p *ListStreamsOutput, lastPage bool) (shouldContinue bool)) error {
  353. page, _ := c.ListStreamsRequest(input)
  354. return page.EachPage(func(p interface{}, lastPage bool) bool {
  355. return fn(p.(*ListStreamsOutput), lastPage)
  356. })
  357. }
  358. const opListTagsForStream = "ListTagsForStream"
  359. // ListTagsForStreamRequest generates a request for the ListTagsForStream operation.
  360. func (c *Kinesis) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req *request.Request, output *ListTagsForStreamOutput) {
  361. op := &request.Operation{
  362. Name: opListTagsForStream,
  363. HTTPMethod: "POST",
  364. HTTPPath: "/",
  365. }
  366. if input == nil {
  367. input = &ListTagsForStreamInput{}
  368. }
  369. req = c.newRequest(op, input, output)
  370. output = &ListTagsForStreamOutput{}
  371. req.Data = output
  372. return
  373. }
  374. // Lists the tags for the specified Amazon Kinesis stream.
  375. func (c *Kinesis) ListTagsForStream(input *ListTagsForStreamInput) (*ListTagsForStreamOutput, error) {
  376. req, out := c.ListTagsForStreamRequest(input)
  377. err := req.Send()
  378. return out, err
  379. }
  380. const opMergeShards = "MergeShards"
  381. // MergeShardsRequest generates a request for the MergeShards operation.
  382. func (c *Kinesis) MergeShardsRequest(input *MergeShardsInput) (req *request.Request, output *MergeShardsOutput) {
  383. op := &request.Operation{
  384. Name: opMergeShards,
  385. HTTPMethod: "POST",
  386. HTTPPath: "/",
  387. }
  388. if input == nil {
  389. input = &MergeShardsInput{}
  390. }
  391. req = c.newRequest(op, input, output)
  392. output = &MergeShardsOutput{}
  393. req.Data = output
  394. return
  395. }
  396. // Merges two adjacent shards in a stream and combines them into a single shard
  397. // to reduce the stream's capacity to ingest and transport data. Two shards
  398. // are considered adjacent if the union of the hash key ranges for the two shards
  399. // form a contiguous set with no gaps. For example, if you have two shards,
  400. // one with a hash key range of 276...381 and the other with a hash key range
  401. // of 382...454, then you could merge these two shards into a single shard that
  402. // would have a hash key range of 276...454. After the merge, the single child
  403. // shard receives data for all hash key values covered by the two parent shards.
  404. //
  405. // MergeShards is called when there is a need to reduce the overall capacity
  406. // of a stream because of excess capacity that is not being used. You must specify
  407. // the shard to be merged and the adjacent shard for a stream. For more information
  408. // about merging shards, see Merge Two Shards (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-merge.html)
  409. // in the Amazon Kinesis Developer Guide.
  410. //
  411. // If the stream is in the ACTIVE state, you can call MergeShards. If a stream
  412. // is in the CREATING, UPDATING, or DELETING state, MergeShards returns a ResourceInUseException.
  413. // If the specified stream does not exist, MergeShards returns a ResourceNotFoundException.
  414. //
  415. // You can use DescribeStream to check the state of the stream, which is returned
  416. // in StreamStatus.
  417. //
  418. // MergeShards is an asynchronous operation. Upon receiving a MergeShards request,
  419. // Amazon Kinesis immediately returns a response and sets the StreamStatus to
  420. // UPDATING. After the operation is completed, Amazon Kinesis sets the StreamStatus
  421. // to ACTIVE. Read and write operations continue to work while the stream is
  422. // in the UPDATING state.
  423. //
  424. // You use DescribeStream to determine the shard IDs that are specified in
  425. // the MergeShards request.
  426. //
  427. // If you try to operate on too many streams in parallel using CreateStream,
  428. // DeleteStream, MergeShards or SplitShard, you will receive a LimitExceededException.
  429. //
  430. // MergeShards has limit of 5 transactions per second per account.
  431. func (c *Kinesis) MergeShards(input *MergeShardsInput) (*MergeShardsOutput, error) {
  432. req, out := c.MergeShardsRequest(input)
  433. err := req.Send()
  434. return out, err
  435. }
  436. const opPutRecord = "PutRecord"
  437. // PutRecordRequest generates a request for the PutRecord operation.
  438. func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request, output *PutRecordOutput) {
  439. op := &request.Operation{
  440. Name: opPutRecord,
  441. HTTPMethod: "POST",
  442. HTTPPath: "/",
  443. }
  444. if input == nil {
  445. input = &PutRecordInput{}
  446. }
  447. req = c.newRequest(op, input, output)
  448. output = &PutRecordOutput{}
  449. req.Data = output
  450. return
  451. }
  452. // Puts (writes) a single data record from a producer into an Amazon Kinesis
  453. // stream. Call PutRecord to send data from the producer into the Amazon Kinesis
  454. // stream for real-time ingestion and subsequent processing, one record at a
  455. // time. Each shard can support up to 1000 records written per second, up to
  456. // a maximum total of 1 MB data written per second.
  457. //
  458. // You must specify the name of the stream that captures, stores, and transports
  459. // the data; a partition key; and the data blob itself.
  460. //
  461. // The data blob can be any type of data; for example, a segment from a log
  462. // file, geographic/location data, website clickstream data, and so on.
  463. //
  464. // The partition key is used by Amazon Kinesis to distribute data across shards.
  465. // Amazon Kinesis segregates the data records that belong to a data stream into
  466. // multiple shards, using the partition key associated with each data record
  467. // to determine which shard a given data record belongs to.
  468. //
  469. // Partition keys are Unicode strings, with a maximum length limit of 256 characters
  470. // for each key. An MD5 hash function is used to map partition keys to 128-bit
  471. // integer values and to map associated data records to shards using the hash
  472. // key ranges of the shards. You can override hashing the partition key to determine
  473. // the shard by explicitly specifying a hash value using the ExplicitHashKey
  474. // parameter. For more information, see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html)
  475. // in the Amazon Kinesis Developer Guide.
  476. //
  477. // PutRecord returns the shard ID of where the data record was placed and the
  478. // sequence number that was assigned to the data record.
  479. //
  480. // Sequence numbers generally increase over time. To guarantee strictly increasing
  481. // ordering, use the SequenceNumberForOrdering parameter. For more information,
  482. // see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html)
  483. // in the Amazon Kinesis Developer Guide.
  484. //
  485. // If a PutRecord request cannot be processed because of insufficient provisioned
  486. // throughput on the shard involved in the request, PutRecord throws ProvisionedThroughputExceededException.
  487. //
  488. // Data records are accessible for only 24 hours from the time that they are
  489. // added to an Amazon Kinesis stream.
  490. func (c *Kinesis) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) {
  491. req, out := c.PutRecordRequest(input)
  492. err := req.Send()
  493. return out, err
  494. }
  495. const opPutRecords = "PutRecords"
  496. // PutRecordsRequest generates a request for the PutRecords operation.
  497. func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Request, output *PutRecordsOutput) {
  498. op := &request.Operation{
  499. Name: opPutRecords,
  500. HTTPMethod: "POST",
  501. HTTPPath: "/",
  502. }
  503. if input == nil {
  504. input = &PutRecordsInput{}
  505. }
  506. req = c.newRequest(op, input, output)
  507. output = &PutRecordsOutput{}
  508. req.Data = output
  509. return
  510. }
  511. // Puts (writes) multiple data records from a producer into an Amazon Kinesis
  512. // stream in a single call (also referred to as a PutRecords request). Use this
  513. // operation to send data from a data producer into the Amazon Kinesis stream
  514. // for real-time ingestion and processing. Each shard can support up to 1000
  515. // records written per second, up to a maximum total of 1 MB data written per
  516. // second.
  517. //
  518. // You must specify the name of the stream that captures, stores, and transports
  519. // the data; and an array of request Records, with each record in the array
  520. // requiring a partition key and data blob.
  521. //
  522. // The data blob can be any type of data; for example, a segment from a log
  523. // file, geographic/location data, website clickstream data, and so on.
  524. //
  525. // The partition key is used by Amazon Kinesis as input to a hash function
  526. // that maps the partition key and associated data to a specific shard. An MD5
  527. // hash function is used to map partition keys to 128-bit integer values and
  528. // to map associated data records to shards. As a result of this hashing mechanism,
  529. // all data records with the same partition key map to the same shard within
  530. // the stream. For more information, see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html)
  531. // in the Amazon Kinesis Developer Guide.
  532. //
  533. // Each record in the Records array may include an optional parameter, ExplicitHashKey,
  534. // which overrides the partition key to shard mapping. This parameter allows
  535. // a data producer to determine explicitly the shard where the record is stored.
  536. // For more information, see Adding Multiple Records with PutRecords (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords)
  537. // in the Amazon Kinesis Developer Guide.
  538. //
  539. // The PutRecords response includes an array of response Records. Each record
  540. // in the response array directly correlates with a record in the request array
  541. // using natural ordering, from the top to the bottom of the request and response.
  542. // The response Records array always includes the same number of records as
  543. // the request array.
  544. //
  545. // The response Records array includes both successfully and unsuccessfully
  546. // processed records. Amazon Kinesis attempts to process all records in each
  547. // PutRecords request. A single record failure does not stop the processing
  548. // of subsequent records.
  549. //
  550. // A successfully-processed record includes ShardId and SequenceNumber values.
  551. // The ShardId parameter identifies the shard in the stream where the record
  552. // is stored. The SequenceNumber parameter is an identifier assigned to the
  553. // put record, unique to all records in the stream.
  554. //
  555. // An unsuccessfully-processed record includes ErrorCode and ErrorMessage values.
  556. // ErrorCode reflects the type of error and can be one of the following values:
  557. // ProvisionedThroughputExceededException or InternalFailure. ErrorMessage provides
  558. // more detailed information about the ProvisionedThroughputExceededException
  559. // exception including the account ID, stream name, and shard ID of the record
  560. // that was throttled. For more information about partially successful responses,
  561. // see Adding Multiple Records with PutRecords (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords)
  562. // in the Amazon Kinesis Developer Guide.
  563. //
  564. // Data records are accessible for only 24 hours from the time that they are
  565. // added to an Amazon Kinesis stream.
  566. func (c *Kinesis) PutRecords(input *PutRecordsInput) (*PutRecordsOutput, error) {
  567. req, out := c.PutRecordsRequest(input)
  568. err := req.Send()
  569. return out, err
  570. }
  571. const opRemoveTagsFromStream = "RemoveTagsFromStream"
  572. // RemoveTagsFromStreamRequest generates a request for the RemoveTagsFromStream operation.
  573. func (c *Kinesis) RemoveTagsFromStreamRequest(input *RemoveTagsFromStreamInput) (req *request.Request, output *RemoveTagsFromStreamOutput) {
  574. op := &request.Operation{
  575. Name: opRemoveTagsFromStream,
  576. HTTPMethod: "POST",
  577. HTTPPath: "/",
  578. }
  579. if input == nil {
  580. input = &RemoveTagsFromStreamInput{}
  581. }
  582. req = c.newRequest(op, input, output)
  583. output = &RemoveTagsFromStreamOutput{}
  584. req.Data = output
  585. return
  586. }
  587. // Deletes tags from the specified Amazon Kinesis stream.
  588. //
  589. // If you specify a tag that does not exist, it is ignored.
  590. func (c *Kinesis) RemoveTagsFromStream(input *RemoveTagsFromStreamInput) (*RemoveTagsFromStreamOutput, error) {
  591. req, out := c.RemoveTagsFromStreamRequest(input)
  592. err := req.Send()
  593. return out, err
  594. }
  595. const opSplitShard = "SplitShard"
  596. // SplitShardRequest generates a request for the SplitShard operation.
  597. func (c *Kinesis) SplitShardRequest(input *SplitShardInput) (req *request.Request, output *SplitShardOutput) {
  598. op := &request.Operation{
  599. Name: opSplitShard,
  600. HTTPMethod: "POST",
  601. HTTPPath: "/",
  602. }
  603. if input == nil {
  604. input = &SplitShardInput{}
  605. }
  606. req = c.newRequest(op, input, output)
  607. output = &SplitShardOutput{}
  608. req.Data = output
  609. return
  610. }
  611. // Splits a shard into two new shards in the stream, to increase the stream's
  612. // capacity to ingest and transport data. SplitShard is called when there is
  613. // a need to increase the overall capacity of stream because of an expected
  614. // increase in the volume of data records being ingested.
  615. //
  616. // You can also use SplitShard when a shard appears to be approaching its maximum
  617. // utilization, for example, when the set of producers sending data into the
  618. // specific shard are suddenly sending more than previously anticipated. You
  619. // can also call SplitShard to increase stream capacity, so that more Amazon
  620. // Kinesis applications can simultaneously read data from the stream for real-time
  621. // processing.
  622. //
  623. // You must specify the shard to be split and the new hash key, which is the
  624. // position in the shard where the shard gets split in two. In many cases, the
  625. // new hash key might simply be the average of the beginning and ending hash
  626. // key, but it can be any hash key value in the range being mapped into the
  627. // shard. For more information about splitting shards, see Split a Shard (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-split.html)
  628. // in the Amazon Kinesis Developer Guide.
  629. //
  630. // You can use DescribeStream to determine the shard ID and hash key values
  631. // for the ShardToSplit and NewStartingHashKey parameters that are specified
  632. // in the SplitShard request.
  633. //
  634. // SplitShard is an asynchronous operation. Upon receiving a SplitShard request,
  635. // Amazon Kinesis immediately returns a response and sets the stream status
  636. // to UPDATING. After the operation is completed, Amazon Kinesis sets the stream
  637. // status to ACTIVE. Read and write operations continue to work while the stream
  638. // is in the UPDATING state.
  639. //
  640. // You can use DescribeStream to check the status of the stream, which is returned
  641. // in StreamStatus. If the stream is in the ACTIVE state, you can call SplitShard.
  642. // If a stream is in CREATING or UPDATING or DELETING states, DescribeStream
  643. // returns a ResourceInUseException.
  644. //
  645. // If the specified stream does not exist, DescribeStream returns a ResourceNotFoundException.
  646. // If you try to create more shards than are authorized for your account, you
  647. // receive a LimitExceededException.
  648. //
  649. // For the default shard limit for an AWS account, see Amazon Kinesis Limits
  650. // (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html).
  651. // If you need to increase this limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)
  652. //
  653. // If you try to operate on too many streams in parallel using CreateStream,
  654. // DeleteStream, MergeShards or SplitShard, you receive a LimitExceededException.
  655. //
  656. // SplitShard has limit of 5 transactions per second per account.
  657. func (c *Kinesis) SplitShard(input *SplitShardInput) (*SplitShardOutput, error) {
  658. req, out := c.SplitShardRequest(input)
  659. err := req.Send()
  660. return out, err
  661. }
  662. // Represents the input for AddTagsToStream.
  663. type AddTagsToStreamInput struct {
  664. // The name of the stream.
  665. StreamName *string `type:"string" required:"true"`
  666. // The set of key-value pairs to use to create the tags.
  667. Tags map[string]*string `type:"map" required:"true"`
  668. metadataAddTagsToStreamInput `json:"-" xml:"-"`
  669. }
  670. type metadataAddTagsToStreamInput struct {
  671. SDKShapeTraits bool `type:"structure"`
  672. }
  673. // String returns the string representation
  674. func (s AddTagsToStreamInput) String() string {
  675. return awsutil.Prettify(s)
  676. }
  677. // GoString returns the string representation
  678. func (s AddTagsToStreamInput) GoString() string {
  679. return s.String()
  680. }
  681. type AddTagsToStreamOutput struct {
  682. metadataAddTagsToStreamOutput `json:"-" xml:"-"`
  683. }
  684. type metadataAddTagsToStreamOutput struct {
  685. SDKShapeTraits bool `type:"structure"`
  686. }
  687. // String returns the string representation
  688. func (s AddTagsToStreamOutput) String() string {
  689. return awsutil.Prettify(s)
  690. }
  691. // GoString returns the string representation
  692. func (s AddTagsToStreamOutput) GoString() string {
  693. return s.String()
  694. }
  695. // Represents the input for CreateStream.
  696. type CreateStreamInput struct {
  697. // The number of shards that the stream will use. The throughput of the stream
  698. // is a function of the number of shards; more shards are required for greater
  699. // provisioned throughput.
  700. //
  701. // DefaultShardLimit;
  702. ShardCount *int64 `type:"integer" required:"true"`
  703. // A name to identify the stream. The stream name is scoped to the AWS account
  704. // used by the application that creates the stream. It is also scoped by region.
  705. // That is, two streams in two different AWS accounts can have the same name,
  706. // and two streams in the same AWS account, but in two different regions, can
  707. // have the same name.
  708. StreamName *string `type:"string" required:"true"`
  709. metadataCreateStreamInput `json:"-" xml:"-"`
  710. }
  711. type metadataCreateStreamInput struct {
  712. SDKShapeTraits bool `type:"structure"`
  713. }
  714. // String returns the string representation
  715. func (s CreateStreamInput) String() string {
  716. return awsutil.Prettify(s)
  717. }
  718. // GoString returns the string representation
  719. func (s CreateStreamInput) GoString() string {
  720. return s.String()
  721. }
  722. type CreateStreamOutput struct {
  723. metadataCreateStreamOutput `json:"-" xml:"-"`
  724. }
  725. type metadataCreateStreamOutput struct {
  726. SDKShapeTraits bool `type:"structure"`
  727. }
  728. // String returns the string representation
  729. func (s CreateStreamOutput) String() string {
  730. return awsutil.Prettify(s)
  731. }
  732. // GoString returns the string representation
  733. func (s CreateStreamOutput) GoString() string {
  734. return s.String()
  735. }
  736. // Represents the input for DeleteStream.
  737. type DeleteStreamInput struct {
  738. // The name of the stream to delete.
  739. StreamName *string `type:"string" required:"true"`
  740. metadataDeleteStreamInput `json:"-" xml:"-"`
  741. }
  742. type metadataDeleteStreamInput struct {
  743. SDKShapeTraits bool `type:"structure"`
  744. }
  745. // String returns the string representation
  746. func (s DeleteStreamInput) String() string {
  747. return awsutil.Prettify(s)
  748. }
  749. // GoString returns the string representation
  750. func (s DeleteStreamInput) GoString() string {
  751. return s.String()
  752. }
  753. type DeleteStreamOutput struct {
  754. metadataDeleteStreamOutput `json:"-" xml:"-"`
  755. }
  756. type metadataDeleteStreamOutput struct {
  757. SDKShapeTraits bool `type:"structure"`
  758. }
  759. // String returns the string representation
  760. func (s DeleteStreamOutput) String() string {
  761. return awsutil.Prettify(s)
  762. }
  763. // GoString returns the string representation
  764. func (s DeleteStreamOutput) GoString() string {
  765. return s.String()
  766. }
  767. // Represents the input for DescribeStream.
  768. type DescribeStreamInput struct {
  769. // The shard ID of the shard to start with.
  770. ExclusiveStartShardId *string `type:"string"`
  771. // The maximum number of shards to return.
  772. Limit *int64 `type:"integer"`
  773. // The name of the stream to describe.
  774. StreamName *string `type:"string" required:"true"`
  775. metadataDescribeStreamInput `json:"-" xml:"-"`
  776. }
  777. type metadataDescribeStreamInput struct {
  778. SDKShapeTraits bool `type:"structure"`
  779. }
  780. // String returns the string representation
  781. func (s DescribeStreamInput) String() string {
  782. return awsutil.Prettify(s)
  783. }
  784. // GoString returns the string representation
  785. func (s DescribeStreamInput) GoString() string {
  786. return s.String()
  787. }
  788. // Represents the output for DescribeStream.
  789. type DescribeStreamOutput struct {
  790. // The current status of the stream, the stream ARN, an array of shard objects
  791. // that comprise the stream, and states whether there are more shards available.
  792. StreamDescription *StreamDescription `type:"structure" required:"true"`
  793. metadataDescribeStreamOutput `json:"-" xml:"-"`
  794. }
  795. type metadataDescribeStreamOutput struct {
  796. SDKShapeTraits bool `type:"structure"`
  797. }
  798. // String returns the string representation
  799. func (s DescribeStreamOutput) String() string {
  800. return awsutil.Prettify(s)
  801. }
  802. // GoString returns the string representation
  803. func (s DescribeStreamOutput) GoString() string {
  804. return s.String()
  805. }
  806. // Represents the input for GetRecords.
  807. type GetRecordsInput struct {
  808. // The maximum number of records to return. Specify a value of up to 10,000.
  809. // If you specify a value that is greater than 10,000, GetRecords throws InvalidArgumentException.
  810. Limit *int64 `type:"integer"`
  811. // The position in the shard from which you want to start sequentially reading
  812. // data records. A shard iterator specifies this position using the sequence
  813. // number of a data record in the shard.
  814. ShardIterator *string `type:"string" required:"true"`
  815. metadataGetRecordsInput `json:"-" xml:"-"`
  816. }
  817. type metadataGetRecordsInput struct {
  818. SDKShapeTraits bool `type:"structure"`
  819. }
  820. // String returns the string representation
  821. func (s GetRecordsInput) String() string {
  822. return awsutil.Prettify(s)
  823. }
  824. // GoString returns the string representation
  825. func (s GetRecordsInput) GoString() string {
  826. return s.String()
  827. }
  828. // Represents the output for GetRecords.
  829. type GetRecordsOutput struct {
  830. // The number of milliseconds the GetRecords response is from the tip of the
  831. // stream, indicating how far behind current time the consumer is. A value of
  832. // zero indicates record processing is caught up, and there are no new records
  833. // to process at this moment.
  834. MillisBehindLatest *int64 `type:"long"`
  835. // The next position in the shard from which to start sequentially reading data
  836. // records. If set to null, the shard has been closed and the requested iterator
  837. // will not return any more data.
  838. NextShardIterator *string `type:"string"`
  839. // The data records retrieved from the shard.
  840. Records []*Record `type:"list" required:"true"`
  841. metadataGetRecordsOutput `json:"-" xml:"-"`
  842. }
  843. type metadataGetRecordsOutput struct {
  844. SDKShapeTraits bool `type:"structure"`
  845. }
  846. // String returns the string representation
  847. func (s GetRecordsOutput) String() string {
  848. return awsutil.Prettify(s)
  849. }
  850. // GoString returns the string representation
  851. func (s GetRecordsOutput) GoString() string {
  852. return s.String()
  853. }
  854. // Represents the input for GetShardIterator.
  855. type GetShardIteratorInput struct {
  856. // The shard ID of the shard to get the iterator for.
  857. ShardId *string `type:"string" required:"true"`
  858. // Determines how the shard iterator is used to start reading data records from
  859. // the shard.
  860. //
  861. // The following are the valid shard iterator types:
  862. //
  863. // AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by
  864. // a specific sequence number. AFTER_SEQUENCE_NUMBER - Start reading right after
  865. // the position denoted by a specific sequence number. TRIM_HORIZON - Start
  866. // reading at the last untrimmed record in the shard in the system, which is
  867. // the oldest data record in the shard. LATEST - Start reading just after the
  868. // most recent record in the shard, so that you always read the most recent
  869. // data in the shard.
  870. ShardIteratorType *string `type:"string" required:"true" enum:"ShardIteratorType"`
  871. // The sequence number of the data record in the shard from which to start reading
  872. // from.
  873. StartingSequenceNumber *string `type:"string"`
  874. // The name of the stream.
  875. StreamName *string `type:"string" required:"true"`
  876. metadataGetShardIteratorInput `json:"-" xml:"-"`
  877. }
  878. type metadataGetShardIteratorInput struct {
  879. SDKShapeTraits bool `type:"structure"`
  880. }
  881. // String returns the string representation
  882. func (s GetShardIteratorInput) String() string {
  883. return awsutil.Prettify(s)
  884. }
  885. // GoString returns the string representation
  886. func (s GetShardIteratorInput) GoString() string {
  887. return s.String()
  888. }
  889. // Represents the output for GetShardIterator.
  890. type GetShardIteratorOutput struct {
  891. // The position in the shard from which to start reading data records sequentially.
  892. // A shard iterator specifies this position using the sequence number of a data
  893. // record in a shard.
  894. ShardIterator *string `type:"string"`
  895. metadataGetShardIteratorOutput `json:"-" xml:"-"`
  896. }
  897. type metadataGetShardIteratorOutput struct {
  898. SDKShapeTraits bool `type:"structure"`
  899. }
  900. // String returns the string representation
  901. func (s GetShardIteratorOutput) String() string {
  902. return awsutil.Prettify(s)
  903. }
  904. // GoString returns the string representation
  905. func (s GetShardIteratorOutput) GoString() string {
  906. return s.String()
  907. }
  908. // The range of possible hash key values for the shard, which is a set of ordered
  909. // contiguous positive integers.
  910. type HashKeyRange struct {
  911. // The ending hash key of the hash key range.
  912. EndingHashKey *string `type:"string" required:"true"`
  913. // The starting hash key of the hash key range.
  914. StartingHashKey *string `type:"string" required:"true"`
  915. metadataHashKeyRange `json:"-" xml:"-"`
  916. }
  917. type metadataHashKeyRange struct {
  918. SDKShapeTraits bool `type:"structure"`
  919. }
  920. // String returns the string representation
  921. func (s HashKeyRange) String() string {
  922. return awsutil.Prettify(s)
  923. }
  924. // GoString returns the string representation
  925. func (s HashKeyRange) GoString() string {
  926. return s.String()
  927. }
  928. // Represents the input for ListStreams.
  929. type ListStreamsInput struct {
  930. // The name of the stream to start the list with.
  931. ExclusiveStartStreamName *string `type:"string"`
  932. // The maximum number of streams to list.
  933. Limit *int64 `type:"integer"`
  934. metadataListStreamsInput `json:"-" xml:"-"`
  935. }
  936. type metadataListStreamsInput struct {
  937. SDKShapeTraits bool `type:"structure"`
  938. }
  939. // String returns the string representation
  940. func (s ListStreamsInput) String() string {
  941. return awsutil.Prettify(s)
  942. }
  943. // GoString returns the string representation
  944. func (s ListStreamsInput) GoString() string {
  945. return s.String()
  946. }
  947. // Represents the output for ListStreams.
  948. type ListStreamsOutput struct {
  949. // If set to true, there are more streams available to list.
  950. HasMoreStreams *bool `type:"boolean" required:"true"`
  951. // The names of the streams that are associated with the AWS account making
  952. // the ListStreams request.
  953. StreamNames []*string `type:"list" required:"true"`
  954. metadataListStreamsOutput `json:"-" xml:"-"`
  955. }
  956. type metadataListStreamsOutput struct {
  957. SDKShapeTraits bool `type:"structure"`
  958. }
  959. // String returns the string representation
  960. func (s ListStreamsOutput) String() string {
  961. return awsutil.Prettify(s)
  962. }
  963. // GoString returns the string representation
  964. func (s ListStreamsOutput) GoString() string {
  965. return s.String()
  966. }
  967. // Represents the input for ListTagsForStream.
  968. type ListTagsForStreamInput struct {
  969. // The key to use as the starting point for the list of tags. If this parameter
  970. // is set, ListTagsForStream gets all tags that occur after ExclusiveStartTagKey.
  971. ExclusiveStartTagKey *string `type:"string"`
  972. // The number of tags to return. If this number is less than the total number
  973. // of tags associated with the stream, HasMoreTags is set to true. To list additional
  974. // tags, set ExclusiveStartTagKey to the last key in the response.
  975. Limit *int64 `type:"integer"`
  976. // The name of the stream.
  977. StreamName *string `type:"string" required:"true"`
  978. metadataListTagsForStreamInput `json:"-" xml:"-"`
  979. }
  980. type metadataListTagsForStreamInput struct {
  981. SDKShapeTraits bool `type:"structure"`
  982. }
  983. // String returns the string representation
  984. func (s ListTagsForStreamInput) String() string {
  985. return awsutil.Prettify(s)
  986. }
  987. // GoString returns the string representation
  988. func (s ListTagsForStreamInput) GoString() string {
  989. return s.String()
  990. }
  991. // Represents the output for ListTagsForStream.
  992. type ListTagsForStreamOutput struct {
  993. // If set to true, more tags are available. To request additional tags, set
  994. // ExclusiveStartTagKey to the key of the last tag returned.
  995. HasMoreTags *bool `type:"boolean" required:"true"`
  996. // A list of tags associated with StreamName, starting with the first tag after
  997. // ExclusiveStartTagKey and up to the specified Limit.
  998. Tags []*Tag `type:"list" required:"true"`
  999. metadataListTagsForStreamOutput `json:"-" xml:"-"`
  1000. }
  1001. type metadataListTagsForStreamOutput struct {
  1002. SDKShapeTraits bool `type:"structure"`
  1003. }
  1004. // String returns the string representation
  1005. func (s ListTagsForStreamOutput) String() string {
  1006. return awsutil.Prettify(s)
  1007. }
  1008. // GoString returns the string representation
  1009. func (s ListTagsForStreamOutput) GoString() string {
  1010. return s.String()
  1011. }
  1012. // Represents the input for MergeShards.
  1013. type MergeShardsInput struct {
  1014. // The shard ID of the adjacent shard for the merge.
  1015. AdjacentShardToMerge *string `type:"string" required:"true"`
  1016. // The shard ID of the shard to combine with the adjacent shard for the merge.
  1017. ShardToMerge *string `type:"string" required:"true"`
  1018. // The name of the stream for the merge.
  1019. StreamName *string `type:"string" required:"true"`
  1020. metadataMergeShardsInput `json:"-" xml:"-"`
  1021. }
  1022. type metadataMergeShardsInput struct {
  1023. SDKShapeTraits bool `type:"structure"`
  1024. }
  1025. // String returns the string representation
  1026. func (s MergeShardsInput) String() string {
  1027. return awsutil.Prettify(s)
  1028. }
  1029. // GoString returns the string representation
  1030. func (s MergeShardsInput) GoString() string {
  1031. return s.String()
  1032. }
  1033. type MergeShardsOutput struct {
  1034. metadataMergeShardsOutput `json:"-" xml:"-"`
  1035. }
  1036. type metadataMergeShardsOutput struct {
  1037. SDKShapeTraits bool `type:"structure"`
  1038. }
  1039. // String returns the string representation
  1040. func (s MergeShardsOutput) String() string {
  1041. return awsutil.Prettify(s)
  1042. }
  1043. // GoString returns the string representation
  1044. func (s MergeShardsOutput) GoString() string {
  1045. return s.String()
  1046. }
  1047. // Represents the input for PutRecord.
  1048. type PutRecordInput struct {
  1049. // The data blob to put into the record, which is base64-encoded when the blob
  1050. // is serialized. The maximum size of the data blob (the payload before base64-encoding)
  1051. // is 50 kilobytes (KB)
  1052. Data []byte `type:"blob" required:"true"`
  1053. // The hash value used to explicitly determine the shard the data record is
  1054. // assigned to by overriding the partition key hash.
  1055. ExplicitHashKey *string `type:"string"`
  1056. // Determines which shard in the stream the data record is assigned to. Partition
  1057. // keys are Unicode strings with a maximum length limit of 256 characters for
  1058. // each key. Amazon Kinesis uses the partition key as input to a hash function
  1059. // that maps the partition key and associated data to a specific shard. Specifically,
  1060. // an MD5 hash function is used to map partition keys to 128-bit integer values
  1061. // and to map associated data records to shards. As a result of this hashing
  1062. // mechanism, all data records with the same partition key will map to the same
  1063. // shard within the stream.
  1064. PartitionKey *string `type:"string" required:"true"`
  1065. // Guarantees strictly increasing sequence numbers, for puts from the same client
  1066. // and to the same partition key. Usage: set the SequenceNumberForOrdering of
  1067. // record n to the sequence number of record n-1 (as returned in the result
  1068. // when putting record n-1). If this parameter is not set, records will be coarsely
  1069. // ordered based on arrival time.
  1070. SequenceNumberForOrdering *string `type:"string"`
  1071. // The name of the stream to put the data record into.
  1072. StreamName *string `type:"string" required:"true"`
  1073. metadataPutRecordInput `json:"-" xml:"-"`
  1074. }
  1075. type metadataPutRecordInput struct {
  1076. SDKShapeTraits bool `type:"structure"`
  1077. }
  1078. // String returns the string representation
  1079. func (s PutRecordInput) String() string {
  1080. return awsutil.Prettify(s)
  1081. }
  1082. // GoString returns the string representation
  1083. func (s PutRecordInput) GoString() string {
  1084. return s.String()
  1085. }
  1086. // Represents the output for PutRecord.
  1087. type PutRecordOutput struct {
  1088. // The sequence number identifier that was assigned to the put data record.
  1089. // The sequence number for the record is unique across all records in the stream.
  1090. // A sequence number is the identifier associated with every record put into
  1091. // the stream.
  1092. SequenceNumber *string `type:"string" required:"true"`
  1093. // The shard ID of the shard where the data record was placed.
  1094. ShardId *string `type:"string" required:"true"`
  1095. metadataPutRecordOutput `json:"-" xml:"-"`
  1096. }
  1097. type metadataPutRecordOutput struct {
  1098. SDKShapeTraits bool `type:"structure"`
  1099. }
  1100. // String returns the string representation
  1101. func (s PutRecordOutput) String() string {
  1102. return awsutil.Prettify(s)
  1103. }
  1104. // GoString returns the string representation
  1105. func (s PutRecordOutput) GoString() string {
  1106. return s.String()
  1107. }
  1108. // A PutRecords request.
  1109. type PutRecordsInput struct {
  1110. // The records associated with the request.
  1111. Records []*PutRecordsRequestEntry `type:"list" required:"true"`
  1112. // The stream name associated with the request.
  1113. StreamName *string `type:"string" required:"true"`
  1114. metadataPutRecordsInput `json:"-" xml:"-"`
  1115. }
  1116. type metadataPutRecordsInput struct {
  1117. SDKShapeTraits bool `type:"structure"`
  1118. }
  1119. // String returns the string representation
  1120. func (s PutRecordsInput) String() string {
  1121. return awsutil.Prettify(s)
  1122. }
  1123. // GoString returns the string representation
  1124. func (s PutRecordsInput) GoString() string {
  1125. return s.String()
  1126. }
  1127. // PutRecords results.
  1128. type PutRecordsOutput struct {
  1129. // The number of unsuccessfully processed records in a PutRecords request.
  1130. FailedRecordCount *int64 `type:"integer"`
  1131. // An array of successfully and unsuccessfully processed record results, correlated
  1132. // with the request by natural ordering. A record that is successfully added
  1133. // to your Amazon Kinesis stream includes SequenceNumber and ShardId in the
  1134. // result. A record that fails to be added to your Amazon Kinesis stream includes
  1135. // ErrorCode and ErrorMessage in the result.
  1136. Records []*PutRecordsResultEntry `type:"list" required:"true"`
  1137. metadataPutRecordsOutput `json:"-" xml:"-"`
  1138. }
  1139. type metadataPutRecordsOutput struct {
  1140. SDKShapeTraits bool `type:"structure"`
  1141. }
  1142. // String returns the string representation
  1143. func (s PutRecordsOutput) String() string {
  1144. return awsutil.Prettify(s)
  1145. }
  1146. // GoString returns the string representation
  1147. func (s PutRecordsOutput) GoString() string {
  1148. return s.String()
  1149. }
  1150. // Represents the output for PutRecords.
  1151. type PutRecordsRequestEntry struct {
  1152. // The data blob to put into the record, which is base64-encoded when the blob
  1153. // is serialized. The maximum size of the data blob (the payload before base64-encoding)
  1154. // is 50 kilobytes (KB)
  1155. Data []byte `type:"blob" required:"true"`
  1156. // The hash value used to determine explicitly the shard that the data record
  1157. // is assigned to by overriding the partition key hash.
  1158. ExplicitHashKey *string `type:"string"`
  1159. // Determines which shard in the stream the data record is assigned to. Partition
  1160. // keys are Unicode strings with a maximum length limit of 256 characters for
  1161. // each key. Amazon Kinesis uses the partition key as input to a hash function
  1162. // that maps the partition key and associated data to a specific shard. Specifically,
  1163. // an MD5 hash function is used to map partition keys to 128-bit integer values
  1164. // and to map associated data records to shards. As a result of this hashing
  1165. // mechanism, all data records with the same partition key map to the same shard
  1166. // within the stream.
  1167. PartitionKey *string `type:"string" required:"true"`
  1168. metadataPutRecordsRequestEntry `json:"-" xml:"-"`
  1169. }
  1170. type metadataPutRecordsRequestEntry struct {
  1171. SDKShapeTraits bool `type:"structure"`
  1172. }
  1173. // String returns the string representation
  1174. func (s PutRecordsRequestEntry) String() string {
  1175. return awsutil.Prettify(s)
  1176. }
  1177. // GoString returns the string representation
  1178. func (s PutRecordsRequestEntry) GoString() string {
  1179. return s.String()
  1180. }
  1181. // Represents the result of an individual record from a PutRecords request.
  1182. // A record that is successfully added to your Amazon Kinesis stream includes
  1183. // SequenceNumber and ShardId in the result. A record that fails to be added
  1184. // to your Amazon Kinesis stream includes ErrorCode and ErrorMessage in the
  1185. // result.
  1186. type PutRecordsResultEntry struct {
  1187. // The error code for an individual record result. ErrorCodes can be either
  1188. // ProvisionedThroughputExceededException or InternalFailure.
  1189. ErrorCode *string `type:"string"`
  1190. // The error message for an individual record result. An ErrorCode value of
  1191. // ProvisionedThroughputExceededException has an error message that includes
  1192. // the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure
  1193. // has the error message "Internal Service Failure".
  1194. ErrorMessage *string `type:"string"`
  1195. // The sequence number for an individual record result.
  1196. SequenceNumber *string `type:"string"`
  1197. // The shard ID for an individual record result.
  1198. ShardId *string `type:"string"`
  1199. metadataPutRecordsResultEntry `json:"-" xml:"-"`
  1200. }
  1201. type metadataPutRecordsResultEntry struct {
  1202. SDKShapeTraits bool `type:"structure"`
  1203. }
  1204. // String returns the string representation
  1205. func (s PutRecordsResultEntry) String() string {
  1206. return awsutil.Prettify(s)
  1207. }
  1208. // GoString returns the string representation
  1209. func (s PutRecordsResultEntry) GoString() string {
  1210. return s.String()
  1211. }
  1212. // The unit of data of the Amazon Kinesis stream, which is composed of a sequence
  1213. // number, a partition key, and a data blob.
  1214. type Record struct {
  1215. // The data blob. The data in the blob is both opaque and immutable to the Amazon
  1216. // Kinesis service, which does not inspect, interpret, or change the data in
  1217. // the blob in any way. The maximum size of the data blob (the payload before
  1218. // base64-encoding) is 50 kilobytes (KB)
  1219. Data []byte `type:"blob" required:"true"`
  1220. // Identifies which shard in the stream the data record is assigned to.
  1221. PartitionKey *string `type:"string" required:"true"`
  1222. // The unique identifier for the record in the Amazon Kinesis stream.
  1223. SequenceNumber *string `type:"string" required:"true"`
  1224. metadataRecord `json:"-" xml:"-"`
  1225. }
  1226. type metadataRecord struct {
  1227. SDKShapeTraits bool `type:"structure"`
  1228. }
  1229. // String returns the string representation
  1230. func (s Record) String() string {
  1231. return awsutil.Prettify(s)
  1232. }
  1233. // GoString returns the string representation
  1234. func (s Record) GoString() string {
  1235. return s.String()
  1236. }
  1237. // Represents the input for RemoveTagsFromStream.
  1238. type RemoveTagsFromStreamInput struct {
  1239. // The name of the stream.
  1240. StreamName *string `type:"string" required:"true"`
  1241. // A list of tag keys. Each corresponding tag is removed from the stream.
  1242. TagKeys []*string `type:"list" required:"true"`
  1243. metadataRemoveTagsFromStreamInput `json:"-" xml:"-"`
  1244. }
  1245. type metadataRemoveTagsFromStreamInput struct {
  1246. SDKShapeTraits bool `type:"structure"`
  1247. }
  1248. // String returns the string representation
  1249. func (s RemoveTagsFromStreamInput) String() string {
  1250. return awsutil.Prettify(s)
  1251. }
  1252. // GoString returns the string representation
  1253. func (s RemoveTagsFromStreamInput) GoString() string {
  1254. return s.String()
  1255. }
  1256. type RemoveTagsFromStreamOutput struct {
  1257. metadataRemoveTagsFromStreamOutput `json:"-" xml:"-"`
  1258. }
  1259. type metadataRemoveTagsFromStreamOutput struct {
  1260. SDKShapeTraits bool `type:"structure"`
  1261. }
  1262. // String returns the string representation
  1263. func (s RemoveTagsFromStreamOutput) String() string {
  1264. return awsutil.Prettify(s)
  1265. }
  1266. // GoString returns the string representation
  1267. func (s RemoveTagsFromStreamOutput) GoString() string {
  1268. return s.String()
  1269. }
  1270. // The range of possible sequence numbers for the shard.
  1271. type SequenceNumberRange struct {
  1272. // The ending sequence number for the range. Shards that are in the OPEN state
  1273. // have an ending sequence number of null.
  1274. EndingSequenceNumber *string `type:"string"`
  1275. // The starting sequence number for the range.
  1276. StartingSequenceNumber *string `type:"string" required:"true"`
  1277. metadataSequenceNumberRange `json:"-" xml:"-"`
  1278. }
  1279. type metadataSequenceNumberRange struct {
  1280. SDKShapeTraits bool `type:"structure"`
  1281. }
  1282. // String returns the string representation
  1283. func (s SequenceNumberRange) String() string {
  1284. return awsutil.Prettify(s)
  1285. }
  1286. // GoString returns the string representation
  1287. func (s SequenceNumberRange) GoString() string {
  1288. return s.String()
  1289. }
  1290. // A uniquely identified group of data records in an Amazon Kinesis stream.
  1291. type Shard struct {
  1292. // The shard Id of the shard adjacent to the shard's parent.
  1293. AdjacentParentShardId *string `type:"string"`
  1294. // The range of possible hash key values for the shard, which is a set of ordered
  1295. // contiguous positive integers.
  1296. HashKeyRange *HashKeyRange `type:"structure" required:"true"`
  1297. // The shard Id of the shard's parent.
  1298. ParentShardId *string `type:"string"`
  1299. // The range of possible sequence numbers for the shard.
  1300. SequenceNumberRange *SequenceNumberRange `type:"structure" required:"true"`
  1301. // The unique identifier of the shard within the Amazon Kinesis stream.
  1302. ShardId *string `type:"string" required:"true"`
  1303. metadataShard `json:"-" xml:"-"`
  1304. }
  1305. type metadataShard struct {
  1306. SDKShapeTraits bool `type:"structure"`
  1307. }
  1308. // String returns the string representation
  1309. func (s Shard) String() string {
  1310. return awsutil.Prettify(s)
  1311. }
  1312. // GoString returns the string representation
  1313. func (s Shard) GoString() string {
  1314. return s.String()
  1315. }
  1316. // Represents the input for SplitShard.
  1317. type SplitShardInput struct {
  1318. // A hash key value for the starting hash key of one of the child shards created
  1319. // by the split. The hash key range for a given shard constitutes a set of ordered
  1320. // contiguous positive integers. The value for NewStartingHashKey must be in
  1321. // the range of hash keys being mapped into the shard. The NewStartingHashKey
  1322. // hash key value and all higher hash key values in hash key range are distributed
  1323. // to one of the child shards. All the lower hash key values in the range are
  1324. // distributed to the other child shard.
  1325. NewStartingHashKey *string `type:"string" required:"true"`
  1326. // The shard ID of the shard to split.
  1327. ShardToSplit *string `type:"string" required:"true"`
  1328. // The name of the stream for the shard split.
  1329. StreamName *string `type:"string" required:"true"`
  1330. metadataSplitShardInput `json:"-" xml:"-"`
  1331. }
  1332. type metadataSplitShardInput struct {
  1333. SDKShapeTraits bool `type:"structure"`
  1334. }
  1335. // String returns the string representation
  1336. func (s SplitShardInput) String() string {
  1337. return awsutil.Prettify(s)
  1338. }
  1339. // GoString returns the string representation
  1340. func (s SplitShardInput) GoString() string {
  1341. return s.String()
  1342. }
  1343. type SplitShardOutput struct {
  1344. metadataSplitShardOutput `json:"-" xml:"-"`
  1345. }
  1346. type metadataSplitShardOutput struct {
  1347. SDKShapeTraits bool `type:"structure"`
  1348. }
  1349. // String returns the string representation
  1350. func (s SplitShardOutput) String() string {
  1351. return awsutil.Prettify(s)
  1352. }
  1353. // GoString returns the string representation
  1354. func (s SplitShardOutput) GoString() string {
  1355. return s.String()
  1356. }
  1357. // Represents the output for DescribeStream.
  1358. type StreamDescription struct {
  1359. // If set to true, more shards in the stream are available to describe.
  1360. HasMoreShards *bool `type:"boolean" required:"true"`
  1361. // The shards that comprise the stream.
  1362. Shards []*Shard `type:"list" required:"true"`
  1363. // The Amazon Resource Name (ARN) for the stream being described.
  1364. StreamARN *string `type:"string" required:"true"`
  1365. // The name of the stream being described.
  1366. StreamName *string `type:"string" required:"true"`
  1367. // The current status of the stream being described.
  1368. //
  1369. // The stream status is one of the following states:
  1370. //
  1371. // CREATING - The stream is being created. Amazon Kinesis immediately returns
  1372. // and sets StreamStatus to CREATING. DELETING - The stream is being deleted.
  1373. // The specified stream is in the DELETING state until Amazon Kinesis completes
  1374. // the deletion. ACTIVE - The stream exists and is ready for read and write
  1375. // operations or deletion. You should perform read and write operations only
  1376. // on an ACTIVE stream. UPDATING - Shards in the stream are being merged or
  1377. // split. Read and write operations continue to work while the stream is in
  1378. // the UPDATING state.
  1379. StreamStatus *string `type:"string" required:"true" enum:"StreamStatus"`
  1380. metadataStreamDescription `json:"-" xml:"-"`
  1381. }
  1382. type metadataStreamDescription struct {
  1383. SDKShapeTraits bool `type:"structure"`
  1384. }
  1385. // String returns the string representation
  1386. func (s StreamDescription) String() string {
  1387. return awsutil.Prettify(s)
  1388. }
  1389. // GoString returns the string representation
  1390. func (s StreamDescription) GoString() string {
  1391. return s.String()
  1392. }
  1393. // Metadata assigned to the stream, consisting of a key-value pair.
  1394. type Tag struct {
  1395. // A unique identifier for the tag. Maximum length: 128 characters. Valid characters:
  1396. // Unicode letters, digits, white space, _ . / = + - % @
  1397. Key *string `type:"string" required:"true"`
  1398. // An optional string, typically used to describe or define the tag. Maximum
  1399. // length: 256 characters. Valid characters: Unicode letters, digits, white
  1400. // space, _ . / = + - % @
  1401. Value *string `type:"string"`
  1402. metadataTag `json:"-" xml:"-"`
  1403. }
  1404. type metadataTag struct {
  1405. SDKShapeTraits bool `type:"structure"`
  1406. }
  1407. // String returns the string representation
  1408. func (s Tag) String() string {
  1409. return awsutil.Prettify(s)
  1410. }
  1411. // GoString returns the string representation
  1412. func (s Tag) GoString() string {
  1413. return s.String()
  1414. }
  1415. const (
  1416. // @enum ShardIteratorType
  1417. ShardIteratorTypeAtSequenceNumber = "AT_SEQUENCE_NUMBER"
  1418. // @enum ShardIteratorType
  1419. ShardIteratorTypeAfterSequenceNumber = "AFTER_SEQUENCE_NUMBER"
  1420. // @enum ShardIteratorType
  1421. ShardIteratorTypeTrimHorizon = "TRIM_HORIZON"
  1422. // @enum ShardIteratorType
  1423. ShardIteratorTypeLatest = "LATEST"
  1424. )
  1425. const (
  1426. // @enum StreamStatus
  1427. StreamStatusCreating = "CREATING"
  1428. // @enum StreamStatus
  1429. StreamStatusDeleting = "DELETING"
  1430. // @enum StreamStatus
  1431. StreamStatusActive = "ACTIVE"
  1432. // @enum StreamStatus
  1433. StreamStatusUpdating = "UPDATING"
  1434. )