api.go 94 KB

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