api.go 155 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package sns provides a client for Amazon Simple Notification Service.
  3. package sns
  4. import (
  5. "fmt"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/query"
  10. )
  11. const opAddPermission = "AddPermission"
  12. // AddPermissionRequest generates a "aws/request.Request" representing the
  13. // client's request for the AddPermission operation. The "output" return
  14. // value can be used to capture response data after the request's "Send" method
  15. // is called.
  16. //
  17. // See AddPermission for usage and error information.
  18. //
  19. // Creating a request object using this method should be used when you want to inject
  20. // custom logic into the request's lifecycle using a custom handler, or if you want to
  21. // access properties on the request object before or after sending the request. If
  22. // you just want the service response, call the AddPermission method directly
  23. // instead.
  24. //
  25. // Note: You must call the "Send" method on the returned request object in order
  26. // to execute the request.
  27. //
  28. // // Example sending a request using the AddPermissionRequest method.
  29. // req, resp := client.AddPermissionRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. func (c *SNS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) {
  37. op := &request.Operation{
  38. Name: opAddPermission,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &AddPermissionInput{}
  44. }
  45. req = c.newRequest(op, input, output)
  46. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  47. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  48. output = &AddPermissionOutput{}
  49. req.Data = output
  50. return
  51. }
  52. // AddPermission API operation for Amazon Simple Notification Service.
  53. //
  54. // Adds a statement to a topic's access control policy, granting access for
  55. // the specified AWS accounts to the specified actions.
  56. //
  57. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  58. // with awserr.Error's Code and Message methods to get detailed information about
  59. // the error.
  60. //
  61. // See the AWS API reference guide for Amazon Simple Notification Service's
  62. // API operation AddPermission for usage and error information.
  63. //
  64. // Returned Error Codes:
  65. // * InvalidParameter
  66. // Indicates that a request parameter does not comply with the associated constraints.
  67. //
  68. // * InternalError
  69. // Indicates an internal service error.
  70. //
  71. // * AuthorizationError
  72. // Indicates that the user has been denied access to the requested resource.
  73. //
  74. // * NotFound
  75. // Indicates that the requested resource does not exist.
  76. //
  77. func (c *SNS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
  78. req, out := c.AddPermissionRequest(input)
  79. err := req.Send()
  80. return out, err
  81. }
  82. const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut"
  83. // CheckIfPhoneNumberIsOptedOutRequest generates a "aws/request.Request" representing the
  84. // client's request for the CheckIfPhoneNumberIsOptedOut operation. The "output" return
  85. // value can be used to capture response data after the request's "Send" method
  86. // is called.
  87. //
  88. // See CheckIfPhoneNumberIsOptedOut for usage and error information.
  89. //
  90. // Creating a request object using this method should be used when you want to inject
  91. // custom logic into the request's lifecycle using a custom handler, or if you want to
  92. // access properties on the request object before or after sending the request. If
  93. // you just want the service response, call the CheckIfPhoneNumberIsOptedOut method directly
  94. // instead.
  95. //
  96. // Note: You must call the "Send" method on the returned request object in order
  97. // to execute the request.
  98. //
  99. // // Example sending a request using the CheckIfPhoneNumberIsOptedOutRequest method.
  100. // req, resp := client.CheckIfPhoneNumberIsOptedOutRequest(params)
  101. //
  102. // err := req.Send()
  103. // if err == nil { // resp is now filled
  104. // fmt.Println(resp)
  105. // }
  106. //
  107. func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOptedOutInput) (req *request.Request, output *CheckIfPhoneNumberIsOptedOutOutput) {
  108. op := &request.Operation{
  109. Name: opCheckIfPhoneNumberIsOptedOut,
  110. HTTPMethod: "POST",
  111. HTTPPath: "/",
  112. }
  113. if input == nil {
  114. input = &CheckIfPhoneNumberIsOptedOutInput{}
  115. }
  116. req = c.newRequest(op, input, output)
  117. output = &CheckIfPhoneNumberIsOptedOutOutput{}
  118. req.Data = output
  119. return
  120. }
  121. // CheckIfPhoneNumberIsOptedOut API operation for Amazon Simple Notification Service.
  122. //
  123. // Accepts a phone number and indicates whether the phone holder has opted out
  124. // of receiving SMS messages from your account. You cannot send SMS messages
  125. // to a number that is opted out.
  126. //
  127. // To resume sending messages, you can opt in the number by using the OptInPhoneNumber
  128. // action.
  129. //
  130. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  131. // with awserr.Error's Code and Message methods to get detailed information about
  132. // the error.
  133. //
  134. // See the AWS API reference guide for Amazon Simple Notification Service's
  135. // API operation CheckIfPhoneNumberIsOptedOut for usage and error information.
  136. //
  137. // Returned Error Codes:
  138. // * Throttled
  139. // Indicates that the rate at which requests have been submitted for this action
  140. // exceeds the limit for your account.
  141. //
  142. // * InternalError
  143. // Indicates an internal service error.
  144. //
  145. // * AuthorizationError
  146. // Indicates that the user has been denied access to the requested resource.
  147. //
  148. // * InvalidParameter
  149. // Indicates that a request parameter does not comply with the associated constraints.
  150. //
  151. func (c *SNS) CheckIfPhoneNumberIsOptedOut(input *CheckIfPhoneNumberIsOptedOutInput) (*CheckIfPhoneNumberIsOptedOutOutput, error) {
  152. req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input)
  153. err := req.Send()
  154. return out, err
  155. }
  156. const opConfirmSubscription = "ConfirmSubscription"
  157. // ConfirmSubscriptionRequest generates a "aws/request.Request" representing the
  158. // client's request for the ConfirmSubscription operation. The "output" return
  159. // value can be used to capture response data after the request's "Send" method
  160. // is called.
  161. //
  162. // See ConfirmSubscription for usage and error information.
  163. //
  164. // Creating a request object using this method should be used when you want to inject
  165. // custom logic into the request's lifecycle using a custom handler, or if you want to
  166. // access properties on the request object before or after sending the request. If
  167. // you just want the service response, call the ConfirmSubscription method directly
  168. // instead.
  169. //
  170. // Note: You must call the "Send" method on the returned request object in order
  171. // to execute the request.
  172. //
  173. // // Example sending a request using the ConfirmSubscriptionRequest method.
  174. // req, resp := client.ConfirmSubscriptionRequest(params)
  175. //
  176. // err := req.Send()
  177. // if err == nil { // resp is now filled
  178. // fmt.Println(resp)
  179. // }
  180. //
  181. func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) (req *request.Request, output *ConfirmSubscriptionOutput) {
  182. op := &request.Operation{
  183. Name: opConfirmSubscription,
  184. HTTPMethod: "POST",
  185. HTTPPath: "/",
  186. }
  187. if input == nil {
  188. input = &ConfirmSubscriptionInput{}
  189. }
  190. req = c.newRequest(op, input, output)
  191. output = &ConfirmSubscriptionOutput{}
  192. req.Data = output
  193. return
  194. }
  195. // ConfirmSubscription API operation for Amazon Simple Notification Service.
  196. //
  197. // Verifies an endpoint owner's intent to receive messages by validating the
  198. // token sent to the endpoint by an earlier Subscribe action. If the token is
  199. // valid, the action creates a new subscription and returns its Amazon Resource
  200. // Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe
  201. // flag is set to "true".
  202. //
  203. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  204. // with awserr.Error's Code and Message methods to get detailed information about
  205. // the error.
  206. //
  207. // See the AWS API reference guide for Amazon Simple Notification Service's
  208. // API operation ConfirmSubscription for usage and error information.
  209. //
  210. // Returned Error Codes:
  211. // * SubscriptionLimitExceeded
  212. // Indicates that the customer already owns the maximum allowed number of subscriptions.
  213. //
  214. // * InvalidParameter
  215. // Indicates that a request parameter does not comply with the associated constraints.
  216. //
  217. // * NotFound
  218. // Indicates that the requested resource does not exist.
  219. //
  220. // * InternalError
  221. // Indicates an internal service error.
  222. //
  223. // * AuthorizationError
  224. // Indicates that the user has been denied access to the requested resource.
  225. //
  226. func (c *SNS) ConfirmSubscription(input *ConfirmSubscriptionInput) (*ConfirmSubscriptionOutput, error) {
  227. req, out := c.ConfirmSubscriptionRequest(input)
  228. err := req.Send()
  229. return out, err
  230. }
  231. const opCreatePlatformApplication = "CreatePlatformApplication"
  232. // CreatePlatformApplicationRequest generates a "aws/request.Request" representing the
  233. // client's request for the CreatePlatformApplication operation. The "output" return
  234. // value can be used to capture response data after the request's "Send" method
  235. // is called.
  236. //
  237. // See CreatePlatformApplication for usage and error information.
  238. //
  239. // Creating a request object using this method should be used when you want to inject
  240. // custom logic into the request's lifecycle using a custom handler, or if you want to
  241. // access properties on the request object before or after sending the request. If
  242. // you just want the service response, call the CreatePlatformApplication method directly
  243. // instead.
  244. //
  245. // Note: You must call the "Send" method on the returned request object in order
  246. // to execute the request.
  247. //
  248. // // Example sending a request using the CreatePlatformApplicationRequest method.
  249. // req, resp := client.CreatePlatformApplicationRequest(params)
  250. //
  251. // err := req.Send()
  252. // if err == nil { // resp is now filled
  253. // fmt.Println(resp)
  254. // }
  255. //
  256. func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationInput) (req *request.Request, output *CreatePlatformApplicationOutput) {
  257. op := &request.Operation{
  258. Name: opCreatePlatformApplication,
  259. HTTPMethod: "POST",
  260. HTTPPath: "/",
  261. }
  262. if input == nil {
  263. input = &CreatePlatformApplicationInput{}
  264. }
  265. req = c.newRequest(op, input, output)
  266. output = &CreatePlatformApplicationOutput{}
  267. req.Data = output
  268. return
  269. }
  270. // CreatePlatformApplication API operation for Amazon Simple Notification Service.
  271. //
  272. // Creates a platform application object for one of the supported push notification
  273. // services, such as APNS and GCM, to which devices and mobile apps may register.
  274. // You must specify PlatformPrincipal and PlatformCredential attributes when
  275. // using the CreatePlatformApplication action. The PlatformPrincipal is received
  276. // from the notification service. For APNS/APNS_SANDBOX, PlatformPrincipal is
  277. // "SSL certificate". For GCM, PlatformPrincipal is not applicable. For ADM,
  278. // PlatformPrincipal is "client id". The PlatformCredential is also received
  279. // from the notification service. For WNS, PlatformPrincipal is "Package Security
  280. // Identifier". For MPNS, PlatformPrincipal is "TLS certificate". For Baidu,
  281. // PlatformPrincipal is "API key".
  282. //
  283. // For APNS/APNS_SANDBOX, PlatformCredential is "private key". For GCM, PlatformCredential
  284. // is "API key". For ADM, PlatformCredential is "client secret". For WNS, PlatformCredential
  285. // is "secret key". For MPNS, PlatformCredential is "private key". For Baidu,
  286. // PlatformCredential is "secret key". The PlatformApplicationArn that is returned
  287. // when using CreatePlatformApplication is then used as an attribute for the
  288. // CreatePlatformEndpoint action. For more information, see Using Amazon SNS
  289. // Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  290. // For more information about obtaining the PlatformPrincipal and PlatformCredential
  291. // for each of the supported push notification services, see Getting Started
  292. // with Apple Push Notification Service (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html),
  293. // Getting Started with Amazon Device Messaging (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html),
  294. // Getting Started with Baidu Cloud Push (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-baidu.html),
  295. // Getting Started with Google Cloud Messaging for Android (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html),
  296. // Getting Started with MPNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-mpns.html),
  297. // or Getting Started with WNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-wns.html).
  298. //
  299. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  300. // with awserr.Error's Code and Message methods to get detailed information about
  301. // the error.
  302. //
  303. // See the AWS API reference guide for Amazon Simple Notification Service's
  304. // API operation CreatePlatformApplication for usage and error information.
  305. //
  306. // Returned Error Codes:
  307. // * InvalidParameter
  308. // Indicates that a request parameter does not comply with the associated constraints.
  309. //
  310. // * InternalError
  311. // Indicates an internal service error.
  312. //
  313. // * AuthorizationError
  314. // Indicates that the user has been denied access to the requested resource.
  315. //
  316. func (c *SNS) CreatePlatformApplication(input *CreatePlatformApplicationInput) (*CreatePlatformApplicationOutput, error) {
  317. req, out := c.CreatePlatformApplicationRequest(input)
  318. err := req.Send()
  319. return out, err
  320. }
  321. const opCreatePlatformEndpoint = "CreatePlatformEndpoint"
  322. // CreatePlatformEndpointRequest generates a "aws/request.Request" representing the
  323. // client's request for the CreatePlatformEndpoint operation. The "output" return
  324. // value can be used to capture response data after the request's "Send" method
  325. // is called.
  326. //
  327. // See CreatePlatformEndpoint for usage and error information.
  328. //
  329. // Creating a request object using this method should be used when you want to inject
  330. // custom logic into the request's lifecycle using a custom handler, or if you want to
  331. // access properties on the request object before or after sending the request. If
  332. // you just want the service response, call the CreatePlatformEndpoint method directly
  333. // instead.
  334. //
  335. // Note: You must call the "Send" method on the returned request object in order
  336. // to execute the request.
  337. //
  338. // // Example sending a request using the CreatePlatformEndpointRequest method.
  339. // req, resp := client.CreatePlatformEndpointRequest(params)
  340. //
  341. // err := req.Send()
  342. // if err == nil { // resp is now filled
  343. // fmt.Println(resp)
  344. // }
  345. //
  346. func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) (req *request.Request, output *CreatePlatformEndpointOutput) {
  347. op := &request.Operation{
  348. Name: opCreatePlatformEndpoint,
  349. HTTPMethod: "POST",
  350. HTTPPath: "/",
  351. }
  352. if input == nil {
  353. input = &CreatePlatformEndpointInput{}
  354. }
  355. req = c.newRequest(op, input, output)
  356. output = &CreatePlatformEndpointOutput{}
  357. req.Data = output
  358. return
  359. }
  360. // CreatePlatformEndpoint API operation for Amazon Simple Notification Service.
  361. //
  362. // Creates an endpoint for a device and mobile app on one of the supported push
  363. // notification services, such as GCM and APNS. CreatePlatformEndpoint requires
  364. // the PlatformApplicationArn that is returned from CreatePlatformApplication.
  365. // The EndpointArn that is returned when using CreatePlatformEndpoint can then
  366. // be used by the Publish action to send a message to a mobile app or by the
  367. // Subscribe action for subscription to a topic. The CreatePlatformEndpoint
  368. // action is idempotent, so if the requester already owns an endpoint with the
  369. // same device token and attributes, that endpoint's ARN is returned without
  370. // creating a new endpoint. For more information, see Using Amazon SNS Mobile
  371. // Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  372. //
  373. // When using CreatePlatformEndpoint with Baidu, two attributes must be provided:
  374. // ChannelId and UserId. The token field must also contain the ChannelId. For
  375. // more information, see Creating an Amazon SNS Endpoint for Baidu (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.html).
  376. //
  377. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  378. // with awserr.Error's Code and Message methods to get detailed information about
  379. // the error.
  380. //
  381. // See the AWS API reference guide for Amazon Simple Notification Service's
  382. // API operation CreatePlatformEndpoint for usage and error information.
  383. //
  384. // Returned Error Codes:
  385. // * InvalidParameter
  386. // Indicates that a request parameter does not comply with the associated constraints.
  387. //
  388. // * InternalError
  389. // Indicates an internal service error.
  390. //
  391. // * AuthorizationError
  392. // Indicates that the user has been denied access to the requested resource.
  393. //
  394. // * NotFound
  395. // Indicates that the requested resource does not exist.
  396. //
  397. func (c *SNS) CreatePlatformEndpoint(input *CreatePlatformEndpointInput) (*CreatePlatformEndpointOutput, error) {
  398. req, out := c.CreatePlatformEndpointRequest(input)
  399. err := req.Send()
  400. return out, err
  401. }
  402. const opCreateTopic = "CreateTopic"
  403. // CreateTopicRequest generates a "aws/request.Request" representing the
  404. // client's request for the CreateTopic operation. The "output" return
  405. // value can be used to capture response data after the request's "Send" method
  406. // is called.
  407. //
  408. // See CreateTopic for usage and error information.
  409. //
  410. // Creating a request object using this method should be used when you want to inject
  411. // custom logic into the request's lifecycle using a custom handler, or if you want to
  412. // access properties on the request object before or after sending the request. If
  413. // you just want the service response, call the CreateTopic method directly
  414. // instead.
  415. //
  416. // Note: You must call the "Send" method on the returned request object in order
  417. // to execute the request.
  418. //
  419. // // Example sending a request using the CreateTopicRequest method.
  420. // req, resp := client.CreateTopicRequest(params)
  421. //
  422. // err := req.Send()
  423. // if err == nil { // resp is now filled
  424. // fmt.Println(resp)
  425. // }
  426. //
  427. func (c *SNS) CreateTopicRequest(input *CreateTopicInput) (req *request.Request, output *CreateTopicOutput) {
  428. op := &request.Operation{
  429. Name: opCreateTopic,
  430. HTTPMethod: "POST",
  431. HTTPPath: "/",
  432. }
  433. if input == nil {
  434. input = &CreateTopicInput{}
  435. }
  436. req = c.newRequest(op, input, output)
  437. output = &CreateTopicOutput{}
  438. req.Data = output
  439. return
  440. }
  441. // CreateTopic API operation for Amazon Simple Notification Service.
  442. //
  443. // Creates a topic to which notifications can be published. Users can create
  444. // at most 100,000 topics. For more information, see http://aws.amazon.com/sns
  445. // (http://aws.amazon.com/sns/). This action is idempotent, so if the requester
  446. // already owns a topic with the specified name, that topic's ARN is returned
  447. // without creating a new topic.
  448. //
  449. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  450. // with awserr.Error's Code and Message methods to get detailed information about
  451. // the error.
  452. //
  453. // See the AWS API reference guide for Amazon Simple Notification Service's
  454. // API operation CreateTopic for usage and error information.
  455. //
  456. // Returned Error Codes:
  457. // * InvalidParameter
  458. // Indicates that a request parameter does not comply with the associated constraints.
  459. //
  460. // * TopicLimitExceeded
  461. // Indicates that the customer already owns the maximum allowed number of topics.
  462. //
  463. // * InternalError
  464. // Indicates an internal service error.
  465. //
  466. // * AuthorizationError
  467. // Indicates that the user has been denied access to the requested resource.
  468. //
  469. func (c *SNS) CreateTopic(input *CreateTopicInput) (*CreateTopicOutput, error) {
  470. req, out := c.CreateTopicRequest(input)
  471. err := req.Send()
  472. return out, err
  473. }
  474. const opDeleteEndpoint = "DeleteEndpoint"
  475. // DeleteEndpointRequest generates a "aws/request.Request" representing the
  476. // client's request for the DeleteEndpoint operation. The "output" return
  477. // value can be used to capture response data after the request's "Send" method
  478. // is called.
  479. //
  480. // See DeleteEndpoint for usage and error information.
  481. //
  482. // Creating a request object using this method should be used when you want to inject
  483. // custom logic into the request's lifecycle using a custom handler, or if you want to
  484. // access properties on the request object before or after sending the request. If
  485. // you just want the service response, call the DeleteEndpoint method directly
  486. // instead.
  487. //
  488. // Note: You must call the "Send" method on the returned request object in order
  489. // to execute the request.
  490. //
  491. // // Example sending a request using the DeleteEndpointRequest method.
  492. // req, resp := client.DeleteEndpointRequest(params)
  493. //
  494. // err := req.Send()
  495. // if err == nil { // resp is now filled
  496. // fmt.Println(resp)
  497. // }
  498. //
  499. func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) {
  500. op := &request.Operation{
  501. Name: opDeleteEndpoint,
  502. HTTPMethod: "POST",
  503. HTTPPath: "/",
  504. }
  505. if input == nil {
  506. input = &DeleteEndpointInput{}
  507. }
  508. req = c.newRequest(op, input, output)
  509. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  510. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  511. output = &DeleteEndpointOutput{}
  512. req.Data = output
  513. return
  514. }
  515. // DeleteEndpoint API operation for Amazon Simple Notification Service.
  516. //
  517. // Deletes the endpoint for a device and mobile app from Amazon SNS. This action
  518. // is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications
  519. // (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  520. //
  521. // When you delete an endpoint that is also subscribed to a topic, then you
  522. // must also unsubscribe the endpoint from the topic.
  523. //
  524. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  525. // with awserr.Error's Code and Message methods to get detailed information about
  526. // the error.
  527. //
  528. // See the AWS API reference guide for Amazon Simple Notification Service's
  529. // API operation DeleteEndpoint for usage and error information.
  530. //
  531. // Returned Error Codes:
  532. // * InvalidParameter
  533. // Indicates that a request parameter does not comply with the associated constraints.
  534. //
  535. // * InternalError
  536. // Indicates an internal service error.
  537. //
  538. // * AuthorizationError
  539. // Indicates that the user has been denied access to the requested resource.
  540. //
  541. func (c *SNS) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) {
  542. req, out := c.DeleteEndpointRequest(input)
  543. err := req.Send()
  544. return out, err
  545. }
  546. const opDeletePlatformApplication = "DeletePlatformApplication"
  547. // DeletePlatformApplicationRequest generates a "aws/request.Request" representing the
  548. // client's request for the DeletePlatformApplication operation. The "output" return
  549. // value can be used to capture response data after the request's "Send" method
  550. // is called.
  551. //
  552. // See DeletePlatformApplication for usage and error information.
  553. //
  554. // Creating a request object using this method should be used when you want to inject
  555. // custom logic into the request's lifecycle using a custom handler, or if you want to
  556. // access properties on the request object before or after sending the request. If
  557. // you just want the service response, call the DeletePlatformApplication method directly
  558. // instead.
  559. //
  560. // Note: You must call the "Send" method on the returned request object in order
  561. // to execute the request.
  562. //
  563. // // Example sending a request using the DeletePlatformApplicationRequest method.
  564. // req, resp := client.DeletePlatformApplicationRequest(params)
  565. //
  566. // err := req.Send()
  567. // if err == nil { // resp is now filled
  568. // fmt.Println(resp)
  569. // }
  570. //
  571. func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationInput) (req *request.Request, output *DeletePlatformApplicationOutput) {
  572. op := &request.Operation{
  573. Name: opDeletePlatformApplication,
  574. HTTPMethod: "POST",
  575. HTTPPath: "/",
  576. }
  577. if input == nil {
  578. input = &DeletePlatformApplicationInput{}
  579. }
  580. req = c.newRequest(op, input, output)
  581. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  582. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  583. output = &DeletePlatformApplicationOutput{}
  584. req.Data = output
  585. return
  586. }
  587. // DeletePlatformApplication API operation for Amazon Simple Notification Service.
  588. //
  589. // Deletes a platform application object for one of the supported push notification
  590. // services, such as APNS and GCM. For more information, see Using Amazon SNS
  591. // Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  592. //
  593. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  594. // with awserr.Error's Code and Message methods to get detailed information about
  595. // the error.
  596. //
  597. // See the AWS API reference guide for Amazon Simple Notification Service's
  598. // API operation DeletePlatformApplication for usage and error information.
  599. //
  600. // Returned Error Codes:
  601. // * InvalidParameter
  602. // Indicates that a request parameter does not comply with the associated constraints.
  603. //
  604. // * InternalError
  605. // Indicates an internal service error.
  606. //
  607. // * AuthorizationError
  608. // Indicates that the user has been denied access to the requested resource.
  609. //
  610. func (c *SNS) DeletePlatformApplication(input *DeletePlatformApplicationInput) (*DeletePlatformApplicationOutput, error) {
  611. req, out := c.DeletePlatformApplicationRequest(input)
  612. err := req.Send()
  613. return out, err
  614. }
  615. const opDeleteTopic = "DeleteTopic"
  616. // DeleteTopicRequest generates a "aws/request.Request" representing the
  617. // client's request for the DeleteTopic operation. The "output" return
  618. // value can be used to capture response data after the request's "Send" method
  619. // is called.
  620. //
  621. // See DeleteTopic for usage and error information.
  622. //
  623. // Creating a request object using this method should be used when you want to inject
  624. // custom logic into the request's lifecycle using a custom handler, or if you want to
  625. // access properties on the request object before or after sending the request. If
  626. // you just want the service response, call the DeleteTopic method directly
  627. // instead.
  628. //
  629. // Note: You must call the "Send" method on the returned request object in order
  630. // to execute the request.
  631. //
  632. // // Example sending a request using the DeleteTopicRequest method.
  633. // req, resp := client.DeleteTopicRequest(params)
  634. //
  635. // err := req.Send()
  636. // if err == nil { // resp is now filled
  637. // fmt.Println(resp)
  638. // }
  639. //
  640. func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) (req *request.Request, output *DeleteTopicOutput) {
  641. op := &request.Operation{
  642. Name: opDeleteTopic,
  643. HTTPMethod: "POST",
  644. HTTPPath: "/",
  645. }
  646. if input == nil {
  647. input = &DeleteTopicInput{}
  648. }
  649. req = c.newRequest(op, input, output)
  650. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  651. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  652. output = &DeleteTopicOutput{}
  653. req.Data = output
  654. return
  655. }
  656. // DeleteTopic API operation for Amazon Simple Notification Service.
  657. //
  658. // Deletes a topic and all its subscriptions. Deleting a topic might prevent
  659. // some messages previously sent to the topic from being delivered to subscribers.
  660. // This action is idempotent, so deleting a topic that does not exist does not
  661. // result in an error.
  662. //
  663. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  664. // with awserr.Error's Code and Message methods to get detailed information about
  665. // the error.
  666. //
  667. // See the AWS API reference guide for Amazon Simple Notification Service's
  668. // API operation DeleteTopic for usage and error information.
  669. //
  670. // Returned Error Codes:
  671. // * InvalidParameter
  672. // Indicates that a request parameter does not comply with the associated constraints.
  673. //
  674. // * InternalError
  675. // Indicates an internal service error.
  676. //
  677. // * AuthorizationError
  678. // Indicates that the user has been denied access to the requested resource.
  679. //
  680. // * NotFound
  681. // Indicates that the requested resource does not exist.
  682. //
  683. func (c *SNS) DeleteTopic(input *DeleteTopicInput) (*DeleteTopicOutput, error) {
  684. req, out := c.DeleteTopicRequest(input)
  685. err := req.Send()
  686. return out, err
  687. }
  688. const opGetEndpointAttributes = "GetEndpointAttributes"
  689. // GetEndpointAttributesRequest generates a "aws/request.Request" representing the
  690. // client's request for the GetEndpointAttributes operation. The "output" return
  691. // value can be used to capture response data after the request's "Send" method
  692. // is called.
  693. //
  694. // See GetEndpointAttributes for usage and error information.
  695. //
  696. // Creating a request object using this method should be used when you want to inject
  697. // custom logic into the request's lifecycle using a custom handler, or if you want to
  698. // access properties on the request object before or after sending the request. If
  699. // you just want the service response, call the GetEndpointAttributes method directly
  700. // instead.
  701. //
  702. // Note: You must call the "Send" method on the returned request object in order
  703. // to execute the request.
  704. //
  705. // // Example sending a request using the GetEndpointAttributesRequest method.
  706. // req, resp := client.GetEndpointAttributesRequest(params)
  707. //
  708. // err := req.Send()
  709. // if err == nil { // resp is now filled
  710. // fmt.Println(resp)
  711. // }
  712. //
  713. func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (req *request.Request, output *GetEndpointAttributesOutput) {
  714. op := &request.Operation{
  715. Name: opGetEndpointAttributes,
  716. HTTPMethod: "POST",
  717. HTTPPath: "/",
  718. }
  719. if input == nil {
  720. input = &GetEndpointAttributesInput{}
  721. }
  722. req = c.newRequest(op, input, output)
  723. output = &GetEndpointAttributesOutput{}
  724. req.Data = output
  725. return
  726. }
  727. // GetEndpointAttributes API operation for Amazon Simple Notification Service.
  728. //
  729. // Retrieves the endpoint attributes for a device on one of the supported push
  730. // notification services, such as GCM and APNS. For more information, see Using
  731. // Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  732. //
  733. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  734. // with awserr.Error's Code and Message methods to get detailed information about
  735. // the error.
  736. //
  737. // See the AWS API reference guide for Amazon Simple Notification Service's
  738. // API operation GetEndpointAttributes for usage and error information.
  739. //
  740. // Returned Error Codes:
  741. // * InvalidParameter
  742. // Indicates that a request parameter does not comply with the associated constraints.
  743. //
  744. // * InternalError
  745. // Indicates an internal service error.
  746. //
  747. // * AuthorizationError
  748. // Indicates that the user has been denied access to the requested resource.
  749. //
  750. // * NotFound
  751. // Indicates that the requested resource does not exist.
  752. //
  753. func (c *SNS) GetEndpointAttributes(input *GetEndpointAttributesInput) (*GetEndpointAttributesOutput, error) {
  754. req, out := c.GetEndpointAttributesRequest(input)
  755. err := req.Send()
  756. return out, err
  757. }
  758. const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes"
  759. // GetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the
  760. // client's request for the GetPlatformApplicationAttributes operation. The "output" return
  761. // value can be used to capture response data after the request's "Send" method
  762. // is called.
  763. //
  764. // See GetPlatformApplicationAttributes for usage and error information.
  765. //
  766. // Creating a request object using this method should be used when you want to inject
  767. // custom logic into the request's lifecycle using a custom handler, or if you want to
  768. // access properties on the request object before or after sending the request. If
  769. // you just want the service response, call the GetPlatformApplicationAttributes method directly
  770. // instead.
  771. //
  772. // Note: You must call the "Send" method on the returned request object in order
  773. // to execute the request.
  774. //
  775. // // Example sending a request using the GetPlatformApplicationAttributesRequest method.
  776. // req, resp := client.GetPlatformApplicationAttributesRequest(params)
  777. //
  778. // err := req.Send()
  779. // if err == nil { // resp is now filled
  780. // fmt.Println(resp)
  781. // }
  782. //
  783. func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicationAttributesInput) (req *request.Request, output *GetPlatformApplicationAttributesOutput) {
  784. op := &request.Operation{
  785. Name: opGetPlatformApplicationAttributes,
  786. HTTPMethod: "POST",
  787. HTTPPath: "/",
  788. }
  789. if input == nil {
  790. input = &GetPlatformApplicationAttributesInput{}
  791. }
  792. req = c.newRequest(op, input, output)
  793. output = &GetPlatformApplicationAttributesOutput{}
  794. req.Data = output
  795. return
  796. }
  797. // GetPlatformApplicationAttributes API operation for Amazon Simple Notification Service.
  798. //
  799. // Retrieves the attributes of the platform application object for the supported
  800. // push notification services, such as APNS and GCM. For more information, see
  801. // Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  802. //
  803. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  804. // with awserr.Error's Code and Message methods to get detailed information about
  805. // the error.
  806. //
  807. // See the AWS API reference guide for Amazon Simple Notification Service's
  808. // API operation GetPlatformApplicationAttributes for usage and error information.
  809. //
  810. // Returned Error Codes:
  811. // * InvalidParameter
  812. // Indicates that a request parameter does not comply with the associated constraints.
  813. //
  814. // * InternalError
  815. // Indicates an internal service error.
  816. //
  817. // * AuthorizationError
  818. // Indicates that the user has been denied access to the requested resource.
  819. //
  820. // * NotFound
  821. // Indicates that the requested resource does not exist.
  822. //
  823. func (c *SNS) GetPlatformApplicationAttributes(input *GetPlatformApplicationAttributesInput) (*GetPlatformApplicationAttributesOutput, error) {
  824. req, out := c.GetPlatformApplicationAttributesRequest(input)
  825. err := req.Send()
  826. return out, err
  827. }
  828. const opGetSMSAttributes = "GetSMSAttributes"
  829. // GetSMSAttributesRequest generates a "aws/request.Request" representing the
  830. // client's request for the GetSMSAttributes operation. The "output" return
  831. // value can be used to capture response data after the request's "Send" method
  832. // is called.
  833. //
  834. // See GetSMSAttributes for usage and error information.
  835. //
  836. // Creating a request object using this method should be used when you want to inject
  837. // custom logic into the request's lifecycle using a custom handler, or if you want to
  838. // access properties on the request object before or after sending the request. If
  839. // you just want the service response, call the GetSMSAttributes method directly
  840. // instead.
  841. //
  842. // Note: You must call the "Send" method on the returned request object in order
  843. // to execute the request.
  844. //
  845. // // Example sending a request using the GetSMSAttributesRequest method.
  846. // req, resp := client.GetSMSAttributesRequest(params)
  847. //
  848. // err := req.Send()
  849. // if err == nil { // resp is now filled
  850. // fmt.Println(resp)
  851. // }
  852. //
  853. func (c *SNS) GetSMSAttributesRequest(input *GetSMSAttributesInput) (req *request.Request, output *GetSMSAttributesOutput) {
  854. op := &request.Operation{
  855. Name: opGetSMSAttributes,
  856. HTTPMethod: "POST",
  857. HTTPPath: "/",
  858. }
  859. if input == nil {
  860. input = &GetSMSAttributesInput{}
  861. }
  862. req = c.newRequest(op, input, output)
  863. output = &GetSMSAttributesOutput{}
  864. req.Data = output
  865. return
  866. }
  867. // GetSMSAttributes API operation for Amazon Simple Notification Service.
  868. //
  869. // Returns the settings for sending SMS messages from your account.
  870. //
  871. // These settings are set with the SetSMSAttributes action.
  872. //
  873. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  874. // with awserr.Error's Code and Message methods to get detailed information about
  875. // the error.
  876. //
  877. // See the AWS API reference guide for Amazon Simple Notification Service's
  878. // API operation GetSMSAttributes for usage and error information.
  879. //
  880. // Returned Error Codes:
  881. // * Throttled
  882. // Indicates that the rate at which requests have been submitted for this action
  883. // exceeds the limit for your account.
  884. //
  885. // * InternalError
  886. // Indicates an internal service error.
  887. //
  888. // * AuthorizationError
  889. // Indicates that the user has been denied access to the requested resource.
  890. //
  891. // * InvalidParameter
  892. // Indicates that a request parameter does not comply with the associated constraints.
  893. //
  894. func (c *SNS) GetSMSAttributes(input *GetSMSAttributesInput) (*GetSMSAttributesOutput, error) {
  895. req, out := c.GetSMSAttributesRequest(input)
  896. err := req.Send()
  897. return out, err
  898. }
  899. const opGetSubscriptionAttributes = "GetSubscriptionAttributes"
  900. // GetSubscriptionAttributesRequest generates a "aws/request.Request" representing the
  901. // client's request for the GetSubscriptionAttributes operation. The "output" return
  902. // value can be used to capture response data after the request's "Send" method
  903. // is called.
  904. //
  905. // See GetSubscriptionAttributes for usage and error information.
  906. //
  907. // Creating a request object using this method should be used when you want to inject
  908. // custom logic into the request's lifecycle using a custom handler, or if you want to
  909. // access properties on the request object before or after sending the request. If
  910. // you just want the service response, call the GetSubscriptionAttributes method directly
  911. // instead.
  912. //
  913. // Note: You must call the "Send" method on the returned request object in order
  914. // to execute the request.
  915. //
  916. // // Example sending a request using the GetSubscriptionAttributesRequest method.
  917. // req, resp := client.GetSubscriptionAttributesRequest(params)
  918. //
  919. // err := req.Send()
  920. // if err == nil { // resp is now filled
  921. // fmt.Println(resp)
  922. // }
  923. //
  924. func (c *SNS) GetSubscriptionAttributesRequest(input *GetSubscriptionAttributesInput) (req *request.Request, output *GetSubscriptionAttributesOutput) {
  925. op := &request.Operation{
  926. Name: opGetSubscriptionAttributes,
  927. HTTPMethod: "POST",
  928. HTTPPath: "/",
  929. }
  930. if input == nil {
  931. input = &GetSubscriptionAttributesInput{}
  932. }
  933. req = c.newRequest(op, input, output)
  934. output = &GetSubscriptionAttributesOutput{}
  935. req.Data = output
  936. return
  937. }
  938. // GetSubscriptionAttributes API operation for Amazon Simple Notification Service.
  939. //
  940. // Returns all of the properties of a subscription.
  941. //
  942. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  943. // with awserr.Error's Code and Message methods to get detailed information about
  944. // the error.
  945. //
  946. // See the AWS API reference guide for Amazon Simple Notification Service's
  947. // API operation GetSubscriptionAttributes for usage and error information.
  948. //
  949. // Returned Error Codes:
  950. // * InvalidParameter
  951. // Indicates that a request parameter does not comply with the associated constraints.
  952. //
  953. // * InternalError
  954. // Indicates an internal service error.
  955. //
  956. // * NotFound
  957. // Indicates that the requested resource does not exist.
  958. //
  959. // * AuthorizationError
  960. // Indicates that the user has been denied access to the requested resource.
  961. //
  962. func (c *SNS) GetSubscriptionAttributes(input *GetSubscriptionAttributesInput) (*GetSubscriptionAttributesOutput, error) {
  963. req, out := c.GetSubscriptionAttributesRequest(input)
  964. err := req.Send()
  965. return out, err
  966. }
  967. const opGetTopicAttributes = "GetTopicAttributes"
  968. // GetTopicAttributesRequest generates a "aws/request.Request" representing the
  969. // client's request for the GetTopicAttributes operation. The "output" return
  970. // value can be used to capture response data after the request's "Send" method
  971. // is called.
  972. //
  973. // See GetTopicAttributes for usage and error information.
  974. //
  975. // Creating a request object using this method should be used when you want to inject
  976. // custom logic into the request's lifecycle using a custom handler, or if you want to
  977. // access properties on the request object before or after sending the request. If
  978. // you just want the service response, call the GetTopicAttributes method directly
  979. // instead.
  980. //
  981. // Note: You must call the "Send" method on the returned request object in order
  982. // to execute the request.
  983. //
  984. // // Example sending a request using the GetTopicAttributesRequest method.
  985. // req, resp := client.GetTopicAttributesRequest(params)
  986. //
  987. // err := req.Send()
  988. // if err == nil { // resp is now filled
  989. // fmt.Println(resp)
  990. // }
  991. //
  992. func (c *SNS) GetTopicAttributesRequest(input *GetTopicAttributesInput) (req *request.Request, output *GetTopicAttributesOutput) {
  993. op := &request.Operation{
  994. Name: opGetTopicAttributes,
  995. HTTPMethod: "POST",
  996. HTTPPath: "/",
  997. }
  998. if input == nil {
  999. input = &GetTopicAttributesInput{}
  1000. }
  1001. req = c.newRequest(op, input, output)
  1002. output = &GetTopicAttributesOutput{}
  1003. req.Data = output
  1004. return
  1005. }
  1006. // GetTopicAttributes API operation for Amazon Simple Notification Service.
  1007. //
  1008. // Returns all of the properties of a topic. Topic properties returned might
  1009. // differ based on the authorization of the user.
  1010. //
  1011. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1012. // with awserr.Error's Code and Message methods to get detailed information about
  1013. // the error.
  1014. //
  1015. // See the AWS API reference guide for Amazon Simple Notification Service's
  1016. // API operation GetTopicAttributes for usage and error information.
  1017. //
  1018. // Returned Error Codes:
  1019. // * InvalidParameter
  1020. // Indicates that a request parameter does not comply with the associated constraints.
  1021. //
  1022. // * InternalError
  1023. // Indicates an internal service error.
  1024. //
  1025. // * NotFound
  1026. // Indicates that the requested resource does not exist.
  1027. //
  1028. // * AuthorizationError
  1029. // Indicates that the user has been denied access to the requested resource.
  1030. //
  1031. func (c *SNS) GetTopicAttributes(input *GetTopicAttributesInput) (*GetTopicAttributesOutput, error) {
  1032. req, out := c.GetTopicAttributesRequest(input)
  1033. err := req.Send()
  1034. return out, err
  1035. }
  1036. const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication"
  1037. // ListEndpointsByPlatformApplicationRequest generates a "aws/request.Request" representing the
  1038. // client's request for the ListEndpointsByPlatformApplication operation. The "output" return
  1039. // value can be used to capture response data after the request's "Send" method
  1040. // is called.
  1041. //
  1042. // See ListEndpointsByPlatformApplication for usage and error information.
  1043. //
  1044. // Creating a request object using this method should be used when you want to inject
  1045. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1046. // access properties on the request object before or after sending the request. If
  1047. // you just want the service response, call the ListEndpointsByPlatformApplication method directly
  1048. // instead.
  1049. //
  1050. // Note: You must call the "Send" method on the returned request object in order
  1051. // to execute the request.
  1052. //
  1053. // // Example sending a request using the ListEndpointsByPlatformApplicationRequest method.
  1054. // req, resp := client.ListEndpointsByPlatformApplicationRequest(params)
  1055. //
  1056. // err := req.Send()
  1057. // if err == nil { // resp is now filled
  1058. // fmt.Println(resp)
  1059. // }
  1060. //
  1061. func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPlatformApplicationInput) (req *request.Request, output *ListEndpointsByPlatformApplicationOutput) {
  1062. op := &request.Operation{
  1063. Name: opListEndpointsByPlatformApplication,
  1064. HTTPMethod: "POST",
  1065. HTTPPath: "/",
  1066. Paginator: &request.Paginator{
  1067. InputTokens: []string{"NextToken"},
  1068. OutputTokens: []string{"NextToken"},
  1069. LimitToken: "",
  1070. TruncationToken: "",
  1071. },
  1072. }
  1073. if input == nil {
  1074. input = &ListEndpointsByPlatformApplicationInput{}
  1075. }
  1076. req = c.newRequest(op, input, output)
  1077. output = &ListEndpointsByPlatformApplicationOutput{}
  1078. req.Data = output
  1079. return
  1080. }
  1081. // ListEndpointsByPlatformApplication API operation for Amazon Simple Notification Service.
  1082. //
  1083. // Lists the endpoints and endpoint attributes for devices in a supported push
  1084. // notification service, such as GCM and APNS. The results for ListEndpointsByPlatformApplication
  1085. // are paginated and return a limited list of endpoints, up to 100. If additional
  1086. // records are available after the first page results, then a NextToken string
  1087. // will be returned. To receive the next page, you call ListEndpointsByPlatformApplication
  1088. // again using the NextToken string received from the previous call. When there
  1089. // are no more records to return, NextToken will be null. For more information,
  1090. // see Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  1091. //
  1092. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1093. // with awserr.Error's Code and Message methods to get detailed information about
  1094. // the error.
  1095. //
  1096. // See the AWS API reference guide for Amazon Simple Notification Service's
  1097. // API operation ListEndpointsByPlatformApplication for usage and error information.
  1098. //
  1099. // Returned Error Codes:
  1100. // * InvalidParameter
  1101. // Indicates that a request parameter does not comply with the associated constraints.
  1102. //
  1103. // * InternalError
  1104. // Indicates an internal service error.
  1105. //
  1106. // * AuthorizationError
  1107. // Indicates that the user has been denied access to the requested resource.
  1108. //
  1109. // * NotFound
  1110. // Indicates that the requested resource does not exist.
  1111. //
  1112. func (c *SNS) ListEndpointsByPlatformApplication(input *ListEndpointsByPlatformApplicationInput) (*ListEndpointsByPlatformApplicationOutput, error) {
  1113. req, out := c.ListEndpointsByPlatformApplicationRequest(input)
  1114. err := req.Send()
  1115. return out, err
  1116. }
  1117. // ListEndpointsByPlatformApplicationPages iterates over the pages of a ListEndpointsByPlatformApplication operation,
  1118. // calling the "fn" function with the response data for each page. To stop
  1119. // iterating, return false from the fn function.
  1120. //
  1121. // See ListEndpointsByPlatformApplication method for more information on how to use this operation.
  1122. //
  1123. // Note: This operation can generate multiple requests to a service.
  1124. //
  1125. // // Example iterating over at most 3 pages of a ListEndpointsByPlatformApplication operation.
  1126. // pageNum := 0
  1127. // err := client.ListEndpointsByPlatformApplicationPages(params,
  1128. // func(page *ListEndpointsByPlatformApplicationOutput, lastPage bool) bool {
  1129. // pageNum++
  1130. // fmt.Println(page)
  1131. // return pageNum <= 3
  1132. // })
  1133. //
  1134. func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlatformApplicationInput, fn func(p *ListEndpointsByPlatformApplicationOutput, lastPage bool) (shouldContinue bool)) error {
  1135. page, _ := c.ListEndpointsByPlatformApplicationRequest(input)
  1136. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1137. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1138. return fn(p.(*ListEndpointsByPlatformApplicationOutput), lastPage)
  1139. })
  1140. }
  1141. const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut"
  1142. // ListPhoneNumbersOptedOutRequest generates a "aws/request.Request" representing the
  1143. // client's request for the ListPhoneNumbersOptedOut operation. The "output" return
  1144. // value can be used to capture response data after the request's "Send" method
  1145. // is called.
  1146. //
  1147. // See ListPhoneNumbersOptedOut for usage and error information.
  1148. //
  1149. // Creating a request object using this method should be used when you want to inject
  1150. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1151. // access properties on the request object before or after sending the request. If
  1152. // you just want the service response, call the ListPhoneNumbersOptedOut method directly
  1153. // instead.
  1154. //
  1155. // Note: You must call the "Send" method on the returned request object in order
  1156. // to execute the request.
  1157. //
  1158. // // Example sending a request using the ListPhoneNumbersOptedOutRequest method.
  1159. // req, resp := client.ListPhoneNumbersOptedOutRequest(params)
  1160. //
  1161. // err := req.Send()
  1162. // if err == nil { // resp is now filled
  1163. // fmt.Println(resp)
  1164. // }
  1165. //
  1166. func (c *SNS) ListPhoneNumbersOptedOutRequest(input *ListPhoneNumbersOptedOutInput) (req *request.Request, output *ListPhoneNumbersOptedOutOutput) {
  1167. op := &request.Operation{
  1168. Name: opListPhoneNumbersOptedOut,
  1169. HTTPMethod: "POST",
  1170. HTTPPath: "/",
  1171. }
  1172. if input == nil {
  1173. input = &ListPhoneNumbersOptedOutInput{}
  1174. }
  1175. req = c.newRequest(op, input, output)
  1176. output = &ListPhoneNumbersOptedOutOutput{}
  1177. req.Data = output
  1178. return
  1179. }
  1180. // ListPhoneNumbersOptedOut API operation for Amazon Simple Notification Service.
  1181. //
  1182. // Returns a list of phone numbers that are opted out, meaning you cannot send
  1183. // SMS messages to them.
  1184. //
  1185. // The results for ListPhoneNumbersOptedOut are paginated, and each page returns
  1186. // up to 100 phone numbers. If additional phone numbers are available after
  1187. // the first page of results, then a NextToken string will be returned. To receive
  1188. // the next page, you call ListPhoneNumbersOptedOut again using the NextToken
  1189. // string received from the previous call. When there are no more records to
  1190. // return, NextToken will be null.
  1191. //
  1192. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1193. // with awserr.Error's Code and Message methods to get detailed information about
  1194. // the error.
  1195. //
  1196. // See the AWS API reference guide for Amazon Simple Notification Service's
  1197. // API operation ListPhoneNumbersOptedOut for usage and error information.
  1198. //
  1199. // Returned Error Codes:
  1200. // * Throttled
  1201. // Indicates that the rate at which requests have been submitted for this action
  1202. // exceeds the limit for your account.
  1203. //
  1204. // * InternalError
  1205. // Indicates an internal service error.
  1206. //
  1207. // * AuthorizationError
  1208. // Indicates that the user has been denied access to the requested resource.
  1209. //
  1210. // * InvalidParameter
  1211. // Indicates that a request parameter does not comply with the associated constraints.
  1212. //
  1213. func (c *SNS) ListPhoneNumbersOptedOut(input *ListPhoneNumbersOptedOutInput) (*ListPhoneNumbersOptedOutOutput, error) {
  1214. req, out := c.ListPhoneNumbersOptedOutRequest(input)
  1215. err := req.Send()
  1216. return out, err
  1217. }
  1218. const opListPlatformApplications = "ListPlatformApplications"
  1219. // ListPlatformApplicationsRequest generates a "aws/request.Request" representing the
  1220. // client's request for the ListPlatformApplications operation. The "output" return
  1221. // value can be used to capture response data after the request's "Send" method
  1222. // is called.
  1223. //
  1224. // See ListPlatformApplications for usage and error information.
  1225. //
  1226. // Creating a request object using this method should be used when you want to inject
  1227. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1228. // access properties on the request object before or after sending the request. If
  1229. // you just want the service response, call the ListPlatformApplications method directly
  1230. // instead.
  1231. //
  1232. // Note: You must call the "Send" method on the returned request object in order
  1233. // to execute the request.
  1234. //
  1235. // // Example sending a request using the ListPlatformApplicationsRequest method.
  1236. // req, resp := client.ListPlatformApplicationsRequest(params)
  1237. //
  1238. // err := req.Send()
  1239. // if err == nil { // resp is now filled
  1240. // fmt.Println(resp)
  1241. // }
  1242. //
  1243. func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInput) (req *request.Request, output *ListPlatformApplicationsOutput) {
  1244. op := &request.Operation{
  1245. Name: opListPlatformApplications,
  1246. HTTPMethod: "POST",
  1247. HTTPPath: "/",
  1248. Paginator: &request.Paginator{
  1249. InputTokens: []string{"NextToken"},
  1250. OutputTokens: []string{"NextToken"},
  1251. LimitToken: "",
  1252. TruncationToken: "",
  1253. },
  1254. }
  1255. if input == nil {
  1256. input = &ListPlatformApplicationsInput{}
  1257. }
  1258. req = c.newRequest(op, input, output)
  1259. output = &ListPlatformApplicationsOutput{}
  1260. req.Data = output
  1261. return
  1262. }
  1263. // ListPlatformApplications API operation for Amazon Simple Notification Service.
  1264. //
  1265. // Lists the platform application objects for the supported push notification
  1266. // services, such as APNS and GCM. The results for ListPlatformApplications
  1267. // are paginated and return a limited list of applications, up to 100. If additional
  1268. // records are available after the first page results, then a NextToken string
  1269. // will be returned. To receive the next page, you call ListPlatformApplications
  1270. // using the NextToken string received from the previous call. When there are
  1271. // no more records to return, NextToken will be null. For more information,
  1272. // see Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  1273. //
  1274. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1275. // with awserr.Error's Code and Message methods to get detailed information about
  1276. // the error.
  1277. //
  1278. // See the AWS API reference guide for Amazon Simple Notification Service's
  1279. // API operation ListPlatformApplications for usage and error information.
  1280. //
  1281. // Returned Error Codes:
  1282. // * InvalidParameter
  1283. // Indicates that a request parameter does not comply with the associated constraints.
  1284. //
  1285. // * InternalError
  1286. // Indicates an internal service error.
  1287. //
  1288. // * AuthorizationError
  1289. // Indicates that the user has been denied access to the requested resource.
  1290. //
  1291. func (c *SNS) ListPlatformApplications(input *ListPlatformApplicationsInput) (*ListPlatformApplicationsOutput, error) {
  1292. req, out := c.ListPlatformApplicationsRequest(input)
  1293. err := req.Send()
  1294. return out, err
  1295. }
  1296. // ListPlatformApplicationsPages iterates over the pages of a ListPlatformApplications operation,
  1297. // calling the "fn" function with the response data for each page. To stop
  1298. // iterating, return false from the fn function.
  1299. //
  1300. // See ListPlatformApplications method for more information on how to use this operation.
  1301. //
  1302. // Note: This operation can generate multiple requests to a service.
  1303. //
  1304. // // Example iterating over at most 3 pages of a ListPlatformApplications operation.
  1305. // pageNum := 0
  1306. // err := client.ListPlatformApplicationsPages(params,
  1307. // func(page *ListPlatformApplicationsOutput, lastPage bool) bool {
  1308. // pageNum++
  1309. // fmt.Println(page)
  1310. // return pageNum <= 3
  1311. // })
  1312. //
  1313. func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput, fn func(p *ListPlatformApplicationsOutput, lastPage bool) (shouldContinue bool)) error {
  1314. page, _ := c.ListPlatformApplicationsRequest(input)
  1315. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1316. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1317. return fn(p.(*ListPlatformApplicationsOutput), lastPage)
  1318. })
  1319. }
  1320. const opListSubscriptions = "ListSubscriptions"
  1321. // ListSubscriptionsRequest generates a "aws/request.Request" representing the
  1322. // client's request for the ListSubscriptions operation. The "output" return
  1323. // value can be used to capture response data after the request's "Send" method
  1324. // is called.
  1325. //
  1326. // See ListSubscriptions for usage and error information.
  1327. //
  1328. // Creating a request object using this method should be used when you want to inject
  1329. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1330. // access properties on the request object before or after sending the request. If
  1331. // you just want the service response, call the ListSubscriptions method directly
  1332. // instead.
  1333. //
  1334. // Note: You must call the "Send" method on the returned request object in order
  1335. // to execute the request.
  1336. //
  1337. // // Example sending a request using the ListSubscriptionsRequest method.
  1338. // req, resp := client.ListSubscriptionsRequest(params)
  1339. //
  1340. // err := req.Send()
  1341. // if err == nil { // resp is now filled
  1342. // fmt.Println(resp)
  1343. // }
  1344. //
  1345. func (c *SNS) ListSubscriptionsRequest(input *ListSubscriptionsInput) (req *request.Request, output *ListSubscriptionsOutput) {
  1346. op := &request.Operation{
  1347. Name: opListSubscriptions,
  1348. HTTPMethod: "POST",
  1349. HTTPPath: "/",
  1350. Paginator: &request.Paginator{
  1351. InputTokens: []string{"NextToken"},
  1352. OutputTokens: []string{"NextToken"},
  1353. LimitToken: "",
  1354. TruncationToken: "",
  1355. },
  1356. }
  1357. if input == nil {
  1358. input = &ListSubscriptionsInput{}
  1359. }
  1360. req = c.newRequest(op, input, output)
  1361. output = &ListSubscriptionsOutput{}
  1362. req.Data = output
  1363. return
  1364. }
  1365. // ListSubscriptions API operation for Amazon Simple Notification Service.
  1366. //
  1367. // Returns a list of the requester's subscriptions. Each call returns a limited
  1368. // list of subscriptions, up to 100. If there are more subscriptions, a NextToken
  1369. // is also returned. Use the NextToken parameter in a new ListSubscriptions
  1370. // call to get further results.
  1371. //
  1372. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1373. // with awserr.Error's Code and Message methods to get detailed information about
  1374. // the error.
  1375. //
  1376. // See the AWS API reference guide for Amazon Simple Notification Service's
  1377. // API operation ListSubscriptions for usage and error information.
  1378. //
  1379. // Returned Error Codes:
  1380. // * InvalidParameter
  1381. // Indicates that a request parameter does not comply with the associated constraints.
  1382. //
  1383. // * InternalError
  1384. // Indicates an internal service error.
  1385. //
  1386. // * AuthorizationError
  1387. // Indicates that the user has been denied access to the requested resource.
  1388. //
  1389. func (c *SNS) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptionsOutput, error) {
  1390. req, out := c.ListSubscriptionsRequest(input)
  1391. err := req.Send()
  1392. return out, err
  1393. }
  1394. // ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation,
  1395. // calling the "fn" function with the response data for each page. To stop
  1396. // iterating, return false from the fn function.
  1397. //
  1398. // See ListSubscriptions method for more information on how to use this operation.
  1399. //
  1400. // Note: This operation can generate multiple requests to a service.
  1401. //
  1402. // // Example iterating over at most 3 pages of a ListSubscriptions operation.
  1403. // pageNum := 0
  1404. // err := client.ListSubscriptionsPages(params,
  1405. // func(page *ListSubscriptionsOutput, lastPage bool) bool {
  1406. // pageNum++
  1407. // fmt.Println(page)
  1408. // return pageNum <= 3
  1409. // })
  1410. //
  1411. func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(p *ListSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error {
  1412. page, _ := c.ListSubscriptionsRequest(input)
  1413. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1414. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1415. return fn(p.(*ListSubscriptionsOutput), lastPage)
  1416. })
  1417. }
  1418. const opListSubscriptionsByTopic = "ListSubscriptionsByTopic"
  1419. // ListSubscriptionsByTopicRequest generates a "aws/request.Request" representing the
  1420. // client's request for the ListSubscriptionsByTopic operation. The "output" return
  1421. // value can be used to capture response data after the request's "Send" method
  1422. // is called.
  1423. //
  1424. // See ListSubscriptionsByTopic for usage and error information.
  1425. //
  1426. // Creating a request object using this method should be used when you want to inject
  1427. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1428. // access properties on the request object before or after sending the request. If
  1429. // you just want the service response, call the ListSubscriptionsByTopic method directly
  1430. // instead.
  1431. //
  1432. // Note: You must call the "Send" method on the returned request object in order
  1433. // to execute the request.
  1434. //
  1435. // // Example sending a request using the ListSubscriptionsByTopicRequest method.
  1436. // req, resp := client.ListSubscriptionsByTopicRequest(params)
  1437. //
  1438. // err := req.Send()
  1439. // if err == nil { // resp is now filled
  1440. // fmt.Println(resp)
  1441. // }
  1442. //
  1443. func (c *SNS) ListSubscriptionsByTopicRequest(input *ListSubscriptionsByTopicInput) (req *request.Request, output *ListSubscriptionsByTopicOutput) {
  1444. op := &request.Operation{
  1445. Name: opListSubscriptionsByTopic,
  1446. HTTPMethod: "POST",
  1447. HTTPPath: "/",
  1448. Paginator: &request.Paginator{
  1449. InputTokens: []string{"NextToken"},
  1450. OutputTokens: []string{"NextToken"},
  1451. LimitToken: "",
  1452. TruncationToken: "",
  1453. },
  1454. }
  1455. if input == nil {
  1456. input = &ListSubscriptionsByTopicInput{}
  1457. }
  1458. req = c.newRequest(op, input, output)
  1459. output = &ListSubscriptionsByTopicOutput{}
  1460. req.Data = output
  1461. return
  1462. }
  1463. // ListSubscriptionsByTopic API operation for Amazon Simple Notification Service.
  1464. //
  1465. // Returns a list of the subscriptions to a specific topic. Each call returns
  1466. // a limited list of subscriptions, up to 100. If there are more subscriptions,
  1467. // a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic
  1468. // call to get further results.
  1469. //
  1470. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1471. // with awserr.Error's Code and Message methods to get detailed information about
  1472. // the error.
  1473. //
  1474. // See the AWS API reference guide for Amazon Simple Notification Service's
  1475. // API operation ListSubscriptionsByTopic for usage and error information.
  1476. //
  1477. // Returned Error Codes:
  1478. // * InvalidParameter
  1479. // Indicates that a request parameter does not comply with the associated constraints.
  1480. //
  1481. // * InternalError
  1482. // Indicates an internal service error.
  1483. //
  1484. // * NotFound
  1485. // Indicates that the requested resource does not exist.
  1486. //
  1487. // * AuthorizationError
  1488. // Indicates that the user has been denied access to the requested resource.
  1489. //
  1490. func (c *SNS) ListSubscriptionsByTopic(input *ListSubscriptionsByTopicInput) (*ListSubscriptionsByTopicOutput, error) {
  1491. req, out := c.ListSubscriptionsByTopicRequest(input)
  1492. err := req.Send()
  1493. return out, err
  1494. }
  1495. // ListSubscriptionsByTopicPages iterates over the pages of a ListSubscriptionsByTopic operation,
  1496. // calling the "fn" function with the response data for each page. To stop
  1497. // iterating, return false from the fn function.
  1498. //
  1499. // See ListSubscriptionsByTopic method for more information on how to use this operation.
  1500. //
  1501. // Note: This operation can generate multiple requests to a service.
  1502. //
  1503. // // Example iterating over at most 3 pages of a ListSubscriptionsByTopic operation.
  1504. // pageNum := 0
  1505. // err := client.ListSubscriptionsByTopicPages(params,
  1506. // func(page *ListSubscriptionsByTopicOutput, lastPage bool) bool {
  1507. // pageNum++
  1508. // fmt.Println(page)
  1509. // return pageNum <= 3
  1510. // })
  1511. //
  1512. func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(p *ListSubscriptionsByTopicOutput, lastPage bool) (shouldContinue bool)) error {
  1513. page, _ := c.ListSubscriptionsByTopicRequest(input)
  1514. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1515. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1516. return fn(p.(*ListSubscriptionsByTopicOutput), lastPage)
  1517. })
  1518. }
  1519. const opListTopics = "ListTopics"
  1520. // ListTopicsRequest generates a "aws/request.Request" representing the
  1521. // client's request for the ListTopics operation. The "output" return
  1522. // value can be used to capture response data after the request's "Send" method
  1523. // is called.
  1524. //
  1525. // See ListTopics for usage and error information.
  1526. //
  1527. // Creating a request object using this method should be used when you want to inject
  1528. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1529. // access properties on the request object before or after sending the request. If
  1530. // you just want the service response, call the ListTopics method directly
  1531. // instead.
  1532. //
  1533. // Note: You must call the "Send" method on the returned request object in order
  1534. // to execute the request.
  1535. //
  1536. // // Example sending a request using the ListTopicsRequest method.
  1537. // req, resp := client.ListTopicsRequest(params)
  1538. //
  1539. // err := req.Send()
  1540. // if err == nil { // resp is now filled
  1541. // fmt.Println(resp)
  1542. // }
  1543. //
  1544. func (c *SNS) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, output *ListTopicsOutput) {
  1545. op := &request.Operation{
  1546. Name: opListTopics,
  1547. HTTPMethod: "POST",
  1548. HTTPPath: "/",
  1549. Paginator: &request.Paginator{
  1550. InputTokens: []string{"NextToken"},
  1551. OutputTokens: []string{"NextToken"},
  1552. LimitToken: "",
  1553. TruncationToken: "",
  1554. },
  1555. }
  1556. if input == nil {
  1557. input = &ListTopicsInput{}
  1558. }
  1559. req = c.newRequest(op, input, output)
  1560. output = &ListTopicsOutput{}
  1561. req.Data = output
  1562. return
  1563. }
  1564. // ListTopics API operation for Amazon Simple Notification Service.
  1565. //
  1566. // Returns a list of the requester's topics. Each call returns a limited list
  1567. // of topics, up to 100. If there are more topics, a NextToken is also returned.
  1568. // Use the NextToken parameter in a new ListTopics call to get further results.
  1569. //
  1570. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1571. // with awserr.Error's Code and Message methods to get detailed information about
  1572. // the error.
  1573. //
  1574. // See the AWS API reference guide for Amazon Simple Notification Service's
  1575. // API operation ListTopics for usage and error information.
  1576. //
  1577. // Returned Error Codes:
  1578. // * InvalidParameter
  1579. // Indicates that a request parameter does not comply with the associated constraints.
  1580. //
  1581. // * InternalError
  1582. // Indicates an internal service error.
  1583. //
  1584. // * AuthorizationError
  1585. // Indicates that the user has been denied access to the requested resource.
  1586. //
  1587. func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) {
  1588. req, out := c.ListTopicsRequest(input)
  1589. err := req.Send()
  1590. return out, err
  1591. }
  1592. // ListTopicsPages iterates over the pages of a ListTopics operation,
  1593. // calling the "fn" function with the response data for each page. To stop
  1594. // iterating, return false from the fn function.
  1595. //
  1596. // See ListTopics method for more information on how to use this operation.
  1597. //
  1598. // Note: This operation can generate multiple requests to a service.
  1599. //
  1600. // // Example iterating over at most 3 pages of a ListTopics operation.
  1601. // pageNum := 0
  1602. // err := client.ListTopicsPages(params,
  1603. // func(page *ListTopicsOutput, lastPage bool) bool {
  1604. // pageNum++
  1605. // fmt.Println(page)
  1606. // return pageNum <= 3
  1607. // })
  1608. //
  1609. func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(p *ListTopicsOutput, lastPage bool) (shouldContinue bool)) error {
  1610. page, _ := c.ListTopicsRequest(input)
  1611. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1612. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1613. return fn(p.(*ListTopicsOutput), lastPage)
  1614. })
  1615. }
  1616. const opOptInPhoneNumber = "OptInPhoneNumber"
  1617. // OptInPhoneNumberRequest generates a "aws/request.Request" representing the
  1618. // client's request for the OptInPhoneNumber operation. The "output" return
  1619. // value can be used to capture response data after the request's "Send" method
  1620. // is called.
  1621. //
  1622. // See OptInPhoneNumber for usage and error information.
  1623. //
  1624. // Creating a request object using this method should be used when you want to inject
  1625. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1626. // access properties on the request object before or after sending the request. If
  1627. // you just want the service response, call the OptInPhoneNumber method directly
  1628. // instead.
  1629. //
  1630. // Note: You must call the "Send" method on the returned request object in order
  1631. // to execute the request.
  1632. //
  1633. // // Example sending a request using the OptInPhoneNumberRequest method.
  1634. // req, resp := client.OptInPhoneNumberRequest(params)
  1635. //
  1636. // err := req.Send()
  1637. // if err == nil { // resp is now filled
  1638. // fmt.Println(resp)
  1639. // }
  1640. //
  1641. func (c *SNS) OptInPhoneNumberRequest(input *OptInPhoneNumberInput) (req *request.Request, output *OptInPhoneNumberOutput) {
  1642. op := &request.Operation{
  1643. Name: opOptInPhoneNumber,
  1644. HTTPMethod: "POST",
  1645. HTTPPath: "/",
  1646. }
  1647. if input == nil {
  1648. input = &OptInPhoneNumberInput{}
  1649. }
  1650. req = c.newRequest(op, input, output)
  1651. output = &OptInPhoneNumberOutput{}
  1652. req.Data = output
  1653. return
  1654. }
  1655. // OptInPhoneNumber API operation for Amazon Simple Notification Service.
  1656. //
  1657. // Use this request to opt in a phone number that is opted out, which enables
  1658. // you to resume sending SMS messages to the number.
  1659. //
  1660. // You can opt in a phone number only once every 30 days.
  1661. //
  1662. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1663. // with awserr.Error's Code and Message methods to get detailed information about
  1664. // the error.
  1665. //
  1666. // See the AWS API reference guide for Amazon Simple Notification Service's
  1667. // API operation OptInPhoneNumber for usage and error information.
  1668. //
  1669. // Returned Error Codes:
  1670. // * Throttled
  1671. // Indicates that the rate at which requests have been submitted for this action
  1672. // exceeds the limit for your account.
  1673. //
  1674. // * InternalError
  1675. // Indicates an internal service error.
  1676. //
  1677. // * AuthorizationError
  1678. // Indicates that the user has been denied access to the requested resource.
  1679. //
  1680. // * InvalidParameter
  1681. // Indicates that a request parameter does not comply with the associated constraints.
  1682. //
  1683. func (c *SNS) OptInPhoneNumber(input *OptInPhoneNumberInput) (*OptInPhoneNumberOutput, error) {
  1684. req, out := c.OptInPhoneNumberRequest(input)
  1685. err := req.Send()
  1686. return out, err
  1687. }
  1688. const opPublish = "Publish"
  1689. // PublishRequest generates a "aws/request.Request" representing the
  1690. // client's request for the Publish operation. The "output" return
  1691. // value can be used to capture response data after the request's "Send" method
  1692. // is called.
  1693. //
  1694. // See Publish for usage and error information.
  1695. //
  1696. // Creating a request object using this method should be used when you want to inject
  1697. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1698. // access properties on the request object before or after sending the request. If
  1699. // you just want the service response, call the Publish method directly
  1700. // instead.
  1701. //
  1702. // Note: You must call the "Send" method on the returned request object in order
  1703. // to execute the request.
  1704. //
  1705. // // Example sending a request using the PublishRequest method.
  1706. // req, resp := client.PublishRequest(params)
  1707. //
  1708. // err := req.Send()
  1709. // if err == nil { // resp is now filled
  1710. // fmt.Println(resp)
  1711. // }
  1712. //
  1713. func (c *SNS) PublishRequest(input *PublishInput) (req *request.Request, output *PublishOutput) {
  1714. op := &request.Operation{
  1715. Name: opPublish,
  1716. HTTPMethod: "POST",
  1717. HTTPPath: "/",
  1718. }
  1719. if input == nil {
  1720. input = &PublishInput{}
  1721. }
  1722. req = c.newRequest(op, input, output)
  1723. output = &PublishOutput{}
  1724. req.Data = output
  1725. return
  1726. }
  1727. // Publish API operation for Amazon Simple Notification Service.
  1728. //
  1729. // Sends a message to all of a topic's subscribed endpoints. When a messageId
  1730. // is returned, the message has been saved and Amazon SNS will attempt to deliver
  1731. // it to the topic's subscribers shortly. The format of the outgoing message
  1732. // to each subscribed endpoint depends on the notification protocol.
  1733. //
  1734. // To use the Publish action for sending a message to a mobile endpoint, such
  1735. // as an app on a Kindle device or mobile phone, you must specify the EndpointArn
  1736. // for the TargetArn parameter. The EndpointArn is returned when making a call
  1737. // with the CreatePlatformEndpoint action.
  1738. //
  1739. // For more information about formatting messages, see Send Custom Platform-Specific
  1740. // Payloads in Messages to Mobile Devices (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html).
  1741. //
  1742. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1743. // with awserr.Error's Code and Message methods to get detailed information about
  1744. // the error.
  1745. //
  1746. // See the AWS API reference guide for Amazon Simple Notification Service's
  1747. // API operation Publish for usage and error information.
  1748. //
  1749. // Returned Error Codes:
  1750. // * InvalidParameter
  1751. // Indicates that a request parameter does not comply with the associated constraints.
  1752. //
  1753. // * ParameterValueInvalid
  1754. // Indicates that a request parameter does not comply with the associated constraints.
  1755. //
  1756. // * InternalError
  1757. // Indicates an internal service error.
  1758. //
  1759. // * NotFound
  1760. // Indicates that the requested resource does not exist.
  1761. //
  1762. // * EndpointDisabled
  1763. // Exception error indicating endpoint disabled.
  1764. //
  1765. // * PlatformApplicationDisabled
  1766. // Exception error indicating platform application disabled.
  1767. //
  1768. // * AuthorizationError
  1769. // Indicates that the user has been denied access to the requested resource.
  1770. //
  1771. func (c *SNS) Publish(input *PublishInput) (*PublishOutput, error) {
  1772. req, out := c.PublishRequest(input)
  1773. err := req.Send()
  1774. return out, err
  1775. }
  1776. const opRemovePermission = "RemovePermission"
  1777. // RemovePermissionRequest generates a "aws/request.Request" representing the
  1778. // client's request for the RemovePermission operation. The "output" return
  1779. // value can be used to capture response data after the request's "Send" method
  1780. // is called.
  1781. //
  1782. // See RemovePermission for usage and error information.
  1783. //
  1784. // Creating a request object using this method should be used when you want to inject
  1785. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1786. // access properties on the request object before or after sending the request. If
  1787. // you just want the service response, call the RemovePermission method directly
  1788. // instead.
  1789. //
  1790. // Note: You must call the "Send" method on the returned request object in order
  1791. // to execute the request.
  1792. //
  1793. // // Example sending a request using the RemovePermissionRequest method.
  1794. // req, resp := client.RemovePermissionRequest(params)
  1795. //
  1796. // err := req.Send()
  1797. // if err == nil { // resp is now filled
  1798. // fmt.Println(resp)
  1799. // }
  1800. //
  1801. func (c *SNS) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
  1802. op := &request.Operation{
  1803. Name: opRemovePermission,
  1804. HTTPMethod: "POST",
  1805. HTTPPath: "/",
  1806. }
  1807. if input == nil {
  1808. input = &RemovePermissionInput{}
  1809. }
  1810. req = c.newRequest(op, input, output)
  1811. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1812. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1813. output = &RemovePermissionOutput{}
  1814. req.Data = output
  1815. return
  1816. }
  1817. // RemovePermission API operation for Amazon Simple Notification Service.
  1818. //
  1819. // Removes a statement from a topic's access control policy.
  1820. //
  1821. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1822. // with awserr.Error's Code and Message methods to get detailed information about
  1823. // the error.
  1824. //
  1825. // See the AWS API reference guide for Amazon Simple Notification Service's
  1826. // API operation RemovePermission for usage and error information.
  1827. //
  1828. // Returned Error Codes:
  1829. // * InvalidParameter
  1830. // Indicates that a request parameter does not comply with the associated constraints.
  1831. //
  1832. // * InternalError
  1833. // Indicates an internal service error.
  1834. //
  1835. // * AuthorizationError
  1836. // Indicates that the user has been denied access to the requested resource.
  1837. //
  1838. // * NotFound
  1839. // Indicates that the requested resource does not exist.
  1840. //
  1841. func (c *SNS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
  1842. req, out := c.RemovePermissionRequest(input)
  1843. err := req.Send()
  1844. return out, err
  1845. }
  1846. const opSetEndpointAttributes = "SetEndpointAttributes"
  1847. // SetEndpointAttributesRequest generates a "aws/request.Request" representing the
  1848. // client's request for the SetEndpointAttributes operation. The "output" return
  1849. // value can be used to capture response data after the request's "Send" method
  1850. // is called.
  1851. //
  1852. // See SetEndpointAttributes for usage and error information.
  1853. //
  1854. // Creating a request object using this method should be used when you want to inject
  1855. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1856. // access properties on the request object before or after sending the request. If
  1857. // you just want the service response, call the SetEndpointAttributes method directly
  1858. // instead.
  1859. //
  1860. // Note: You must call the "Send" method on the returned request object in order
  1861. // to execute the request.
  1862. //
  1863. // // Example sending a request using the SetEndpointAttributesRequest method.
  1864. // req, resp := client.SetEndpointAttributesRequest(params)
  1865. //
  1866. // err := req.Send()
  1867. // if err == nil { // resp is now filled
  1868. // fmt.Println(resp)
  1869. // }
  1870. //
  1871. func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) (req *request.Request, output *SetEndpointAttributesOutput) {
  1872. op := &request.Operation{
  1873. Name: opSetEndpointAttributes,
  1874. HTTPMethod: "POST",
  1875. HTTPPath: "/",
  1876. }
  1877. if input == nil {
  1878. input = &SetEndpointAttributesInput{}
  1879. }
  1880. req = c.newRequest(op, input, output)
  1881. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1882. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1883. output = &SetEndpointAttributesOutput{}
  1884. req.Data = output
  1885. return
  1886. }
  1887. // SetEndpointAttributes API operation for Amazon Simple Notification Service.
  1888. //
  1889. // Sets the attributes for an endpoint for a device on one of the supported
  1890. // push notification services, such as GCM and APNS. For more information, see
  1891. // Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  1892. //
  1893. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1894. // with awserr.Error's Code and Message methods to get detailed information about
  1895. // the error.
  1896. //
  1897. // See the AWS API reference guide for Amazon Simple Notification Service's
  1898. // API operation SetEndpointAttributes for usage and error information.
  1899. //
  1900. // Returned Error Codes:
  1901. // * InvalidParameter
  1902. // Indicates that a request parameter does not comply with the associated constraints.
  1903. //
  1904. // * InternalError
  1905. // Indicates an internal service error.
  1906. //
  1907. // * AuthorizationError
  1908. // Indicates that the user has been denied access to the requested resource.
  1909. //
  1910. // * NotFound
  1911. // Indicates that the requested resource does not exist.
  1912. //
  1913. func (c *SNS) SetEndpointAttributes(input *SetEndpointAttributesInput) (*SetEndpointAttributesOutput, error) {
  1914. req, out := c.SetEndpointAttributesRequest(input)
  1915. err := req.Send()
  1916. return out, err
  1917. }
  1918. const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes"
  1919. // SetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the
  1920. // client's request for the SetPlatformApplicationAttributes operation. The "output" return
  1921. // value can be used to capture response data after the request's "Send" method
  1922. // is called.
  1923. //
  1924. // See SetPlatformApplicationAttributes for usage and error information.
  1925. //
  1926. // Creating a request object using this method should be used when you want to inject
  1927. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1928. // access properties on the request object before or after sending the request. If
  1929. // you just want the service response, call the SetPlatformApplicationAttributes method directly
  1930. // instead.
  1931. //
  1932. // Note: You must call the "Send" method on the returned request object in order
  1933. // to execute the request.
  1934. //
  1935. // // Example sending a request using the SetPlatformApplicationAttributesRequest method.
  1936. // req, resp := client.SetPlatformApplicationAttributesRequest(params)
  1937. //
  1938. // err := req.Send()
  1939. // if err == nil { // resp is now filled
  1940. // fmt.Println(resp)
  1941. // }
  1942. //
  1943. func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicationAttributesInput) (req *request.Request, output *SetPlatformApplicationAttributesOutput) {
  1944. op := &request.Operation{
  1945. Name: opSetPlatformApplicationAttributes,
  1946. HTTPMethod: "POST",
  1947. HTTPPath: "/",
  1948. }
  1949. if input == nil {
  1950. input = &SetPlatformApplicationAttributesInput{}
  1951. }
  1952. req = c.newRequest(op, input, output)
  1953. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1954. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1955. output = &SetPlatformApplicationAttributesOutput{}
  1956. req.Data = output
  1957. return
  1958. }
  1959. // SetPlatformApplicationAttributes API operation for Amazon Simple Notification Service.
  1960. //
  1961. // Sets the attributes of the platform application object for the supported
  1962. // push notification services, such as APNS and GCM. For more information, see
  1963. // Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
  1964. // For information on configuring attributes for message delivery status, see
  1965. // Using Amazon SNS Application Attributes for Message Delivery Status (http://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html).
  1966. //
  1967. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1968. // with awserr.Error's Code and Message methods to get detailed information about
  1969. // the error.
  1970. //
  1971. // See the AWS API reference guide for Amazon Simple Notification Service's
  1972. // API operation SetPlatformApplicationAttributes for usage and error information.
  1973. //
  1974. // Returned Error Codes:
  1975. // * InvalidParameter
  1976. // Indicates that a request parameter does not comply with the associated constraints.
  1977. //
  1978. // * InternalError
  1979. // Indicates an internal service error.
  1980. //
  1981. // * AuthorizationError
  1982. // Indicates that the user has been denied access to the requested resource.
  1983. //
  1984. // * NotFound
  1985. // Indicates that the requested resource does not exist.
  1986. //
  1987. func (c *SNS) SetPlatformApplicationAttributes(input *SetPlatformApplicationAttributesInput) (*SetPlatformApplicationAttributesOutput, error) {
  1988. req, out := c.SetPlatformApplicationAttributesRequest(input)
  1989. err := req.Send()
  1990. return out, err
  1991. }
  1992. const opSetSMSAttributes = "SetSMSAttributes"
  1993. // SetSMSAttributesRequest generates a "aws/request.Request" representing the
  1994. // client's request for the SetSMSAttributes operation. The "output" return
  1995. // value can be used to capture response data after the request's "Send" method
  1996. // is called.
  1997. //
  1998. // See SetSMSAttributes for usage and error information.
  1999. //
  2000. // Creating a request object using this method should be used when you want to inject
  2001. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2002. // access properties on the request object before or after sending the request. If
  2003. // you just want the service response, call the SetSMSAttributes method directly
  2004. // instead.
  2005. //
  2006. // Note: You must call the "Send" method on the returned request object in order
  2007. // to execute the request.
  2008. //
  2009. // // Example sending a request using the SetSMSAttributesRequest method.
  2010. // req, resp := client.SetSMSAttributesRequest(params)
  2011. //
  2012. // err := req.Send()
  2013. // if err == nil { // resp is now filled
  2014. // fmt.Println(resp)
  2015. // }
  2016. //
  2017. func (c *SNS) SetSMSAttributesRequest(input *SetSMSAttributesInput) (req *request.Request, output *SetSMSAttributesOutput) {
  2018. op := &request.Operation{
  2019. Name: opSetSMSAttributes,
  2020. HTTPMethod: "POST",
  2021. HTTPPath: "/",
  2022. }
  2023. if input == nil {
  2024. input = &SetSMSAttributesInput{}
  2025. }
  2026. req = c.newRequest(op, input, output)
  2027. output = &SetSMSAttributesOutput{}
  2028. req.Data = output
  2029. return
  2030. }
  2031. // SetSMSAttributes API operation for Amazon Simple Notification Service.
  2032. //
  2033. // Use this request to set the default settings for sending SMS messages and
  2034. // receiving daily SMS usage reports.
  2035. //
  2036. // You can override some of these settings for a single message when you use
  2037. // the Publish action with the MessageAttributes.entry.N parameter. For more
  2038. // information, see Sending an SMS Message (http://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html)
  2039. // in the Amazon SNS Developer Guide.
  2040. //
  2041. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2042. // with awserr.Error's Code and Message methods to get detailed information about
  2043. // the error.
  2044. //
  2045. // See the AWS API reference guide for Amazon Simple Notification Service's
  2046. // API operation SetSMSAttributes for usage and error information.
  2047. //
  2048. // Returned Error Codes:
  2049. // * InvalidParameter
  2050. // Indicates that a request parameter does not comply with the associated constraints.
  2051. //
  2052. // * Throttled
  2053. // Indicates that the rate at which requests have been submitted for this action
  2054. // exceeds the limit for your account.
  2055. //
  2056. // * InternalError
  2057. // Indicates an internal service error.
  2058. //
  2059. // * AuthorizationError
  2060. // Indicates that the user has been denied access to the requested resource.
  2061. //
  2062. func (c *SNS) SetSMSAttributes(input *SetSMSAttributesInput) (*SetSMSAttributesOutput, error) {
  2063. req, out := c.SetSMSAttributesRequest(input)
  2064. err := req.Send()
  2065. return out, err
  2066. }
  2067. const opSetSubscriptionAttributes = "SetSubscriptionAttributes"
  2068. // SetSubscriptionAttributesRequest generates a "aws/request.Request" representing the
  2069. // client's request for the SetSubscriptionAttributes operation. The "output" return
  2070. // value can be used to capture response data after the request's "Send" method
  2071. // is called.
  2072. //
  2073. // See SetSubscriptionAttributes for usage and error information.
  2074. //
  2075. // Creating a request object using this method should be used when you want to inject
  2076. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2077. // access properties on the request object before or after sending the request. If
  2078. // you just want the service response, call the SetSubscriptionAttributes method directly
  2079. // instead.
  2080. //
  2081. // Note: You must call the "Send" method on the returned request object in order
  2082. // to execute the request.
  2083. //
  2084. // // Example sending a request using the SetSubscriptionAttributesRequest method.
  2085. // req, resp := client.SetSubscriptionAttributesRequest(params)
  2086. //
  2087. // err := req.Send()
  2088. // if err == nil { // resp is now filled
  2089. // fmt.Println(resp)
  2090. // }
  2091. //
  2092. func (c *SNS) SetSubscriptionAttributesRequest(input *SetSubscriptionAttributesInput) (req *request.Request, output *SetSubscriptionAttributesOutput) {
  2093. op := &request.Operation{
  2094. Name: opSetSubscriptionAttributes,
  2095. HTTPMethod: "POST",
  2096. HTTPPath: "/",
  2097. }
  2098. if input == nil {
  2099. input = &SetSubscriptionAttributesInput{}
  2100. }
  2101. req = c.newRequest(op, input, output)
  2102. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  2103. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  2104. output = &SetSubscriptionAttributesOutput{}
  2105. req.Data = output
  2106. return
  2107. }
  2108. // SetSubscriptionAttributes API operation for Amazon Simple Notification Service.
  2109. //
  2110. // Allows a subscription owner to set an attribute of the topic to a new value.
  2111. //
  2112. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2113. // with awserr.Error's Code and Message methods to get detailed information about
  2114. // the error.
  2115. //
  2116. // See the AWS API reference guide for Amazon Simple Notification Service's
  2117. // API operation SetSubscriptionAttributes for usage and error information.
  2118. //
  2119. // Returned Error Codes:
  2120. // * InvalidParameter
  2121. // Indicates that a request parameter does not comply with the associated constraints.
  2122. //
  2123. // * InternalError
  2124. // Indicates an internal service error.
  2125. //
  2126. // * NotFound
  2127. // Indicates that the requested resource does not exist.
  2128. //
  2129. // * AuthorizationError
  2130. // Indicates that the user has been denied access to the requested resource.
  2131. //
  2132. func (c *SNS) SetSubscriptionAttributes(input *SetSubscriptionAttributesInput) (*SetSubscriptionAttributesOutput, error) {
  2133. req, out := c.SetSubscriptionAttributesRequest(input)
  2134. err := req.Send()
  2135. return out, err
  2136. }
  2137. const opSetTopicAttributes = "SetTopicAttributes"
  2138. // SetTopicAttributesRequest generates a "aws/request.Request" representing the
  2139. // client's request for the SetTopicAttributes operation. The "output" return
  2140. // value can be used to capture response data after the request's "Send" method
  2141. // is called.
  2142. //
  2143. // See SetTopicAttributes for usage and error information.
  2144. //
  2145. // Creating a request object using this method should be used when you want to inject
  2146. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2147. // access properties on the request object before or after sending the request. If
  2148. // you just want the service response, call the SetTopicAttributes method directly
  2149. // instead.
  2150. //
  2151. // Note: You must call the "Send" method on the returned request object in order
  2152. // to execute the request.
  2153. //
  2154. // // Example sending a request using the SetTopicAttributesRequest method.
  2155. // req, resp := client.SetTopicAttributesRequest(params)
  2156. //
  2157. // err := req.Send()
  2158. // if err == nil { // resp is now filled
  2159. // fmt.Println(resp)
  2160. // }
  2161. //
  2162. func (c *SNS) SetTopicAttributesRequest(input *SetTopicAttributesInput) (req *request.Request, output *SetTopicAttributesOutput) {
  2163. op := &request.Operation{
  2164. Name: opSetTopicAttributes,
  2165. HTTPMethod: "POST",
  2166. HTTPPath: "/",
  2167. }
  2168. if input == nil {
  2169. input = &SetTopicAttributesInput{}
  2170. }
  2171. req = c.newRequest(op, input, output)
  2172. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  2173. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  2174. output = &SetTopicAttributesOutput{}
  2175. req.Data = output
  2176. return
  2177. }
  2178. // SetTopicAttributes API operation for Amazon Simple Notification Service.
  2179. //
  2180. // Allows a topic owner to set an attribute of the topic to a new value.
  2181. //
  2182. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2183. // with awserr.Error's Code and Message methods to get detailed information about
  2184. // the error.
  2185. //
  2186. // See the AWS API reference guide for Amazon Simple Notification Service's
  2187. // API operation SetTopicAttributes for usage and error information.
  2188. //
  2189. // Returned Error Codes:
  2190. // * InvalidParameter
  2191. // Indicates that a request parameter does not comply with the associated constraints.
  2192. //
  2193. // * InternalError
  2194. // Indicates an internal service error.
  2195. //
  2196. // * NotFound
  2197. // Indicates that the requested resource does not exist.
  2198. //
  2199. // * AuthorizationError
  2200. // Indicates that the user has been denied access to the requested resource.
  2201. //
  2202. func (c *SNS) SetTopicAttributes(input *SetTopicAttributesInput) (*SetTopicAttributesOutput, error) {
  2203. req, out := c.SetTopicAttributesRequest(input)
  2204. err := req.Send()
  2205. return out, err
  2206. }
  2207. const opSubscribe = "Subscribe"
  2208. // SubscribeRequest generates a "aws/request.Request" representing the
  2209. // client's request for the Subscribe operation. The "output" return
  2210. // value can be used to capture response data after the request's "Send" method
  2211. // is called.
  2212. //
  2213. // See Subscribe for usage and error information.
  2214. //
  2215. // Creating a request object using this method should be used when you want to inject
  2216. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2217. // access properties on the request object before or after sending the request. If
  2218. // you just want the service response, call the Subscribe method directly
  2219. // instead.
  2220. //
  2221. // Note: You must call the "Send" method on the returned request object in order
  2222. // to execute the request.
  2223. //
  2224. // // Example sending a request using the SubscribeRequest method.
  2225. // req, resp := client.SubscribeRequest(params)
  2226. //
  2227. // err := req.Send()
  2228. // if err == nil { // resp is now filled
  2229. // fmt.Println(resp)
  2230. // }
  2231. //
  2232. func (c *SNS) SubscribeRequest(input *SubscribeInput) (req *request.Request, output *SubscribeOutput) {
  2233. op := &request.Operation{
  2234. Name: opSubscribe,
  2235. HTTPMethod: "POST",
  2236. HTTPPath: "/",
  2237. }
  2238. if input == nil {
  2239. input = &SubscribeInput{}
  2240. }
  2241. req = c.newRequest(op, input, output)
  2242. output = &SubscribeOutput{}
  2243. req.Data = output
  2244. return
  2245. }
  2246. // Subscribe API operation for Amazon Simple Notification Service.
  2247. //
  2248. // Prepares to subscribe an endpoint by sending the endpoint a confirmation
  2249. // message. To actually create a subscription, the endpoint owner must call
  2250. // the ConfirmSubscription action with the token from the confirmation message.
  2251. // Confirmation tokens are valid for three days.
  2252. //
  2253. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2254. // with awserr.Error's Code and Message methods to get detailed information about
  2255. // the error.
  2256. //
  2257. // See the AWS API reference guide for Amazon Simple Notification Service's
  2258. // API operation Subscribe for usage and error information.
  2259. //
  2260. // Returned Error Codes:
  2261. // * SubscriptionLimitExceeded
  2262. // Indicates that the customer already owns the maximum allowed number of subscriptions.
  2263. //
  2264. // * InvalidParameter
  2265. // Indicates that a request parameter does not comply with the associated constraints.
  2266. //
  2267. // * InternalError
  2268. // Indicates an internal service error.
  2269. //
  2270. // * NotFound
  2271. // Indicates that the requested resource does not exist.
  2272. //
  2273. // * AuthorizationError
  2274. // Indicates that the user has been denied access to the requested resource.
  2275. //
  2276. func (c *SNS) Subscribe(input *SubscribeInput) (*SubscribeOutput, error) {
  2277. req, out := c.SubscribeRequest(input)
  2278. err := req.Send()
  2279. return out, err
  2280. }
  2281. const opUnsubscribe = "Unsubscribe"
  2282. // UnsubscribeRequest generates a "aws/request.Request" representing the
  2283. // client's request for the Unsubscribe operation. The "output" return
  2284. // value can be used to capture response data after the request's "Send" method
  2285. // is called.
  2286. //
  2287. // See Unsubscribe for usage and error information.
  2288. //
  2289. // Creating a request object using this method should be used when you want to inject
  2290. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2291. // access properties on the request object before or after sending the request. If
  2292. // you just want the service response, call the Unsubscribe method directly
  2293. // instead.
  2294. //
  2295. // Note: You must call the "Send" method on the returned request object in order
  2296. // to execute the request.
  2297. //
  2298. // // Example sending a request using the UnsubscribeRequest method.
  2299. // req, resp := client.UnsubscribeRequest(params)
  2300. //
  2301. // err := req.Send()
  2302. // if err == nil { // resp is now filled
  2303. // fmt.Println(resp)
  2304. // }
  2305. //
  2306. func (c *SNS) UnsubscribeRequest(input *UnsubscribeInput) (req *request.Request, output *UnsubscribeOutput) {
  2307. op := &request.Operation{
  2308. Name: opUnsubscribe,
  2309. HTTPMethod: "POST",
  2310. HTTPPath: "/",
  2311. }
  2312. if input == nil {
  2313. input = &UnsubscribeInput{}
  2314. }
  2315. req = c.newRequest(op, input, output)
  2316. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  2317. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  2318. output = &UnsubscribeOutput{}
  2319. req.Data = output
  2320. return
  2321. }
  2322. // Unsubscribe API operation for Amazon Simple Notification Service.
  2323. //
  2324. // Deletes a subscription. If the subscription requires authentication for deletion,
  2325. // only the owner of the subscription or the topic's owner can unsubscribe,
  2326. // and an AWS signature is required. If the Unsubscribe call does not require
  2327. // authentication and the requester is not the subscription owner, a final cancellation
  2328. // message is delivered to the endpoint, so that the endpoint owner can easily
  2329. // resubscribe to the topic if the Unsubscribe request was unintended.
  2330. //
  2331. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2332. // with awserr.Error's Code and Message methods to get detailed information about
  2333. // the error.
  2334. //
  2335. // See the AWS API reference guide for Amazon Simple Notification Service's
  2336. // API operation Unsubscribe for usage and error information.
  2337. //
  2338. // Returned Error Codes:
  2339. // * InvalidParameter
  2340. // Indicates that a request parameter does not comply with the associated constraints.
  2341. //
  2342. // * InternalError
  2343. // Indicates an internal service error.
  2344. //
  2345. // * AuthorizationError
  2346. // Indicates that the user has been denied access to the requested resource.
  2347. //
  2348. // * NotFound
  2349. // Indicates that the requested resource does not exist.
  2350. //
  2351. func (c *SNS) Unsubscribe(input *UnsubscribeInput) (*UnsubscribeOutput, error) {
  2352. req, out := c.UnsubscribeRequest(input)
  2353. err := req.Send()
  2354. return out, err
  2355. }
  2356. type AddPermissionInput struct {
  2357. _ struct{} `type:"structure"`
  2358. // The AWS account IDs of the users (principals) who will be given access to
  2359. // the specified actions. The users must have AWS accounts, but do not need
  2360. // to be signed up for this service.
  2361. //
  2362. // AWSAccountId is a required field
  2363. AWSAccountId []*string `type:"list" required:"true"`
  2364. // The action you want to allow for the specified principal(s).
  2365. //
  2366. // Valid values: any Amazon SNS action name.
  2367. //
  2368. // ActionName is a required field
  2369. ActionName []*string `type:"list" required:"true"`
  2370. // A unique identifier for the new policy statement.
  2371. //
  2372. // Label is a required field
  2373. Label *string `type:"string" required:"true"`
  2374. // The ARN of the topic whose access control policy you wish to modify.
  2375. //
  2376. // TopicArn is a required field
  2377. TopicArn *string `type:"string" required:"true"`
  2378. }
  2379. // String returns the string representation
  2380. func (s AddPermissionInput) String() string {
  2381. return awsutil.Prettify(s)
  2382. }
  2383. // GoString returns the string representation
  2384. func (s AddPermissionInput) GoString() string {
  2385. return s.String()
  2386. }
  2387. // Validate inspects the fields of the type to determine if they are valid.
  2388. func (s *AddPermissionInput) Validate() error {
  2389. invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
  2390. if s.AWSAccountId == nil {
  2391. invalidParams.Add(request.NewErrParamRequired("AWSAccountId"))
  2392. }
  2393. if s.ActionName == nil {
  2394. invalidParams.Add(request.NewErrParamRequired("ActionName"))
  2395. }
  2396. if s.Label == nil {
  2397. invalidParams.Add(request.NewErrParamRequired("Label"))
  2398. }
  2399. if s.TopicArn == nil {
  2400. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  2401. }
  2402. if invalidParams.Len() > 0 {
  2403. return invalidParams
  2404. }
  2405. return nil
  2406. }
  2407. type AddPermissionOutput struct {
  2408. _ struct{} `type:"structure"`
  2409. }
  2410. // String returns the string representation
  2411. func (s AddPermissionOutput) String() string {
  2412. return awsutil.Prettify(s)
  2413. }
  2414. // GoString returns the string representation
  2415. func (s AddPermissionOutput) GoString() string {
  2416. return s.String()
  2417. }
  2418. // The input for the CheckIfPhoneNumberIsOptedOut action.
  2419. type CheckIfPhoneNumberIsOptedOutInput struct {
  2420. _ struct{} `type:"structure"`
  2421. // The phone number for which you want to check the opt out status.
  2422. //
  2423. // PhoneNumber is a required field
  2424. PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"`
  2425. }
  2426. // String returns the string representation
  2427. func (s CheckIfPhoneNumberIsOptedOutInput) String() string {
  2428. return awsutil.Prettify(s)
  2429. }
  2430. // GoString returns the string representation
  2431. func (s CheckIfPhoneNumberIsOptedOutInput) GoString() string {
  2432. return s.String()
  2433. }
  2434. // Validate inspects the fields of the type to determine if they are valid.
  2435. func (s *CheckIfPhoneNumberIsOptedOutInput) Validate() error {
  2436. invalidParams := request.ErrInvalidParams{Context: "CheckIfPhoneNumberIsOptedOutInput"}
  2437. if s.PhoneNumber == nil {
  2438. invalidParams.Add(request.NewErrParamRequired("PhoneNumber"))
  2439. }
  2440. if invalidParams.Len() > 0 {
  2441. return invalidParams
  2442. }
  2443. return nil
  2444. }
  2445. // The response from the CheckIfPhoneNumberIsOptedOut action.
  2446. type CheckIfPhoneNumberIsOptedOutOutput struct {
  2447. _ struct{} `type:"structure"`
  2448. // Indicates whether the phone number is opted out:
  2449. //
  2450. // * true – The phone number is opted out, meaning you cannot publish SMS
  2451. // messages to it.
  2452. //
  2453. // * false – The phone number is opted in, meaning you can publish SMS messages
  2454. // to it.
  2455. IsOptedOut *bool `locationName:"isOptedOut" type:"boolean"`
  2456. }
  2457. // String returns the string representation
  2458. func (s CheckIfPhoneNumberIsOptedOutOutput) String() string {
  2459. return awsutil.Prettify(s)
  2460. }
  2461. // GoString returns the string representation
  2462. func (s CheckIfPhoneNumberIsOptedOutOutput) GoString() string {
  2463. return s.String()
  2464. }
  2465. // Input for ConfirmSubscription action.
  2466. type ConfirmSubscriptionInput struct {
  2467. _ struct{} `type:"structure"`
  2468. // Disallows unauthenticated unsubscribes of the subscription. If the value
  2469. // of this parameter is true and the request has an AWS signature, then only
  2470. // the topic owner and the subscription owner can unsubscribe the endpoint.
  2471. // The unsubscribe action requires AWS authentication.
  2472. AuthenticateOnUnsubscribe *string `type:"string"`
  2473. // Short-lived token sent to an endpoint during the Subscribe action.
  2474. //
  2475. // Token is a required field
  2476. Token *string `type:"string" required:"true"`
  2477. // The ARN of the topic for which you wish to confirm a subscription.
  2478. //
  2479. // TopicArn is a required field
  2480. TopicArn *string `type:"string" required:"true"`
  2481. }
  2482. // String returns the string representation
  2483. func (s ConfirmSubscriptionInput) String() string {
  2484. return awsutil.Prettify(s)
  2485. }
  2486. // GoString returns the string representation
  2487. func (s ConfirmSubscriptionInput) GoString() string {
  2488. return s.String()
  2489. }
  2490. // Validate inspects the fields of the type to determine if they are valid.
  2491. func (s *ConfirmSubscriptionInput) Validate() error {
  2492. invalidParams := request.ErrInvalidParams{Context: "ConfirmSubscriptionInput"}
  2493. if s.Token == nil {
  2494. invalidParams.Add(request.NewErrParamRequired("Token"))
  2495. }
  2496. if s.TopicArn == nil {
  2497. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  2498. }
  2499. if invalidParams.Len() > 0 {
  2500. return invalidParams
  2501. }
  2502. return nil
  2503. }
  2504. // Response for ConfirmSubscriptions action.
  2505. type ConfirmSubscriptionOutput struct {
  2506. _ struct{} `type:"structure"`
  2507. // The ARN of the created subscription.
  2508. SubscriptionArn *string `type:"string"`
  2509. }
  2510. // String returns the string representation
  2511. func (s ConfirmSubscriptionOutput) String() string {
  2512. return awsutil.Prettify(s)
  2513. }
  2514. // GoString returns the string representation
  2515. func (s ConfirmSubscriptionOutput) GoString() string {
  2516. return s.String()
  2517. }
  2518. // Input for CreatePlatformApplication action.
  2519. type CreatePlatformApplicationInput struct {
  2520. _ struct{} `type:"structure"`
  2521. // For a list of attributes, see SetPlatformApplicationAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html)
  2522. //
  2523. // Attributes is a required field
  2524. Attributes map[string]*string `type:"map" required:"true"`
  2525. // Application names must be made up of only uppercase and lowercase ASCII letters,
  2526. // numbers, underscores, hyphens, and periods, and must be between 1 and 256
  2527. // characters long.
  2528. //
  2529. // Name is a required field
  2530. Name *string `type:"string" required:"true"`
  2531. // The following platforms are supported: ADM (Amazon Device Messaging), APNS
  2532. // (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging).
  2533. //
  2534. // Platform is a required field
  2535. Platform *string `type:"string" required:"true"`
  2536. }
  2537. // String returns the string representation
  2538. func (s CreatePlatformApplicationInput) String() string {
  2539. return awsutil.Prettify(s)
  2540. }
  2541. // GoString returns the string representation
  2542. func (s CreatePlatformApplicationInput) GoString() string {
  2543. return s.String()
  2544. }
  2545. // Validate inspects the fields of the type to determine if they are valid.
  2546. func (s *CreatePlatformApplicationInput) Validate() error {
  2547. invalidParams := request.ErrInvalidParams{Context: "CreatePlatformApplicationInput"}
  2548. if s.Attributes == nil {
  2549. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  2550. }
  2551. if s.Name == nil {
  2552. invalidParams.Add(request.NewErrParamRequired("Name"))
  2553. }
  2554. if s.Platform == nil {
  2555. invalidParams.Add(request.NewErrParamRequired("Platform"))
  2556. }
  2557. if invalidParams.Len() > 0 {
  2558. return invalidParams
  2559. }
  2560. return nil
  2561. }
  2562. // Response from CreatePlatformApplication action.
  2563. type CreatePlatformApplicationOutput struct {
  2564. _ struct{} `type:"structure"`
  2565. // PlatformApplicationArn is returned.
  2566. PlatformApplicationArn *string `type:"string"`
  2567. }
  2568. // String returns the string representation
  2569. func (s CreatePlatformApplicationOutput) String() string {
  2570. return awsutil.Prettify(s)
  2571. }
  2572. // GoString returns the string representation
  2573. func (s CreatePlatformApplicationOutput) GoString() string {
  2574. return s.String()
  2575. }
  2576. // Input for CreatePlatformEndpoint action.
  2577. type CreatePlatformEndpointInput struct {
  2578. _ struct{} `type:"structure"`
  2579. // For a list of attributes, see SetEndpointAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html).
  2580. Attributes map[string]*string `type:"map"`
  2581. // Arbitrary user data to associate with the endpoint. Amazon SNS does not use
  2582. // this data. The data must be in UTF-8 format and less than 2KB.
  2583. CustomUserData *string `type:"string"`
  2584. // PlatformApplicationArn returned from CreatePlatformApplication is used to
  2585. // create a an endpoint.
  2586. //
  2587. // PlatformApplicationArn is a required field
  2588. PlatformApplicationArn *string `type:"string" required:"true"`
  2589. // Unique identifier created by the notification service for an app on a device.
  2590. // The specific name for Token will vary, depending on which notification service
  2591. // is being used. For example, when using APNS as the notification service,
  2592. // you need the device token. Alternatively, when using GCM or ADM, the device
  2593. // token equivalent is called the registration ID.
  2594. //
  2595. // Token is a required field
  2596. Token *string `type:"string" required:"true"`
  2597. }
  2598. // String returns the string representation
  2599. func (s CreatePlatformEndpointInput) String() string {
  2600. return awsutil.Prettify(s)
  2601. }
  2602. // GoString returns the string representation
  2603. func (s CreatePlatformEndpointInput) GoString() string {
  2604. return s.String()
  2605. }
  2606. // Validate inspects the fields of the type to determine if they are valid.
  2607. func (s *CreatePlatformEndpointInput) Validate() error {
  2608. invalidParams := request.ErrInvalidParams{Context: "CreatePlatformEndpointInput"}
  2609. if s.PlatformApplicationArn == nil {
  2610. invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
  2611. }
  2612. if s.Token == nil {
  2613. invalidParams.Add(request.NewErrParamRequired("Token"))
  2614. }
  2615. if invalidParams.Len() > 0 {
  2616. return invalidParams
  2617. }
  2618. return nil
  2619. }
  2620. // Response from CreateEndpoint action.
  2621. type CreatePlatformEndpointOutput struct {
  2622. _ struct{} `type:"structure"`
  2623. // EndpointArn returned from CreateEndpoint action.
  2624. EndpointArn *string `type:"string"`
  2625. }
  2626. // String returns the string representation
  2627. func (s CreatePlatformEndpointOutput) String() string {
  2628. return awsutil.Prettify(s)
  2629. }
  2630. // GoString returns the string representation
  2631. func (s CreatePlatformEndpointOutput) GoString() string {
  2632. return s.String()
  2633. }
  2634. // Input for CreateTopic action.
  2635. type CreateTopicInput struct {
  2636. _ struct{} `type:"structure"`
  2637. // The name of the topic you want to create.
  2638. //
  2639. // Constraints: Topic names must be made up of only uppercase and lowercase
  2640. // ASCII letters, numbers, underscores, and hyphens, and must be between 1 and
  2641. // 256 characters long.
  2642. //
  2643. // Name is a required field
  2644. Name *string `type:"string" required:"true"`
  2645. }
  2646. // String returns the string representation
  2647. func (s CreateTopicInput) String() string {
  2648. return awsutil.Prettify(s)
  2649. }
  2650. // GoString returns the string representation
  2651. func (s CreateTopicInput) GoString() string {
  2652. return s.String()
  2653. }
  2654. // Validate inspects the fields of the type to determine if they are valid.
  2655. func (s *CreateTopicInput) Validate() error {
  2656. invalidParams := request.ErrInvalidParams{Context: "CreateTopicInput"}
  2657. if s.Name == nil {
  2658. invalidParams.Add(request.NewErrParamRequired("Name"))
  2659. }
  2660. if invalidParams.Len() > 0 {
  2661. return invalidParams
  2662. }
  2663. return nil
  2664. }
  2665. // Response from CreateTopic action.
  2666. type CreateTopicOutput struct {
  2667. _ struct{} `type:"structure"`
  2668. // The Amazon Resource Name (ARN) assigned to the created topic.
  2669. TopicArn *string `type:"string"`
  2670. }
  2671. // String returns the string representation
  2672. func (s CreateTopicOutput) String() string {
  2673. return awsutil.Prettify(s)
  2674. }
  2675. // GoString returns the string representation
  2676. func (s CreateTopicOutput) GoString() string {
  2677. return s.String()
  2678. }
  2679. // Input for DeleteEndpoint action.
  2680. type DeleteEndpointInput struct {
  2681. _ struct{} `type:"structure"`
  2682. // EndpointArn of endpoint to delete.
  2683. //
  2684. // EndpointArn is a required field
  2685. EndpointArn *string `type:"string" required:"true"`
  2686. }
  2687. // String returns the string representation
  2688. func (s DeleteEndpointInput) String() string {
  2689. return awsutil.Prettify(s)
  2690. }
  2691. // GoString returns the string representation
  2692. func (s DeleteEndpointInput) GoString() string {
  2693. return s.String()
  2694. }
  2695. // Validate inspects the fields of the type to determine if they are valid.
  2696. func (s *DeleteEndpointInput) Validate() error {
  2697. invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointInput"}
  2698. if s.EndpointArn == nil {
  2699. invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
  2700. }
  2701. if invalidParams.Len() > 0 {
  2702. return invalidParams
  2703. }
  2704. return nil
  2705. }
  2706. type DeleteEndpointOutput struct {
  2707. _ struct{} `type:"structure"`
  2708. }
  2709. // String returns the string representation
  2710. func (s DeleteEndpointOutput) String() string {
  2711. return awsutil.Prettify(s)
  2712. }
  2713. // GoString returns the string representation
  2714. func (s DeleteEndpointOutput) GoString() string {
  2715. return s.String()
  2716. }
  2717. // Input for DeletePlatformApplication action.
  2718. type DeletePlatformApplicationInput struct {
  2719. _ struct{} `type:"structure"`
  2720. // PlatformApplicationArn of platform application object to delete.
  2721. //
  2722. // PlatformApplicationArn is a required field
  2723. PlatformApplicationArn *string `type:"string" required:"true"`
  2724. }
  2725. // String returns the string representation
  2726. func (s DeletePlatformApplicationInput) String() string {
  2727. return awsutil.Prettify(s)
  2728. }
  2729. // GoString returns the string representation
  2730. func (s DeletePlatformApplicationInput) GoString() string {
  2731. return s.String()
  2732. }
  2733. // Validate inspects the fields of the type to determine if they are valid.
  2734. func (s *DeletePlatformApplicationInput) Validate() error {
  2735. invalidParams := request.ErrInvalidParams{Context: "DeletePlatformApplicationInput"}
  2736. if s.PlatformApplicationArn == nil {
  2737. invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
  2738. }
  2739. if invalidParams.Len() > 0 {
  2740. return invalidParams
  2741. }
  2742. return nil
  2743. }
  2744. type DeletePlatformApplicationOutput struct {
  2745. _ struct{} `type:"structure"`
  2746. }
  2747. // String returns the string representation
  2748. func (s DeletePlatformApplicationOutput) String() string {
  2749. return awsutil.Prettify(s)
  2750. }
  2751. // GoString returns the string representation
  2752. func (s DeletePlatformApplicationOutput) GoString() string {
  2753. return s.String()
  2754. }
  2755. type DeleteTopicInput struct {
  2756. _ struct{} `type:"structure"`
  2757. // The ARN of the topic you want to delete.
  2758. //
  2759. // TopicArn is a required field
  2760. TopicArn *string `type:"string" required:"true"`
  2761. }
  2762. // String returns the string representation
  2763. func (s DeleteTopicInput) String() string {
  2764. return awsutil.Prettify(s)
  2765. }
  2766. // GoString returns the string representation
  2767. func (s DeleteTopicInput) GoString() string {
  2768. return s.String()
  2769. }
  2770. // Validate inspects the fields of the type to determine if they are valid.
  2771. func (s *DeleteTopicInput) Validate() error {
  2772. invalidParams := request.ErrInvalidParams{Context: "DeleteTopicInput"}
  2773. if s.TopicArn == nil {
  2774. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  2775. }
  2776. if invalidParams.Len() > 0 {
  2777. return invalidParams
  2778. }
  2779. return nil
  2780. }
  2781. type DeleteTopicOutput struct {
  2782. _ struct{} `type:"structure"`
  2783. }
  2784. // String returns the string representation
  2785. func (s DeleteTopicOutput) String() string {
  2786. return awsutil.Prettify(s)
  2787. }
  2788. // GoString returns the string representation
  2789. func (s DeleteTopicOutput) GoString() string {
  2790. return s.String()
  2791. }
  2792. // Endpoint for mobile app and device.
  2793. type Endpoint struct {
  2794. _ struct{} `type:"structure"`
  2795. // Attributes for endpoint.
  2796. Attributes map[string]*string `type:"map"`
  2797. // EndpointArn for mobile app and device.
  2798. EndpointArn *string `type:"string"`
  2799. }
  2800. // String returns the string representation
  2801. func (s Endpoint) String() string {
  2802. return awsutil.Prettify(s)
  2803. }
  2804. // GoString returns the string representation
  2805. func (s Endpoint) GoString() string {
  2806. return s.String()
  2807. }
  2808. // Input for GetEndpointAttributes action.
  2809. type GetEndpointAttributesInput struct {
  2810. _ struct{} `type:"structure"`
  2811. // EndpointArn for GetEndpointAttributes input.
  2812. //
  2813. // EndpointArn is a required field
  2814. EndpointArn *string `type:"string" required:"true"`
  2815. }
  2816. // String returns the string representation
  2817. func (s GetEndpointAttributesInput) String() string {
  2818. return awsutil.Prettify(s)
  2819. }
  2820. // GoString returns the string representation
  2821. func (s GetEndpointAttributesInput) GoString() string {
  2822. return s.String()
  2823. }
  2824. // Validate inspects the fields of the type to determine if they are valid.
  2825. func (s *GetEndpointAttributesInput) Validate() error {
  2826. invalidParams := request.ErrInvalidParams{Context: "GetEndpointAttributesInput"}
  2827. if s.EndpointArn == nil {
  2828. invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
  2829. }
  2830. if invalidParams.Len() > 0 {
  2831. return invalidParams
  2832. }
  2833. return nil
  2834. }
  2835. // Response from GetEndpointAttributes of the EndpointArn.
  2836. type GetEndpointAttributesOutput struct {
  2837. _ struct{} `type:"structure"`
  2838. // Attributes include the following:
  2839. //
  2840. // * CustomUserData -- arbitrary user data to associate with the endpoint.
  2841. // Amazon SNS does not use this data. The data must be in UTF-8 format and
  2842. // less than 2KB.
  2843. //
  2844. // * Enabled -- flag that enables/disables delivery to the endpoint. Amazon
  2845. // SNS will set this to false when a notification service indicates to Amazon
  2846. // SNS that the endpoint is invalid. Users can set it back to true, typically
  2847. // after updating Token.
  2848. //
  2849. // * Token -- device token, also referred to as a registration id, for an
  2850. // app and mobile device. This is returned from the notification service
  2851. // when an app and mobile device are registered with the notification service.
  2852. Attributes map[string]*string `type:"map"`
  2853. }
  2854. // String returns the string representation
  2855. func (s GetEndpointAttributesOutput) String() string {
  2856. return awsutil.Prettify(s)
  2857. }
  2858. // GoString returns the string representation
  2859. func (s GetEndpointAttributesOutput) GoString() string {
  2860. return s.String()
  2861. }
  2862. // Input for GetPlatformApplicationAttributes action.
  2863. type GetPlatformApplicationAttributesInput struct {
  2864. _ struct{} `type:"structure"`
  2865. // PlatformApplicationArn for GetPlatformApplicationAttributesInput.
  2866. //
  2867. // PlatformApplicationArn is a required field
  2868. PlatformApplicationArn *string `type:"string" required:"true"`
  2869. }
  2870. // String returns the string representation
  2871. func (s GetPlatformApplicationAttributesInput) String() string {
  2872. return awsutil.Prettify(s)
  2873. }
  2874. // GoString returns the string representation
  2875. func (s GetPlatformApplicationAttributesInput) GoString() string {
  2876. return s.String()
  2877. }
  2878. // Validate inspects the fields of the type to determine if they are valid.
  2879. func (s *GetPlatformApplicationAttributesInput) Validate() error {
  2880. invalidParams := request.ErrInvalidParams{Context: "GetPlatformApplicationAttributesInput"}
  2881. if s.PlatformApplicationArn == nil {
  2882. invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
  2883. }
  2884. if invalidParams.Len() > 0 {
  2885. return invalidParams
  2886. }
  2887. return nil
  2888. }
  2889. // Response for GetPlatformApplicationAttributes action.
  2890. type GetPlatformApplicationAttributesOutput struct {
  2891. _ struct{} `type:"structure"`
  2892. // Attributes include the following:
  2893. //
  2894. // * EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications
  2895. // should be sent.
  2896. //
  2897. // * EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications
  2898. // should be sent.
  2899. //
  2900. // * EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications
  2901. // should be sent.
  2902. //
  2903. // * EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications
  2904. // should be sent upon Direct Publish delivery failure (permanent) to one
  2905. // of the application's endpoints.
  2906. Attributes map[string]*string `type:"map"`
  2907. }
  2908. // String returns the string representation
  2909. func (s GetPlatformApplicationAttributesOutput) String() string {
  2910. return awsutil.Prettify(s)
  2911. }
  2912. // GoString returns the string representation
  2913. func (s GetPlatformApplicationAttributesOutput) GoString() string {
  2914. return s.String()
  2915. }
  2916. // The input for the GetSMSAttributes request.
  2917. type GetSMSAttributesInput struct {
  2918. _ struct{} `type:"structure"`
  2919. // A list of the individual attribute names, such as MonthlySpendLimit, for
  2920. // which you want values.
  2921. //
  2922. // For all attribute names, see SetSMSAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html).
  2923. //
  2924. // If you don't use this parameter, Amazon SNS returns all SMS attributes.
  2925. Attributes []*string `locationName:"attributes" type:"list"`
  2926. }
  2927. // String returns the string representation
  2928. func (s GetSMSAttributesInput) String() string {
  2929. return awsutil.Prettify(s)
  2930. }
  2931. // GoString returns the string representation
  2932. func (s GetSMSAttributesInput) GoString() string {
  2933. return s.String()
  2934. }
  2935. // The response from the GetSMSAttributes request.
  2936. type GetSMSAttributesOutput struct {
  2937. _ struct{} `type:"structure"`
  2938. // The SMS attribute names and their values.
  2939. Attributes map[string]*string `locationName:"attributes" type:"map"`
  2940. }
  2941. // String returns the string representation
  2942. func (s GetSMSAttributesOutput) String() string {
  2943. return awsutil.Prettify(s)
  2944. }
  2945. // GoString returns the string representation
  2946. func (s GetSMSAttributesOutput) GoString() string {
  2947. return s.String()
  2948. }
  2949. // Input for GetSubscriptionAttributes.
  2950. type GetSubscriptionAttributesInput struct {
  2951. _ struct{} `type:"structure"`
  2952. // The ARN of the subscription whose properties you want to get.
  2953. //
  2954. // SubscriptionArn is a required field
  2955. SubscriptionArn *string `type:"string" required:"true"`
  2956. }
  2957. // String returns the string representation
  2958. func (s GetSubscriptionAttributesInput) String() string {
  2959. return awsutil.Prettify(s)
  2960. }
  2961. // GoString returns the string representation
  2962. func (s GetSubscriptionAttributesInput) GoString() string {
  2963. return s.String()
  2964. }
  2965. // Validate inspects the fields of the type to determine if they are valid.
  2966. func (s *GetSubscriptionAttributesInput) Validate() error {
  2967. invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionAttributesInput"}
  2968. if s.SubscriptionArn == nil {
  2969. invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
  2970. }
  2971. if invalidParams.Len() > 0 {
  2972. return invalidParams
  2973. }
  2974. return nil
  2975. }
  2976. // Response for GetSubscriptionAttributes action.
  2977. type GetSubscriptionAttributesOutput struct {
  2978. _ struct{} `type:"structure"`
  2979. // A map of the subscription's attributes. Attributes in this map include the
  2980. // following:
  2981. //
  2982. // * SubscriptionArn -- the subscription's ARN
  2983. //
  2984. // * TopicArn -- the topic ARN that the subscription is associated with
  2985. //
  2986. // * Owner -- the AWS account ID of the subscription's owner
  2987. //
  2988. // * ConfirmationWasAuthenticated -- true if the subscription confirmation
  2989. // request was authenticated
  2990. //
  2991. // * DeliveryPolicy -- the JSON serialization of the subscription's delivery
  2992. // policy
  2993. //
  2994. // * EffectiveDeliveryPolicy -- the JSON serialization of the effective delivery
  2995. // policy that takes into account the topic delivery policy and account system
  2996. // defaults
  2997. Attributes map[string]*string `type:"map"`
  2998. }
  2999. // String returns the string representation
  3000. func (s GetSubscriptionAttributesOutput) String() string {
  3001. return awsutil.Prettify(s)
  3002. }
  3003. // GoString returns the string representation
  3004. func (s GetSubscriptionAttributesOutput) GoString() string {
  3005. return s.String()
  3006. }
  3007. // Input for GetTopicAttributes action.
  3008. type GetTopicAttributesInput struct {
  3009. _ struct{} `type:"structure"`
  3010. // The ARN of the topic whose properties you want to get.
  3011. //
  3012. // TopicArn is a required field
  3013. TopicArn *string `type:"string" required:"true"`
  3014. }
  3015. // String returns the string representation
  3016. func (s GetTopicAttributesInput) String() string {
  3017. return awsutil.Prettify(s)
  3018. }
  3019. // GoString returns the string representation
  3020. func (s GetTopicAttributesInput) GoString() string {
  3021. return s.String()
  3022. }
  3023. // Validate inspects the fields of the type to determine if they are valid.
  3024. func (s *GetTopicAttributesInput) Validate() error {
  3025. invalidParams := request.ErrInvalidParams{Context: "GetTopicAttributesInput"}
  3026. if s.TopicArn == nil {
  3027. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  3028. }
  3029. if invalidParams.Len() > 0 {
  3030. return invalidParams
  3031. }
  3032. return nil
  3033. }
  3034. // Response for GetTopicAttributes action.
  3035. type GetTopicAttributesOutput struct {
  3036. _ struct{} `type:"structure"`
  3037. // A map of the topic's attributes. Attributes in this map include the following:
  3038. //
  3039. // * TopicArn -- the topic's ARN
  3040. //
  3041. // * Owner -- the AWS account ID of the topic's owner
  3042. //
  3043. // * Policy -- the JSON serialization of the topic's access control policy
  3044. //
  3045. // * DisplayName -- the human-readable name used in the "From" field for
  3046. // notifications to email and email-json endpoints
  3047. //
  3048. // * SubscriptionsPending -- the number of subscriptions pending confirmation
  3049. // on this topic
  3050. //
  3051. // * SubscriptionsConfirmed -- the number of confirmed subscriptions on this
  3052. // topic
  3053. //
  3054. // * SubscriptionsDeleted -- the number of deleted subscriptions on this
  3055. // topic
  3056. //
  3057. // * DeliveryPolicy -- the JSON serialization of the topic's delivery policy
  3058. //
  3059. // * EffectiveDeliveryPolicy -- the JSON serialization of the effective delivery
  3060. // policy that takes into account system defaults
  3061. Attributes map[string]*string `type:"map"`
  3062. }
  3063. // String returns the string representation
  3064. func (s GetTopicAttributesOutput) String() string {
  3065. return awsutil.Prettify(s)
  3066. }
  3067. // GoString returns the string representation
  3068. func (s GetTopicAttributesOutput) GoString() string {
  3069. return s.String()
  3070. }
  3071. // Input for ListEndpointsByPlatformApplication action.
  3072. type ListEndpointsByPlatformApplicationInput struct {
  3073. _ struct{} `type:"structure"`
  3074. // NextToken string is used when calling ListEndpointsByPlatformApplication
  3075. // action to retrieve additional records that are available after the first
  3076. // page results.
  3077. NextToken *string `type:"string"`
  3078. // PlatformApplicationArn for ListEndpointsByPlatformApplicationInput action.
  3079. //
  3080. // PlatformApplicationArn is a required field
  3081. PlatformApplicationArn *string `type:"string" required:"true"`
  3082. }
  3083. // String returns the string representation
  3084. func (s ListEndpointsByPlatformApplicationInput) String() string {
  3085. return awsutil.Prettify(s)
  3086. }
  3087. // GoString returns the string representation
  3088. func (s ListEndpointsByPlatformApplicationInput) GoString() string {
  3089. return s.String()
  3090. }
  3091. // Validate inspects the fields of the type to determine if they are valid.
  3092. func (s *ListEndpointsByPlatformApplicationInput) Validate() error {
  3093. invalidParams := request.ErrInvalidParams{Context: "ListEndpointsByPlatformApplicationInput"}
  3094. if s.PlatformApplicationArn == nil {
  3095. invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
  3096. }
  3097. if invalidParams.Len() > 0 {
  3098. return invalidParams
  3099. }
  3100. return nil
  3101. }
  3102. // Response for ListEndpointsByPlatformApplication action.
  3103. type ListEndpointsByPlatformApplicationOutput struct {
  3104. _ struct{} `type:"structure"`
  3105. // Endpoints returned for ListEndpointsByPlatformApplication action.
  3106. Endpoints []*Endpoint `type:"list"`
  3107. // NextToken string is returned when calling ListEndpointsByPlatformApplication
  3108. // action if additional records are available after the first page results.
  3109. NextToken *string `type:"string"`
  3110. }
  3111. // String returns the string representation
  3112. func (s ListEndpointsByPlatformApplicationOutput) String() string {
  3113. return awsutil.Prettify(s)
  3114. }
  3115. // GoString returns the string representation
  3116. func (s ListEndpointsByPlatformApplicationOutput) GoString() string {
  3117. return s.String()
  3118. }
  3119. // The input for the ListPhoneNumbersOptedOut action.
  3120. type ListPhoneNumbersOptedOutInput struct {
  3121. _ struct{} `type:"structure"`
  3122. // A NextToken string is used when you call the ListPhoneNumbersOptedOut action
  3123. // to retrieve additional records that are available after the first page of
  3124. // results.
  3125. NextToken *string `locationName:"nextToken" type:"string"`
  3126. }
  3127. // String returns the string representation
  3128. func (s ListPhoneNumbersOptedOutInput) String() string {
  3129. return awsutil.Prettify(s)
  3130. }
  3131. // GoString returns the string representation
  3132. func (s ListPhoneNumbersOptedOutInput) GoString() string {
  3133. return s.String()
  3134. }
  3135. // The response from the ListPhoneNumbersOptedOut action.
  3136. type ListPhoneNumbersOptedOutOutput struct {
  3137. _ struct{} `type:"structure"`
  3138. // A NextToken string is returned when you call the ListPhoneNumbersOptedOut
  3139. // action if additional records are available after the first page of results.
  3140. NextToken *string `locationName:"nextToken" type:"string"`
  3141. // A list of phone numbers that are opted out of receiving SMS messages. The
  3142. // list is paginated, and each page can contain up to 100 phone numbers.
  3143. PhoneNumbers []*string `locationName:"phoneNumbers" type:"list"`
  3144. }
  3145. // String returns the string representation
  3146. func (s ListPhoneNumbersOptedOutOutput) String() string {
  3147. return awsutil.Prettify(s)
  3148. }
  3149. // GoString returns the string representation
  3150. func (s ListPhoneNumbersOptedOutOutput) GoString() string {
  3151. return s.String()
  3152. }
  3153. // Input for ListPlatformApplications action.
  3154. type ListPlatformApplicationsInput struct {
  3155. _ struct{} `type:"structure"`
  3156. // NextToken string is used when calling ListPlatformApplications action to
  3157. // retrieve additional records that are available after the first page results.
  3158. NextToken *string `type:"string"`
  3159. }
  3160. // String returns the string representation
  3161. func (s ListPlatformApplicationsInput) String() string {
  3162. return awsutil.Prettify(s)
  3163. }
  3164. // GoString returns the string representation
  3165. func (s ListPlatformApplicationsInput) GoString() string {
  3166. return s.String()
  3167. }
  3168. // Response for ListPlatformApplications action.
  3169. type ListPlatformApplicationsOutput struct {
  3170. _ struct{} `type:"structure"`
  3171. // NextToken string is returned when calling ListPlatformApplications action
  3172. // if additional records are available after the first page results.
  3173. NextToken *string `type:"string"`
  3174. // Platform applications returned when calling ListPlatformApplications action.
  3175. PlatformApplications []*PlatformApplication `type:"list"`
  3176. }
  3177. // String returns the string representation
  3178. func (s ListPlatformApplicationsOutput) String() string {
  3179. return awsutil.Prettify(s)
  3180. }
  3181. // GoString returns the string representation
  3182. func (s ListPlatformApplicationsOutput) GoString() string {
  3183. return s.String()
  3184. }
  3185. // Input for ListSubscriptionsByTopic action.
  3186. type ListSubscriptionsByTopicInput struct {
  3187. _ struct{} `type:"structure"`
  3188. // Token returned by the previous ListSubscriptionsByTopic request.
  3189. NextToken *string `type:"string"`
  3190. // The ARN of the topic for which you wish to find subscriptions.
  3191. //
  3192. // TopicArn is a required field
  3193. TopicArn *string `type:"string" required:"true"`
  3194. }
  3195. // String returns the string representation
  3196. func (s ListSubscriptionsByTopicInput) String() string {
  3197. return awsutil.Prettify(s)
  3198. }
  3199. // GoString returns the string representation
  3200. func (s ListSubscriptionsByTopicInput) GoString() string {
  3201. return s.String()
  3202. }
  3203. // Validate inspects the fields of the type to determine if they are valid.
  3204. func (s *ListSubscriptionsByTopicInput) Validate() error {
  3205. invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionsByTopicInput"}
  3206. if s.TopicArn == nil {
  3207. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  3208. }
  3209. if invalidParams.Len() > 0 {
  3210. return invalidParams
  3211. }
  3212. return nil
  3213. }
  3214. // Response for ListSubscriptionsByTopic action.
  3215. type ListSubscriptionsByTopicOutput struct {
  3216. _ struct{} `type:"structure"`
  3217. // Token to pass along to the next ListSubscriptionsByTopic request. This element
  3218. // is returned if there are more subscriptions to retrieve.
  3219. NextToken *string `type:"string"`
  3220. // A list of subscriptions.
  3221. Subscriptions []*Subscription `type:"list"`
  3222. }
  3223. // String returns the string representation
  3224. func (s ListSubscriptionsByTopicOutput) String() string {
  3225. return awsutil.Prettify(s)
  3226. }
  3227. // GoString returns the string representation
  3228. func (s ListSubscriptionsByTopicOutput) GoString() string {
  3229. return s.String()
  3230. }
  3231. // Input for ListSubscriptions action.
  3232. type ListSubscriptionsInput struct {
  3233. _ struct{} `type:"structure"`
  3234. // Token returned by the previous ListSubscriptions request.
  3235. NextToken *string `type:"string"`
  3236. }
  3237. // String returns the string representation
  3238. func (s ListSubscriptionsInput) String() string {
  3239. return awsutil.Prettify(s)
  3240. }
  3241. // GoString returns the string representation
  3242. func (s ListSubscriptionsInput) GoString() string {
  3243. return s.String()
  3244. }
  3245. // Response for ListSubscriptions action
  3246. type ListSubscriptionsOutput struct {
  3247. _ struct{} `type:"structure"`
  3248. // Token to pass along to the next ListSubscriptions request. This element is
  3249. // returned if there are more subscriptions to retrieve.
  3250. NextToken *string `type:"string"`
  3251. // A list of subscriptions.
  3252. Subscriptions []*Subscription `type:"list"`
  3253. }
  3254. // String returns the string representation
  3255. func (s ListSubscriptionsOutput) String() string {
  3256. return awsutil.Prettify(s)
  3257. }
  3258. // GoString returns the string representation
  3259. func (s ListSubscriptionsOutput) GoString() string {
  3260. return s.String()
  3261. }
  3262. type ListTopicsInput struct {
  3263. _ struct{} `type:"structure"`
  3264. // Token returned by the previous ListTopics request.
  3265. NextToken *string `type:"string"`
  3266. }
  3267. // String returns the string representation
  3268. func (s ListTopicsInput) String() string {
  3269. return awsutil.Prettify(s)
  3270. }
  3271. // GoString returns the string representation
  3272. func (s ListTopicsInput) GoString() string {
  3273. return s.String()
  3274. }
  3275. // Response for ListTopics action.
  3276. type ListTopicsOutput struct {
  3277. _ struct{} `type:"structure"`
  3278. // Token to pass along to the next ListTopics request. This element is returned
  3279. // if there are additional topics to retrieve.
  3280. NextToken *string `type:"string"`
  3281. // A list of topic ARNs.
  3282. Topics []*Topic `type:"list"`
  3283. }
  3284. // String returns the string representation
  3285. func (s ListTopicsOutput) String() string {
  3286. return awsutil.Prettify(s)
  3287. }
  3288. // GoString returns the string representation
  3289. func (s ListTopicsOutput) GoString() string {
  3290. return s.String()
  3291. }
  3292. // The user-specified message attribute value. For string data types, the value
  3293. // attribute has the same restrictions on the content as the message body. For
  3294. // more information, see Publish (http://docs.aws.amazon.com/sns/latest/api/API_Publish.html).
  3295. //
  3296. // Name, type, and value must not be empty or null. In addition, the message
  3297. // body should not be empty or null. All parts of the message attribute, including
  3298. // name, type, and value, are included in the message size restriction, which
  3299. // is currently 256 KB (262,144 bytes). For more information, see Using Amazon
  3300. // SNS Message Attributes (http://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html).
  3301. type MessageAttributeValue struct {
  3302. _ struct{} `type:"structure"`
  3303. // Binary type attributes can store any binary data, for example, compressed
  3304. // data, encrypted data, or images.
  3305. //
  3306. // BinaryValue is automatically base64 encoded/decoded by the SDK.
  3307. BinaryValue []byte `type:"blob"`
  3308. // Amazon SNS supports the following logical data types: String, Number, and
  3309. // Binary. For more information, see Message Attribute Data Types (http://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes).
  3310. //
  3311. // DataType is a required field
  3312. DataType *string `type:"string" required:"true"`
  3313. // Strings are Unicode with UTF8 binary encoding. For a list of code values,
  3314. // see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  3315. StringValue *string `type:"string"`
  3316. }
  3317. // String returns the string representation
  3318. func (s MessageAttributeValue) String() string {
  3319. return awsutil.Prettify(s)
  3320. }
  3321. // GoString returns the string representation
  3322. func (s MessageAttributeValue) GoString() string {
  3323. return s.String()
  3324. }
  3325. // Validate inspects the fields of the type to determine if they are valid.
  3326. func (s *MessageAttributeValue) Validate() error {
  3327. invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"}
  3328. if s.DataType == nil {
  3329. invalidParams.Add(request.NewErrParamRequired("DataType"))
  3330. }
  3331. if invalidParams.Len() > 0 {
  3332. return invalidParams
  3333. }
  3334. return nil
  3335. }
  3336. // Input for the OptInPhoneNumber action.
  3337. type OptInPhoneNumberInput struct {
  3338. _ struct{} `type:"structure"`
  3339. // The phone number to opt in.
  3340. //
  3341. // PhoneNumber is a required field
  3342. PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"`
  3343. }
  3344. // String returns the string representation
  3345. func (s OptInPhoneNumberInput) String() string {
  3346. return awsutil.Prettify(s)
  3347. }
  3348. // GoString returns the string representation
  3349. func (s OptInPhoneNumberInput) GoString() string {
  3350. return s.String()
  3351. }
  3352. // Validate inspects the fields of the type to determine if they are valid.
  3353. func (s *OptInPhoneNumberInput) Validate() error {
  3354. invalidParams := request.ErrInvalidParams{Context: "OptInPhoneNumberInput"}
  3355. if s.PhoneNumber == nil {
  3356. invalidParams.Add(request.NewErrParamRequired("PhoneNumber"))
  3357. }
  3358. if invalidParams.Len() > 0 {
  3359. return invalidParams
  3360. }
  3361. return nil
  3362. }
  3363. // The response for the OptInPhoneNumber action.
  3364. type OptInPhoneNumberOutput struct {
  3365. _ struct{} `type:"structure"`
  3366. }
  3367. // String returns the string representation
  3368. func (s OptInPhoneNumberOutput) String() string {
  3369. return awsutil.Prettify(s)
  3370. }
  3371. // GoString returns the string representation
  3372. func (s OptInPhoneNumberOutput) GoString() string {
  3373. return s.String()
  3374. }
  3375. // Platform application object.
  3376. type PlatformApplication struct {
  3377. _ struct{} `type:"structure"`
  3378. // Attributes for platform application object.
  3379. Attributes map[string]*string `type:"map"`
  3380. // PlatformApplicationArn for platform application object.
  3381. PlatformApplicationArn *string `type:"string"`
  3382. }
  3383. // String returns the string representation
  3384. func (s PlatformApplication) String() string {
  3385. return awsutil.Prettify(s)
  3386. }
  3387. // GoString returns the string representation
  3388. func (s PlatformApplication) GoString() string {
  3389. return s.String()
  3390. }
  3391. // Input for Publish action.
  3392. type PublishInput struct {
  3393. _ struct{} `type:"structure"`
  3394. // The message you want to send to the topic.
  3395. //
  3396. // If you want to send the same message to all transport protocols, include
  3397. // the text of the message as a String value.
  3398. //
  3399. // If you want to send different messages for each transport protocol, set the
  3400. // value of the MessageStructure parameter to json and use a JSON object for
  3401. // the Message parameter.
  3402. //
  3403. // Constraints: Messages must be UTF-8 encoded strings at most 256 KB in size
  3404. // (262144 bytes, not 262144 characters).
  3405. //
  3406. // JSON-specific constraints:
  3407. //
  3408. // * Keys in the JSON object that correspond to supported transport protocols
  3409. // must have simple JSON string values.
  3410. //
  3411. // * The values will be parsed (unescaped) before they are used in outgoing
  3412. // messages.
  3413. //
  3414. // * Outbound notifications are JSON encoded (meaning that the characters
  3415. // will be reescaped for sending).
  3416. //
  3417. // * Values have a minimum length of 0 (the empty string, "", is allowed).
  3418. //
  3419. // * Values have a maximum length bounded by the overall message size (so,
  3420. // including multiple protocols may limit message sizes).
  3421. //
  3422. // * Non-string values will cause the key to be ignored.
  3423. //
  3424. // * Keys that do not correspond to supported transport protocols are ignored.
  3425. //
  3426. // * Duplicate keys are not allowed.
  3427. //
  3428. // * Failure to parse or validate any key or value in the message will cause
  3429. // the Publish call to return an error (no partial delivery).
  3430. //
  3431. // Message is a required field
  3432. Message *string `type:"string" required:"true"`
  3433. // Message attributes for Publish action.
  3434. MessageAttributes map[string]*MessageAttributeValue `locationNameKey:"Name" locationNameValue:"Value" type:"map"`
  3435. // Set MessageStructure to json if you want to send a different message for
  3436. // each protocol. For example, using one publish action, you can send a short
  3437. // message to your SMS subscribers and a longer message to your email subscribers.
  3438. // If you set MessageStructure to json, the value of the Message parameter must:
  3439. //
  3440. // * be a syntactically valid JSON object; and
  3441. //
  3442. // * contain at least a top-level JSON key of "default" with a value that
  3443. // is a string.
  3444. //
  3445. // You can define other top-level keys that define the message you want to send
  3446. // to a specific transport protocol (e.g., "http").
  3447. //
  3448. // For information about sending different messages for each protocol using
  3449. // the AWS Management Console, go to Create Different Messages for Each Protocol
  3450. // (http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol)
  3451. // in the Amazon Simple Notification Service Getting Started Guide.
  3452. //
  3453. // Valid value: json
  3454. MessageStructure *string `type:"string"`
  3455. // The phone number to which you want to deliver an SMS message. Use E.164 format.
  3456. //
  3457. // If you don't specify a value for the PhoneNumber parameter, you must specify
  3458. // a value for the TargetArn or TopicArn parameters.
  3459. PhoneNumber *string `type:"string"`
  3460. // Optional parameter to be used as the "Subject" line when the message is delivered
  3461. // to email endpoints. This field will also be included, if present, in the
  3462. // standard JSON messages delivered to other endpoints.
  3463. //
  3464. // Constraints: Subjects must be ASCII text that begins with a letter, number,
  3465. // or punctuation mark; must not include line breaks or control characters;
  3466. // and must be less than 100 characters long.
  3467. Subject *string `type:"string"`
  3468. // Either TopicArn or EndpointArn, but not both.
  3469. //
  3470. // If you don't specify a value for the TargetArn parameter, you must specify
  3471. // a value for the PhoneNumber or TopicArn parameters.
  3472. TargetArn *string `type:"string"`
  3473. // The topic you want to publish to.
  3474. //
  3475. // If you don't specify a value for the TopicArn parameter, you must specify
  3476. // a value for the PhoneNumber or TargetArn parameters.
  3477. TopicArn *string `type:"string"`
  3478. }
  3479. // String returns the string representation
  3480. func (s PublishInput) String() string {
  3481. return awsutil.Prettify(s)
  3482. }
  3483. // GoString returns the string representation
  3484. func (s PublishInput) GoString() string {
  3485. return s.String()
  3486. }
  3487. // Validate inspects the fields of the type to determine if they are valid.
  3488. func (s *PublishInput) Validate() error {
  3489. invalidParams := request.ErrInvalidParams{Context: "PublishInput"}
  3490. if s.Message == nil {
  3491. invalidParams.Add(request.NewErrParamRequired("Message"))
  3492. }
  3493. if s.MessageAttributes != nil {
  3494. for i, v := range s.MessageAttributes {
  3495. if v == nil {
  3496. continue
  3497. }
  3498. if err := v.Validate(); err != nil {
  3499. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
  3500. }
  3501. }
  3502. }
  3503. if invalidParams.Len() > 0 {
  3504. return invalidParams
  3505. }
  3506. return nil
  3507. }
  3508. // Response for Publish action.
  3509. type PublishOutput struct {
  3510. _ struct{} `type:"structure"`
  3511. // Unique identifier assigned to the published message.
  3512. //
  3513. // Length Constraint: Maximum 100 characters
  3514. MessageId *string `type:"string"`
  3515. }
  3516. // String returns the string representation
  3517. func (s PublishOutput) String() string {
  3518. return awsutil.Prettify(s)
  3519. }
  3520. // GoString returns the string representation
  3521. func (s PublishOutput) GoString() string {
  3522. return s.String()
  3523. }
  3524. // Input for RemovePermission action.
  3525. type RemovePermissionInput struct {
  3526. _ struct{} `type:"structure"`
  3527. // The unique label of the statement you want to remove.
  3528. //
  3529. // Label is a required field
  3530. Label *string `type:"string" required:"true"`
  3531. // The ARN of the topic whose access control policy you wish to modify.
  3532. //
  3533. // TopicArn is a required field
  3534. TopicArn *string `type:"string" required:"true"`
  3535. }
  3536. // String returns the string representation
  3537. func (s RemovePermissionInput) String() string {
  3538. return awsutil.Prettify(s)
  3539. }
  3540. // GoString returns the string representation
  3541. func (s RemovePermissionInput) GoString() string {
  3542. return s.String()
  3543. }
  3544. // Validate inspects the fields of the type to determine if they are valid.
  3545. func (s *RemovePermissionInput) Validate() error {
  3546. invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
  3547. if s.Label == nil {
  3548. invalidParams.Add(request.NewErrParamRequired("Label"))
  3549. }
  3550. if s.TopicArn == nil {
  3551. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  3552. }
  3553. if invalidParams.Len() > 0 {
  3554. return invalidParams
  3555. }
  3556. return nil
  3557. }
  3558. type RemovePermissionOutput struct {
  3559. _ struct{} `type:"structure"`
  3560. }
  3561. // String returns the string representation
  3562. func (s RemovePermissionOutput) String() string {
  3563. return awsutil.Prettify(s)
  3564. }
  3565. // GoString returns the string representation
  3566. func (s RemovePermissionOutput) GoString() string {
  3567. return s.String()
  3568. }
  3569. // Input for SetEndpointAttributes action.
  3570. type SetEndpointAttributesInput struct {
  3571. _ struct{} `type:"structure"`
  3572. // A map of the endpoint attributes. Attributes in this map include the following:
  3573. //
  3574. // * CustomUserData -- arbitrary user data to associate with the endpoint.
  3575. // Amazon SNS does not use this data. The data must be in UTF-8 format and
  3576. // less than 2KB.
  3577. //
  3578. // * Enabled -- flag that enables/disables delivery to the endpoint. Amazon
  3579. // SNS will set this to false when a notification service indicates to Amazon
  3580. // SNS that the endpoint is invalid. Users can set it back to true, typically
  3581. // after updating Token.
  3582. //
  3583. // * Token -- device token, also referred to as a registration id, for an
  3584. // app and mobile device. This is returned from the notification service
  3585. // when an app and mobile device are registered with the notification service.
  3586. //
  3587. // Attributes is a required field
  3588. Attributes map[string]*string `type:"map" required:"true"`
  3589. // EndpointArn used for SetEndpointAttributes action.
  3590. //
  3591. // EndpointArn is a required field
  3592. EndpointArn *string `type:"string" required:"true"`
  3593. }
  3594. // String returns the string representation
  3595. func (s SetEndpointAttributesInput) String() string {
  3596. return awsutil.Prettify(s)
  3597. }
  3598. // GoString returns the string representation
  3599. func (s SetEndpointAttributesInput) GoString() string {
  3600. return s.String()
  3601. }
  3602. // Validate inspects the fields of the type to determine if they are valid.
  3603. func (s *SetEndpointAttributesInput) Validate() error {
  3604. invalidParams := request.ErrInvalidParams{Context: "SetEndpointAttributesInput"}
  3605. if s.Attributes == nil {
  3606. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  3607. }
  3608. if s.EndpointArn == nil {
  3609. invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
  3610. }
  3611. if invalidParams.Len() > 0 {
  3612. return invalidParams
  3613. }
  3614. return nil
  3615. }
  3616. type SetEndpointAttributesOutput struct {
  3617. _ struct{} `type:"structure"`
  3618. }
  3619. // String returns the string representation
  3620. func (s SetEndpointAttributesOutput) String() string {
  3621. return awsutil.Prettify(s)
  3622. }
  3623. // GoString returns the string representation
  3624. func (s SetEndpointAttributesOutput) GoString() string {
  3625. return s.String()
  3626. }
  3627. // Input for SetPlatformApplicationAttributes action.
  3628. type SetPlatformApplicationAttributesInput struct {
  3629. _ struct{} `type:"structure"`
  3630. // A map of the platform application attributes. Attributes in this map include
  3631. // the following:
  3632. //
  3633. // * PlatformCredential -- The credential received from the notification
  3634. // service. For APNS/APNS_SANDBOX, PlatformCredential is private key. For
  3635. // GCM, PlatformCredential is "API key". For ADM, PlatformCredential is "client
  3636. // secret".
  3637. //
  3638. // * PlatformPrincipal -- The principal received from the notification service.
  3639. // For APNS/APNS_SANDBOX, PlatformPrincipal is SSL certificate. For GCM,
  3640. // PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is "client
  3641. // id".
  3642. //
  3643. // * EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications
  3644. // should be sent.
  3645. //
  3646. // * EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications
  3647. // should be sent.
  3648. //
  3649. // * EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications
  3650. // should be sent.
  3651. //
  3652. // * EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications
  3653. // should be sent upon Direct Publish delivery failure (permanent) to one
  3654. // of the application's endpoints.
  3655. //
  3656. // * SuccessFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write
  3657. // access to use CloudWatch Logs on your behalf.
  3658. //
  3659. // * FailureFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write
  3660. // access to use CloudWatch Logs on your behalf.
  3661. //
  3662. // * SuccessFeedbackSampleRate -- Sample rate percentage (0-100) of successfully
  3663. // delivered messages.
  3664. //
  3665. // Attributes is a required field
  3666. Attributes map[string]*string `type:"map" required:"true"`
  3667. // PlatformApplicationArn for SetPlatformApplicationAttributes action.
  3668. //
  3669. // PlatformApplicationArn is a required field
  3670. PlatformApplicationArn *string `type:"string" required:"true"`
  3671. }
  3672. // String returns the string representation
  3673. func (s SetPlatformApplicationAttributesInput) String() string {
  3674. return awsutil.Prettify(s)
  3675. }
  3676. // GoString returns the string representation
  3677. func (s SetPlatformApplicationAttributesInput) GoString() string {
  3678. return s.String()
  3679. }
  3680. // Validate inspects the fields of the type to determine if they are valid.
  3681. func (s *SetPlatformApplicationAttributesInput) Validate() error {
  3682. invalidParams := request.ErrInvalidParams{Context: "SetPlatformApplicationAttributesInput"}
  3683. if s.Attributes == nil {
  3684. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  3685. }
  3686. if s.PlatformApplicationArn == nil {
  3687. invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
  3688. }
  3689. if invalidParams.Len() > 0 {
  3690. return invalidParams
  3691. }
  3692. return nil
  3693. }
  3694. type SetPlatformApplicationAttributesOutput struct {
  3695. _ struct{} `type:"structure"`
  3696. }
  3697. // String returns the string representation
  3698. func (s SetPlatformApplicationAttributesOutput) String() string {
  3699. return awsutil.Prettify(s)
  3700. }
  3701. // GoString returns the string representation
  3702. func (s SetPlatformApplicationAttributesOutput) GoString() string {
  3703. return s.String()
  3704. }
  3705. // The input for the SetSMSAttributes action.
  3706. type SetSMSAttributesInput struct {
  3707. _ struct{} `type:"structure"`
  3708. // The default settings for sending SMS messages from your account. You can
  3709. // set values for the following attribute names:
  3710. //
  3711. // MonthlySpendLimit – The maximum amount in USD that you are willing to spend
  3712. // each month to send SMS messages. When Amazon SNS determines that sending
  3713. // an SMS message would incur a cost that exceeds this limit, it stops sending
  3714. // SMS messages within minutes.
  3715. //
  3716. // Amazon SNS stops sending SMS messages within minutes of the limit being crossed.
  3717. // During that interval, if you continue to send SMS messages, you will incur
  3718. // costs that exceed your limit.
  3719. //
  3720. // By default, the spend limit is set to the maximum allowed by Amazon SNS.
  3721. // If you want to exceed the maximum, contact AWS Support (https://aws.amazon.com/premiumsupport/)
  3722. // or your AWS sales representative for a service limit increase.
  3723. //
  3724. // DeliveryStatusIAMRole – The ARN of the IAM role that allows Amazon SNS to
  3725. // write logs about SMS deliveries in CloudWatch Logs. For each SMS message
  3726. // that you send, Amazon SNS writes a log that includes the message price, the
  3727. // success or failure status, the reason for failure (if the message failed),
  3728. // the message dwell time, and other information.
  3729. //
  3730. // DeliveryStatusSuccessSamplingRate – The percentage of successful SMS deliveries
  3731. // for which Amazon SNS will write logs in CloudWatch Logs. The value can be
  3732. // an integer from 0 - 100. For example, to write logs only for failed deliveries,
  3733. // set this value to 0. To write logs for 10% of your successful deliveries,
  3734. // set it to 10.
  3735. //
  3736. // DefaultSenderID – A string, such as your business brand, that is displayed
  3737. // as the sender on the receiving device. Support for sender IDs varies by country.
  3738. // The sender ID can be 1 - 11 alphanumeric characters, and it must contain
  3739. // at least one letter.
  3740. //
  3741. // DefaultSMSType – The type of SMS message that you will send by default. You
  3742. // can assign the following values:
  3743. //
  3744. // * Promotional – (Default) Noncritical messages, such as marketing messages.
  3745. // Amazon SNS optimizes the message delivery to incur the lowest cost.
  3746. //
  3747. // * Transactional – Critical messages that support customer transactions,
  3748. // such as one-time passcodes for multi-factor authentication. Amazon SNS
  3749. // optimizes the message delivery to achieve the highest reliability.
  3750. //
  3751. // UsageReportS3Bucket – The name of the Amazon S3 bucket to receive daily SMS
  3752. // usage reports from Amazon SNS. Each day, Amazon SNS will deliver a usage
  3753. // report as a CSV file to the bucket. The report includes the following information
  3754. // for each SMS message that was successfully delivered by your account:
  3755. //
  3756. // * Time that the message was published (in UTC)
  3757. //
  3758. // * Message ID
  3759. //
  3760. // * Destination phone number
  3761. //
  3762. // * Message type
  3763. //
  3764. // * Delivery status
  3765. //
  3766. // * Message price (in USD)
  3767. //
  3768. // * Part number (a message is split into multiple parts if it is too long
  3769. // for a single message)
  3770. //
  3771. // * Total number of parts
  3772. //
  3773. // To receive the report, the bucket must have a policy that allows the Amazon
  3774. // SNS service principle to perform the s3:PutObject and s3:GetBucketLocation
  3775. // actions.
  3776. //
  3777. // For an example bucket policy and usage report, see Monitoring SMS Activity
  3778. // (http://docs.aws.amazon.com/sns/latest/dg/sms_stats.html) in the Amazon SNS
  3779. // Developer Guide.
  3780. //
  3781. // Attributes is a required field
  3782. Attributes map[string]*string `locationName:"attributes" type:"map" required:"true"`
  3783. }
  3784. // String returns the string representation
  3785. func (s SetSMSAttributesInput) String() string {
  3786. return awsutil.Prettify(s)
  3787. }
  3788. // GoString returns the string representation
  3789. func (s SetSMSAttributesInput) GoString() string {
  3790. return s.String()
  3791. }
  3792. // Validate inspects the fields of the type to determine if they are valid.
  3793. func (s *SetSMSAttributesInput) Validate() error {
  3794. invalidParams := request.ErrInvalidParams{Context: "SetSMSAttributesInput"}
  3795. if s.Attributes == nil {
  3796. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  3797. }
  3798. if invalidParams.Len() > 0 {
  3799. return invalidParams
  3800. }
  3801. return nil
  3802. }
  3803. // The response for the SetSMSAttributes action.
  3804. type SetSMSAttributesOutput struct {
  3805. _ struct{} `type:"structure"`
  3806. }
  3807. // String returns the string representation
  3808. func (s SetSMSAttributesOutput) String() string {
  3809. return awsutil.Prettify(s)
  3810. }
  3811. // GoString returns the string representation
  3812. func (s SetSMSAttributesOutput) GoString() string {
  3813. return s.String()
  3814. }
  3815. // Input for SetSubscriptionAttributes action.
  3816. type SetSubscriptionAttributesInput struct {
  3817. _ struct{} `type:"structure"`
  3818. // The name of the attribute you want to set. Only a subset of the subscriptions
  3819. // attributes are mutable.
  3820. //
  3821. // Valid values: DeliveryPolicy | RawMessageDelivery
  3822. //
  3823. // AttributeName is a required field
  3824. AttributeName *string `type:"string" required:"true"`
  3825. // The new value for the attribute in JSON format.
  3826. AttributeValue *string `type:"string"`
  3827. // The ARN of the subscription to modify.
  3828. //
  3829. // SubscriptionArn is a required field
  3830. SubscriptionArn *string `type:"string" required:"true"`
  3831. }
  3832. // String returns the string representation
  3833. func (s SetSubscriptionAttributesInput) String() string {
  3834. return awsutil.Prettify(s)
  3835. }
  3836. // GoString returns the string representation
  3837. func (s SetSubscriptionAttributesInput) GoString() string {
  3838. return s.String()
  3839. }
  3840. // Validate inspects the fields of the type to determine if they are valid.
  3841. func (s *SetSubscriptionAttributesInput) Validate() error {
  3842. invalidParams := request.ErrInvalidParams{Context: "SetSubscriptionAttributesInput"}
  3843. if s.AttributeName == nil {
  3844. invalidParams.Add(request.NewErrParamRequired("AttributeName"))
  3845. }
  3846. if s.SubscriptionArn == nil {
  3847. invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
  3848. }
  3849. if invalidParams.Len() > 0 {
  3850. return invalidParams
  3851. }
  3852. return nil
  3853. }
  3854. type SetSubscriptionAttributesOutput struct {
  3855. _ struct{} `type:"structure"`
  3856. }
  3857. // String returns the string representation
  3858. func (s SetSubscriptionAttributesOutput) String() string {
  3859. return awsutil.Prettify(s)
  3860. }
  3861. // GoString returns the string representation
  3862. func (s SetSubscriptionAttributesOutput) GoString() string {
  3863. return s.String()
  3864. }
  3865. // Input for SetTopicAttributes action.
  3866. type SetTopicAttributesInput struct {
  3867. _ struct{} `type:"structure"`
  3868. // The name of the attribute you want to set. Only a subset of the topic's attributes
  3869. // are mutable.
  3870. //
  3871. // Valid values: Policy | DisplayName | DeliveryPolicy
  3872. //
  3873. // AttributeName is a required field
  3874. AttributeName *string `type:"string" required:"true"`
  3875. // The new value for the attribute.
  3876. AttributeValue *string `type:"string"`
  3877. // The ARN of the topic to modify.
  3878. //
  3879. // TopicArn is a required field
  3880. TopicArn *string `type:"string" required:"true"`
  3881. }
  3882. // String returns the string representation
  3883. func (s SetTopicAttributesInput) String() string {
  3884. return awsutil.Prettify(s)
  3885. }
  3886. // GoString returns the string representation
  3887. func (s SetTopicAttributesInput) GoString() string {
  3888. return s.String()
  3889. }
  3890. // Validate inspects the fields of the type to determine if they are valid.
  3891. func (s *SetTopicAttributesInput) Validate() error {
  3892. invalidParams := request.ErrInvalidParams{Context: "SetTopicAttributesInput"}
  3893. if s.AttributeName == nil {
  3894. invalidParams.Add(request.NewErrParamRequired("AttributeName"))
  3895. }
  3896. if s.TopicArn == nil {
  3897. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  3898. }
  3899. if invalidParams.Len() > 0 {
  3900. return invalidParams
  3901. }
  3902. return nil
  3903. }
  3904. type SetTopicAttributesOutput struct {
  3905. _ struct{} `type:"structure"`
  3906. }
  3907. // String returns the string representation
  3908. func (s SetTopicAttributesOutput) String() string {
  3909. return awsutil.Prettify(s)
  3910. }
  3911. // GoString returns the string representation
  3912. func (s SetTopicAttributesOutput) GoString() string {
  3913. return s.String()
  3914. }
  3915. // Input for Subscribe action.
  3916. type SubscribeInput struct {
  3917. _ struct{} `type:"structure"`
  3918. // The endpoint that you want to receive notifications. Endpoints vary by protocol:
  3919. //
  3920. // * For the http protocol, the endpoint is an URL beginning with "http://"
  3921. //
  3922. // * For the https protocol, the endpoint is a URL beginning with "https://"
  3923. //
  3924. // * For the email protocol, the endpoint is an email address
  3925. //
  3926. // * For the email-json protocol, the endpoint is an email address
  3927. //
  3928. // * For the sms protocol, the endpoint is a phone number of an SMS-enabled
  3929. // device
  3930. //
  3931. // * For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
  3932. //
  3933. // * For the application protocol, the endpoint is the EndpointArn of a mobile
  3934. // app and device.
  3935. //
  3936. // * For the lambda protocol, the endpoint is the ARN of an AWS Lambda function.
  3937. Endpoint *string `type:"string"`
  3938. // The protocol you want to use. Supported protocols include:
  3939. //
  3940. // * http -- delivery of JSON-encoded message via HTTP POST
  3941. //
  3942. // * https -- delivery of JSON-encoded message via HTTPS POST
  3943. //
  3944. // * email -- delivery of message via SMTP
  3945. //
  3946. // * email-json -- delivery of JSON-encoded message via SMTP
  3947. //
  3948. // * sms -- delivery of message via SMS
  3949. //
  3950. // * sqs -- delivery of JSON-encoded message to an Amazon SQS queue
  3951. //
  3952. // * application -- delivery of JSON-encoded message to an EndpointArn for
  3953. // a mobile app and device.
  3954. //
  3955. // * lambda -- delivery of JSON-encoded message to an AWS Lambda function.
  3956. //
  3957. // Protocol is a required field
  3958. Protocol *string `type:"string" required:"true"`
  3959. // The ARN of the topic you want to subscribe to.
  3960. //
  3961. // TopicArn is a required field
  3962. TopicArn *string `type:"string" required:"true"`
  3963. }
  3964. // String returns the string representation
  3965. func (s SubscribeInput) String() string {
  3966. return awsutil.Prettify(s)
  3967. }
  3968. // GoString returns the string representation
  3969. func (s SubscribeInput) GoString() string {
  3970. return s.String()
  3971. }
  3972. // Validate inspects the fields of the type to determine if they are valid.
  3973. func (s *SubscribeInput) Validate() error {
  3974. invalidParams := request.ErrInvalidParams{Context: "SubscribeInput"}
  3975. if s.Protocol == nil {
  3976. invalidParams.Add(request.NewErrParamRequired("Protocol"))
  3977. }
  3978. if s.TopicArn == nil {
  3979. invalidParams.Add(request.NewErrParamRequired("TopicArn"))
  3980. }
  3981. if invalidParams.Len() > 0 {
  3982. return invalidParams
  3983. }
  3984. return nil
  3985. }
  3986. // Response for Subscribe action.
  3987. type SubscribeOutput struct {
  3988. _ struct{} `type:"structure"`
  3989. // The ARN of the subscription, if the service was able to create a subscription
  3990. // immediately (without requiring endpoint owner confirmation).
  3991. SubscriptionArn *string `type:"string"`
  3992. }
  3993. // String returns the string representation
  3994. func (s SubscribeOutput) String() string {
  3995. return awsutil.Prettify(s)
  3996. }
  3997. // GoString returns the string representation
  3998. func (s SubscribeOutput) GoString() string {
  3999. return s.String()
  4000. }
  4001. // A wrapper type for the attributes of an Amazon SNS subscription.
  4002. type Subscription struct {
  4003. _ struct{} `type:"structure"`
  4004. // The subscription's endpoint (format depends on the protocol).
  4005. Endpoint *string `type:"string"`
  4006. // The subscription's owner.
  4007. Owner *string `type:"string"`
  4008. // The subscription's protocol.
  4009. Protocol *string `type:"string"`
  4010. // The subscription's ARN.
  4011. SubscriptionArn *string `type:"string"`
  4012. // The ARN of the subscription's topic.
  4013. TopicArn *string `type:"string"`
  4014. }
  4015. // String returns the string representation
  4016. func (s Subscription) String() string {
  4017. return awsutil.Prettify(s)
  4018. }
  4019. // GoString returns the string representation
  4020. func (s Subscription) GoString() string {
  4021. return s.String()
  4022. }
  4023. // A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve a
  4024. // topic's attributes, use GetTopicAttributes.
  4025. type Topic struct {
  4026. _ struct{} `type:"structure"`
  4027. // The topic's ARN.
  4028. TopicArn *string `type:"string"`
  4029. }
  4030. // String returns the string representation
  4031. func (s Topic) String() string {
  4032. return awsutil.Prettify(s)
  4033. }
  4034. // GoString returns the string representation
  4035. func (s Topic) GoString() string {
  4036. return s.String()
  4037. }
  4038. // Input for Unsubscribe action.
  4039. type UnsubscribeInput struct {
  4040. _ struct{} `type:"structure"`
  4041. // The ARN of the subscription to be deleted.
  4042. //
  4043. // SubscriptionArn is a required field
  4044. SubscriptionArn *string `type:"string" required:"true"`
  4045. }
  4046. // String returns the string representation
  4047. func (s UnsubscribeInput) String() string {
  4048. return awsutil.Prettify(s)
  4049. }
  4050. // GoString returns the string representation
  4051. func (s UnsubscribeInput) GoString() string {
  4052. return s.String()
  4053. }
  4054. // Validate inspects the fields of the type to determine if they are valid.
  4055. func (s *UnsubscribeInput) Validate() error {
  4056. invalidParams := request.ErrInvalidParams{Context: "UnsubscribeInput"}
  4057. if s.SubscriptionArn == nil {
  4058. invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
  4059. }
  4060. if invalidParams.Len() > 0 {
  4061. return invalidParams
  4062. }
  4063. return nil
  4064. }
  4065. type UnsubscribeOutput struct {
  4066. _ struct{} `type:"structure"`
  4067. }
  4068. // String returns the string representation
  4069. func (s UnsubscribeOutput) String() string {
  4070. return awsutil.Prettify(s)
  4071. }
  4072. // GoString returns the string representation
  4073. func (s UnsubscribeOutput) GoString() string {
  4074. return s.String()
  4075. }