api.go 127 KB

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