api.go 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package sqs provides a client for Amazon Simple Queue Service.
  3. package sqs
  4. import (
  5. "fmt"
  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/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/query"
  10. )
  11. const opAddPermission = "AddPermission"
  12. // AddPermissionRequest generates a "aws/request.Request" representing the
  13. // client's request for the AddPermission operation. The "output" return
  14. // value can be used to capture response data after the request's "Send" method
  15. // is called.
  16. //
  17. // See AddPermission for usage and error information.
  18. //
  19. // Creating a request object using this method should be used when you want to inject
  20. // custom logic into the request's lifecycle using a custom handler, or if you want to
  21. // access properties on the request object before or after sending the request. If
  22. // you just want the service response, call the AddPermission method directly
  23. // instead.
  24. //
  25. // Note: You must call the "Send" method on the returned request object in order
  26. // to execute the request.
  27. //
  28. // // Example sending a request using the AddPermissionRequest method.
  29. // req, resp := client.AddPermissionRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. func (c *SQS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) {
  37. op := &request.Operation{
  38. Name: opAddPermission,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &AddPermissionInput{}
  44. }
  45. req = c.newRequest(op, input, output)
  46. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  47. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  48. output = &AddPermissionOutput{}
  49. req.Data = output
  50. return
  51. }
  52. // AddPermission API operation for Amazon Simple Queue Service.
  53. //
  54. // Adds a permission to a queue for a specific principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P).
  55. // This allows for sharing access to the queue.
  56. //
  57. // When you create a queue, you have full control access rights for the queue.
  58. // Only you (as owner of the queue) can grant or deny permissions to the queue.
  59. // For more information about these permissions, see Shared Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html)
  60. // in the Amazon SQS Developer Guide.
  61. //
  62. // AddPermission writes an Amazon SQS-generated policy. If you want to write
  63. // your own policy, use SetQueueAttributes to upload your policy. For more information
  64. // about writing your own policy, see Using The Access Policy Language (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html)
  65. // in the Amazon SQS Developer Guide.
  66. //
  67. // Some API actions take lists of parameters. These lists are specified using
  68. // the param.n notation. Values of n are integers starting from 1. For example,
  69. // a parameter list with two elements looks like this:
  70. //
  71. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  72. // with awserr.Error's Code and Message methods to get detailed information about
  73. // the error.
  74. //
  75. // See the AWS API reference guide for Amazon Simple Queue Service's
  76. // API operation AddPermission for usage and error information.
  77. //
  78. // Returned Error Codes:
  79. // * OverLimit
  80. // The action that you requested would violate a limit. For example, ReceiveMessage
  81. // returns this error if the maximum number of messages inflight has already
  82. // been reached. AddPermission returns this error if the maximum number of permissions
  83. // for the queue has already been reached.
  84. //
  85. func (c *SQS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
  86. req, out := c.AddPermissionRequest(input)
  87. err := req.Send()
  88. return out, err
  89. }
  90. const opChangeMessageVisibility = "ChangeMessageVisibility"
  91. // ChangeMessageVisibilityRequest generates a "aws/request.Request" representing the
  92. // client's request for the ChangeMessageVisibility operation. The "output" return
  93. // value can be used to capture response data after the request's "Send" method
  94. // is called.
  95. //
  96. // See ChangeMessageVisibility for usage and error information.
  97. //
  98. // Creating a request object using this method should be used when you want to inject
  99. // custom logic into the request's lifecycle using a custom handler, or if you want to
  100. // access properties on the request object before or after sending the request. If
  101. // you just want the service response, call the ChangeMessageVisibility method directly
  102. // instead.
  103. //
  104. // Note: You must call the "Send" method on the returned request object in order
  105. // to execute the request.
  106. //
  107. // // Example sending a request using the ChangeMessageVisibilityRequest method.
  108. // req, resp := client.ChangeMessageVisibilityRequest(params)
  109. //
  110. // err := req.Send()
  111. // if err == nil { // resp is now filled
  112. // fmt.Println(resp)
  113. // }
  114. //
  115. func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput) (req *request.Request, output *ChangeMessageVisibilityOutput) {
  116. op := &request.Operation{
  117. Name: opChangeMessageVisibility,
  118. HTTPMethod: "POST",
  119. HTTPPath: "/",
  120. }
  121. if input == nil {
  122. input = &ChangeMessageVisibilityInput{}
  123. }
  124. req = c.newRequest(op, input, output)
  125. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  126. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  127. output = &ChangeMessageVisibilityOutput{}
  128. req.Data = output
  129. return
  130. }
  131. // ChangeMessageVisibility API operation for Amazon Simple Queue Service.
  132. //
  133. // Changes the visibility timeout of a specified message in a queue to a new
  134. // value. The maximum allowed timeout value you can set the value to is 12 hours.
  135. // This means you can't extend the timeout of a message in an existing queue
  136. // to more than a total visibility timeout of 12 hours. (For more information
  137. // visibility timeout, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html)
  138. // in the Amazon SQS Developer Guide.)
  139. //
  140. // For example, let's say you have a message and its default message visibility
  141. // timeout is 5 minutes. After 3 minutes, you call ChangeMessageVisiblity with
  142. // a timeout of 10 minutes. At that time, the timeout for the message would
  143. // be extended by 10 minutes beyond the time of the ChangeMessageVisibility
  144. // call. This results in a total visibility timeout of 13 minutes. You can continue
  145. // to call ChangeMessageVisibility to extend the visibility timeout to a maximum
  146. // of 12 hours. If you try to extend beyond 12 hours, the request will be rejected.
  147. //
  148. // There is a 120,000 limit for the number of inflight messages per queue. Messages
  149. // are inflight after they have been received from the queue by a consuming
  150. // component, but have not yet been deleted from the queue. If you reach the
  151. // 120,000 limit, you will receive an OverLimit error message from Amazon SQS.
  152. // To help avoid reaching the limit, you should delete the messages from the
  153. // queue after they have been processed. You can also increase the number of
  154. // queues you use to process the messages.
  155. //
  156. // If you attempt to set the VisibilityTimeout to an amount more than the maximum
  157. // time left, Amazon SQS returns an error. It will not automatically recalculate
  158. // and increase the timeout to the maximum time remaining.
  159. //
  160. // Unlike with a queue, when you change the visibility timeout for a specific
  161. // message, that timeout value is applied immediately but is not saved in memory
  162. // for that message. If you don't delete a message after it is received, the
  163. // visibility timeout for the message the next time it is received reverts to
  164. // the original timeout value, not the value you set with the ChangeMessageVisibility
  165. // action.
  166. //
  167. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  168. // with awserr.Error's Code and Message methods to get detailed information about
  169. // the error.
  170. //
  171. // See the AWS API reference guide for Amazon Simple Queue Service's
  172. // API operation ChangeMessageVisibility for usage and error information.
  173. //
  174. // Returned Error Codes:
  175. // * AWS.SimpleQueueService.MessageNotInflight
  176. // The message referred to is not in flight.
  177. //
  178. // * ReceiptHandleIsInvalid
  179. // The receipt handle provided is not valid.
  180. //
  181. func (c *SQS) ChangeMessageVisibility(input *ChangeMessageVisibilityInput) (*ChangeMessageVisibilityOutput, error) {
  182. req, out := c.ChangeMessageVisibilityRequest(input)
  183. err := req.Send()
  184. return out, err
  185. }
  186. const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch"
  187. // ChangeMessageVisibilityBatchRequest generates a "aws/request.Request" representing the
  188. // client's request for the ChangeMessageVisibilityBatch operation. The "output" return
  189. // value can be used to capture response data after the request's "Send" method
  190. // is called.
  191. //
  192. // See ChangeMessageVisibilityBatch for usage and error information.
  193. //
  194. // Creating a request object using this method should be used when you want to inject
  195. // custom logic into the request's lifecycle using a custom handler, or if you want to
  196. // access properties on the request object before or after sending the request. If
  197. // you just want the service response, call the ChangeMessageVisibilityBatch method directly
  198. // instead.
  199. //
  200. // Note: You must call the "Send" method on the returned request object in order
  201. // to execute the request.
  202. //
  203. // // Example sending a request using the ChangeMessageVisibilityBatchRequest method.
  204. // req, resp := client.ChangeMessageVisibilityBatchRequest(params)
  205. //
  206. // err := req.Send()
  207. // if err == nil { // resp is now filled
  208. // fmt.Println(resp)
  209. // }
  210. //
  211. func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibilityBatchInput) (req *request.Request, output *ChangeMessageVisibilityBatchOutput) {
  212. op := &request.Operation{
  213. Name: opChangeMessageVisibilityBatch,
  214. HTTPMethod: "POST",
  215. HTTPPath: "/",
  216. }
  217. if input == nil {
  218. input = &ChangeMessageVisibilityBatchInput{}
  219. }
  220. req = c.newRequest(op, input, output)
  221. output = &ChangeMessageVisibilityBatchOutput{}
  222. req.Data = output
  223. return
  224. }
  225. // ChangeMessageVisibilityBatch API operation for Amazon Simple Queue Service.
  226. //
  227. // Changes the visibility timeout of multiple messages. This is a batch version
  228. // of ChangeMessageVisibility. The result of the action on each message is reported
  229. // individually in the response. You can send up to 10 ChangeMessageVisibility
  230. // requests with each ChangeMessageVisibilityBatch action.
  231. //
  232. // Because the batch request can result in a combination of successful and unsuccessful
  233. // actions, you should check for batch errors even when the call returns an
  234. // HTTP status code of 200.
  235. //
  236. // Some API actions take lists of parameters. These lists are specified using
  237. // the param.n notation. Values of n are integers starting from 1. For example,
  238. // a parameter list with two elements looks like this:
  239. //
  240. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  241. // with awserr.Error's Code and Message methods to get detailed information about
  242. // the error.
  243. //
  244. // See the AWS API reference guide for Amazon Simple Queue Service's
  245. // API operation ChangeMessageVisibilityBatch for usage and error information.
  246. //
  247. // Returned Error Codes:
  248. // * AWS.SimpleQueueService.TooManyEntriesInBatchRequest
  249. // Batch request contains more number of entries than permissible.
  250. //
  251. // * AWS.SimpleQueueService.EmptyBatchRequest
  252. // Batch request does not contain an entry.
  253. //
  254. // * AWS.SimpleQueueService.BatchEntryIdsNotDistinct
  255. // Two or more batch entries have the same Id in the request.
  256. //
  257. // * AWS.SimpleQueueService.InvalidBatchEntryId
  258. // The Id of a batch entry in a batch request does not abide by the specification.
  259. //
  260. func (c *SQS) ChangeMessageVisibilityBatch(input *ChangeMessageVisibilityBatchInput) (*ChangeMessageVisibilityBatchOutput, error) {
  261. req, out := c.ChangeMessageVisibilityBatchRequest(input)
  262. err := req.Send()
  263. return out, err
  264. }
  265. const opCreateQueue = "CreateQueue"
  266. // CreateQueueRequest generates a "aws/request.Request" representing the
  267. // client's request for the CreateQueue operation. The "output" return
  268. // value can be used to capture response data after the request's "Send" method
  269. // is called.
  270. //
  271. // See CreateQueue for usage and error information.
  272. //
  273. // Creating a request object using this method should be used when you want to inject
  274. // custom logic into the request's lifecycle using a custom handler, or if you want to
  275. // access properties on the request object before or after sending the request. If
  276. // you just want the service response, call the CreateQueue method directly
  277. // instead.
  278. //
  279. // Note: You must call the "Send" method on the returned request object in order
  280. // to execute the request.
  281. //
  282. // // Example sending a request using the CreateQueueRequest method.
  283. // req, resp := client.CreateQueueRequest(params)
  284. //
  285. // err := req.Send()
  286. // if err == nil { // resp is now filled
  287. // fmt.Println(resp)
  288. // }
  289. //
  290. func (c *SQS) CreateQueueRequest(input *CreateQueueInput) (req *request.Request, output *CreateQueueOutput) {
  291. op := &request.Operation{
  292. Name: opCreateQueue,
  293. HTTPMethod: "POST",
  294. HTTPPath: "/",
  295. }
  296. if input == nil {
  297. input = &CreateQueueInput{}
  298. }
  299. req = c.newRequest(op, input, output)
  300. output = &CreateQueueOutput{}
  301. req.Data = output
  302. return
  303. }
  304. // CreateQueue API operation for Amazon Simple Queue Service.
  305. //
  306. // Creates a new queue, or returns the URL of an existing one. When you request
  307. // CreateQueue, you provide a name for the queue. To successfully create a new
  308. // queue, you must provide a name that is unique within the scope of your own
  309. // queues.
  310. //
  311. // If you delete a queue, you must wait at least 60 seconds before creating
  312. // a queue with the same name.
  313. //
  314. // You may pass one or more attributes in the request. If you do not provide
  315. // a value for any attribute, the queue will have the default value for that
  316. // attribute.
  317. //
  318. // Use GetQueueUrl to get a queue's URL. GetQueueUrl requires only the QueueName
  319. // parameter.
  320. //
  321. // If you provide the name of an existing queue, along with the exact names
  322. // and values of all the queue's attributes, CreateQueue returns the queue URL
  323. // for the existing queue. If the queue name, attribute names, or attribute
  324. // values do not match an existing queue, CreateQueue returns an error.
  325. //
  326. // Some API actions take lists of parameters. These lists are specified using
  327. // the param.n notation. Values of n are integers starting from 1. For example,
  328. // a parameter list with two elements looks like this:
  329. //
  330. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  331. // with awserr.Error's Code and Message methods to get detailed information about
  332. // the error.
  333. //
  334. // See the AWS API reference guide for Amazon Simple Queue Service's
  335. // API operation CreateQueue for usage and error information.
  336. //
  337. // Returned Error Codes:
  338. // * AWS.SimpleQueueService.QueueDeletedRecently
  339. // You must wait 60 seconds after deleting a queue before you can create another
  340. // with the same name.
  341. //
  342. // * QueueAlreadyExists
  343. // A queue already exists with this name. Amazon SQS returns this error only
  344. // if the request includes attributes whose values differ from those of the
  345. // existing queue.
  346. //
  347. func (c *SQS) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) {
  348. req, out := c.CreateQueueRequest(input)
  349. err := req.Send()
  350. return out, err
  351. }
  352. const opDeleteMessage = "DeleteMessage"
  353. // DeleteMessageRequest generates a "aws/request.Request" representing the
  354. // client's request for the DeleteMessage operation. The "output" return
  355. // value can be used to capture response data after the request's "Send" method
  356. // is called.
  357. //
  358. // See DeleteMessage for usage and error information.
  359. //
  360. // Creating a request object using this method should be used when you want to inject
  361. // custom logic into the request's lifecycle using a custom handler, or if you want to
  362. // access properties on the request object before or after sending the request. If
  363. // you just want the service response, call the DeleteMessage method directly
  364. // instead.
  365. //
  366. // Note: You must call the "Send" method on the returned request object in order
  367. // to execute the request.
  368. //
  369. // // Example sending a request using the DeleteMessageRequest method.
  370. // req, resp := client.DeleteMessageRequest(params)
  371. //
  372. // err := req.Send()
  373. // if err == nil { // resp is now filled
  374. // fmt.Println(resp)
  375. // }
  376. //
  377. func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) (req *request.Request, output *DeleteMessageOutput) {
  378. op := &request.Operation{
  379. Name: opDeleteMessage,
  380. HTTPMethod: "POST",
  381. HTTPPath: "/",
  382. }
  383. if input == nil {
  384. input = &DeleteMessageInput{}
  385. }
  386. req = c.newRequest(op, input, output)
  387. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  388. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  389. output = &DeleteMessageOutput{}
  390. req.Data = output
  391. return
  392. }
  393. // DeleteMessage API operation for Amazon Simple Queue Service.
  394. //
  395. // Deletes the specified message from the specified queue. You specify the message
  396. // by using the message's receipt handle and not the message ID you received
  397. // when you sent the message. Even if the message is locked by another reader
  398. // due to the visibility timeout setting, it is still deleted from the queue.
  399. // If you leave a message in the queue for longer than the queue's configured
  400. // retention period, Amazon SQS automatically deletes it.
  401. //
  402. // The receipt handle is associated with a specific instance of receiving the
  403. // message. If you receive a message more than once, the receipt handle you
  404. // get each time you receive the message is different. When you request DeleteMessage,
  405. // if you don't provide the most recently received receipt handle for the message,
  406. // the request will still succeed, but the message might not be deleted.
  407. //
  408. // It is possible you will receive a message even after you have deleted it.
  409. // This might happen on rare occasions if one of the servers storing a copy
  410. // of the message is unavailable when you request to delete the message. The
  411. // copy remains on the server and might be returned to you again on a subsequent
  412. // receive request. You should create your system to be idempotent so that receiving
  413. // a particular message more than once is not a problem.
  414. //
  415. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  416. // with awserr.Error's Code and Message methods to get detailed information about
  417. // the error.
  418. //
  419. // See the AWS API reference guide for Amazon Simple Queue Service's
  420. // API operation DeleteMessage for usage and error information.
  421. //
  422. // Returned Error Codes:
  423. // * InvalidIdFormat
  424. // The receipt handle is not valid for the current version.
  425. //
  426. // * ReceiptHandleIsInvalid
  427. // The receipt handle provided is not valid.
  428. //
  429. func (c *SQS) DeleteMessage(input *DeleteMessageInput) (*DeleteMessageOutput, error) {
  430. req, out := c.DeleteMessageRequest(input)
  431. err := req.Send()
  432. return out, err
  433. }
  434. const opDeleteMessageBatch = "DeleteMessageBatch"
  435. // DeleteMessageBatchRequest generates a "aws/request.Request" representing the
  436. // client's request for the DeleteMessageBatch operation. The "output" return
  437. // value can be used to capture response data after the request's "Send" method
  438. // is called.
  439. //
  440. // See DeleteMessageBatch for usage and error information.
  441. //
  442. // Creating a request object using this method should be used when you want to inject
  443. // custom logic into the request's lifecycle using a custom handler, or if you want to
  444. // access properties on the request object before or after sending the request. If
  445. // you just want the service response, call the DeleteMessageBatch method directly
  446. // instead.
  447. //
  448. // Note: You must call the "Send" method on the returned request object in order
  449. // to execute the request.
  450. //
  451. // // Example sending a request using the DeleteMessageBatchRequest method.
  452. // req, resp := client.DeleteMessageBatchRequest(params)
  453. //
  454. // err := req.Send()
  455. // if err == nil { // resp is now filled
  456. // fmt.Println(resp)
  457. // }
  458. //
  459. func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) (req *request.Request, output *DeleteMessageBatchOutput) {
  460. op := &request.Operation{
  461. Name: opDeleteMessageBatch,
  462. HTTPMethod: "POST",
  463. HTTPPath: "/",
  464. }
  465. if input == nil {
  466. input = &DeleteMessageBatchInput{}
  467. }
  468. req = c.newRequest(op, input, output)
  469. output = &DeleteMessageBatchOutput{}
  470. req.Data = output
  471. return
  472. }
  473. // DeleteMessageBatch API operation for Amazon Simple Queue Service.
  474. //
  475. // Deletes up to ten messages from the specified queue. This is a batch version
  476. // of DeleteMessage. The result of the delete action on each message is reported
  477. // individually in the response.
  478. //
  479. // Because the batch request can result in a combination of successful and unsuccessful
  480. // actions, you should check for batch errors even when the call returns an
  481. // HTTP status code of 200.
  482. //
  483. // Some API actions take lists of parameters. These lists are specified using
  484. // the param.n notation. Values of n are integers starting from 1. For example,
  485. // a parameter list with two elements looks like this:
  486. //
  487. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  488. // with awserr.Error's Code and Message methods to get detailed information about
  489. // the error.
  490. //
  491. // See the AWS API reference guide for Amazon Simple Queue Service's
  492. // API operation DeleteMessageBatch for usage and error information.
  493. //
  494. // Returned Error Codes:
  495. // * AWS.SimpleQueueService.TooManyEntriesInBatchRequest
  496. // Batch request contains more number of entries than permissible.
  497. //
  498. // * AWS.SimpleQueueService.EmptyBatchRequest
  499. // Batch request does not contain an entry.
  500. //
  501. // * AWS.SimpleQueueService.BatchEntryIdsNotDistinct
  502. // Two or more batch entries have the same Id in the request.
  503. //
  504. // * AWS.SimpleQueueService.InvalidBatchEntryId
  505. // The Id of a batch entry in a batch request does not abide by the specification.
  506. //
  507. func (c *SQS) DeleteMessageBatch(input *DeleteMessageBatchInput) (*DeleteMessageBatchOutput, error) {
  508. req, out := c.DeleteMessageBatchRequest(input)
  509. err := req.Send()
  510. return out, err
  511. }
  512. const opDeleteQueue = "DeleteQueue"
  513. // DeleteQueueRequest generates a "aws/request.Request" representing the
  514. // client's request for the DeleteQueue operation. The "output" return
  515. // value can be used to capture response data after the request's "Send" method
  516. // is called.
  517. //
  518. // See DeleteQueue for usage and error information.
  519. //
  520. // Creating a request object using this method should be used when you want to inject
  521. // custom logic into the request's lifecycle using a custom handler, or if you want to
  522. // access properties on the request object before or after sending the request. If
  523. // you just want the service response, call the DeleteQueue method directly
  524. // instead.
  525. //
  526. // Note: You must call the "Send" method on the returned request object in order
  527. // to execute the request.
  528. //
  529. // // Example sending a request using the DeleteQueueRequest method.
  530. // req, resp := client.DeleteQueueRequest(params)
  531. //
  532. // err := req.Send()
  533. // if err == nil { // resp is now filled
  534. // fmt.Println(resp)
  535. // }
  536. //
  537. func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) (req *request.Request, output *DeleteQueueOutput) {
  538. op := &request.Operation{
  539. Name: opDeleteQueue,
  540. HTTPMethod: "POST",
  541. HTTPPath: "/",
  542. }
  543. if input == nil {
  544. input = &DeleteQueueInput{}
  545. }
  546. req = c.newRequest(op, input, output)
  547. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  548. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  549. output = &DeleteQueueOutput{}
  550. req.Data = output
  551. return
  552. }
  553. // DeleteQueue API operation for Amazon Simple Queue Service.
  554. //
  555. // Deletes the queue specified by the queue URL, regardless of whether the queue
  556. // is empty. If the specified queue does not exist, Amazon SQS returns a successful
  557. // response.
  558. //
  559. // Use DeleteQueue with care; once you delete your queue, any messages in the
  560. // queue are no longer available.
  561. //
  562. // When you delete a queue, the deletion process takes up to 60 seconds. Requests
  563. // you send involving that queue during the 60 seconds might succeed. For example,
  564. // a SendMessage request might succeed, but after the 60 seconds, the queue
  565. // and that message you sent no longer exist. Also, when you delete a queue,
  566. // you must wait at least 60 seconds before creating a queue with the same name.
  567. //
  568. // We reserve the right to delete queues that have had no activity for more
  569. // than 30 days. For more information, see How Amazon SQS Queues Work (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html)
  570. // in the Amazon SQS Developer Guide.
  571. //
  572. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  573. // with awserr.Error's Code and Message methods to get detailed information about
  574. // the error.
  575. //
  576. // See the AWS API reference guide for Amazon Simple Queue Service's
  577. // API operation DeleteQueue for usage and error information.
  578. func (c *SQS) DeleteQueue(input *DeleteQueueInput) (*DeleteQueueOutput, error) {
  579. req, out := c.DeleteQueueRequest(input)
  580. err := req.Send()
  581. return out, err
  582. }
  583. const opGetQueueAttributes = "GetQueueAttributes"
  584. // GetQueueAttributesRequest generates a "aws/request.Request" representing the
  585. // client's request for the GetQueueAttributes operation. The "output" return
  586. // value can be used to capture response data after the request's "Send" method
  587. // is called.
  588. //
  589. // See GetQueueAttributes for usage and error information.
  590. //
  591. // Creating a request object using this method should be used when you want to inject
  592. // custom logic into the request's lifecycle using a custom handler, or if you want to
  593. // access properties on the request object before or after sending the request. If
  594. // you just want the service response, call the GetQueueAttributes method directly
  595. // instead.
  596. //
  597. // Note: You must call the "Send" method on the returned request object in order
  598. // to execute the request.
  599. //
  600. // // Example sending a request using the GetQueueAttributesRequest method.
  601. // req, resp := client.GetQueueAttributesRequest(params)
  602. //
  603. // err := req.Send()
  604. // if err == nil { // resp is now filled
  605. // fmt.Println(resp)
  606. // }
  607. //
  608. func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) (req *request.Request, output *GetQueueAttributesOutput) {
  609. op := &request.Operation{
  610. Name: opGetQueueAttributes,
  611. HTTPMethod: "POST",
  612. HTTPPath: "/",
  613. }
  614. if input == nil {
  615. input = &GetQueueAttributesInput{}
  616. }
  617. req = c.newRequest(op, input, output)
  618. output = &GetQueueAttributesOutput{}
  619. req.Data = output
  620. return
  621. }
  622. // GetQueueAttributes API operation for Amazon Simple Queue Service.
  623. //
  624. // Gets attributes for the specified queue.
  625. //
  626. // Some API actions take lists of parameters. These lists are specified using
  627. // the param.n notation. Values of n are integers starting from 1. For example,
  628. // a parameter list with two elements looks like this:
  629. //
  630. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  631. // with awserr.Error's Code and Message methods to get detailed information about
  632. // the error.
  633. //
  634. // See the AWS API reference guide for Amazon Simple Queue Service's
  635. // API operation GetQueueAttributes for usage and error information.
  636. //
  637. // Returned Error Codes:
  638. // * InvalidAttributeName
  639. // The attribute referred to does not exist.
  640. //
  641. func (c *SQS) GetQueueAttributes(input *GetQueueAttributesInput) (*GetQueueAttributesOutput, error) {
  642. req, out := c.GetQueueAttributesRequest(input)
  643. err := req.Send()
  644. return out, err
  645. }
  646. const opGetQueueUrl = "GetQueueUrl"
  647. // GetQueueUrlRequest generates a "aws/request.Request" representing the
  648. // client's request for the GetQueueUrl operation. The "output" return
  649. // value can be used to capture response data after the request's "Send" method
  650. // is called.
  651. //
  652. // See GetQueueUrl for usage and error information.
  653. //
  654. // Creating a request object using this method should be used when you want to inject
  655. // custom logic into the request's lifecycle using a custom handler, or if you want to
  656. // access properties on the request object before or after sending the request. If
  657. // you just want the service response, call the GetQueueUrl method directly
  658. // instead.
  659. //
  660. // Note: You must call the "Send" method on the returned request object in order
  661. // to execute the request.
  662. //
  663. // // Example sending a request using the GetQueueUrlRequest method.
  664. // req, resp := client.GetQueueUrlRequest(params)
  665. //
  666. // err := req.Send()
  667. // if err == nil { // resp is now filled
  668. // fmt.Println(resp)
  669. // }
  670. //
  671. func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) (req *request.Request, output *GetQueueUrlOutput) {
  672. op := &request.Operation{
  673. Name: opGetQueueUrl,
  674. HTTPMethod: "POST",
  675. HTTPPath: "/",
  676. }
  677. if input == nil {
  678. input = &GetQueueUrlInput{}
  679. }
  680. req = c.newRequest(op, input, output)
  681. output = &GetQueueUrlOutput{}
  682. req.Data = output
  683. return
  684. }
  685. // GetQueueUrl API operation for Amazon Simple Queue Service.
  686. //
  687. // Returns the URL of an existing queue. This action provides a simple way to
  688. // retrieve the URL of an Amazon SQS queue.
  689. //
  690. // To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId
  691. // parameter to specify the account ID of the queue's owner. The queue's owner
  692. // must grant you permission to access the queue. For more information about
  693. // shared queue access, see AddPermission or go to Shared Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html)
  694. // in the Amazon SQS Developer Guide.
  695. //
  696. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  697. // with awserr.Error's Code and Message methods to get detailed information about
  698. // the error.
  699. //
  700. // See the AWS API reference guide for Amazon Simple Queue Service's
  701. // API operation GetQueueUrl for usage and error information.
  702. //
  703. // Returned Error Codes:
  704. // * AWS.SimpleQueueService.NonExistentQueue
  705. // The queue referred to does not exist.
  706. //
  707. func (c *SQS) GetQueueUrl(input *GetQueueUrlInput) (*GetQueueUrlOutput, error) {
  708. req, out := c.GetQueueUrlRequest(input)
  709. err := req.Send()
  710. return out, err
  711. }
  712. const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues"
  713. // ListDeadLetterSourceQueuesRequest generates a "aws/request.Request" representing the
  714. // client's request for the ListDeadLetterSourceQueues operation. The "output" return
  715. // value can be used to capture response data after the request's "Send" method
  716. // is called.
  717. //
  718. // See ListDeadLetterSourceQueues for usage and error information.
  719. //
  720. // Creating a request object using this method should be used when you want to inject
  721. // custom logic into the request's lifecycle using a custom handler, or if you want to
  722. // access properties on the request object before or after sending the request. If
  723. // you just want the service response, call the ListDeadLetterSourceQueues method directly
  724. // instead.
  725. //
  726. // Note: You must call the "Send" method on the returned request object in order
  727. // to execute the request.
  728. //
  729. // // Example sending a request using the ListDeadLetterSourceQueuesRequest method.
  730. // req, resp := client.ListDeadLetterSourceQueuesRequest(params)
  731. //
  732. // err := req.Send()
  733. // if err == nil { // resp is now filled
  734. // fmt.Println(resp)
  735. // }
  736. //
  737. func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueuesInput) (req *request.Request, output *ListDeadLetterSourceQueuesOutput) {
  738. op := &request.Operation{
  739. Name: opListDeadLetterSourceQueues,
  740. HTTPMethod: "POST",
  741. HTTPPath: "/",
  742. }
  743. if input == nil {
  744. input = &ListDeadLetterSourceQueuesInput{}
  745. }
  746. req = c.newRequest(op, input, output)
  747. output = &ListDeadLetterSourceQueuesOutput{}
  748. req.Data = output
  749. return
  750. }
  751. // ListDeadLetterSourceQueues API operation for Amazon Simple Queue Service.
  752. //
  753. // Returns a list of your queues that have the RedrivePolicy queue attribute
  754. // configured with a dead letter queue.
  755. //
  756. // For more information about using dead letter queues, see Using Amazon SQS
  757. // Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html).
  758. //
  759. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  760. // with awserr.Error's Code and Message methods to get detailed information about
  761. // the error.
  762. //
  763. // See the AWS API reference guide for Amazon Simple Queue Service's
  764. // API operation ListDeadLetterSourceQueues for usage and error information.
  765. //
  766. // Returned Error Codes:
  767. // * AWS.SimpleQueueService.NonExistentQueue
  768. // The queue referred to does not exist.
  769. //
  770. func (c *SQS) ListDeadLetterSourceQueues(input *ListDeadLetterSourceQueuesInput) (*ListDeadLetterSourceQueuesOutput, error) {
  771. req, out := c.ListDeadLetterSourceQueuesRequest(input)
  772. err := req.Send()
  773. return out, err
  774. }
  775. const opListQueues = "ListQueues"
  776. // ListQueuesRequest generates a "aws/request.Request" representing the
  777. // client's request for the ListQueues operation. The "output" return
  778. // value can be used to capture response data after the request's "Send" method
  779. // is called.
  780. //
  781. // See ListQueues for usage and error information.
  782. //
  783. // Creating a request object using this method should be used when you want to inject
  784. // custom logic into the request's lifecycle using a custom handler, or if you want to
  785. // access properties on the request object before or after sending the request. If
  786. // you just want the service response, call the ListQueues method directly
  787. // instead.
  788. //
  789. // Note: You must call the "Send" method on the returned request object in order
  790. // to execute the request.
  791. //
  792. // // Example sending a request using the ListQueuesRequest method.
  793. // req, resp := client.ListQueuesRequest(params)
  794. //
  795. // err := req.Send()
  796. // if err == nil { // resp is now filled
  797. // fmt.Println(resp)
  798. // }
  799. //
  800. func (c *SQS) ListQueuesRequest(input *ListQueuesInput) (req *request.Request, output *ListQueuesOutput) {
  801. op := &request.Operation{
  802. Name: opListQueues,
  803. HTTPMethod: "POST",
  804. HTTPPath: "/",
  805. }
  806. if input == nil {
  807. input = &ListQueuesInput{}
  808. }
  809. req = c.newRequest(op, input, output)
  810. output = &ListQueuesOutput{}
  811. req.Data = output
  812. return
  813. }
  814. // ListQueues API operation for Amazon Simple Queue Service.
  815. //
  816. // Returns a list of your queues. The maximum number of queues that can be returned
  817. // is 1000. If you specify a value for the optional QueueNamePrefix parameter,
  818. // only queues with a name beginning with the specified value are returned.
  819. //
  820. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  821. // with awserr.Error's Code and Message methods to get detailed information about
  822. // the error.
  823. //
  824. // See the AWS API reference guide for Amazon Simple Queue Service's
  825. // API operation ListQueues for usage and error information.
  826. func (c *SQS) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error) {
  827. req, out := c.ListQueuesRequest(input)
  828. err := req.Send()
  829. return out, err
  830. }
  831. const opPurgeQueue = "PurgeQueue"
  832. // PurgeQueueRequest generates a "aws/request.Request" representing the
  833. // client's request for the PurgeQueue operation. The "output" return
  834. // value can be used to capture response data after the request's "Send" method
  835. // is called.
  836. //
  837. // See PurgeQueue for usage and error information.
  838. //
  839. // Creating a request object using this method should be used when you want to inject
  840. // custom logic into the request's lifecycle using a custom handler, or if you want to
  841. // access properties on the request object before or after sending the request. If
  842. // you just want the service response, call the PurgeQueue method directly
  843. // instead.
  844. //
  845. // Note: You must call the "Send" method on the returned request object in order
  846. // to execute the request.
  847. //
  848. // // Example sending a request using the PurgeQueueRequest method.
  849. // req, resp := client.PurgeQueueRequest(params)
  850. //
  851. // err := req.Send()
  852. // if err == nil { // resp is now filled
  853. // fmt.Println(resp)
  854. // }
  855. //
  856. func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) (req *request.Request, output *PurgeQueueOutput) {
  857. op := &request.Operation{
  858. Name: opPurgeQueue,
  859. HTTPMethod: "POST",
  860. HTTPPath: "/",
  861. }
  862. if input == nil {
  863. input = &PurgeQueueInput{}
  864. }
  865. req = c.newRequest(op, input, output)
  866. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  867. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  868. output = &PurgeQueueOutput{}
  869. req.Data = output
  870. return
  871. }
  872. // PurgeQueue API operation for Amazon Simple Queue Service.
  873. //
  874. // Deletes the messages in a queue specified by the queue URL.
  875. //
  876. // When you use the PurgeQueue API, the deleted messages in the queue cannot
  877. // be retrieved.
  878. //
  879. // When you purge a queue, the message deletion process takes up to 60 seconds.
  880. // All messages sent to the queue before calling PurgeQueue will be deleted;
  881. // messages sent to the queue while it is being purged may be deleted. While
  882. // the queue is being purged, messages sent to the queue before PurgeQueue was
  883. // called may be received, but will be deleted within the next minute.
  884. //
  885. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  886. // with awserr.Error's Code and Message methods to get detailed information about
  887. // the error.
  888. //
  889. // See the AWS API reference guide for Amazon Simple Queue Service's
  890. // API operation PurgeQueue for usage and error information.
  891. //
  892. // Returned Error Codes:
  893. // * AWS.SimpleQueueService.NonExistentQueue
  894. // The queue referred to does not exist.
  895. //
  896. // * AWS.SimpleQueueService.PurgeQueueInProgress
  897. // Indicates that the specified queue previously received a PurgeQueue request
  898. // within the last 60 seconds, the time it can take to delete the messages in
  899. // the queue.
  900. //
  901. func (c *SQS) PurgeQueue(input *PurgeQueueInput) (*PurgeQueueOutput, error) {
  902. req, out := c.PurgeQueueRequest(input)
  903. err := req.Send()
  904. return out, err
  905. }
  906. const opReceiveMessage = "ReceiveMessage"
  907. // ReceiveMessageRequest generates a "aws/request.Request" representing the
  908. // client's request for the ReceiveMessage operation. The "output" return
  909. // value can be used to capture response data after the request's "Send" method
  910. // is called.
  911. //
  912. // See ReceiveMessage for usage and error information.
  913. //
  914. // Creating a request object using this method should be used when you want to inject
  915. // custom logic into the request's lifecycle using a custom handler, or if you want to
  916. // access properties on the request object before or after sending the request. If
  917. // you just want the service response, call the ReceiveMessage method directly
  918. // instead.
  919. //
  920. // Note: You must call the "Send" method on the returned request object in order
  921. // to execute the request.
  922. //
  923. // // Example sending a request using the ReceiveMessageRequest method.
  924. // req, resp := client.ReceiveMessageRequest(params)
  925. //
  926. // err := req.Send()
  927. // if err == nil { // resp is now filled
  928. // fmt.Println(resp)
  929. // }
  930. //
  931. func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) (req *request.Request, output *ReceiveMessageOutput) {
  932. op := &request.Operation{
  933. Name: opReceiveMessage,
  934. HTTPMethod: "POST",
  935. HTTPPath: "/",
  936. }
  937. if input == nil {
  938. input = &ReceiveMessageInput{}
  939. }
  940. req = c.newRequest(op, input, output)
  941. output = &ReceiveMessageOutput{}
  942. req.Data = output
  943. return
  944. }
  945. // ReceiveMessage API operation for Amazon Simple Queue Service.
  946. //
  947. // Retrieves one or more messages, with a maximum limit of 10 messages, from
  948. // the specified queue. Long poll support is enabled by using the WaitTimeSeconds
  949. // parameter. For more information, see Amazon SQS Long Poll (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html)
  950. // in the Amazon SQS Developer Guide.
  951. //
  952. // Short poll is the default behavior where a weighted random set of machines
  953. // is sampled on a ReceiveMessage call. This means only the messages on the
  954. // sampled machines are returned. If the number of messages in the queue is
  955. // small (less than 1000), it is likely you will get fewer messages than you
  956. // requested per ReceiveMessage call. If the number of messages in the queue
  957. // is extremely small, you might not receive any messages in a particular ReceiveMessage
  958. // response; in which case you should repeat the request.
  959. //
  960. // For each message returned, the response includes the following:
  961. //
  962. // * Message body
  963. //
  964. // * MD5 digest of the message body. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html
  965. // (http://www.faqs.org/rfcs/rfc1321.html).
  966. //
  967. // * Message ID you received when you sent the message to the queue.
  968. //
  969. // * Receipt handle.
  970. //
  971. // * Message attributes.
  972. //
  973. // * MD5 digest of the message attributes.
  974. //
  975. // The receipt handle is the identifier you must provide when deleting the message.
  976. // For more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html)
  977. // in the Amazon SQS Developer Guide.
  978. //
  979. // You can provide the VisibilityTimeout parameter in your request, which will
  980. // be applied to the messages that Amazon SQS returns in the response. If you
  981. // do not include the parameter, the overall visibility timeout for the queue
  982. // is used for the returned messages. For more information, see Visibility Timeout
  983. // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html)
  984. // in the Amazon SQS Developer Guide.
  985. //
  986. // Going forward, new attributes might be added. If you are writing code that
  987. // calls this action, we recommend that you structure your code so that it can
  988. // handle new attributes gracefully.
  989. //
  990. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  991. // with awserr.Error's Code and Message methods to get detailed information about
  992. // the error.
  993. //
  994. // See the AWS API reference guide for Amazon Simple Queue Service's
  995. // API operation ReceiveMessage for usage and error information.
  996. //
  997. // Returned Error Codes:
  998. // * OverLimit
  999. // The action that you requested would violate a limit. For example, ReceiveMessage
  1000. // returns this error if the maximum number of messages inflight has already
  1001. // been reached. AddPermission returns this error if the maximum number of permissions
  1002. // for the queue has already been reached.
  1003. //
  1004. func (c *SQS) ReceiveMessage(input *ReceiveMessageInput) (*ReceiveMessageOutput, error) {
  1005. req, out := c.ReceiveMessageRequest(input)
  1006. err := req.Send()
  1007. return out, err
  1008. }
  1009. const opRemovePermission = "RemovePermission"
  1010. // RemovePermissionRequest generates a "aws/request.Request" representing the
  1011. // client's request for the RemovePermission operation. The "output" return
  1012. // value can be used to capture response data after the request's "Send" method
  1013. // is called.
  1014. //
  1015. // See RemovePermission for usage and error information.
  1016. //
  1017. // Creating a request object using this method should be used when you want to inject
  1018. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1019. // access properties on the request object before or after sending the request. If
  1020. // you just want the service response, call the RemovePermission method directly
  1021. // instead.
  1022. //
  1023. // Note: You must call the "Send" method on the returned request object in order
  1024. // to execute the request.
  1025. //
  1026. // // Example sending a request using the RemovePermissionRequest method.
  1027. // req, resp := client.RemovePermissionRequest(params)
  1028. //
  1029. // err := req.Send()
  1030. // if err == nil { // resp is now filled
  1031. // fmt.Println(resp)
  1032. // }
  1033. //
  1034. func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
  1035. op := &request.Operation{
  1036. Name: opRemovePermission,
  1037. HTTPMethod: "POST",
  1038. HTTPPath: "/",
  1039. }
  1040. if input == nil {
  1041. input = &RemovePermissionInput{}
  1042. }
  1043. req = c.newRequest(op, input, output)
  1044. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1045. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1046. output = &RemovePermissionOutput{}
  1047. req.Data = output
  1048. return
  1049. }
  1050. // RemovePermission API operation for Amazon Simple Queue Service.
  1051. //
  1052. // Revokes any permissions in the queue policy that matches the specified Label
  1053. // parameter. Only the owner of the queue can remove permissions.
  1054. //
  1055. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1056. // with awserr.Error's Code and Message methods to get detailed information about
  1057. // the error.
  1058. //
  1059. // See the AWS API reference guide for Amazon Simple Queue Service's
  1060. // API operation RemovePermission for usage and error information.
  1061. func (c *SQS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
  1062. req, out := c.RemovePermissionRequest(input)
  1063. err := req.Send()
  1064. return out, err
  1065. }
  1066. const opSendMessage = "SendMessage"
  1067. // SendMessageRequest generates a "aws/request.Request" representing the
  1068. // client's request for the SendMessage operation. The "output" return
  1069. // value can be used to capture response data after the request's "Send" method
  1070. // is called.
  1071. //
  1072. // See SendMessage for usage and error information.
  1073. //
  1074. // Creating a request object using this method should be used when you want to inject
  1075. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1076. // access properties on the request object before or after sending the request. If
  1077. // you just want the service response, call the SendMessage method directly
  1078. // instead.
  1079. //
  1080. // Note: You must call the "Send" method on the returned request object in order
  1081. // to execute the request.
  1082. //
  1083. // // Example sending a request using the SendMessageRequest method.
  1084. // req, resp := client.SendMessageRequest(params)
  1085. //
  1086. // err := req.Send()
  1087. // if err == nil { // resp is now filled
  1088. // fmt.Println(resp)
  1089. // }
  1090. //
  1091. func (c *SQS) SendMessageRequest(input *SendMessageInput) (req *request.Request, output *SendMessageOutput) {
  1092. op := &request.Operation{
  1093. Name: opSendMessage,
  1094. HTTPMethod: "POST",
  1095. HTTPPath: "/",
  1096. }
  1097. if input == nil {
  1098. input = &SendMessageInput{}
  1099. }
  1100. req = c.newRequest(op, input, output)
  1101. output = &SendMessageOutput{}
  1102. req.Data = output
  1103. return
  1104. }
  1105. // SendMessage API operation for Amazon Simple Queue Service.
  1106. //
  1107. // Delivers a message to the specified queue. With Amazon SQS, you now have
  1108. // the ability to send large payload messages that are up to 256KB (262,144
  1109. // bytes) in size. To send large payloads, you must use an AWS SDK that supports
  1110. // SigV4 signing. To verify whether SigV4 is supported for an AWS SDK, check
  1111. // the SDK release notes.
  1112. //
  1113. // The following list shows the characters (in Unicode) allowed in your message,
  1114. // according to the W3C XML specification. For more information, go to http://www.w3.org/TR/REC-xml/#charsets
  1115. // (http://www.w3.org/TR/REC-xml/#charsets) If you send any characters not included
  1116. // in the list, your request will be rejected.
  1117. //
  1118. // #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]
  1119. //
  1120. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1121. // with awserr.Error's Code and Message methods to get detailed information about
  1122. // the error.
  1123. //
  1124. // See the AWS API reference guide for Amazon Simple Queue Service's
  1125. // API operation SendMessage for usage and error information.
  1126. //
  1127. // Returned Error Codes:
  1128. // * InvalidMessageContents
  1129. // The message contains characters outside the allowed set.
  1130. //
  1131. // * AWS.SimpleQueueService.UnsupportedOperation
  1132. // Error code 400. Unsupported operation.
  1133. //
  1134. func (c *SQS) SendMessage(input *SendMessageInput) (*SendMessageOutput, error) {
  1135. req, out := c.SendMessageRequest(input)
  1136. err := req.Send()
  1137. return out, err
  1138. }
  1139. const opSendMessageBatch = "SendMessageBatch"
  1140. // SendMessageBatchRequest generates a "aws/request.Request" representing the
  1141. // client's request for the SendMessageBatch operation. The "output" return
  1142. // value can be used to capture response data after the request's "Send" method
  1143. // is called.
  1144. //
  1145. // See SendMessageBatch for usage and error information.
  1146. //
  1147. // Creating a request object using this method should be used when you want to inject
  1148. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1149. // access properties on the request object before or after sending the request. If
  1150. // you just want the service response, call the SendMessageBatch method directly
  1151. // instead.
  1152. //
  1153. // Note: You must call the "Send" method on the returned request object in order
  1154. // to execute the request.
  1155. //
  1156. // // Example sending a request using the SendMessageBatchRequest method.
  1157. // req, resp := client.SendMessageBatchRequest(params)
  1158. //
  1159. // err := req.Send()
  1160. // if err == nil { // resp is now filled
  1161. // fmt.Println(resp)
  1162. // }
  1163. //
  1164. func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) (req *request.Request, output *SendMessageBatchOutput) {
  1165. op := &request.Operation{
  1166. Name: opSendMessageBatch,
  1167. HTTPMethod: "POST",
  1168. HTTPPath: "/",
  1169. }
  1170. if input == nil {
  1171. input = &SendMessageBatchInput{}
  1172. }
  1173. req = c.newRequest(op, input, output)
  1174. output = &SendMessageBatchOutput{}
  1175. req.Data = output
  1176. return
  1177. }
  1178. // SendMessageBatch API operation for Amazon Simple Queue Service.
  1179. //
  1180. // Delivers up to ten messages to the specified queue. This is a batch version
  1181. // of SendMessage. The result of the send action on each message is reported
  1182. // individually in the response. The maximum allowed individual message size
  1183. // is 256 KB (262,144 bytes).
  1184. //
  1185. // The maximum total payload size (i.e., the sum of all a batch's individual
  1186. // message lengths) is also 256 KB (262,144 bytes).
  1187. //
  1188. // If the DelaySeconds parameter is not specified for an entry, the default
  1189. // for the queue is used.
  1190. //
  1191. // The following list shows the characters (in Unicode) that are allowed in
  1192. // your message, according to the W3C XML specification. For more information,
  1193. // go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  1194. // If you send any characters that are not included in the list, your request
  1195. // will be rejected.
  1196. //
  1197. // #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]
  1198. //
  1199. // Because the batch request can result in a combination of successful and unsuccessful
  1200. // actions, you should check for batch errors even when the call returns an
  1201. // HTTP status code of 200.
  1202. //
  1203. // Some API actions take lists of parameters. These lists are specified using
  1204. // the param.n notation. Values of n are integers starting from 1. For example,
  1205. // a parameter list with two elements looks like this:
  1206. //
  1207. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1208. // with awserr.Error's Code and Message methods to get detailed information about
  1209. // the error.
  1210. //
  1211. // See the AWS API reference guide for Amazon Simple Queue Service's
  1212. // API operation SendMessageBatch for usage and error information.
  1213. //
  1214. // Returned Error Codes:
  1215. // * AWS.SimpleQueueService.TooManyEntriesInBatchRequest
  1216. // Batch request contains more number of entries than permissible.
  1217. //
  1218. // * AWS.SimpleQueueService.EmptyBatchRequest
  1219. // Batch request does not contain an entry.
  1220. //
  1221. // * AWS.SimpleQueueService.BatchEntryIdsNotDistinct
  1222. // Two or more batch entries have the same Id in the request.
  1223. //
  1224. // * AWS.SimpleQueueService.BatchRequestTooLong
  1225. // The length of all the messages put together is more than the limit.
  1226. //
  1227. // * AWS.SimpleQueueService.InvalidBatchEntryId
  1228. // The Id of a batch entry in a batch request does not abide by the specification.
  1229. //
  1230. // * AWS.SimpleQueueService.UnsupportedOperation
  1231. // Error code 400. Unsupported operation.
  1232. //
  1233. func (c *SQS) SendMessageBatch(input *SendMessageBatchInput) (*SendMessageBatchOutput, error) {
  1234. req, out := c.SendMessageBatchRequest(input)
  1235. err := req.Send()
  1236. return out, err
  1237. }
  1238. const opSetQueueAttributes = "SetQueueAttributes"
  1239. // SetQueueAttributesRequest generates a "aws/request.Request" representing the
  1240. // client's request for the SetQueueAttributes operation. The "output" return
  1241. // value can be used to capture response data after the request's "Send" method
  1242. // is called.
  1243. //
  1244. // See SetQueueAttributes for usage and error information.
  1245. //
  1246. // Creating a request object using this method should be used when you want to inject
  1247. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1248. // access properties on the request object before or after sending the request. If
  1249. // you just want the service response, call the SetQueueAttributes method directly
  1250. // instead.
  1251. //
  1252. // Note: You must call the "Send" method on the returned request object in order
  1253. // to execute the request.
  1254. //
  1255. // // Example sending a request using the SetQueueAttributesRequest method.
  1256. // req, resp := client.SetQueueAttributesRequest(params)
  1257. //
  1258. // err := req.Send()
  1259. // if err == nil { // resp is now filled
  1260. // fmt.Println(resp)
  1261. // }
  1262. //
  1263. func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) (req *request.Request, output *SetQueueAttributesOutput) {
  1264. op := &request.Operation{
  1265. Name: opSetQueueAttributes,
  1266. HTTPMethod: "POST",
  1267. HTTPPath: "/",
  1268. }
  1269. if input == nil {
  1270. input = &SetQueueAttributesInput{}
  1271. }
  1272. req = c.newRequest(op, input, output)
  1273. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1274. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1275. output = &SetQueueAttributesOutput{}
  1276. req.Data = output
  1277. return
  1278. }
  1279. // SetQueueAttributes API operation for Amazon Simple Queue Service.
  1280. //
  1281. // Sets the value of one or more queue attributes. When you change a queue's
  1282. // attributes, the change can take up to 60 seconds for most of the attributes
  1283. // to propagate throughout the SQS system. Changes made to the MessageRetentionPeriod
  1284. // attribute can take up to 15 minutes.
  1285. //
  1286. // Going forward, new attributes might be added. If you are writing code that
  1287. // calls this action, we recommend that you structure your code so that it can
  1288. // handle new attributes gracefully.
  1289. //
  1290. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1291. // with awserr.Error's Code and Message methods to get detailed information about
  1292. // the error.
  1293. //
  1294. // See the AWS API reference guide for Amazon Simple Queue Service's
  1295. // API operation SetQueueAttributes for usage and error information.
  1296. //
  1297. // Returned Error Codes:
  1298. // * InvalidAttributeName
  1299. // The attribute referred to does not exist.
  1300. //
  1301. func (c *SQS) SetQueueAttributes(input *SetQueueAttributesInput) (*SetQueueAttributesOutput, error) {
  1302. req, out := c.SetQueueAttributesRequest(input)
  1303. err := req.Send()
  1304. return out, err
  1305. }
  1306. type AddPermissionInput struct {
  1307. _ struct{} `type:"structure"`
  1308. // The AWS account number of the principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P)
  1309. // who will be given permission. The principal must have an AWS account, but
  1310. // does not need to be signed up for Amazon SQS. For information about locating
  1311. // the AWS account identification, see Your AWS Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html)
  1312. // in the Amazon SQS Developer Guide.
  1313. //
  1314. // AWSAccountIds is a required field
  1315. AWSAccountIds []*string `locationNameList:"AWSAccountId" type:"list" flattened:"true" required:"true"`
  1316. // The action the client wants to allow for the specified principal. The following
  1317. // are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility
  1318. // | GetQueueAttributes | GetQueueUrl. For more information about these actions,
  1319. // see Understanding Permissions (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes)
  1320. // in the Amazon SQS Developer Guide.
  1321. //
  1322. // Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the
  1323. // ActionName.n also grants permissions for the corresponding batch versions
  1324. // of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.
  1325. //
  1326. // Actions is a required field
  1327. Actions []*string `locationNameList:"ActionName" type:"list" flattened:"true" required:"true"`
  1328. // The unique identification of the permission you're setting (e.g., AliceSendMessage).
  1329. // Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-),
  1330. // and underscores (_) are allowed.
  1331. //
  1332. // Label is a required field
  1333. Label *string `type:"string" required:"true"`
  1334. // The URL of the Amazon SQS queue to take action on.
  1335. //
  1336. // Queue URLs are case-sensitive.
  1337. //
  1338. // QueueUrl is a required field
  1339. QueueUrl *string `type:"string" required:"true"`
  1340. }
  1341. // String returns the string representation
  1342. func (s AddPermissionInput) String() string {
  1343. return awsutil.Prettify(s)
  1344. }
  1345. // GoString returns the string representation
  1346. func (s AddPermissionInput) GoString() string {
  1347. return s.String()
  1348. }
  1349. // Validate inspects the fields of the type to determine if they are valid.
  1350. func (s *AddPermissionInput) Validate() error {
  1351. invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
  1352. if s.AWSAccountIds == nil {
  1353. invalidParams.Add(request.NewErrParamRequired("AWSAccountIds"))
  1354. }
  1355. if s.Actions == nil {
  1356. invalidParams.Add(request.NewErrParamRequired("Actions"))
  1357. }
  1358. if s.Label == nil {
  1359. invalidParams.Add(request.NewErrParamRequired("Label"))
  1360. }
  1361. if s.QueueUrl == nil {
  1362. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1363. }
  1364. if invalidParams.Len() > 0 {
  1365. return invalidParams
  1366. }
  1367. return nil
  1368. }
  1369. type AddPermissionOutput struct {
  1370. _ struct{} `type:"structure"`
  1371. }
  1372. // String returns the string representation
  1373. func (s AddPermissionOutput) String() string {
  1374. return awsutil.Prettify(s)
  1375. }
  1376. // GoString returns the string representation
  1377. func (s AddPermissionOutput) GoString() string {
  1378. return s.String()
  1379. }
  1380. // This is used in the responses of batch API to give a detailed description
  1381. // of the result of an action on each entry in the request.
  1382. type BatchResultErrorEntry struct {
  1383. _ struct{} `type:"structure"`
  1384. // An error code representing why the action failed on this entry.
  1385. //
  1386. // Code is a required field
  1387. Code *string `type:"string" required:"true"`
  1388. // The id of an entry in a batch request.
  1389. //
  1390. // Id is a required field
  1391. Id *string `type:"string" required:"true"`
  1392. // A message explaining why the action failed on this entry.
  1393. Message *string `type:"string"`
  1394. // Whether the error happened due to the sender's fault.
  1395. //
  1396. // SenderFault is a required field
  1397. SenderFault *bool `type:"boolean" required:"true"`
  1398. }
  1399. // String returns the string representation
  1400. func (s BatchResultErrorEntry) String() string {
  1401. return awsutil.Prettify(s)
  1402. }
  1403. // GoString returns the string representation
  1404. func (s BatchResultErrorEntry) GoString() string {
  1405. return s.String()
  1406. }
  1407. type ChangeMessageVisibilityBatchInput struct {
  1408. _ struct{} `type:"structure"`
  1409. // A list of receipt handles of the messages for which the visibility timeout
  1410. // must be changed.
  1411. //
  1412. // Entries is a required field
  1413. Entries []*ChangeMessageVisibilityBatchRequestEntry `locationNameList:"ChangeMessageVisibilityBatchRequestEntry" type:"list" flattened:"true" required:"true"`
  1414. // The URL of the Amazon SQS queue to take action on.
  1415. //
  1416. // Queue URLs are case-sensitive.
  1417. //
  1418. // QueueUrl is a required field
  1419. QueueUrl *string `type:"string" required:"true"`
  1420. }
  1421. // String returns the string representation
  1422. func (s ChangeMessageVisibilityBatchInput) String() string {
  1423. return awsutil.Prettify(s)
  1424. }
  1425. // GoString returns the string representation
  1426. func (s ChangeMessageVisibilityBatchInput) GoString() string {
  1427. return s.String()
  1428. }
  1429. // Validate inspects the fields of the type to determine if they are valid.
  1430. func (s *ChangeMessageVisibilityBatchInput) Validate() error {
  1431. invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchInput"}
  1432. if s.Entries == nil {
  1433. invalidParams.Add(request.NewErrParamRequired("Entries"))
  1434. }
  1435. if s.QueueUrl == nil {
  1436. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1437. }
  1438. if s.Entries != nil {
  1439. for i, v := range s.Entries {
  1440. if v == nil {
  1441. continue
  1442. }
  1443. if err := v.Validate(); err != nil {
  1444. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
  1445. }
  1446. }
  1447. }
  1448. if invalidParams.Len() > 0 {
  1449. return invalidParams
  1450. }
  1451. return nil
  1452. }
  1453. // For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry
  1454. // tag if the message succeeds or a BatchResultErrorEntry tag if the message
  1455. // fails.
  1456. type ChangeMessageVisibilityBatchOutput struct {
  1457. _ struct{} `type:"structure"`
  1458. // A list of BatchResultErrorEntry items.
  1459. //
  1460. // Failed is a required field
  1461. Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"`
  1462. // A list of ChangeMessageVisibilityBatchResultEntry items.
  1463. //
  1464. // Successful is a required field
  1465. Successful []*ChangeMessageVisibilityBatchResultEntry `locationNameList:"ChangeMessageVisibilityBatchResultEntry" type:"list" flattened:"true" required:"true"`
  1466. }
  1467. // String returns the string representation
  1468. func (s ChangeMessageVisibilityBatchOutput) String() string {
  1469. return awsutil.Prettify(s)
  1470. }
  1471. // GoString returns the string representation
  1472. func (s ChangeMessageVisibilityBatchOutput) GoString() string {
  1473. return s.String()
  1474. }
  1475. // Encloses a receipt handle and an entry id for each message in ChangeMessageVisibilityBatch.
  1476. //
  1477. // All of the following parameters are list parameters that must be prefixed
  1478. // with ChangeMessageVisibilityBatchRequestEntry.n, where n is an integer value
  1479. // starting with 1. For example, a parameter list for this action might look
  1480. // like this:
  1481. //
  1482. // Your_Receipt_Handle]]>
  1483. type ChangeMessageVisibilityBatchRequestEntry struct {
  1484. _ struct{} `type:"structure"`
  1485. // An identifier for this particular receipt handle. This is used to communicate
  1486. // the result. Note that the Ids of a batch request need to be unique within
  1487. // the request.
  1488. //
  1489. // Id is a required field
  1490. Id *string `type:"string" required:"true"`
  1491. // A receipt handle.
  1492. //
  1493. // ReceiptHandle is a required field
  1494. ReceiptHandle *string `type:"string" required:"true"`
  1495. // The new value (in seconds) for the message's visibility timeout.
  1496. VisibilityTimeout *int64 `type:"integer"`
  1497. }
  1498. // String returns the string representation
  1499. func (s ChangeMessageVisibilityBatchRequestEntry) String() string {
  1500. return awsutil.Prettify(s)
  1501. }
  1502. // GoString returns the string representation
  1503. func (s ChangeMessageVisibilityBatchRequestEntry) GoString() string {
  1504. return s.String()
  1505. }
  1506. // Validate inspects the fields of the type to determine if they are valid.
  1507. func (s *ChangeMessageVisibilityBatchRequestEntry) Validate() error {
  1508. invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchRequestEntry"}
  1509. if s.Id == nil {
  1510. invalidParams.Add(request.NewErrParamRequired("Id"))
  1511. }
  1512. if s.ReceiptHandle == nil {
  1513. invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
  1514. }
  1515. if invalidParams.Len() > 0 {
  1516. return invalidParams
  1517. }
  1518. return nil
  1519. }
  1520. // Encloses the id of an entry in ChangeMessageVisibilityBatch.
  1521. type ChangeMessageVisibilityBatchResultEntry struct {
  1522. _ struct{} `type:"structure"`
  1523. // Represents a message whose visibility timeout has been changed successfully.
  1524. //
  1525. // Id is a required field
  1526. Id *string `type:"string" required:"true"`
  1527. }
  1528. // String returns the string representation
  1529. func (s ChangeMessageVisibilityBatchResultEntry) String() string {
  1530. return awsutil.Prettify(s)
  1531. }
  1532. // GoString returns the string representation
  1533. func (s ChangeMessageVisibilityBatchResultEntry) GoString() string {
  1534. return s.String()
  1535. }
  1536. type ChangeMessageVisibilityInput struct {
  1537. _ struct{} `type:"structure"`
  1538. // The URL of the Amazon SQS queue to take action on.
  1539. //
  1540. // Queue URLs are case-sensitive.
  1541. //
  1542. // QueueUrl is a required field
  1543. QueueUrl *string `type:"string" required:"true"`
  1544. // The receipt handle associated with the message whose visibility timeout should
  1545. // be changed. This parameter is returned by the ReceiveMessage action.
  1546. //
  1547. // ReceiptHandle is a required field
  1548. ReceiptHandle *string `type:"string" required:"true"`
  1549. // The new value (in seconds - from 0 to 43200 - maximum 12 hours) for the message's
  1550. // visibility timeout.
  1551. //
  1552. // VisibilityTimeout is a required field
  1553. VisibilityTimeout *int64 `type:"integer" required:"true"`
  1554. }
  1555. // String returns the string representation
  1556. func (s ChangeMessageVisibilityInput) String() string {
  1557. return awsutil.Prettify(s)
  1558. }
  1559. // GoString returns the string representation
  1560. func (s ChangeMessageVisibilityInput) GoString() string {
  1561. return s.String()
  1562. }
  1563. // Validate inspects the fields of the type to determine if they are valid.
  1564. func (s *ChangeMessageVisibilityInput) Validate() error {
  1565. invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityInput"}
  1566. if s.QueueUrl == nil {
  1567. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1568. }
  1569. if s.ReceiptHandle == nil {
  1570. invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
  1571. }
  1572. if s.VisibilityTimeout == nil {
  1573. invalidParams.Add(request.NewErrParamRequired("VisibilityTimeout"))
  1574. }
  1575. if invalidParams.Len() > 0 {
  1576. return invalidParams
  1577. }
  1578. return nil
  1579. }
  1580. type ChangeMessageVisibilityOutput struct {
  1581. _ struct{} `type:"structure"`
  1582. }
  1583. // String returns the string representation
  1584. func (s ChangeMessageVisibilityOutput) String() string {
  1585. return awsutil.Prettify(s)
  1586. }
  1587. // GoString returns the string representation
  1588. func (s ChangeMessageVisibilityOutput) GoString() string {
  1589. return s.String()
  1590. }
  1591. type CreateQueueInput struct {
  1592. _ struct{} `type:"structure"`
  1593. // A map of attributes with their corresponding values.
  1594. //
  1595. // The following lists the names, descriptions, and values of the special request
  1596. // parameters the CreateQueue action uses:
  1597. //
  1598. // * DelaySeconds - The time in seconds that the delivery of all messages
  1599. // in the queue will be delayed. An integer from 0 to 900 (15 minutes). The
  1600. // default for this attribute is 0 (zero).
  1601. //
  1602. // * MaximumMessageSize - The limit of how many bytes a message can contain
  1603. // before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to
  1604. // 262144 bytes (256 KiB). The default for this attribute is 262144 (256
  1605. // KiB).
  1606. //
  1607. // * MessageRetentionPeriod - The number of seconds Amazon SQS retains a
  1608. // message. Integer representing seconds, from 60 (1 minute) to 1209600 (14
  1609. // days). The default for this attribute is 345600 (4 days).
  1610. //
  1611. // * Policy - The queue's policy. A valid AWS policy. For more information
  1612. // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html)
  1613. // in the Amazon IAM User Guide.
  1614. //
  1615. // * ReceiveMessageWaitTimeSeconds - The time for which a ReceiveMessage
  1616. // call will wait for a message to arrive. An integer from 0 to 20 (seconds).
  1617. // The default for this attribute is 0.
  1618. //
  1619. // * RedrivePolicy - The parameters for dead letter queue functionality of
  1620. // the source queue. For more information about RedrivePolicy and dead letter
  1621. // queues, see Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html)
  1622. // in the Amazon SQS Developer Guide.
  1623. //
  1624. // * VisibilityTimeout - The visibility timeout for the queue. An integer
  1625. // from 0 to 43200 (12 hours). The default for this attribute is 30. For
  1626. // more information about visibility timeout, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html)
  1627. // in the Amazon SQS Developer Guide.
  1628. //
  1629. // Any other valid special request parameters that are specified (such as ApproximateNumberOfMessages,
  1630. // ApproximateNumberOfMessagesDelayed, ApproximateNumberOfMessagesNotVisible,
  1631. // CreatedTimestamp, LastModifiedTimestamp, and QueueArn) will be ignored.
  1632. Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  1633. // The name for the queue to be created.
  1634. //
  1635. // Queue names are case-sensitive.
  1636. //
  1637. // QueueName is a required field
  1638. QueueName *string `type:"string" required:"true"`
  1639. }
  1640. // String returns the string representation
  1641. func (s CreateQueueInput) String() string {
  1642. return awsutil.Prettify(s)
  1643. }
  1644. // GoString returns the string representation
  1645. func (s CreateQueueInput) GoString() string {
  1646. return s.String()
  1647. }
  1648. // Validate inspects the fields of the type to determine if they are valid.
  1649. func (s *CreateQueueInput) Validate() error {
  1650. invalidParams := request.ErrInvalidParams{Context: "CreateQueueInput"}
  1651. if s.QueueName == nil {
  1652. invalidParams.Add(request.NewErrParamRequired("QueueName"))
  1653. }
  1654. if invalidParams.Len() > 0 {
  1655. return invalidParams
  1656. }
  1657. return nil
  1658. }
  1659. // Returns the QueueUrl element of the created queue.
  1660. type CreateQueueOutput struct {
  1661. _ struct{} `type:"structure"`
  1662. // The URL for the created Amazon SQS queue.
  1663. QueueUrl *string `type:"string"`
  1664. }
  1665. // String returns the string representation
  1666. func (s CreateQueueOutput) String() string {
  1667. return awsutil.Prettify(s)
  1668. }
  1669. // GoString returns the string representation
  1670. func (s CreateQueueOutput) GoString() string {
  1671. return s.String()
  1672. }
  1673. type DeleteMessageBatchInput struct {
  1674. _ struct{} `type:"structure"`
  1675. // A list of receipt handles for the messages to be deleted.
  1676. //
  1677. // Entries is a required field
  1678. Entries []*DeleteMessageBatchRequestEntry `locationNameList:"DeleteMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"`
  1679. // The URL of the Amazon SQS queue to take action on.
  1680. //
  1681. // Queue URLs are case-sensitive.
  1682. //
  1683. // QueueUrl is a required field
  1684. QueueUrl *string `type:"string" required:"true"`
  1685. }
  1686. // String returns the string representation
  1687. func (s DeleteMessageBatchInput) String() string {
  1688. return awsutil.Prettify(s)
  1689. }
  1690. // GoString returns the string representation
  1691. func (s DeleteMessageBatchInput) GoString() string {
  1692. return s.String()
  1693. }
  1694. // Validate inspects the fields of the type to determine if they are valid.
  1695. func (s *DeleteMessageBatchInput) Validate() error {
  1696. invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchInput"}
  1697. if s.Entries == nil {
  1698. invalidParams.Add(request.NewErrParamRequired("Entries"))
  1699. }
  1700. if s.QueueUrl == nil {
  1701. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1702. }
  1703. if s.Entries != nil {
  1704. for i, v := range s.Entries {
  1705. if v == nil {
  1706. continue
  1707. }
  1708. if err := v.Validate(); err != nil {
  1709. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
  1710. }
  1711. }
  1712. }
  1713. if invalidParams.Len() > 0 {
  1714. return invalidParams
  1715. }
  1716. return nil
  1717. }
  1718. // For each message in the batch, the response contains a DeleteMessageBatchResultEntry
  1719. // tag if the message is deleted or a BatchResultErrorEntry tag if the message
  1720. // cannot be deleted.
  1721. type DeleteMessageBatchOutput struct {
  1722. _ struct{} `type:"structure"`
  1723. // A list of BatchResultErrorEntry items.
  1724. //
  1725. // Failed is a required field
  1726. Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"`
  1727. // A list of DeleteMessageBatchResultEntry items.
  1728. //
  1729. // Successful is a required field
  1730. Successful []*DeleteMessageBatchResultEntry `locationNameList:"DeleteMessageBatchResultEntry" type:"list" flattened:"true" required:"true"`
  1731. }
  1732. // String returns the string representation
  1733. func (s DeleteMessageBatchOutput) String() string {
  1734. return awsutil.Prettify(s)
  1735. }
  1736. // GoString returns the string representation
  1737. func (s DeleteMessageBatchOutput) GoString() string {
  1738. return s.String()
  1739. }
  1740. // Encloses a receipt handle and an identifier for it.
  1741. type DeleteMessageBatchRequestEntry struct {
  1742. _ struct{} `type:"structure"`
  1743. // An identifier for this particular receipt handle. This is used to communicate
  1744. // the result. Note that the Ids of a batch request need to be unique within
  1745. // the request.
  1746. //
  1747. // Id is a required field
  1748. Id *string `type:"string" required:"true"`
  1749. // A receipt handle.
  1750. //
  1751. // ReceiptHandle is a required field
  1752. ReceiptHandle *string `type:"string" required:"true"`
  1753. }
  1754. // String returns the string representation
  1755. func (s DeleteMessageBatchRequestEntry) String() string {
  1756. return awsutil.Prettify(s)
  1757. }
  1758. // GoString returns the string representation
  1759. func (s DeleteMessageBatchRequestEntry) GoString() string {
  1760. return s.String()
  1761. }
  1762. // Validate inspects the fields of the type to determine if they are valid.
  1763. func (s *DeleteMessageBatchRequestEntry) Validate() error {
  1764. invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchRequestEntry"}
  1765. if s.Id == nil {
  1766. invalidParams.Add(request.NewErrParamRequired("Id"))
  1767. }
  1768. if s.ReceiptHandle == nil {
  1769. invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
  1770. }
  1771. if invalidParams.Len() > 0 {
  1772. return invalidParams
  1773. }
  1774. return nil
  1775. }
  1776. // Encloses the id an entry in DeleteMessageBatch.
  1777. type DeleteMessageBatchResultEntry struct {
  1778. _ struct{} `type:"structure"`
  1779. // Represents a successfully deleted message.
  1780. //
  1781. // Id is a required field
  1782. Id *string `type:"string" required:"true"`
  1783. }
  1784. // String returns the string representation
  1785. func (s DeleteMessageBatchResultEntry) String() string {
  1786. return awsutil.Prettify(s)
  1787. }
  1788. // GoString returns the string representation
  1789. func (s DeleteMessageBatchResultEntry) GoString() string {
  1790. return s.String()
  1791. }
  1792. type DeleteMessageInput struct {
  1793. _ struct{} `type:"structure"`
  1794. // The URL of the Amazon SQS queue to take action on.
  1795. //
  1796. // Queue URLs are case-sensitive.
  1797. //
  1798. // QueueUrl is a required field
  1799. QueueUrl *string `type:"string" required:"true"`
  1800. // The receipt handle associated with the message to delete.
  1801. //
  1802. // ReceiptHandle is a required field
  1803. ReceiptHandle *string `type:"string" required:"true"`
  1804. }
  1805. // String returns the string representation
  1806. func (s DeleteMessageInput) String() string {
  1807. return awsutil.Prettify(s)
  1808. }
  1809. // GoString returns the string representation
  1810. func (s DeleteMessageInput) GoString() string {
  1811. return s.String()
  1812. }
  1813. // Validate inspects the fields of the type to determine if they are valid.
  1814. func (s *DeleteMessageInput) Validate() error {
  1815. invalidParams := request.ErrInvalidParams{Context: "DeleteMessageInput"}
  1816. if s.QueueUrl == nil {
  1817. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1818. }
  1819. if s.ReceiptHandle == nil {
  1820. invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
  1821. }
  1822. if invalidParams.Len() > 0 {
  1823. return invalidParams
  1824. }
  1825. return nil
  1826. }
  1827. type DeleteMessageOutput struct {
  1828. _ struct{} `type:"structure"`
  1829. }
  1830. // String returns the string representation
  1831. func (s DeleteMessageOutput) String() string {
  1832. return awsutil.Prettify(s)
  1833. }
  1834. // GoString returns the string representation
  1835. func (s DeleteMessageOutput) GoString() string {
  1836. return s.String()
  1837. }
  1838. type DeleteQueueInput struct {
  1839. _ struct{} `type:"structure"`
  1840. // The URL of the Amazon SQS queue to take action on.
  1841. //
  1842. // Queue URLs are case-sensitive.
  1843. //
  1844. // QueueUrl is a required field
  1845. QueueUrl *string `type:"string" required:"true"`
  1846. }
  1847. // String returns the string representation
  1848. func (s DeleteQueueInput) String() string {
  1849. return awsutil.Prettify(s)
  1850. }
  1851. // GoString returns the string representation
  1852. func (s DeleteQueueInput) GoString() string {
  1853. return s.String()
  1854. }
  1855. // Validate inspects the fields of the type to determine if they are valid.
  1856. func (s *DeleteQueueInput) Validate() error {
  1857. invalidParams := request.ErrInvalidParams{Context: "DeleteQueueInput"}
  1858. if s.QueueUrl == nil {
  1859. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1860. }
  1861. if invalidParams.Len() > 0 {
  1862. return invalidParams
  1863. }
  1864. return nil
  1865. }
  1866. type DeleteQueueOutput struct {
  1867. _ struct{} `type:"structure"`
  1868. }
  1869. // String returns the string representation
  1870. func (s DeleteQueueOutput) String() string {
  1871. return awsutil.Prettify(s)
  1872. }
  1873. // GoString returns the string representation
  1874. func (s DeleteQueueOutput) GoString() string {
  1875. return s.String()
  1876. }
  1877. type GetQueueAttributesInput struct {
  1878. _ struct{} `type:"structure"`
  1879. // A list of attributes to retrieve information for. The following attributes
  1880. // are supported:
  1881. //
  1882. // * All - returns all values.
  1883. //
  1884. // * ApproximateNumberOfMessages - returns the approximate number of visible
  1885. // messages in a queue. For more information, see Resources Required to Process
  1886. // Messages (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ApproximateNumber.html)
  1887. // in the Amazon SQS Developer Guide.
  1888. //
  1889. // * ApproximateNumberOfMessagesNotVisible - returns the approximate number
  1890. // of messages that are not timed-out and not deleted. For more information,
  1891. // see Resources Required to Process Messages (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ApproximateNumber.html)
  1892. // in the Amazon SQS Developer Guide.
  1893. //
  1894. // * VisibilityTimeout - returns the visibility timeout for the queue. For
  1895. // more information about visibility timeout, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html)
  1896. // in the Amazon SQS Developer Guide.
  1897. //
  1898. // * CreatedTimestamp - returns the time when the queue was created (epoch
  1899. // time in seconds).
  1900. //
  1901. // * LastModifiedTimestamp - returns the time when the queue was last changed
  1902. // (epoch time in seconds).
  1903. //
  1904. // * Policy - returns the queue's policy.
  1905. //
  1906. // * MaximumMessageSize - returns the limit of how many bytes a message can
  1907. // contain before Amazon SQS rejects it.
  1908. //
  1909. // * MessageRetentionPeriod - returns the number of seconds Amazon SQS retains
  1910. // a message.
  1911. //
  1912. // * QueueArn - returns the queue's Amazon resource name (ARN).
  1913. //
  1914. // * ApproximateNumberOfMessagesDelayed - returns the approximate number
  1915. // of messages that are pending to be added to the queue.
  1916. //
  1917. // * DelaySeconds - returns the default delay on the queue in seconds.
  1918. //
  1919. // * ReceiveMessageWaitTimeSeconds - returns the time for which a ReceiveMessage
  1920. // call will wait for a message to arrive.
  1921. //
  1922. // * RedrivePolicy - returns the parameters for dead letter queue functionality
  1923. // of the source queue. For more information about RedrivePolicy and dead
  1924. // letter queues, see Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html)
  1925. // in the Amazon SQS Developer Guide.
  1926. //
  1927. // Going forward, new attributes might be added. If you are writing code that
  1928. // calls this action, we recommend that you structure your code so that it can
  1929. // handle new attributes gracefully.
  1930. AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"`
  1931. // The URL of the Amazon SQS queue to take action on.
  1932. //
  1933. // Queue URLs are case-sensitive.
  1934. //
  1935. // QueueUrl is a required field
  1936. QueueUrl *string `type:"string" required:"true"`
  1937. }
  1938. // String returns the string representation
  1939. func (s GetQueueAttributesInput) String() string {
  1940. return awsutil.Prettify(s)
  1941. }
  1942. // GoString returns the string representation
  1943. func (s GetQueueAttributesInput) GoString() string {
  1944. return s.String()
  1945. }
  1946. // Validate inspects the fields of the type to determine if they are valid.
  1947. func (s *GetQueueAttributesInput) Validate() error {
  1948. invalidParams := request.ErrInvalidParams{Context: "GetQueueAttributesInput"}
  1949. if s.QueueUrl == nil {
  1950. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  1951. }
  1952. if invalidParams.Len() > 0 {
  1953. return invalidParams
  1954. }
  1955. return nil
  1956. }
  1957. // A list of returned queue attributes.
  1958. type GetQueueAttributesOutput struct {
  1959. _ struct{} `type:"structure"`
  1960. // A map of attributes to the respective values.
  1961. Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  1962. }
  1963. // String returns the string representation
  1964. func (s GetQueueAttributesOutput) String() string {
  1965. return awsutil.Prettify(s)
  1966. }
  1967. // GoString returns the string representation
  1968. func (s GetQueueAttributesOutput) GoString() string {
  1969. return s.String()
  1970. }
  1971. type GetQueueUrlInput struct {
  1972. _ struct{} `type:"structure"`
  1973. // The name of the queue whose URL must be fetched. Maximum 80 characters; alphanumeric
  1974. // characters, hyphens (-), and underscores (_) are allowed.
  1975. //
  1976. // Queue names are case-sensitive.
  1977. //
  1978. // QueueName is a required field
  1979. QueueName *string `type:"string" required:"true"`
  1980. // The AWS account ID of the account that created the queue.
  1981. QueueOwnerAWSAccountId *string `type:"string"`
  1982. }
  1983. // String returns the string representation
  1984. func (s GetQueueUrlInput) String() string {
  1985. return awsutil.Prettify(s)
  1986. }
  1987. // GoString returns the string representation
  1988. func (s GetQueueUrlInput) GoString() string {
  1989. return s.String()
  1990. }
  1991. // Validate inspects the fields of the type to determine if they are valid.
  1992. func (s *GetQueueUrlInput) Validate() error {
  1993. invalidParams := request.ErrInvalidParams{Context: "GetQueueUrlInput"}
  1994. if s.QueueName == nil {
  1995. invalidParams.Add(request.NewErrParamRequired("QueueName"))
  1996. }
  1997. if invalidParams.Len() > 0 {
  1998. return invalidParams
  1999. }
  2000. return nil
  2001. }
  2002. // For more information, see Responses (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/UnderstandingResponses.html)
  2003. // in the Amazon SQS Developer Guide.
  2004. type GetQueueUrlOutput struct {
  2005. _ struct{} `type:"structure"`
  2006. // The URL for the queue.
  2007. QueueUrl *string `type:"string"`
  2008. }
  2009. // String returns the string representation
  2010. func (s GetQueueUrlOutput) String() string {
  2011. return awsutil.Prettify(s)
  2012. }
  2013. // GoString returns the string representation
  2014. func (s GetQueueUrlOutput) GoString() string {
  2015. return s.String()
  2016. }
  2017. type ListDeadLetterSourceQueuesInput struct {
  2018. _ struct{} `type:"structure"`
  2019. // The queue URL of a dead letter queue.
  2020. //
  2021. // Queue URLs are case-sensitive.
  2022. //
  2023. // QueueUrl is a required field
  2024. QueueUrl *string `type:"string" required:"true"`
  2025. }
  2026. // String returns the string representation
  2027. func (s ListDeadLetterSourceQueuesInput) String() string {
  2028. return awsutil.Prettify(s)
  2029. }
  2030. // GoString returns the string representation
  2031. func (s ListDeadLetterSourceQueuesInput) GoString() string {
  2032. return s.String()
  2033. }
  2034. // Validate inspects the fields of the type to determine if they are valid.
  2035. func (s *ListDeadLetterSourceQueuesInput) Validate() error {
  2036. invalidParams := request.ErrInvalidParams{Context: "ListDeadLetterSourceQueuesInput"}
  2037. if s.QueueUrl == nil {
  2038. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2039. }
  2040. if invalidParams.Len() > 0 {
  2041. return invalidParams
  2042. }
  2043. return nil
  2044. }
  2045. // A list of your dead letter source queues.
  2046. type ListDeadLetterSourceQueuesOutput struct {
  2047. _ struct{} `type:"structure"`
  2048. // A list of source queue URLs that have the RedrivePolicy queue attribute configured
  2049. // with a dead letter queue.
  2050. //
  2051. // QueueUrls is a required field
  2052. QueueUrls []*string `locationName:"queueUrls" locationNameList:"QueueUrl" type:"list" flattened:"true" required:"true"`
  2053. }
  2054. // String returns the string representation
  2055. func (s ListDeadLetterSourceQueuesOutput) String() string {
  2056. return awsutil.Prettify(s)
  2057. }
  2058. // GoString returns the string representation
  2059. func (s ListDeadLetterSourceQueuesOutput) GoString() string {
  2060. return s.String()
  2061. }
  2062. type ListQueuesInput struct {
  2063. _ struct{} `type:"structure"`
  2064. // A string to use for filtering the list results. Only those queues whose name
  2065. // begins with the specified string are returned.
  2066. //
  2067. // Queue names are case-sensitive.
  2068. QueueNamePrefix *string `type:"string"`
  2069. }
  2070. // String returns the string representation
  2071. func (s ListQueuesInput) String() string {
  2072. return awsutil.Prettify(s)
  2073. }
  2074. // GoString returns the string representation
  2075. func (s ListQueuesInput) GoString() string {
  2076. return s.String()
  2077. }
  2078. // A list of your queues.
  2079. type ListQueuesOutput struct {
  2080. _ struct{} `type:"structure"`
  2081. // A list of queue URLs, up to 1000 entries.
  2082. QueueUrls []*string `locationNameList:"QueueUrl" type:"list" flattened:"true"`
  2083. }
  2084. // String returns the string representation
  2085. func (s ListQueuesOutput) String() string {
  2086. return awsutil.Prettify(s)
  2087. }
  2088. // GoString returns the string representation
  2089. func (s ListQueuesOutput) GoString() string {
  2090. return s.String()
  2091. }
  2092. // An Amazon SQS message.
  2093. type Message struct {
  2094. _ struct{} `type:"structure"`
  2095. // SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp.
  2096. // SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an
  2097. // integer representing the epoch time (http://en.wikipedia.org/wiki/Unix_time)
  2098. // in milliseconds.
  2099. Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  2100. // The message's contents (not URL-encoded).
  2101. Body *string `type:"string"`
  2102. // An MD5 digest of the non-URL-encoded message body string.
  2103. MD5OfBody *string `type:"string"`
  2104. // An MD5 digest of the non-URL-encoded message attribute string. This can be
  2105. // used to verify that Amazon SQS received the message correctly. Amazon SQS
  2106. // first URL decodes the message before creating the MD5 digest. For information
  2107. // about MD5, go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  2108. MD5OfMessageAttributes *string `type:"string"`
  2109. // Each message attribute consists of a Name, Type, and Value. For more information,
  2110. // see Message Attribute Items (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV).
  2111. MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  2112. // A unique identifier for the message. Message IDs are considered unique across
  2113. // all AWS accounts for an extended period of time.
  2114. MessageId *string `type:"string"`
  2115. // An identifier associated with the act of receiving the message. A new receipt
  2116. // handle is returned every time you receive a message. When deleting a message,
  2117. // you provide the last received receipt handle to delete the message.
  2118. ReceiptHandle *string `type:"string"`
  2119. }
  2120. // String returns the string representation
  2121. func (s Message) String() string {
  2122. return awsutil.Prettify(s)
  2123. }
  2124. // GoString returns the string representation
  2125. func (s Message) GoString() string {
  2126. return s.String()
  2127. }
  2128. // The user-specified message attribute value. For string data types, the value
  2129. // attribute has the same restrictions on the content as the message body. For
  2130. // more information, see SendMessage (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html).
  2131. //
  2132. // Name, type, and value must not be empty or null. In addition, the message
  2133. // body should not be empty or null. All parts of the message attribute, including
  2134. // name, type, and value, are included in the message size restriction, which
  2135. // is currently 256 KB (262,144 bytes).
  2136. type MessageAttributeValue struct {
  2137. _ struct{} `type:"structure"`
  2138. // Not implemented. Reserved for future use.
  2139. BinaryListValues [][]byte `locationName:"BinaryListValue" locationNameList:"BinaryListValue" type:"list" flattened:"true"`
  2140. // Binary type attributes can store any binary data, for example, compressed
  2141. // data, encrypted data, or images.
  2142. //
  2143. // BinaryValue is automatically base64 encoded/decoded by the SDK.
  2144. BinaryValue []byte `type:"blob"`
  2145. // Amazon SQS supports the following logical data types: String, Number, and
  2146. // Binary. For the Number data type, you must use StringValue.
  2147. //
  2148. // You can also append custom labels. For more information, see Message Attribute
  2149. // Data Types (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributes.DataTypes).
  2150. //
  2151. // DataType is a required field
  2152. DataType *string `type:"string" required:"true"`
  2153. // Not implemented. Reserved for future use.
  2154. StringListValues []*string `locationName:"StringListValue" locationNameList:"StringListValue" type:"list" flattened:"true"`
  2155. // Strings are Unicode with UTF8 binary encoding. For a list of code values,
  2156. // see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  2157. StringValue *string `type:"string"`
  2158. }
  2159. // String returns the string representation
  2160. func (s MessageAttributeValue) String() string {
  2161. return awsutil.Prettify(s)
  2162. }
  2163. // GoString returns the string representation
  2164. func (s MessageAttributeValue) GoString() string {
  2165. return s.String()
  2166. }
  2167. // Validate inspects the fields of the type to determine if they are valid.
  2168. func (s *MessageAttributeValue) Validate() error {
  2169. invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"}
  2170. if s.DataType == nil {
  2171. invalidParams.Add(request.NewErrParamRequired("DataType"))
  2172. }
  2173. if invalidParams.Len() > 0 {
  2174. return invalidParams
  2175. }
  2176. return nil
  2177. }
  2178. type PurgeQueueInput struct {
  2179. _ struct{} `type:"structure"`
  2180. // The queue URL of the queue to delete the messages from when using the PurgeQueue
  2181. // API.
  2182. //
  2183. // Queue URLs are case-sensitive.
  2184. //
  2185. // QueueUrl is a required field
  2186. QueueUrl *string `type:"string" required:"true"`
  2187. }
  2188. // String returns the string representation
  2189. func (s PurgeQueueInput) String() string {
  2190. return awsutil.Prettify(s)
  2191. }
  2192. // GoString returns the string representation
  2193. func (s PurgeQueueInput) GoString() string {
  2194. return s.String()
  2195. }
  2196. // Validate inspects the fields of the type to determine if they are valid.
  2197. func (s *PurgeQueueInput) Validate() error {
  2198. invalidParams := request.ErrInvalidParams{Context: "PurgeQueueInput"}
  2199. if s.QueueUrl == nil {
  2200. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2201. }
  2202. if invalidParams.Len() > 0 {
  2203. return invalidParams
  2204. }
  2205. return nil
  2206. }
  2207. type PurgeQueueOutput struct {
  2208. _ struct{} `type:"structure"`
  2209. }
  2210. // String returns the string representation
  2211. func (s PurgeQueueOutput) String() string {
  2212. return awsutil.Prettify(s)
  2213. }
  2214. // GoString returns the string representation
  2215. func (s PurgeQueueOutput) GoString() string {
  2216. return s.String()
  2217. }
  2218. type ReceiveMessageInput struct {
  2219. _ struct{} `type:"structure"`
  2220. // A list of attributes that need to be returned along with each message. These
  2221. // attributes include:
  2222. //
  2223. // * All - returns all values.
  2224. //
  2225. // * ApproximateFirstReceiveTimestamp - returns the time when the message
  2226. // was first received from the queue (epoch time in milliseconds).
  2227. //
  2228. // * ApproximateReceiveCount - returns the number of times a message has
  2229. // been received from the queue but not deleted.
  2230. //
  2231. // * SenderId - returns the AWS account number (or the IP address, if anonymous
  2232. // access is allowed) of the sender.
  2233. //
  2234. // * SentTimestamp - returns the time when the message was sent to the queue
  2235. // (epoch time in milliseconds).
  2236. //
  2237. // Any other valid special request parameters that are specified (such as ApproximateNumberOfMessages,
  2238. // ApproximateNumberOfMessagesDelayed, ApproximateNumberOfMessagesNotVisible,
  2239. // CreatedTimestamp, DelaySeconds, LastModifiedTimestamp, MaximumMessageSize,
  2240. // MessageRetentionPeriod, Policy, QueueArn, ReceiveMessageWaitTimeSeconds,
  2241. // RedrivePolicy, and VisibilityTimeout) will be ignored.
  2242. AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"`
  2243. // The maximum number of messages to return. Amazon SQS never returns more messages
  2244. // than this value but may return fewer. Values can be from 1 to 10. Default
  2245. // is 1.
  2246. //
  2247. // All of the messages are not necessarily returned.
  2248. MaxNumberOfMessages *int64 `type:"integer"`
  2249. // The name of the message attribute, where N is the index. The message attribute
  2250. // name can contain the following characters: A-Z, a-z, 0-9, underscore (_),
  2251. // hyphen (-), and period (.). The name must not start or end with a period,
  2252. // and it should not have successive periods. The name is case sensitive and
  2253. // must be unique among all attribute names for the message. The name can be
  2254. // up to 256 characters long. The name cannot start with "AWS." or "Amazon."
  2255. // (or any variations in casing), because these prefixes are reserved for use
  2256. // by Amazon Web Services.
  2257. //
  2258. // When using ReceiveMessage, you can send a list of attribute names to receive,
  2259. // or you can return all of the attributes by specifying "All" or ".*" in your
  2260. // request. You can also use "bar.*" to return all message attributes starting
  2261. // with the "bar" prefix.
  2262. MessageAttributeNames []*string `locationNameList:"MessageAttributeName" type:"list" flattened:"true"`
  2263. // The URL of the Amazon SQS queue to take action on.
  2264. //
  2265. // Queue URLs are case-sensitive.
  2266. //
  2267. // QueueUrl is a required field
  2268. QueueUrl *string `type:"string" required:"true"`
  2269. // The duration (in seconds) that the received messages are hidden from subsequent
  2270. // retrieve requests after being retrieved by a ReceiveMessage request.
  2271. VisibilityTimeout *int64 `type:"integer"`
  2272. // The duration (in seconds) for which the call will wait for a message to arrive
  2273. // in the queue before returning. If a message is available, the call will return
  2274. // sooner than WaitTimeSeconds.
  2275. WaitTimeSeconds *int64 `type:"integer"`
  2276. }
  2277. // String returns the string representation
  2278. func (s ReceiveMessageInput) String() string {
  2279. return awsutil.Prettify(s)
  2280. }
  2281. // GoString returns the string representation
  2282. func (s ReceiveMessageInput) GoString() string {
  2283. return s.String()
  2284. }
  2285. // Validate inspects the fields of the type to determine if they are valid.
  2286. func (s *ReceiveMessageInput) Validate() error {
  2287. invalidParams := request.ErrInvalidParams{Context: "ReceiveMessageInput"}
  2288. if s.QueueUrl == nil {
  2289. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2290. }
  2291. if invalidParams.Len() > 0 {
  2292. return invalidParams
  2293. }
  2294. return nil
  2295. }
  2296. // A list of received messages.
  2297. type ReceiveMessageOutput struct {
  2298. _ struct{} `type:"structure"`
  2299. // A list of messages.
  2300. Messages []*Message `locationNameList:"Message" type:"list" flattened:"true"`
  2301. }
  2302. // String returns the string representation
  2303. func (s ReceiveMessageOutput) String() string {
  2304. return awsutil.Prettify(s)
  2305. }
  2306. // GoString returns the string representation
  2307. func (s ReceiveMessageOutput) GoString() string {
  2308. return s.String()
  2309. }
  2310. type RemovePermissionInput struct {
  2311. _ struct{} `type:"structure"`
  2312. // The identification of the permission to remove. This is the label added with
  2313. // the AddPermission action.
  2314. //
  2315. // Label is a required field
  2316. Label *string `type:"string" required:"true"`
  2317. // The URL of the Amazon SQS queue to take action on.
  2318. //
  2319. // Queue URLs are case-sensitive.
  2320. //
  2321. // QueueUrl is a required field
  2322. QueueUrl *string `type:"string" required:"true"`
  2323. }
  2324. // String returns the string representation
  2325. func (s RemovePermissionInput) String() string {
  2326. return awsutil.Prettify(s)
  2327. }
  2328. // GoString returns the string representation
  2329. func (s RemovePermissionInput) GoString() string {
  2330. return s.String()
  2331. }
  2332. // Validate inspects the fields of the type to determine if they are valid.
  2333. func (s *RemovePermissionInput) Validate() error {
  2334. invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
  2335. if s.Label == nil {
  2336. invalidParams.Add(request.NewErrParamRequired("Label"))
  2337. }
  2338. if s.QueueUrl == nil {
  2339. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2340. }
  2341. if invalidParams.Len() > 0 {
  2342. return invalidParams
  2343. }
  2344. return nil
  2345. }
  2346. type RemovePermissionOutput struct {
  2347. _ struct{} `type:"structure"`
  2348. }
  2349. // String returns the string representation
  2350. func (s RemovePermissionOutput) String() string {
  2351. return awsutil.Prettify(s)
  2352. }
  2353. // GoString returns the string representation
  2354. func (s RemovePermissionOutput) GoString() string {
  2355. return s.String()
  2356. }
  2357. type SendMessageBatchInput struct {
  2358. _ struct{} `type:"structure"`
  2359. // A list of SendMessageBatchRequestEntry items.
  2360. //
  2361. // Entries is a required field
  2362. Entries []*SendMessageBatchRequestEntry `locationNameList:"SendMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"`
  2363. // The URL of the Amazon SQS queue to take action on.
  2364. //
  2365. // Queue URLs are case-sensitive.
  2366. //
  2367. // QueueUrl is a required field
  2368. QueueUrl *string `type:"string" required:"true"`
  2369. }
  2370. // String returns the string representation
  2371. func (s SendMessageBatchInput) String() string {
  2372. return awsutil.Prettify(s)
  2373. }
  2374. // GoString returns the string representation
  2375. func (s SendMessageBatchInput) GoString() string {
  2376. return s.String()
  2377. }
  2378. // Validate inspects the fields of the type to determine if they are valid.
  2379. func (s *SendMessageBatchInput) Validate() error {
  2380. invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchInput"}
  2381. if s.Entries == nil {
  2382. invalidParams.Add(request.NewErrParamRequired("Entries"))
  2383. }
  2384. if s.QueueUrl == nil {
  2385. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2386. }
  2387. if s.Entries != nil {
  2388. for i, v := range s.Entries {
  2389. if v == nil {
  2390. continue
  2391. }
  2392. if err := v.Validate(); err != nil {
  2393. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
  2394. }
  2395. }
  2396. }
  2397. if invalidParams.Len() > 0 {
  2398. return invalidParams
  2399. }
  2400. return nil
  2401. }
  2402. // For each message in the batch, the response contains a SendMessageBatchResultEntry
  2403. // tag if the message succeeds or a BatchResultErrorEntry tag if the message
  2404. // fails.
  2405. type SendMessageBatchOutput struct {
  2406. _ struct{} `type:"structure"`
  2407. // A list of BatchResultErrorEntry items with the error detail about each message
  2408. // that could not be enqueued.
  2409. //
  2410. // Failed is a required field
  2411. Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"`
  2412. // A list of SendMessageBatchResultEntry items.
  2413. //
  2414. // Successful is a required field
  2415. Successful []*SendMessageBatchResultEntry `locationNameList:"SendMessageBatchResultEntry" type:"list" flattened:"true" required:"true"`
  2416. }
  2417. // String returns the string representation
  2418. func (s SendMessageBatchOutput) String() string {
  2419. return awsutil.Prettify(s)
  2420. }
  2421. // GoString returns the string representation
  2422. func (s SendMessageBatchOutput) GoString() string {
  2423. return s.String()
  2424. }
  2425. // Contains the details of a single Amazon SQS message along with a Id.
  2426. type SendMessageBatchRequestEntry struct {
  2427. _ struct{} `type:"structure"`
  2428. // The number of seconds for which the message has to be delayed.
  2429. DelaySeconds *int64 `type:"integer"`
  2430. // An identifier for the message in this batch. This is used to communicate
  2431. // the result. Note that the Ids of a batch request need to be unique within
  2432. // the request.
  2433. //
  2434. // Id is a required field
  2435. Id *string `type:"string" required:"true"`
  2436. // Each message attribute consists of a Name, Type, and Value. For more information,
  2437. // see Message Attribute Items (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV).
  2438. MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  2439. // Body of the message.
  2440. //
  2441. // MessageBody is a required field
  2442. MessageBody *string `type:"string" required:"true"`
  2443. }
  2444. // String returns the string representation
  2445. func (s SendMessageBatchRequestEntry) String() string {
  2446. return awsutil.Prettify(s)
  2447. }
  2448. // GoString returns the string representation
  2449. func (s SendMessageBatchRequestEntry) GoString() string {
  2450. return s.String()
  2451. }
  2452. // Validate inspects the fields of the type to determine if they are valid.
  2453. func (s *SendMessageBatchRequestEntry) Validate() error {
  2454. invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchRequestEntry"}
  2455. if s.Id == nil {
  2456. invalidParams.Add(request.NewErrParamRequired("Id"))
  2457. }
  2458. if s.MessageBody == nil {
  2459. invalidParams.Add(request.NewErrParamRequired("MessageBody"))
  2460. }
  2461. if s.MessageAttributes != nil {
  2462. for i, v := range s.MessageAttributes {
  2463. if v == nil {
  2464. continue
  2465. }
  2466. if err := v.Validate(); err != nil {
  2467. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
  2468. }
  2469. }
  2470. }
  2471. if invalidParams.Len() > 0 {
  2472. return invalidParams
  2473. }
  2474. return nil
  2475. }
  2476. // Encloses a message ID for successfully enqueued message of a SendMessageBatch.
  2477. type SendMessageBatchResultEntry struct {
  2478. _ struct{} `type:"structure"`
  2479. // An identifier for the message in this batch.
  2480. //
  2481. // Id is a required field
  2482. Id *string `type:"string" required:"true"`
  2483. // An MD5 digest of the non-URL-encoded message attribute string. This can be
  2484. // used to verify that Amazon SQS received the message batch correctly. Amazon
  2485. // SQS first URL decodes the message before creating the MD5 digest. For information
  2486. // about MD5, go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  2487. MD5OfMessageAttributes *string `type:"string"`
  2488. // An MD5 digest of the non-URL-encoded message body string. This can be used
  2489. // to verify that Amazon SQS received the message correctly. Amazon SQS first
  2490. // URL decodes the message before creating the MD5 digest. For information about
  2491. // MD5, go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  2492. //
  2493. // MD5OfMessageBody is a required field
  2494. MD5OfMessageBody *string `type:"string" required:"true"`
  2495. // An identifier for the message.
  2496. //
  2497. // MessageId is a required field
  2498. MessageId *string `type:"string" required:"true"`
  2499. }
  2500. // String returns the string representation
  2501. func (s SendMessageBatchResultEntry) String() string {
  2502. return awsutil.Prettify(s)
  2503. }
  2504. // GoString returns the string representation
  2505. func (s SendMessageBatchResultEntry) GoString() string {
  2506. return s.String()
  2507. }
  2508. type SendMessageInput struct {
  2509. _ struct{} `type:"structure"`
  2510. // The number of seconds (0 to 900 - 15 minutes) to delay a specific message.
  2511. // Messages with a positive DelaySeconds value become available for processing
  2512. // after the delay time is finished. If you don't specify a value, the default
  2513. // value for the queue applies.
  2514. DelaySeconds *int64 `type:"integer"`
  2515. // Each message attribute consists of a Name, Type, and Value. For more information,
  2516. // see Message Attribute Items (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV).
  2517. MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"`
  2518. // The message to send. String maximum 256 KB in size. For a list of allowed
  2519. // characters, see the preceding important note.
  2520. //
  2521. // MessageBody is a required field
  2522. MessageBody *string `type:"string" required:"true"`
  2523. // The URL of the Amazon SQS queue to take action on.
  2524. //
  2525. // Queue URLs are case-sensitive.
  2526. //
  2527. // QueueUrl is a required field
  2528. QueueUrl *string `type:"string" required:"true"`
  2529. }
  2530. // String returns the string representation
  2531. func (s SendMessageInput) String() string {
  2532. return awsutil.Prettify(s)
  2533. }
  2534. // GoString returns the string representation
  2535. func (s SendMessageInput) GoString() string {
  2536. return s.String()
  2537. }
  2538. // Validate inspects the fields of the type to determine if they are valid.
  2539. func (s *SendMessageInput) Validate() error {
  2540. invalidParams := request.ErrInvalidParams{Context: "SendMessageInput"}
  2541. if s.MessageBody == nil {
  2542. invalidParams.Add(request.NewErrParamRequired("MessageBody"))
  2543. }
  2544. if s.QueueUrl == nil {
  2545. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2546. }
  2547. if s.MessageAttributes != nil {
  2548. for i, v := range s.MessageAttributes {
  2549. if v == nil {
  2550. continue
  2551. }
  2552. if err := v.Validate(); err != nil {
  2553. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
  2554. }
  2555. }
  2556. }
  2557. if invalidParams.Len() > 0 {
  2558. return invalidParams
  2559. }
  2560. return nil
  2561. }
  2562. // The MD5OfMessageBody and MessageId elements.
  2563. type SendMessageOutput struct {
  2564. _ struct{} `type:"structure"`
  2565. // An MD5 digest of the non-URL-encoded message attribute string. This can be
  2566. // used to verify that Amazon SQS received the message correctly. Amazon SQS
  2567. // first URL decodes the message before creating the MD5 digest. For information
  2568. // about MD5, go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  2569. MD5OfMessageAttributes *string `type:"string"`
  2570. // An MD5 digest of the non-URL-encoded message body string. This can be used
  2571. // to verify that Amazon SQS received the message correctly. Amazon SQS first
  2572. // URL decodes the message before creating the MD5 digest. For information about
  2573. // MD5, go to http://www.faqs.org/rfcs/rfc1321.html (http://www.faqs.org/rfcs/rfc1321.html).
  2574. MD5OfMessageBody *string `type:"string"`
  2575. // An element containing the message ID of the message sent to the queue. For
  2576. // more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html)
  2577. // in the Amazon SQS Developer Guide.
  2578. MessageId *string `type:"string"`
  2579. }
  2580. // String returns the string representation
  2581. func (s SendMessageOutput) String() string {
  2582. return awsutil.Prettify(s)
  2583. }
  2584. // GoString returns the string representation
  2585. func (s SendMessageOutput) GoString() string {
  2586. return s.String()
  2587. }
  2588. type SetQueueAttributesInput struct {
  2589. _ struct{} `type:"structure"`
  2590. // A map of attributes to set.
  2591. //
  2592. // The following lists the names, descriptions, and values of the special request
  2593. // parameters the SetQueueAttributes action uses:
  2594. //
  2595. // * DelaySeconds - The time in seconds that the delivery of all messages
  2596. // in the queue will be delayed. An integer from 0 to 900 (15 minutes). The
  2597. // default for this attribute is 0 (zero).
  2598. //
  2599. // * MaximumMessageSize - The limit of how many bytes a message can contain
  2600. // before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to
  2601. // 262144 bytes (256 KiB). The default for this attribute is 262144 (256
  2602. // KiB).
  2603. //
  2604. // * MessageRetentionPeriod - The number of seconds Amazon SQS retains a
  2605. // message. Integer representing seconds, from 60 (1 minute) to 1209600 (14
  2606. // days). The default for this attribute is 345600 (4 days).
  2607. //
  2608. // * Policy - The queue's policy. A valid AWS policy. For more information
  2609. // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html)
  2610. // in the Amazon IAM User Guide.
  2611. //
  2612. // * ReceiveMessageWaitTimeSeconds - The time for which a ReceiveMessage
  2613. // call will wait for a message to arrive. An integer from 0 to 20 (seconds).
  2614. // The default for this attribute is 0.
  2615. //
  2616. // * VisibilityTimeout - The visibility timeout for the queue. An integer
  2617. // from 0 to 43200 (12 hours). The default for this attribute is 30. For
  2618. // more information about visibility timeout, see Visibility Timeout in the
  2619. // Amazon SQS Developer Guide.
  2620. //
  2621. // * RedrivePolicy - The parameters for dead letter queue functionality of
  2622. // the source queue. For more information about RedrivePolicy and dead letter
  2623. // queues, see Using Amazon SQS Dead Letter Queues in the Amazon SQS Developer
  2624. // Guide.
  2625. //
  2626. // Any other valid special request parameters that are specified (such as ApproximateNumberOfMessages,
  2627. // ApproximateNumberOfMessagesDelayed, ApproximateNumberOfMessagesNotVisible,
  2628. // CreatedTimestamp, LastModifiedTimestamp, and QueueArn) will be ignored.
  2629. //
  2630. // Attributes is a required field
  2631. Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true" required:"true"`
  2632. // The URL of the Amazon SQS queue to take action on.
  2633. //
  2634. // Queue URLs are case-sensitive.
  2635. //
  2636. // QueueUrl is a required field
  2637. QueueUrl *string `type:"string" required:"true"`
  2638. }
  2639. // String returns the string representation
  2640. func (s SetQueueAttributesInput) String() string {
  2641. return awsutil.Prettify(s)
  2642. }
  2643. // GoString returns the string representation
  2644. func (s SetQueueAttributesInput) GoString() string {
  2645. return s.String()
  2646. }
  2647. // Validate inspects the fields of the type to determine if they are valid.
  2648. func (s *SetQueueAttributesInput) Validate() error {
  2649. invalidParams := request.ErrInvalidParams{Context: "SetQueueAttributesInput"}
  2650. if s.Attributes == nil {
  2651. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  2652. }
  2653. if s.QueueUrl == nil {
  2654. invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
  2655. }
  2656. if invalidParams.Len() > 0 {
  2657. return invalidParams
  2658. }
  2659. return nil
  2660. }
  2661. type SetQueueAttributesOutput struct {
  2662. _ struct{} `type:"structure"`
  2663. }
  2664. // String returns the string representation
  2665. func (s SetQueueAttributesOutput) String() string {
  2666. return awsutil.Prettify(s)
  2667. }
  2668. // GoString returns the string representation
  2669. func (s SetQueueAttributesOutput) GoString() string {
  2670. return s.String()
  2671. }
  2672. const (
  2673. // QueueAttributeNamePolicy is a QueueAttributeName enum value
  2674. QueueAttributeNamePolicy = "Policy"
  2675. // QueueAttributeNameVisibilityTimeout is a QueueAttributeName enum value
  2676. QueueAttributeNameVisibilityTimeout = "VisibilityTimeout"
  2677. // QueueAttributeNameMaximumMessageSize is a QueueAttributeName enum value
  2678. QueueAttributeNameMaximumMessageSize = "MaximumMessageSize"
  2679. // QueueAttributeNameMessageRetentionPeriod is a QueueAttributeName enum value
  2680. QueueAttributeNameMessageRetentionPeriod = "MessageRetentionPeriod"
  2681. // QueueAttributeNameApproximateNumberOfMessages is a QueueAttributeName enum value
  2682. QueueAttributeNameApproximateNumberOfMessages = "ApproximateNumberOfMessages"
  2683. // QueueAttributeNameApproximateNumberOfMessagesNotVisible is a QueueAttributeName enum value
  2684. QueueAttributeNameApproximateNumberOfMessagesNotVisible = "ApproximateNumberOfMessagesNotVisible"
  2685. // QueueAttributeNameCreatedTimestamp is a QueueAttributeName enum value
  2686. QueueAttributeNameCreatedTimestamp = "CreatedTimestamp"
  2687. // QueueAttributeNameLastModifiedTimestamp is a QueueAttributeName enum value
  2688. QueueAttributeNameLastModifiedTimestamp = "LastModifiedTimestamp"
  2689. // QueueAttributeNameQueueArn is a QueueAttributeName enum value
  2690. QueueAttributeNameQueueArn = "QueueArn"
  2691. // QueueAttributeNameApproximateNumberOfMessagesDelayed is a QueueAttributeName enum value
  2692. QueueAttributeNameApproximateNumberOfMessagesDelayed = "ApproximateNumberOfMessagesDelayed"
  2693. // QueueAttributeNameDelaySeconds is a QueueAttributeName enum value
  2694. QueueAttributeNameDelaySeconds = "DelaySeconds"
  2695. // QueueAttributeNameReceiveMessageWaitTimeSeconds is a QueueAttributeName enum value
  2696. QueueAttributeNameReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds"
  2697. // QueueAttributeNameRedrivePolicy is a QueueAttributeName enum value
  2698. QueueAttributeNameRedrivePolicy = "RedrivePolicy"
  2699. )