api.go 152 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package lambda provides a client for AWS Lambda.
  3. package lambda
  4. import (
  5. "io"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  11. )
  12. const opAddPermission = "AddPermission"
  13. // AddPermissionRequest generates a "aws/request.Request" representing the
  14. // client's request for the AddPermission operation. The "output" return
  15. // value can be used to capture response data after the request's "Send" method
  16. // is called.
  17. //
  18. // See AddPermission for usage and error information.
  19. //
  20. // Creating a request object using this method should be used when you want to inject
  21. // custom logic into the request's lifecycle using a custom handler, or if you want to
  22. // access properties on the request object before or after sending the request. If
  23. // you just want the service response, call the AddPermission method directly
  24. // instead.
  25. //
  26. // Note: You must call the "Send" method on the returned request object in order
  27. // to execute the request.
  28. //
  29. // // Example sending a request using the AddPermissionRequest method.
  30. // req, resp := client.AddPermissionRequest(params)
  31. //
  32. // err := req.Send()
  33. // if err == nil { // resp is now filled
  34. // fmt.Println(resp)
  35. // }
  36. //
  37. func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) {
  38. op := &request.Operation{
  39. Name: opAddPermission,
  40. HTTPMethod: "POST",
  41. HTTPPath: "/2015-03-31/functions/{FunctionName}/policy",
  42. }
  43. if input == nil {
  44. input = &AddPermissionInput{}
  45. }
  46. req = c.newRequest(op, input, output)
  47. output = &AddPermissionOutput{}
  48. req.Data = output
  49. return
  50. }
  51. // AddPermission API operation for AWS Lambda.
  52. //
  53. // Adds a permission to the resource policy associated with the specified AWS
  54. // Lambda function. You use resource policies to grant permissions to event
  55. // sources that use push model. In a push model, event sources (such as Amazon
  56. // S3 and custom applications) invoke your Lambda function. Each permission
  57. // you add to the resource policy allows an event source, permission to invoke
  58. // the Lambda function.
  59. //
  60. // For information about the push model, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html).
  61. //
  62. // If you are using versioning, the permissions you add are specific to the
  63. // Lambda function version or alias you specify in the AddPermission request
  64. // via the Qualifier parameter. For more information about versioning, see AWS
  65. // Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  66. //
  67. // This operation requires permission for the lambda:AddPermission action.
  68. //
  69. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  70. // with awserr.Error's Code and Message methods to get detailed information about
  71. // the error.
  72. //
  73. // See the AWS API reference guide for AWS Lambda's
  74. // API operation AddPermission for usage and error information.
  75. //
  76. // Returned Error Codes:
  77. // * ServiceException
  78. // The AWS Lambda service encountered an internal error.
  79. //
  80. // * ResourceNotFoundException
  81. // The resource (for example, a Lambda function or access policy statement)
  82. // specified in the request does not exist.
  83. //
  84. // * ResourceConflictException
  85. // The resource already exists.
  86. //
  87. // * InvalidParameterValueException
  88. // One of the parameters in the request is invalid. For example, if you provided
  89. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  90. // API, that AWS Lambda is unable to assume you will get this exception.
  91. //
  92. // * PolicyLengthExceededException
  93. // Lambda function access policy is limited to 20 KB.
  94. //
  95. // * TooManyRequestsException
  96. //
  97. func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
  98. req, out := c.AddPermissionRequest(input)
  99. err := req.Send()
  100. return out, err
  101. }
  102. const opCreateAlias = "CreateAlias"
  103. // CreateAliasRequest generates a "aws/request.Request" representing the
  104. // client's request for the CreateAlias operation. The "output" return
  105. // value can be used to capture response data after the request's "Send" method
  106. // is called.
  107. //
  108. // See CreateAlias for usage and error information.
  109. //
  110. // Creating a request object using this method should be used when you want to inject
  111. // custom logic into the request's lifecycle using a custom handler, or if you want to
  112. // access properties on the request object before or after sending the request. If
  113. // you just want the service response, call the CreateAlias method directly
  114. // instead.
  115. //
  116. // Note: You must call the "Send" method on the returned request object in order
  117. // to execute the request.
  118. //
  119. // // Example sending a request using the CreateAliasRequest method.
  120. // req, resp := client.CreateAliasRequest(params)
  121. //
  122. // err := req.Send()
  123. // if err == nil { // resp is now filled
  124. // fmt.Println(resp)
  125. // }
  126. //
  127. func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *AliasConfiguration) {
  128. op := &request.Operation{
  129. Name: opCreateAlias,
  130. HTTPMethod: "POST",
  131. HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases",
  132. }
  133. if input == nil {
  134. input = &CreateAliasInput{}
  135. }
  136. req = c.newRequest(op, input, output)
  137. output = &AliasConfiguration{}
  138. req.Data = output
  139. return
  140. }
  141. // CreateAlias API operation for AWS Lambda.
  142. //
  143. // Creates an alias that points to the specified Lambda function version. For
  144. // more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
  145. //
  146. // Alias names are unique for a given function. This requires permission for
  147. // the lambda:CreateAlias action.
  148. //
  149. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  150. // with awserr.Error's Code and Message methods to get detailed information about
  151. // the error.
  152. //
  153. // See the AWS API reference guide for AWS Lambda's
  154. // API operation CreateAlias for usage and error information.
  155. //
  156. // Returned Error Codes:
  157. // * ServiceException
  158. // The AWS Lambda service encountered an internal error.
  159. //
  160. // * ResourceNotFoundException
  161. // The resource (for example, a Lambda function or access policy statement)
  162. // specified in the request does not exist.
  163. //
  164. // * ResourceConflictException
  165. // The resource already exists.
  166. //
  167. // * InvalidParameterValueException
  168. // One of the parameters in the request is invalid. For example, if you provided
  169. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  170. // API, that AWS Lambda is unable to assume you will get this exception.
  171. //
  172. // * TooManyRequestsException
  173. //
  174. func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error) {
  175. req, out := c.CreateAliasRequest(input)
  176. err := req.Send()
  177. return out, err
  178. }
  179. const opCreateEventSourceMapping = "CreateEventSourceMapping"
  180. // CreateEventSourceMappingRequest generates a "aws/request.Request" representing the
  181. // client's request for the CreateEventSourceMapping operation. The "output" return
  182. // value can be used to capture response data after the request's "Send" method
  183. // is called.
  184. //
  185. // See CreateEventSourceMapping for usage and error information.
  186. //
  187. // Creating a request object using this method should be used when you want to inject
  188. // custom logic into the request's lifecycle using a custom handler, or if you want to
  189. // access properties on the request object before or after sending the request. If
  190. // you just want the service response, call the CreateEventSourceMapping method directly
  191. // instead.
  192. //
  193. // Note: You must call the "Send" method on the returned request object in order
  194. // to execute the request.
  195. //
  196. // // Example sending a request using the CreateEventSourceMappingRequest method.
  197. // req, resp := client.CreateEventSourceMappingRequest(params)
  198. //
  199. // err := req.Send()
  200. // if err == nil { // resp is now filled
  201. // fmt.Println(resp)
  202. // }
  203. //
  204. func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  205. op := &request.Operation{
  206. Name: opCreateEventSourceMapping,
  207. HTTPMethod: "POST",
  208. HTTPPath: "/2015-03-31/event-source-mappings/",
  209. }
  210. if input == nil {
  211. input = &CreateEventSourceMappingInput{}
  212. }
  213. req = c.newRequest(op, input, output)
  214. output = &EventSourceMappingConfiguration{}
  215. req.Data = output
  216. return
  217. }
  218. // CreateEventSourceMapping API operation for AWS Lambda.
  219. //
  220. // Identifies a stream as an event source for a Lambda function. It can be either
  221. // an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes
  222. // the specified function when records are posted to the stream.
  223. //
  224. // This association between a stream source and a Lambda function is called
  225. // the event source mapping.
  226. //
  227. // This event source mapping is relevant only in the AWS Lambda pull model,
  228. // where AWS Lambda invokes the function. For more information, go to AWS Lambda:
  229. // How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html)
  230. // in the AWS Lambda Developer Guide.
  231. //
  232. // You provide mapping information (for example, which stream to read from and
  233. // which Lambda function to invoke) in the request body.
  234. //
  235. // Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be
  236. // associated with multiple AWS Lambda function. A given Lambda function can
  237. // be associated with multiple AWS event sources.
  238. //
  239. // If you are using versioning, you can specify a specific function version
  240. // or an alias via the function name parameter. For more information about versioning,
  241. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  242. //
  243. // This operation requires permission for the lambda:CreateEventSourceMapping
  244. // action.
  245. //
  246. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  247. // with awserr.Error's Code and Message methods to get detailed information about
  248. // the error.
  249. //
  250. // See the AWS API reference guide for AWS Lambda's
  251. // API operation CreateEventSourceMapping for usage and error information.
  252. //
  253. // Returned Error Codes:
  254. // * ServiceException
  255. // The AWS Lambda service encountered an internal error.
  256. //
  257. // * InvalidParameterValueException
  258. // One of the parameters in the request is invalid. For example, if you provided
  259. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  260. // API, that AWS Lambda is unable to assume you will get this exception.
  261. //
  262. // * ResourceConflictException
  263. // The resource already exists.
  264. //
  265. // * TooManyRequestsException
  266. //
  267. // * ResourceNotFoundException
  268. // The resource (for example, a Lambda function or access policy statement)
  269. // specified in the request does not exist.
  270. //
  271. func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  272. req, out := c.CreateEventSourceMappingRequest(input)
  273. err := req.Send()
  274. return out, err
  275. }
  276. const opCreateFunction = "CreateFunction"
  277. // CreateFunctionRequest generates a "aws/request.Request" representing the
  278. // client's request for the CreateFunction operation. The "output" return
  279. // value can be used to capture response data after the request's "Send" method
  280. // is called.
  281. //
  282. // See CreateFunction for usage and error information.
  283. //
  284. // Creating a request object using this method should be used when you want to inject
  285. // custom logic into the request's lifecycle using a custom handler, or if you want to
  286. // access properties on the request object before or after sending the request. If
  287. // you just want the service response, call the CreateFunction method directly
  288. // instead.
  289. //
  290. // Note: You must call the "Send" method on the returned request object in order
  291. // to execute the request.
  292. //
  293. // // Example sending a request using the CreateFunctionRequest method.
  294. // req, resp := client.CreateFunctionRequest(params)
  295. //
  296. // err := req.Send()
  297. // if err == nil { // resp is now filled
  298. // fmt.Println(resp)
  299. // }
  300. //
  301. func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request.Request, output *FunctionConfiguration) {
  302. op := &request.Operation{
  303. Name: opCreateFunction,
  304. HTTPMethod: "POST",
  305. HTTPPath: "/2015-03-31/functions",
  306. }
  307. if input == nil {
  308. input = &CreateFunctionInput{}
  309. }
  310. req = c.newRequest(op, input, output)
  311. output = &FunctionConfiguration{}
  312. req.Data = output
  313. return
  314. }
  315. // CreateFunction API operation for AWS Lambda.
  316. //
  317. // Creates a new Lambda function. The function metadata is created from the
  318. // request parameters, and the code for the function is provided by a .zip file
  319. // in the request body. If the function name already exists, the operation will
  320. // fail. Note that the function name is case-sensitive.
  321. //
  322. // If you are using versioning, you can also publish a version of the Lambda
  323. // function you are creating using the Publish parameter. For more information
  324. // about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  325. //
  326. // This operation requires permission for the lambda:CreateFunction action.
  327. //
  328. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  329. // with awserr.Error's Code and Message methods to get detailed information about
  330. // the error.
  331. //
  332. // See the AWS API reference guide for AWS Lambda's
  333. // API operation CreateFunction for usage and error information.
  334. //
  335. // Returned Error Codes:
  336. // * ServiceException
  337. // The AWS Lambda service encountered an internal error.
  338. //
  339. // * InvalidParameterValueException
  340. // One of the parameters in the request is invalid. For example, if you provided
  341. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  342. // API, that AWS Lambda is unable to assume you will get this exception.
  343. //
  344. // * ResourceNotFoundException
  345. // The resource (for example, a Lambda function or access policy statement)
  346. // specified in the request does not exist.
  347. //
  348. // * ResourceConflictException
  349. // The resource already exists.
  350. //
  351. // * TooManyRequestsException
  352. //
  353. // * CodeStorageExceededException
  354. // You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
  355. //
  356. func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error) {
  357. req, out := c.CreateFunctionRequest(input)
  358. err := req.Send()
  359. return out, err
  360. }
  361. const opDeleteAlias = "DeleteAlias"
  362. // DeleteAliasRequest generates a "aws/request.Request" representing the
  363. // client's request for the DeleteAlias operation. The "output" return
  364. // value can be used to capture response data after the request's "Send" method
  365. // is called.
  366. //
  367. // See DeleteAlias for usage and error information.
  368. //
  369. // Creating a request object using this method should be used when you want to inject
  370. // custom logic into the request's lifecycle using a custom handler, or if you want to
  371. // access properties on the request object before or after sending the request. If
  372. // you just want the service response, call the DeleteAlias method directly
  373. // instead.
  374. //
  375. // Note: You must call the "Send" method on the returned request object in order
  376. // to execute the request.
  377. //
  378. // // Example sending a request using the DeleteAliasRequest method.
  379. // req, resp := client.DeleteAliasRequest(params)
  380. //
  381. // err := req.Send()
  382. // if err == nil { // resp is now filled
  383. // fmt.Println(resp)
  384. // }
  385. //
  386. func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) {
  387. op := &request.Operation{
  388. Name: opDeleteAlias,
  389. HTTPMethod: "DELETE",
  390. HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}",
  391. }
  392. if input == nil {
  393. input = &DeleteAliasInput{}
  394. }
  395. req = c.newRequest(op, input, output)
  396. req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
  397. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  398. output = &DeleteAliasOutput{}
  399. req.Data = output
  400. return
  401. }
  402. // DeleteAlias API operation for AWS Lambda.
  403. //
  404. // Deletes the specified Lambda function alias. For more information, see Introduction
  405. // to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
  406. //
  407. // This requires permission for the lambda:DeleteAlias action.
  408. //
  409. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  410. // with awserr.Error's Code and Message methods to get detailed information about
  411. // the error.
  412. //
  413. // See the AWS API reference guide for AWS Lambda's
  414. // API operation DeleteAlias for usage and error information.
  415. //
  416. // Returned Error Codes:
  417. // * ServiceException
  418. // The AWS Lambda service encountered an internal error.
  419. //
  420. // * InvalidParameterValueException
  421. // One of the parameters in the request is invalid. For example, if you provided
  422. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  423. // API, that AWS Lambda is unable to assume you will get this exception.
  424. //
  425. // * TooManyRequestsException
  426. //
  427. func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) {
  428. req, out := c.DeleteAliasRequest(input)
  429. err := req.Send()
  430. return out, err
  431. }
  432. const opDeleteEventSourceMapping = "DeleteEventSourceMapping"
  433. // DeleteEventSourceMappingRequest generates a "aws/request.Request" representing the
  434. // client's request for the DeleteEventSourceMapping operation. The "output" return
  435. // value can be used to capture response data after the request's "Send" method
  436. // is called.
  437. //
  438. // See DeleteEventSourceMapping for usage and error information.
  439. //
  440. // Creating a request object using this method should be used when you want to inject
  441. // custom logic into the request's lifecycle using a custom handler, or if you want to
  442. // access properties on the request object before or after sending the request. If
  443. // you just want the service response, call the DeleteEventSourceMapping method directly
  444. // instead.
  445. //
  446. // Note: You must call the "Send" method on the returned request object in order
  447. // to execute the request.
  448. //
  449. // // Example sending a request using the DeleteEventSourceMappingRequest method.
  450. // req, resp := client.DeleteEventSourceMappingRequest(params)
  451. //
  452. // err := req.Send()
  453. // if err == nil { // resp is now filled
  454. // fmt.Println(resp)
  455. // }
  456. //
  457. func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  458. op := &request.Operation{
  459. Name: opDeleteEventSourceMapping,
  460. HTTPMethod: "DELETE",
  461. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  462. }
  463. if input == nil {
  464. input = &DeleteEventSourceMappingInput{}
  465. }
  466. req = c.newRequest(op, input, output)
  467. output = &EventSourceMappingConfiguration{}
  468. req.Data = output
  469. return
  470. }
  471. // DeleteEventSourceMapping API operation for AWS Lambda.
  472. //
  473. // Removes an event source mapping. This means AWS Lambda will no longer invoke
  474. // the function for events in the associated source.
  475. //
  476. // This operation requires permission for the lambda:DeleteEventSourceMapping
  477. // action.
  478. //
  479. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  480. // with awserr.Error's Code and Message methods to get detailed information about
  481. // the error.
  482. //
  483. // See the AWS API reference guide for AWS Lambda's
  484. // API operation DeleteEventSourceMapping for usage and error information.
  485. //
  486. // Returned Error Codes:
  487. // * ServiceException
  488. // The AWS Lambda service encountered an internal error.
  489. //
  490. // * ResourceNotFoundException
  491. // The resource (for example, a Lambda function or access policy statement)
  492. // specified in the request does not exist.
  493. //
  494. // * InvalidParameterValueException
  495. // One of the parameters in the request is invalid. For example, if you provided
  496. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  497. // API, that AWS Lambda is unable to assume you will get this exception.
  498. //
  499. // * TooManyRequestsException
  500. //
  501. func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  502. req, out := c.DeleteEventSourceMappingRequest(input)
  503. err := req.Send()
  504. return out, err
  505. }
  506. const opDeleteFunction = "DeleteFunction"
  507. // DeleteFunctionRequest generates a "aws/request.Request" representing the
  508. // client's request for the DeleteFunction operation. The "output" return
  509. // value can be used to capture response data after the request's "Send" method
  510. // is called.
  511. //
  512. // See DeleteFunction for usage and error information.
  513. //
  514. // Creating a request object using this method should be used when you want to inject
  515. // custom logic into the request's lifecycle using a custom handler, or if you want to
  516. // access properties on the request object before or after sending the request. If
  517. // you just want the service response, call the DeleteFunction method directly
  518. // instead.
  519. //
  520. // Note: You must call the "Send" method on the returned request object in order
  521. // to execute the request.
  522. //
  523. // // Example sending a request using the DeleteFunctionRequest method.
  524. // req, resp := client.DeleteFunctionRequest(params)
  525. //
  526. // err := req.Send()
  527. // if err == nil { // resp is now filled
  528. // fmt.Println(resp)
  529. // }
  530. //
  531. func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request.Request, output *DeleteFunctionOutput) {
  532. op := &request.Operation{
  533. Name: opDeleteFunction,
  534. HTTPMethod: "DELETE",
  535. HTTPPath: "/2015-03-31/functions/{FunctionName}",
  536. }
  537. if input == nil {
  538. input = &DeleteFunctionInput{}
  539. }
  540. req = c.newRequest(op, input, output)
  541. req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
  542. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  543. output = &DeleteFunctionOutput{}
  544. req.Data = output
  545. return
  546. }
  547. // DeleteFunction API operation for AWS Lambda.
  548. //
  549. // Deletes the specified Lambda function code and configuration.
  550. //
  551. // If you are using the versioning feature and you don't specify a function
  552. // version in your DeleteFunction request, AWS Lambda will delete the function,
  553. // including all its versions, and any aliases pointing to the function versions.
  554. // To delete a specific function version, you must provide the function version
  555. // via the Qualifier parameter. For information about function versioning, see
  556. // AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  557. //
  558. // When you delete a function the associated resource policy is also deleted.
  559. // You will need to delete the event source mappings explicitly.
  560. //
  561. // This operation requires permission for the lambda:DeleteFunction action.
  562. //
  563. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  564. // with awserr.Error's Code and Message methods to get detailed information about
  565. // the error.
  566. //
  567. // See the AWS API reference guide for AWS Lambda's
  568. // API operation DeleteFunction for usage and error information.
  569. //
  570. // Returned Error Codes:
  571. // * ServiceException
  572. // The AWS Lambda service encountered an internal error.
  573. //
  574. // * ResourceNotFoundException
  575. // The resource (for example, a Lambda function or access policy statement)
  576. // specified in the request does not exist.
  577. //
  578. // * TooManyRequestsException
  579. //
  580. // * InvalidParameterValueException
  581. // One of the parameters in the request is invalid. For example, if you provided
  582. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  583. // API, that AWS Lambda is unable to assume you will get this exception.
  584. //
  585. // * ResourceConflictException
  586. // The resource already exists.
  587. //
  588. func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error) {
  589. req, out := c.DeleteFunctionRequest(input)
  590. err := req.Send()
  591. return out, err
  592. }
  593. const opGetAlias = "GetAlias"
  594. // GetAliasRequest generates a "aws/request.Request" representing the
  595. // client's request for the GetAlias operation. The "output" return
  596. // value can be used to capture response data after the request's "Send" method
  597. // is called.
  598. //
  599. // See GetAlias for usage and error information.
  600. //
  601. // Creating a request object using this method should be used when you want to inject
  602. // custom logic into the request's lifecycle using a custom handler, or if you want to
  603. // access properties on the request object before or after sending the request. If
  604. // you just want the service response, call the GetAlias method directly
  605. // instead.
  606. //
  607. // Note: You must call the "Send" method on the returned request object in order
  608. // to execute the request.
  609. //
  610. // // Example sending a request using the GetAliasRequest method.
  611. // req, resp := client.GetAliasRequest(params)
  612. //
  613. // err := req.Send()
  614. // if err == nil { // resp is now filled
  615. // fmt.Println(resp)
  616. // }
  617. //
  618. func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, output *AliasConfiguration) {
  619. op := &request.Operation{
  620. Name: opGetAlias,
  621. HTTPMethod: "GET",
  622. HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}",
  623. }
  624. if input == nil {
  625. input = &GetAliasInput{}
  626. }
  627. req = c.newRequest(op, input, output)
  628. output = &AliasConfiguration{}
  629. req.Data = output
  630. return
  631. }
  632. // GetAlias API operation for AWS Lambda.
  633. //
  634. // Returns the specified alias information such as the alias ARN, description,
  635. // and function version it is pointing to. For more information, see Introduction
  636. // to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
  637. //
  638. // This requires permission for the lambda:GetAlias action.
  639. //
  640. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  641. // with awserr.Error's Code and Message methods to get detailed information about
  642. // the error.
  643. //
  644. // See the AWS API reference guide for AWS Lambda's
  645. // API operation GetAlias for usage and error information.
  646. //
  647. // Returned Error Codes:
  648. // * ServiceException
  649. // The AWS Lambda service encountered an internal error.
  650. //
  651. // * ResourceNotFoundException
  652. // The resource (for example, a Lambda function or access policy statement)
  653. // specified in the request does not exist.
  654. //
  655. // * InvalidParameterValueException
  656. // One of the parameters in the request is invalid. For example, if you provided
  657. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  658. // API, that AWS Lambda is unable to assume you will get this exception.
  659. //
  660. // * TooManyRequestsException
  661. //
  662. func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error) {
  663. req, out := c.GetAliasRequest(input)
  664. err := req.Send()
  665. return out, err
  666. }
  667. const opGetEventSourceMapping = "GetEventSourceMapping"
  668. // GetEventSourceMappingRequest generates a "aws/request.Request" representing the
  669. // client's request for the GetEventSourceMapping operation. The "output" return
  670. // value can be used to capture response data after the request's "Send" method
  671. // is called.
  672. //
  673. // See GetEventSourceMapping for usage and error information.
  674. //
  675. // Creating a request object using this method should be used when you want to inject
  676. // custom logic into the request's lifecycle using a custom handler, or if you want to
  677. // access properties on the request object before or after sending the request. If
  678. // you just want the service response, call the GetEventSourceMapping method directly
  679. // instead.
  680. //
  681. // Note: You must call the "Send" method on the returned request object in order
  682. // to execute the request.
  683. //
  684. // // Example sending a request using the GetEventSourceMappingRequest method.
  685. // req, resp := client.GetEventSourceMappingRequest(params)
  686. //
  687. // err := req.Send()
  688. // if err == nil { // resp is now filled
  689. // fmt.Println(resp)
  690. // }
  691. //
  692. func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  693. op := &request.Operation{
  694. Name: opGetEventSourceMapping,
  695. HTTPMethod: "GET",
  696. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  697. }
  698. if input == nil {
  699. input = &GetEventSourceMappingInput{}
  700. }
  701. req = c.newRequest(op, input, output)
  702. output = &EventSourceMappingConfiguration{}
  703. req.Data = output
  704. return
  705. }
  706. // GetEventSourceMapping API operation for AWS Lambda.
  707. //
  708. // Returns configuration information for the specified event source mapping
  709. // (see CreateEventSourceMapping).
  710. //
  711. // This operation requires permission for the lambda:GetEventSourceMapping action.
  712. //
  713. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  714. // with awserr.Error's Code and Message methods to get detailed information about
  715. // the error.
  716. //
  717. // See the AWS API reference guide for AWS Lambda's
  718. // API operation GetEventSourceMapping for usage and error information.
  719. //
  720. // Returned Error Codes:
  721. // * ServiceException
  722. // The AWS Lambda service encountered an internal error.
  723. //
  724. // * ResourceNotFoundException
  725. // The resource (for example, a Lambda function or access policy statement)
  726. // specified in the request does not exist.
  727. //
  728. // * InvalidParameterValueException
  729. // One of the parameters in the request is invalid. For example, if you provided
  730. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  731. // API, that AWS Lambda is unable to assume you will get this exception.
  732. //
  733. // * TooManyRequestsException
  734. //
  735. func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  736. req, out := c.GetEventSourceMappingRequest(input)
  737. err := req.Send()
  738. return out, err
  739. }
  740. const opGetFunction = "GetFunction"
  741. // GetFunctionRequest generates a "aws/request.Request" representing the
  742. // client's request for the GetFunction operation. The "output" return
  743. // value can be used to capture response data after the request's "Send" method
  744. // is called.
  745. //
  746. // See GetFunction for usage and error information.
  747. //
  748. // Creating a request object using this method should be used when you want to inject
  749. // custom logic into the request's lifecycle using a custom handler, or if you want to
  750. // access properties on the request object before or after sending the request. If
  751. // you just want the service response, call the GetFunction method directly
  752. // instead.
  753. //
  754. // Note: You must call the "Send" method on the returned request object in order
  755. // to execute the request.
  756. //
  757. // // Example sending a request using the GetFunctionRequest method.
  758. // req, resp := client.GetFunctionRequest(params)
  759. //
  760. // err := req.Send()
  761. // if err == nil { // resp is now filled
  762. // fmt.Println(resp)
  763. // }
  764. //
  765. func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput) {
  766. op := &request.Operation{
  767. Name: opGetFunction,
  768. HTTPMethod: "GET",
  769. HTTPPath: "/2015-03-31/functions/{FunctionName}",
  770. }
  771. if input == nil {
  772. input = &GetFunctionInput{}
  773. }
  774. req = c.newRequest(op, input, output)
  775. output = &GetFunctionOutput{}
  776. req.Data = output
  777. return
  778. }
  779. // GetFunction API operation for AWS Lambda.
  780. //
  781. // Returns the configuration information of the Lambda function and a presigned
  782. // URL link to the .zip file you uploaded with CreateFunction so you can download
  783. // the .zip file. Note that the URL is valid for up to 10 minutes. The configuration
  784. // information is the same information you provided as parameters when uploading
  785. // the function.
  786. //
  787. // Using the optional Qualifier parameter, you can specify a specific function
  788. // version for which you want this information. If you don't specify this parameter,
  789. // the API uses unqualified function ARN which return information about the
  790. // $LATEST version of the Lambda function. For more information, see AWS Lambda
  791. // Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  792. //
  793. // This operation requires permission for the lambda:GetFunction action.
  794. //
  795. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  796. // with awserr.Error's Code and Message methods to get detailed information about
  797. // the error.
  798. //
  799. // See the AWS API reference guide for AWS Lambda's
  800. // API operation GetFunction for usage and error information.
  801. //
  802. // Returned Error Codes:
  803. // * ServiceException
  804. // The AWS Lambda service encountered an internal error.
  805. //
  806. // * ResourceNotFoundException
  807. // The resource (for example, a Lambda function or access policy statement)
  808. // specified in the request does not exist.
  809. //
  810. // * TooManyRequestsException
  811. //
  812. // * InvalidParameterValueException
  813. // One of the parameters in the request is invalid. For example, if you provided
  814. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  815. // API, that AWS Lambda is unable to assume you will get this exception.
  816. //
  817. func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) {
  818. req, out := c.GetFunctionRequest(input)
  819. err := req.Send()
  820. return out, err
  821. }
  822. const opGetFunctionConfiguration = "GetFunctionConfiguration"
  823. // GetFunctionConfigurationRequest generates a "aws/request.Request" representing the
  824. // client's request for the GetFunctionConfiguration operation. The "output" return
  825. // value can be used to capture response data after the request's "Send" method
  826. // is called.
  827. //
  828. // See GetFunctionConfiguration for usage and error information.
  829. //
  830. // Creating a request object using this method should be used when you want to inject
  831. // custom logic into the request's lifecycle using a custom handler, or if you want to
  832. // access properties on the request object before or after sending the request. If
  833. // you just want the service response, call the GetFunctionConfiguration method directly
  834. // instead.
  835. //
  836. // Note: You must call the "Send" method on the returned request object in order
  837. // to execute the request.
  838. //
  839. // // Example sending a request using the GetFunctionConfigurationRequest method.
  840. // req, resp := client.GetFunctionConfigurationRequest(params)
  841. //
  842. // err := req.Send()
  843. // if err == nil { // resp is now filled
  844. // fmt.Println(resp)
  845. // }
  846. //
  847. func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) {
  848. op := &request.Operation{
  849. Name: opGetFunctionConfiguration,
  850. HTTPMethod: "GET",
  851. HTTPPath: "/2015-03-31/functions/{FunctionName}/configuration",
  852. }
  853. if input == nil {
  854. input = &GetFunctionConfigurationInput{}
  855. }
  856. req = c.newRequest(op, input, output)
  857. output = &FunctionConfiguration{}
  858. req.Data = output
  859. return
  860. }
  861. // GetFunctionConfiguration API operation for AWS Lambda.
  862. //
  863. // Returns the configuration information of the Lambda function. This the same
  864. // information you provided as parameters when uploading the function by using
  865. // CreateFunction.
  866. //
  867. // If you are using the versioning feature, you can retrieve this information
  868. // for a specific function version by using the optional Qualifier parameter
  869. // and specifying the function version or alias that points to it. If you don't
  870. // provide it, the API returns information about the $LATEST version of the
  871. // function. For more information about versioning, see AWS Lambda Function
  872. // Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  873. //
  874. // This operation requires permission for the lambda:GetFunctionConfiguration
  875. // operation.
  876. //
  877. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  878. // with awserr.Error's Code and Message methods to get detailed information about
  879. // the error.
  880. //
  881. // See the AWS API reference guide for AWS Lambda's
  882. // API operation GetFunctionConfiguration for usage and error information.
  883. //
  884. // Returned Error Codes:
  885. // * ServiceException
  886. // The AWS Lambda service encountered an internal error.
  887. //
  888. // * ResourceNotFoundException
  889. // The resource (for example, a Lambda function or access policy statement)
  890. // specified in the request does not exist.
  891. //
  892. // * TooManyRequestsException
  893. //
  894. // * InvalidParameterValueException
  895. // One of the parameters in the request is invalid. For example, if you provided
  896. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  897. // API, that AWS Lambda is unable to assume you will get this exception.
  898. //
  899. func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) {
  900. req, out := c.GetFunctionConfigurationRequest(input)
  901. err := req.Send()
  902. return out, err
  903. }
  904. const opGetPolicy = "GetPolicy"
  905. // GetPolicyRequest generates a "aws/request.Request" representing the
  906. // client's request for the GetPolicy operation. The "output" return
  907. // value can be used to capture response data after the request's "Send" method
  908. // is called.
  909. //
  910. // See GetPolicy for usage and error information.
  911. //
  912. // Creating a request object using this method should be used when you want to inject
  913. // custom logic into the request's lifecycle using a custom handler, or if you want to
  914. // access properties on the request object before or after sending the request. If
  915. // you just want the service response, call the GetPolicy method directly
  916. // instead.
  917. //
  918. // Note: You must call the "Send" method on the returned request object in order
  919. // to execute the request.
  920. //
  921. // // Example sending a request using the GetPolicyRequest method.
  922. // req, resp := client.GetPolicyRequest(params)
  923. //
  924. // err := req.Send()
  925. // if err == nil { // resp is now filled
  926. // fmt.Println(resp)
  927. // }
  928. //
  929. func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) {
  930. op := &request.Operation{
  931. Name: opGetPolicy,
  932. HTTPMethod: "GET",
  933. HTTPPath: "/2015-03-31/functions/{FunctionName}/policy",
  934. }
  935. if input == nil {
  936. input = &GetPolicyInput{}
  937. }
  938. req = c.newRequest(op, input, output)
  939. output = &GetPolicyOutput{}
  940. req.Data = output
  941. return
  942. }
  943. // GetPolicy API operation for AWS Lambda.
  944. //
  945. // Returns the resource policy associated with the specified Lambda function.
  946. //
  947. // If you are using the versioning feature, you can get the resource policy
  948. // associated with the specific Lambda function version or alias by specifying
  949. // the version or alias name using the Qualifier parameter. For more information
  950. // about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  951. //
  952. // For information about adding permissions, see AddPermission.
  953. //
  954. // You need permission for the lambda:GetPolicy action.
  955. //
  956. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  957. // with awserr.Error's Code and Message methods to get detailed information about
  958. // the error.
  959. //
  960. // See the AWS API reference guide for AWS Lambda's
  961. // API operation GetPolicy for usage and error information.
  962. //
  963. // Returned Error Codes:
  964. // * ServiceException
  965. // The AWS Lambda service encountered an internal error.
  966. //
  967. // * ResourceNotFoundException
  968. // The resource (for example, a Lambda function or access policy statement)
  969. // specified in the request does not exist.
  970. //
  971. // * TooManyRequestsException
  972. //
  973. // * InvalidParameterValueException
  974. // One of the parameters in the request is invalid. For example, if you provided
  975. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  976. // API, that AWS Lambda is unable to assume you will get this exception.
  977. //
  978. func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) {
  979. req, out := c.GetPolicyRequest(input)
  980. err := req.Send()
  981. return out, err
  982. }
  983. const opInvoke = "Invoke"
  984. // InvokeRequest generates a "aws/request.Request" representing the
  985. // client's request for the Invoke operation. The "output" return
  986. // value can be used to capture response data after the request's "Send" method
  987. // is called.
  988. //
  989. // See Invoke for usage and error information.
  990. //
  991. // Creating a request object using this method should be used when you want to inject
  992. // custom logic into the request's lifecycle using a custom handler, or if you want to
  993. // access properties on the request object before or after sending the request. If
  994. // you just want the service response, call the Invoke method directly
  995. // instead.
  996. //
  997. // Note: You must call the "Send" method on the returned request object in order
  998. // to execute the request.
  999. //
  1000. // // Example sending a request using the InvokeRequest method.
  1001. // req, resp := client.InvokeRequest(params)
  1002. //
  1003. // err := req.Send()
  1004. // if err == nil { // resp is now filled
  1005. // fmt.Println(resp)
  1006. // }
  1007. //
  1008. func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput) {
  1009. op := &request.Operation{
  1010. Name: opInvoke,
  1011. HTTPMethod: "POST",
  1012. HTTPPath: "/2015-03-31/functions/{FunctionName}/invocations",
  1013. }
  1014. if input == nil {
  1015. input = &InvokeInput{}
  1016. }
  1017. req = c.newRequest(op, input, output)
  1018. output = &InvokeOutput{}
  1019. req.Data = output
  1020. return
  1021. }
  1022. // Invoke API operation for AWS Lambda.
  1023. //
  1024. // Invokes a specific Lambda function.
  1025. //
  1026. // If you are using the versioning feature, you can invoke the specific function
  1027. // version by providing function version or alias name that is pointing to the
  1028. // function version using the Qualifier parameter in the request. If you don't
  1029. // provide the Qualifier parameter, the $LATEST version of the Lambda function
  1030. // is invoked. Invocations occur at least once in response to an event and functions
  1031. // must be idempotent to handle this. For information about the versioning feature,
  1032. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1033. //
  1034. // This operation requires permission for the lambda:InvokeFunction action.
  1035. //
  1036. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1037. // with awserr.Error's Code and Message methods to get detailed information about
  1038. // the error.
  1039. //
  1040. // See the AWS API reference guide for AWS Lambda's
  1041. // API operation Invoke for usage and error information.
  1042. //
  1043. // Returned Error Codes:
  1044. // * ServiceException
  1045. // The AWS Lambda service encountered an internal error.
  1046. //
  1047. // * ResourceNotFoundException
  1048. // The resource (for example, a Lambda function or access policy statement)
  1049. // specified in the request does not exist.
  1050. //
  1051. // * InvalidRequestContentException
  1052. // The request body could not be parsed as JSON.
  1053. //
  1054. // * RequestTooLargeException
  1055. // The request payload exceeded the Invoke request body JSON input limit. For
  1056. // more information, see Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html).
  1057. //
  1058. // * UnsupportedMediaTypeException
  1059. // The content type of the Invoke request body is not JSON.
  1060. //
  1061. // * TooManyRequestsException
  1062. //
  1063. // * InvalidParameterValueException
  1064. // One of the parameters in the request is invalid. For example, if you provided
  1065. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1066. // API, that AWS Lambda is unable to assume you will get this exception.
  1067. //
  1068. // * EC2UnexpectedException
  1069. // AWS Lambda received an unexpected EC2 client exception while setting up for
  1070. // the Lambda function.
  1071. //
  1072. // * SubnetIPAddressLimitReachedException
  1073. // AWS Lambda was not able to set up VPC access for the Lambda function because
  1074. // one or more configured subnets has no available IP addresses.
  1075. //
  1076. // * ENILimitReachedException
  1077. // AWS Lambda was not able to create an Elastic Network Interface (ENI) in the
  1078. // VPC, specified as part of Lambda function configuration, because the limit
  1079. // for network interfaces has been reached.
  1080. //
  1081. // * EC2ThrottledException
  1082. // AWS Lambda was throttled by Amazon EC2 during Lambda function initialization
  1083. // using the execution role provided for the Lambda function.
  1084. //
  1085. // * EC2AccessDeniedException
  1086. //
  1087. // * InvalidSubnetIDException
  1088. // The Subnet ID provided in the Lambda function VPC configuration is invalid.
  1089. //
  1090. // * InvalidSecurityGroupIDException
  1091. // The Security Group ID provided in the Lambda function VPC configuration is
  1092. // invalid.
  1093. //
  1094. // * InvalidZipFileException
  1095. // AWS Lambda could not unzip the function zip file.
  1096. //
  1097. func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) {
  1098. req, out := c.InvokeRequest(input)
  1099. err := req.Send()
  1100. return out, err
  1101. }
  1102. const opInvokeAsync = "InvokeAsync"
  1103. // InvokeAsyncRequest generates a "aws/request.Request" representing the
  1104. // client's request for the InvokeAsync operation. The "output" return
  1105. // value can be used to capture response data after the request's "Send" method
  1106. // is called.
  1107. //
  1108. // See InvokeAsync for usage and error information.
  1109. //
  1110. // Creating a request object using this method should be used when you want to inject
  1111. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1112. // access properties on the request object before or after sending the request. If
  1113. // you just want the service response, call the InvokeAsync method directly
  1114. // instead.
  1115. //
  1116. // Note: You must call the "Send" method on the returned request object in order
  1117. // to execute the request.
  1118. //
  1119. // // Example sending a request using the InvokeAsyncRequest method.
  1120. // req, resp := client.InvokeAsyncRequest(params)
  1121. //
  1122. // err := req.Send()
  1123. // if err == nil { // resp is now filled
  1124. // fmt.Println(resp)
  1125. // }
  1126. //
  1127. func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Request, output *InvokeAsyncOutput) {
  1128. if c.Client.Config.Logger != nil {
  1129. c.Client.Config.Logger.Log("This operation, InvokeAsync, has been deprecated")
  1130. }
  1131. op := &request.Operation{
  1132. Name: opInvokeAsync,
  1133. HTTPMethod: "POST",
  1134. HTTPPath: "/2014-11-13/functions/{FunctionName}/invoke-async/",
  1135. }
  1136. if input == nil {
  1137. input = &InvokeAsyncInput{}
  1138. }
  1139. req = c.newRequest(op, input, output)
  1140. output = &InvokeAsyncOutput{}
  1141. req.Data = output
  1142. return
  1143. }
  1144. // InvokeAsync API operation for AWS Lambda.
  1145. //
  1146. // This API is deprecated. We recommend you use Invoke API (see Invoke).
  1147. //
  1148. // Submits an invocation request to AWS Lambda. Upon receiving the request,
  1149. // Lambda executes the specified function asynchronously. To see the logs generated
  1150. // by the Lambda function execution, see the CloudWatch Logs console.
  1151. //
  1152. // This operation requires permission for the lambda:InvokeFunction action.
  1153. //
  1154. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1155. // with awserr.Error's Code and Message methods to get detailed information about
  1156. // the error.
  1157. //
  1158. // See the AWS API reference guide for AWS Lambda's
  1159. // API operation InvokeAsync for usage and error information.
  1160. //
  1161. // Returned Error Codes:
  1162. // * ServiceException
  1163. // The AWS Lambda service encountered an internal error.
  1164. //
  1165. // * ResourceNotFoundException
  1166. // The resource (for example, a Lambda function or access policy statement)
  1167. // specified in the request does not exist.
  1168. //
  1169. // * InvalidRequestContentException
  1170. // The request body could not be parsed as JSON.
  1171. //
  1172. func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error) {
  1173. req, out := c.InvokeAsyncRequest(input)
  1174. err := req.Send()
  1175. return out, err
  1176. }
  1177. const opListAliases = "ListAliases"
  1178. // ListAliasesRequest generates a "aws/request.Request" representing the
  1179. // client's request for the ListAliases operation. The "output" return
  1180. // value can be used to capture response data after the request's "Send" method
  1181. // is called.
  1182. //
  1183. // See ListAliases for usage and error information.
  1184. //
  1185. // Creating a request object using this method should be used when you want to inject
  1186. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1187. // access properties on the request object before or after sending the request. If
  1188. // you just want the service response, call the ListAliases method directly
  1189. // instead.
  1190. //
  1191. // Note: You must call the "Send" method on the returned request object in order
  1192. // to execute the request.
  1193. //
  1194. // // Example sending a request using the ListAliasesRequest method.
  1195. // req, resp := client.ListAliasesRequest(params)
  1196. //
  1197. // err := req.Send()
  1198. // if err == nil { // resp is now filled
  1199. // fmt.Println(resp)
  1200. // }
  1201. //
  1202. func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) {
  1203. op := &request.Operation{
  1204. Name: opListAliases,
  1205. HTTPMethod: "GET",
  1206. HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases",
  1207. }
  1208. if input == nil {
  1209. input = &ListAliasesInput{}
  1210. }
  1211. req = c.newRequest(op, input, output)
  1212. output = &ListAliasesOutput{}
  1213. req.Data = output
  1214. return
  1215. }
  1216. // ListAliases API operation for AWS Lambda.
  1217. //
  1218. // Returns list of aliases created for a Lambda function. For each alias, the
  1219. // response includes information such as the alias ARN, description, alias name,
  1220. // and the function version to which it points. For more information, see Introduction
  1221. // to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
  1222. //
  1223. // This requires permission for the lambda:ListAliases action.
  1224. //
  1225. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1226. // with awserr.Error's Code and Message methods to get detailed information about
  1227. // the error.
  1228. //
  1229. // See the AWS API reference guide for AWS Lambda's
  1230. // API operation ListAliases for usage and error information.
  1231. //
  1232. // Returned Error Codes:
  1233. // * ServiceException
  1234. // The AWS Lambda service encountered an internal error.
  1235. //
  1236. // * ResourceNotFoundException
  1237. // The resource (for example, a Lambda function or access policy statement)
  1238. // specified in the request does not exist.
  1239. //
  1240. // * InvalidParameterValueException
  1241. // One of the parameters in the request is invalid. For example, if you provided
  1242. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1243. // API, that AWS Lambda is unable to assume you will get this exception.
  1244. //
  1245. // * TooManyRequestsException
  1246. //
  1247. func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) {
  1248. req, out := c.ListAliasesRequest(input)
  1249. err := req.Send()
  1250. return out, err
  1251. }
  1252. const opListEventSourceMappings = "ListEventSourceMappings"
  1253. // ListEventSourceMappingsRequest generates a "aws/request.Request" representing the
  1254. // client's request for the ListEventSourceMappings operation. The "output" return
  1255. // value can be used to capture response data after the request's "Send" method
  1256. // is called.
  1257. //
  1258. // See ListEventSourceMappings for usage and error information.
  1259. //
  1260. // Creating a request object using this method should be used when you want to inject
  1261. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1262. // access properties on the request object before or after sending the request. If
  1263. // you just want the service response, call the ListEventSourceMappings method directly
  1264. // instead.
  1265. //
  1266. // Note: You must call the "Send" method on the returned request object in order
  1267. // to execute the request.
  1268. //
  1269. // // Example sending a request using the ListEventSourceMappingsRequest method.
  1270. // req, resp := client.ListEventSourceMappingsRequest(params)
  1271. //
  1272. // err := req.Send()
  1273. // if err == nil { // resp is now filled
  1274. // fmt.Println(resp)
  1275. // }
  1276. //
  1277. func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsInput) (req *request.Request, output *ListEventSourceMappingsOutput) {
  1278. op := &request.Operation{
  1279. Name: opListEventSourceMappings,
  1280. HTTPMethod: "GET",
  1281. HTTPPath: "/2015-03-31/event-source-mappings/",
  1282. Paginator: &request.Paginator{
  1283. InputTokens: []string{"Marker"},
  1284. OutputTokens: []string{"NextMarker"},
  1285. LimitToken: "MaxItems",
  1286. TruncationToken: "",
  1287. },
  1288. }
  1289. if input == nil {
  1290. input = &ListEventSourceMappingsInput{}
  1291. }
  1292. req = c.newRequest(op, input, output)
  1293. output = &ListEventSourceMappingsOutput{}
  1294. req.Data = output
  1295. return
  1296. }
  1297. // ListEventSourceMappings API operation for AWS Lambda.
  1298. //
  1299. // Returns a list of event source mappings you created using the CreateEventSourceMapping
  1300. // (see CreateEventSourceMapping).
  1301. //
  1302. // For each mapping, the API returns configuration information. You can optionally
  1303. // specify filters to retrieve specific event source mappings.
  1304. //
  1305. // If you are using the versioning feature, you can get list of event source
  1306. // mappings for a specific Lambda function version or an alias as described
  1307. // in the FunctionName parameter. For information about the versioning feature,
  1308. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1309. //
  1310. // This operation requires permission for the lambda:ListEventSourceMappings
  1311. // action.
  1312. //
  1313. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1314. // with awserr.Error's Code and Message methods to get detailed information about
  1315. // the error.
  1316. //
  1317. // See the AWS API reference guide for AWS Lambda's
  1318. // API operation ListEventSourceMappings for usage and error information.
  1319. //
  1320. // Returned Error Codes:
  1321. // * ServiceException
  1322. // The AWS Lambda service encountered an internal error.
  1323. //
  1324. // * ResourceNotFoundException
  1325. // The resource (for example, a Lambda function or access policy statement)
  1326. // specified in the request does not exist.
  1327. //
  1328. // * InvalidParameterValueException
  1329. // One of the parameters in the request is invalid. For example, if you provided
  1330. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1331. // API, that AWS Lambda is unable to assume you will get this exception.
  1332. //
  1333. // * TooManyRequestsException
  1334. //
  1335. func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error) {
  1336. req, out := c.ListEventSourceMappingsRequest(input)
  1337. err := req.Send()
  1338. return out, err
  1339. }
  1340. // ListEventSourceMappingsPages iterates over the pages of a ListEventSourceMappings operation,
  1341. // calling the "fn" function with the response data for each page. To stop
  1342. // iterating, return false from the fn function.
  1343. //
  1344. // See ListEventSourceMappings method for more information on how to use this operation.
  1345. //
  1346. // Note: This operation can generate multiple requests to a service.
  1347. //
  1348. // // Example iterating over at most 3 pages of a ListEventSourceMappings operation.
  1349. // pageNum := 0
  1350. // err := client.ListEventSourceMappingsPages(params,
  1351. // func(page *ListEventSourceMappingsOutput, lastPage bool) bool {
  1352. // pageNum++
  1353. // fmt.Println(page)
  1354. // return pageNum <= 3
  1355. // })
  1356. //
  1357. func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(p *ListEventSourceMappingsOutput, lastPage bool) (shouldContinue bool)) error {
  1358. page, _ := c.ListEventSourceMappingsRequest(input)
  1359. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1360. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1361. return fn(p.(*ListEventSourceMappingsOutput), lastPage)
  1362. })
  1363. }
  1364. const opListFunctions = "ListFunctions"
  1365. // ListFunctionsRequest generates a "aws/request.Request" representing the
  1366. // client's request for the ListFunctions operation. The "output" return
  1367. // value can be used to capture response data after the request's "Send" method
  1368. // is called.
  1369. //
  1370. // See ListFunctions for usage and error information.
  1371. //
  1372. // Creating a request object using this method should be used when you want to inject
  1373. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1374. // access properties on the request object before or after sending the request. If
  1375. // you just want the service response, call the ListFunctions method directly
  1376. // instead.
  1377. //
  1378. // Note: You must call the "Send" method on the returned request object in order
  1379. // to execute the request.
  1380. //
  1381. // // Example sending a request using the ListFunctionsRequest method.
  1382. // req, resp := client.ListFunctionsRequest(params)
  1383. //
  1384. // err := req.Send()
  1385. // if err == nil { // resp is now filled
  1386. // fmt.Println(resp)
  1387. // }
  1388. //
  1389. func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.Request, output *ListFunctionsOutput) {
  1390. op := &request.Operation{
  1391. Name: opListFunctions,
  1392. HTTPMethod: "GET",
  1393. HTTPPath: "/2015-03-31/functions/",
  1394. Paginator: &request.Paginator{
  1395. InputTokens: []string{"Marker"},
  1396. OutputTokens: []string{"NextMarker"},
  1397. LimitToken: "MaxItems",
  1398. TruncationToken: "",
  1399. },
  1400. }
  1401. if input == nil {
  1402. input = &ListFunctionsInput{}
  1403. }
  1404. req = c.newRequest(op, input, output)
  1405. output = &ListFunctionsOutput{}
  1406. req.Data = output
  1407. return
  1408. }
  1409. // ListFunctions API operation for AWS Lambda.
  1410. //
  1411. // Returns a list of your Lambda functions. For each function, the response
  1412. // includes the function configuration information. You must use GetFunction
  1413. // to retrieve the code for your function.
  1414. //
  1415. // This operation requires permission for the lambda:ListFunctions action.
  1416. //
  1417. // If you are using versioning feature, the response returns list of $LATEST
  1418. // versions of your functions. For information about the versioning feature,
  1419. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1420. //
  1421. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1422. // with awserr.Error's Code and Message methods to get detailed information about
  1423. // the error.
  1424. //
  1425. // See the AWS API reference guide for AWS Lambda's
  1426. // API operation ListFunctions for usage and error information.
  1427. //
  1428. // Returned Error Codes:
  1429. // * ServiceException
  1430. // The AWS Lambda service encountered an internal error.
  1431. //
  1432. // * TooManyRequestsException
  1433. //
  1434. func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) {
  1435. req, out := c.ListFunctionsRequest(input)
  1436. err := req.Send()
  1437. return out, err
  1438. }
  1439. // ListFunctionsPages iterates over the pages of a ListFunctions operation,
  1440. // calling the "fn" function with the response data for each page. To stop
  1441. // iterating, return false from the fn function.
  1442. //
  1443. // See ListFunctions method for more information on how to use this operation.
  1444. //
  1445. // Note: This operation can generate multiple requests to a service.
  1446. //
  1447. // // Example iterating over at most 3 pages of a ListFunctions operation.
  1448. // pageNum := 0
  1449. // err := client.ListFunctionsPages(params,
  1450. // func(page *ListFunctionsOutput, lastPage bool) bool {
  1451. // pageNum++
  1452. // fmt.Println(page)
  1453. // return pageNum <= 3
  1454. // })
  1455. //
  1456. func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(p *ListFunctionsOutput, lastPage bool) (shouldContinue bool)) error {
  1457. page, _ := c.ListFunctionsRequest(input)
  1458. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1459. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1460. return fn(p.(*ListFunctionsOutput), lastPage)
  1461. })
  1462. }
  1463. const opListVersionsByFunction = "ListVersionsByFunction"
  1464. // ListVersionsByFunctionRequest generates a "aws/request.Request" representing the
  1465. // client's request for the ListVersionsByFunction operation. The "output" return
  1466. // value can be used to capture response data after the request's "Send" method
  1467. // is called.
  1468. //
  1469. // See ListVersionsByFunction for usage and error information.
  1470. //
  1471. // Creating a request object using this method should be used when you want to inject
  1472. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1473. // access properties on the request object before or after sending the request. If
  1474. // you just want the service response, call the ListVersionsByFunction method directly
  1475. // instead.
  1476. //
  1477. // Note: You must call the "Send" method on the returned request object in order
  1478. // to execute the request.
  1479. //
  1480. // // Example sending a request using the ListVersionsByFunctionRequest method.
  1481. // req, resp := client.ListVersionsByFunctionRequest(params)
  1482. //
  1483. // err := req.Send()
  1484. // if err == nil { // resp is now filled
  1485. // fmt.Println(resp)
  1486. // }
  1487. //
  1488. func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInput) (req *request.Request, output *ListVersionsByFunctionOutput) {
  1489. op := &request.Operation{
  1490. Name: opListVersionsByFunction,
  1491. HTTPMethod: "GET",
  1492. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions",
  1493. }
  1494. if input == nil {
  1495. input = &ListVersionsByFunctionInput{}
  1496. }
  1497. req = c.newRequest(op, input, output)
  1498. output = &ListVersionsByFunctionOutput{}
  1499. req.Data = output
  1500. return
  1501. }
  1502. // ListVersionsByFunction API operation for AWS Lambda.
  1503. //
  1504. // List all versions of a function. For information about the versioning feature,
  1505. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1506. //
  1507. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1508. // with awserr.Error's Code and Message methods to get detailed information about
  1509. // the error.
  1510. //
  1511. // See the AWS API reference guide for AWS Lambda's
  1512. // API operation ListVersionsByFunction for usage and error information.
  1513. //
  1514. // Returned Error Codes:
  1515. // * ServiceException
  1516. // The AWS Lambda service encountered an internal error.
  1517. //
  1518. // * ResourceNotFoundException
  1519. // The resource (for example, a Lambda function or access policy statement)
  1520. // specified in the request does not exist.
  1521. //
  1522. // * InvalidParameterValueException
  1523. // One of the parameters in the request is invalid. For example, if you provided
  1524. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1525. // API, that AWS Lambda is unable to assume you will get this exception.
  1526. //
  1527. // * TooManyRequestsException
  1528. //
  1529. func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error) {
  1530. req, out := c.ListVersionsByFunctionRequest(input)
  1531. err := req.Send()
  1532. return out, err
  1533. }
  1534. const opPublishVersion = "PublishVersion"
  1535. // PublishVersionRequest generates a "aws/request.Request" representing the
  1536. // client's request for the PublishVersion operation. The "output" return
  1537. // value can be used to capture response data after the request's "Send" method
  1538. // is called.
  1539. //
  1540. // See PublishVersion for usage and error information.
  1541. //
  1542. // Creating a request object using this method should be used when you want to inject
  1543. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1544. // access properties on the request object before or after sending the request. If
  1545. // you just want the service response, call the PublishVersion method directly
  1546. // instead.
  1547. //
  1548. // Note: You must call the "Send" method on the returned request object in order
  1549. // to execute the request.
  1550. //
  1551. // // Example sending a request using the PublishVersionRequest method.
  1552. // req, resp := client.PublishVersionRequest(params)
  1553. //
  1554. // err := req.Send()
  1555. // if err == nil { // resp is now filled
  1556. // fmt.Println(resp)
  1557. // }
  1558. //
  1559. func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request.Request, output *FunctionConfiguration) {
  1560. op := &request.Operation{
  1561. Name: opPublishVersion,
  1562. HTTPMethod: "POST",
  1563. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions",
  1564. }
  1565. if input == nil {
  1566. input = &PublishVersionInput{}
  1567. }
  1568. req = c.newRequest(op, input, output)
  1569. output = &FunctionConfiguration{}
  1570. req.Data = output
  1571. return
  1572. }
  1573. // PublishVersion API operation for AWS Lambda.
  1574. //
  1575. // Publishes a version of your function from the current snapshot of $LATEST.
  1576. // That is, AWS Lambda takes a snapshot of the function code and configuration
  1577. // information from $LATEST and publishes a new version. The code and configuration
  1578. // cannot be modified after publication. For information about the versioning
  1579. // feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1580. //
  1581. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1582. // with awserr.Error's Code and Message methods to get detailed information about
  1583. // the error.
  1584. //
  1585. // See the AWS API reference guide for AWS Lambda's
  1586. // API operation PublishVersion for usage and error information.
  1587. //
  1588. // Returned Error Codes:
  1589. // * ServiceException
  1590. // The AWS Lambda service encountered an internal error.
  1591. //
  1592. // * ResourceNotFoundException
  1593. // The resource (for example, a Lambda function or access policy statement)
  1594. // specified in the request does not exist.
  1595. //
  1596. // * InvalidParameterValueException
  1597. // One of the parameters in the request is invalid. For example, if you provided
  1598. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1599. // API, that AWS Lambda is unable to assume you will get this exception.
  1600. //
  1601. // * TooManyRequestsException
  1602. //
  1603. // * CodeStorageExceededException
  1604. // You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
  1605. //
  1606. func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error) {
  1607. req, out := c.PublishVersionRequest(input)
  1608. err := req.Send()
  1609. return out, err
  1610. }
  1611. const opRemovePermission = "RemovePermission"
  1612. // RemovePermissionRequest generates a "aws/request.Request" representing the
  1613. // client's request for the RemovePermission operation. The "output" return
  1614. // value can be used to capture response data after the request's "Send" method
  1615. // is called.
  1616. //
  1617. // See RemovePermission for usage and error information.
  1618. //
  1619. // Creating a request object using this method should be used when you want to inject
  1620. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1621. // access properties on the request object before or after sending the request. If
  1622. // you just want the service response, call the RemovePermission method directly
  1623. // instead.
  1624. //
  1625. // Note: You must call the "Send" method on the returned request object in order
  1626. // to execute the request.
  1627. //
  1628. // // Example sending a request using the RemovePermissionRequest method.
  1629. // req, resp := client.RemovePermissionRequest(params)
  1630. //
  1631. // err := req.Send()
  1632. // if err == nil { // resp is now filled
  1633. // fmt.Println(resp)
  1634. // }
  1635. //
  1636. func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
  1637. op := &request.Operation{
  1638. Name: opRemovePermission,
  1639. HTTPMethod: "DELETE",
  1640. HTTPPath: "/2015-03-31/functions/{FunctionName}/policy/{StatementId}",
  1641. }
  1642. if input == nil {
  1643. input = &RemovePermissionInput{}
  1644. }
  1645. req = c.newRequest(op, input, output)
  1646. req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
  1647. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1648. output = &RemovePermissionOutput{}
  1649. req.Data = output
  1650. return
  1651. }
  1652. // RemovePermission API operation for AWS Lambda.
  1653. //
  1654. // You can remove individual permissions from an resource policy associated
  1655. // with a Lambda function by providing a statement ID that you provided when
  1656. // you added the permission.
  1657. //
  1658. // If you are using versioning, the permissions you remove are specific to the
  1659. // Lambda function version or alias you specify in the AddPermission request
  1660. // via the Qualifier parameter. For more information about versioning, see AWS
  1661. // Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1662. //
  1663. // Note that removal of a permission will cause an active event source to lose
  1664. // permission to the function.
  1665. //
  1666. // You need permission for the lambda:RemovePermission action.
  1667. //
  1668. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1669. // with awserr.Error's Code and Message methods to get detailed information about
  1670. // the error.
  1671. //
  1672. // See the AWS API reference guide for AWS Lambda's
  1673. // API operation RemovePermission for usage and error information.
  1674. //
  1675. // Returned Error Codes:
  1676. // * ServiceException
  1677. // The AWS Lambda service encountered an internal error.
  1678. //
  1679. // * ResourceNotFoundException
  1680. // The resource (for example, a Lambda function or access policy statement)
  1681. // specified in the request does not exist.
  1682. //
  1683. // * InvalidParameterValueException
  1684. // One of the parameters in the request is invalid. For example, if you provided
  1685. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1686. // API, that AWS Lambda is unable to assume you will get this exception.
  1687. //
  1688. // * TooManyRequestsException
  1689. //
  1690. func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
  1691. req, out := c.RemovePermissionRequest(input)
  1692. err := req.Send()
  1693. return out, err
  1694. }
  1695. const opUpdateAlias = "UpdateAlias"
  1696. // UpdateAliasRequest generates a "aws/request.Request" representing the
  1697. // client's request for the UpdateAlias operation. The "output" return
  1698. // value can be used to capture response data after the request's "Send" method
  1699. // is called.
  1700. //
  1701. // See UpdateAlias for usage and error information.
  1702. //
  1703. // Creating a request object using this method should be used when you want to inject
  1704. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1705. // access properties on the request object before or after sending the request. If
  1706. // you just want the service response, call the UpdateAlias method directly
  1707. // instead.
  1708. //
  1709. // Note: You must call the "Send" method on the returned request object in order
  1710. // to execute the request.
  1711. //
  1712. // // Example sending a request using the UpdateAliasRequest method.
  1713. // req, resp := client.UpdateAliasRequest(params)
  1714. //
  1715. // err := req.Send()
  1716. // if err == nil { // resp is now filled
  1717. // fmt.Println(resp)
  1718. // }
  1719. //
  1720. func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *AliasConfiguration) {
  1721. op := &request.Operation{
  1722. Name: opUpdateAlias,
  1723. HTTPMethod: "PUT",
  1724. HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}",
  1725. }
  1726. if input == nil {
  1727. input = &UpdateAliasInput{}
  1728. }
  1729. req = c.newRequest(op, input, output)
  1730. output = &AliasConfiguration{}
  1731. req.Data = output
  1732. return
  1733. }
  1734. // UpdateAlias API operation for AWS Lambda.
  1735. //
  1736. // Using this API you can update the function version to which the alias points
  1737. // and the alias description. For more information, see Introduction to AWS
  1738. // Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
  1739. //
  1740. // This requires permission for the lambda:UpdateAlias action.
  1741. //
  1742. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1743. // with awserr.Error's Code and Message methods to get detailed information about
  1744. // the error.
  1745. //
  1746. // See the AWS API reference guide for AWS Lambda's
  1747. // API operation UpdateAlias for usage and error information.
  1748. //
  1749. // Returned Error Codes:
  1750. // * ServiceException
  1751. // The AWS Lambda service encountered an internal error.
  1752. //
  1753. // * ResourceNotFoundException
  1754. // The resource (for example, a Lambda function or access policy statement)
  1755. // specified in the request does not exist.
  1756. //
  1757. // * InvalidParameterValueException
  1758. // One of the parameters in the request is invalid. For example, if you provided
  1759. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1760. // API, that AWS Lambda is unable to assume you will get this exception.
  1761. //
  1762. // * TooManyRequestsException
  1763. //
  1764. func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error) {
  1765. req, out := c.UpdateAliasRequest(input)
  1766. err := req.Send()
  1767. return out, err
  1768. }
  1769. const opUpdateEventSourceMapping = "UpdateEventSourceMapping"
  1770. // UpdateEventSourceMappingRequest generates a "aws/request.Request" representing the
  1771. // client's request for the UpdateEventSourceMapping operation. The "output" return
  1772. // value can be used to capture response data after the request's "Send" method
  1773. // is called.
  1774. //
  1775. // See UpdateEventSourceMapping for usage and error information.
  1776. //
  1777. // Creating a request object using this method should be used when you want to inject
  1778. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1779. // access properties on the request object before or after sending the request. If
  1780. // you just want the service response, call the UpdateEventSourceMapping method directly
  1781. // instead.
  1782. //
  1783. // Note: You must call the "Send" method on the returned request object in order
  1784. // to execute the request.
  1785. //
  1786. // // Example sending a request using the UpdateEventSourceMappingRequest method.
  1787. // req, resp := client.UpdateEventSourceMappingRequest(params)
  1788. //
  1789. // err := req.Send()
  1790. // if err == nil { // resp is now filled
  1791. // fmt.Println(resp)
  1792. // }
  1793. //
  1794. func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  1795. op := &request.Operation{
  1796. Name: opUpdateEventSourceMapping,
  1797. HTTPMethod: "PUT",
  1798. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  1799. }
  1800. if input == nil {
  1801. input = &UpdateEventSourceMappingInput{}
  1802. }
  1803. req = c.newRequest(op, input, output)
  1804. output = &EventSourceMappingConfiguration{}
  1805. req.Data = output
  1806. return
  1807. }
  1808. // UpdateEventSourceMapping API operation for AWS Lambda.
  1809. //
  1810. // You can update an event source mapping. This is useful if you want to change
  1811. // the parameters of the existing mapping without losing your position in the
  1812. // stream. You can change which function will receive the stream records, but
  1813. // to change the stream itself, you must create a new mapping.
  1814. //
  1815. // If you are using the versioning feature, you can update the event source
  1816. // mapping to map to a specific Lambda function version or alias as described
  1817. // in the FunctionName parameter. For information about the versioning feature,
  1818. // see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1819. //
  1820. // If you disable the event source mapping, AWS Lambda stops polling. If you
  1821. // enable again, it will resume polling from the time it had stopped polling,
  1822. // so you don't lose processing of any records. However, if you delete event
  1823. // source mapping and create it again, it will reset.
  1824. //
  1825. // This operation requires permission for the lambda:UpdateEventSourceMapping
  1826. // action.
  1827. //
  1828. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1829. // with awserr.Error's Code and Message methods to get detailed information about
  1830. // the error.
  1831. //
  1832. // See the AWS API reference guide for AWS Lambda's
  1833. // API operation UpdateEventSourceMapping for usage and error information.
  1834. //
  1835. // Returned Error Codes:
  1836. // * ServiceException
  1837. // The AWS Lambda service encountered an internal error.
  1838. //
  1839. // * ResourceNotFoundException
  1840. // The resource (for example, a Lambda function or access policy statement)
  1841. // specified in the request does not exist.
  1842. //
  1843. // * InvalidParameterValueException
  1844. // One of the parameters in the request is invalid. For example, if you provided
  1845. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1846. // API, that AWS Lambda is unable to assume you will get this exception.
  1847. //
  1848. // * TooManyRequestsException
  1849. //
  1850. // * ResourceConflictException
  1851. // The resource already exists.
  1852. //
  1853. func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  1854. req, out := c.UpdateEventSourceMappingRequest(input)
  1855. err := req.Send()
  1856. return out, err
  1857. }
  1858. const opUpdateFunctionCode = "UpdateFunctionCode"
  1859. // UpdateFunctionCodeRequest generates a "aws/request.Request" representing the
  1860. // client's request for the UpdateFunctionCode operation. The "output" return
  1861. // value can be used to capture response data after the request's "Send" method
  1862. // is called.
  1863. //
  1864. // See UpdateFunctionCode for usage and error information.
  1865. //
  1866. // Creating a request object using this method should be used when you want to inject
  1867. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1868. // access properties on the request object before or after sending the request. If
  1869. // you just want the service response, call the UpdateFunctionCode method directly
  1870. // instead.
  1871. //
  1872. // Note: You must call the "Send" method on the returned request object in order
  1873. // to execute the request.
  1874. //
  1875. // // Example sending a request using the UpdateFunctionCodeRequest method.
  1876. // req, resp := client.UpdateFunctionCodeRequest(params)
  1877. //
  1878. // err := req.Send()
  1879. // if err == nil { // resp is now filled
  1880. // fmt.Println(resp)
  1881. // }
  1882. //
  1883. func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req *request.Request, output *FunctionConfiguration) {
  1884. op := &request.Operation{
  1885. Name: opUpdateFunctionCode,
  1886. HTTPMethod: "PUT",
  1887. HTTPPath: "/2015-03-31/functions/{FunctionName}/code",
  1888. }
  1889. if input == nil {
  1890. input = &UpdateFunctionCodeInput{}
  1891. }
  1892. req = c.newRequest(op, input, output)
  1893. output = &FunctionConfiguration{}
  1894. req.Data = output
  1895. return
  1896. }
  1897. // UpdateFunctionCode API operation for AWS Lambda.
  1898. //
  1899. // Updates the code for the specified Lambda function. This operation must only
  1900. // be used on an existing Lambda function and cannot be used to update the function
  1901. // configuration.
  1902. //
  1903. // If you are using the versioning feature, note this API will always update
  1904. // the $LATEST version of your Lambda function. For information about the versioning
  1905. // feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1906. //
  1907. // This operation requires permission for the lambda:UpdateFunctionCode action.
  1908. //
  1909. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1910. // with awserr.Error's Code and Message methods to get detailed information about
  1911. // the error.
  1912. //
  1913. // See the AWS API reference guide for AWS Lambda's
  1914. // API operation UpdateFunctionCode for usage and error information.
  1915. //
  1916. // Returned Error Codes:
  1917. // * ServiceException
  1918. // The AWS Lambda service encountered an internal error.
  1919. //
  1920. // * ResourceNotFoundException
  1921. // The resource (for example, a Lambda function or access policy statement)
  1922. // specified in the request does not exist.
  1923. //
  1924. // * InvalidParameterValueException
  1925. // One of the parameters in the request is invalid. For example, if you provided
  1926. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  1927. // API, that AWS Lambda is unable to assume you will get this exception.
  1928. //
  1929. // * TooManyRequestsException
  1930. //
  1931. // * CodeStorageExceededException
  1932. // You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
  1933. //
  1934. func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) {
  1935. req, out := c.UpdateFunctionCodeRequest(input)
  1936. err := req.Send()
  1937. return out, err
  1938. }
  1939. const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration"
  1940. // UpdateFunctionConfigurationRequest generates a "aws/request.Request" representing the
  1941. // client's request for the UpdateFunctionConfiguration operation. The "output" return
  1942. // value can be used to capture response data after the request's "Send" method
  1943. // is called.
  1944. //
  1945. // See UpdateFunctionConfiguration for usage and error information.
  1946. //
  1947. // Creating a request object using this method should be used when you want to inject
  1948. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1949. // access properties on the request object before or after sending the request. If
  1950. // you just want the service response, call the UpdateFunctionConfiguration method directly
  1951. // instead.
  1952. //
  1953. // Note: You must call the "Send" method on the returned request object in order
  1954. // to execute the request.
  1955. //
  1956. // // Example sending a request using the UpdateFunctionConfigurationRequest method.
  1957. // req, resp := client.UpdateFunctionConfigurationRequest(params)
  1958. //
  1959. // err := req.Send()
  1960. // if err == nil { // resp is now filled
  1961. // fmt.Println(resp)
  1962. // }
  1963. //
  1964. func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) {
  1965. op := &request.Operation{
  1966. Name: opUpdateFunctionConfiguration,
  1967. HTTPMethod: "PUT",
  1968. HTTPPath: "/2015-03-31/functions/{FunctionName}/configuration",
  1969. }
  1970. if input == nil {
  1971. input = &UpdateFunctionConfigurationInput{}
  1972. }
  1973. req = c.newRequest(op, input, output)
  1974. output = &FunctionConfiguration{}
  1975. req.Data = output
  1976. return
  1977. }
  1978. // UpdateFunctionConfiguration API operation for AWS Lambda.
  1979. //
  1980. // Updates the configuration parameters for the specified Lambda function by
  1981. // using the values provided in the request. You provide only the parameters
  1982. // you want to change. This operation must only be used on an existing Lambda
  1983. // function and cannot be used to update the function's code.
  1984. //
  1985. // If you are using the versioning feature, note this API will always update
  1986. // the $LATEST version of your Lambda function. For information about the versioning
  1987. // feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
  1988. //
  1989. // This operation requires permission for the lambda:UpdateFunctionConfiguration
  1990. // action.
  1991. //
  1992. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1993. // with awserr.Error's Code and Message methods to get detailed information about
  1994. // the error.
  1995. //
  1996. // See the AWS API reference guide for AWS Lambda's
  1997. // API operation UpdateFunctionConfiguration for usage and error information.
  1998. //
  1999. // Returned Error Codes:
  2000. // * ServiceException
  2001. // The AWS Lambda service encountered an internal error.
  2002. //
  2003. // * ResourceNotFoundException
  2004. // The resource (for example, a Lambda function or access policy statement)
  2005. // specified in the request does not exist.
  2006. //
  2007. // * InvalidParameterValueException
  2008. // One of the parameters in the request is invalid. For example, if you provided
  2009. // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
  2010. // API, that AWS Lambda is unable to assume you will get this exception.
  2011. //
  2012. // * TooManyRequestsException
  2013. //
  2014. func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) {
  2015. req, out := c.UpdateFunctionConfigurationRequest(input)
  2016. err := req.Send()
  2017. return out, err
  2018. }
  2019. type AddPermissionInput struct {
  2020. _ struct{} `type:"structure"`
  2021. // The AWS Lambda action you want to allow in this statement. Each Lambda action
  2022. // is a string starting with lambda: followed by the API name . For example,
  2023. // lambda:CreateFunction. You can use wildcard (lambda:*) to grant permission
  2024. // for all AWS Lambda actions.
  2025. //
  2026. // Action is a required field
  2027. Action *string `type:"string" required:"true"`
  2028. // A unique token that must be supplied by the principal invoking the function.
  2029. // This is currently only used for Alexa Smart Home functions.
  2030. EventSourceToken *string `type:"string"`
  2031. // Name of the Lambda function whose resource policy you are updating by adding
  2032. // a new permission.
  2033. //
  2034. // You can specify a function name (for example, Thumbnail) or you can specify
  2035. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2036. // AWS Lambda also allows you to specify partial ARN (for example, account-id:Thumbnail).
  2037. // Note that the length constraint applies only to the ARN. If you specify only
  2038. // the function name, it is limited to 64 character in length.
  2039. //
  2040. // FunctionName is a required field
  2041. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2042. // The principal who is getting this permission. It can be Amazon S3 service
  2043. // Principal (s3.amazonaws.com) if you want Amazon S3 to invoke the function,
  2044. // an AWS account ID if you are granting cross-account permission, or any valid
  2045. // AWS service principal such as sns.amazonaws.com. For example, you might want
  2046. // to allow a custom application in another AWS account to push events to AWS
  2047. // Lambda by invoking your function.
  2048. //
  2049. // Principal is a required field
  2050. Principal *string `type:"string" required:"true"`
  2051. // You can use this optional query parameter to describe a qualified ARN using
  2052. // a function version or an alias name. The permission will then apply to the
  2053. // specific qualified ARN. For example, if you specify function version 2 as
  2054. // the qualifier, then permission applies only when request is made using qualified
  2055. // function ARN:
  2056. //
  2057. // arn:aws:lambda:aws-region:acct-id:function:function-name:2
  2058. //
  2059. // If you specify an alias name, for example PROD, then the permission is valid
  2060. // only for requests made using the alias ARN:
  2061. //
  2062. // arn:aws:lambda:aws-region:acct-id:function:function-name:PROD
  2063. //
  2064. // If the qualifier is not specified, the permission is valid only when requests
  2065. // is made using unqualified function ARN.
  2066. //
  2067. // arn:aws:lambda:aws-region:acct-id:function:function-name
  2068. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  2069. // This parameter is used for S3 and SES only. The AWS account ID (without a
  2070. // hyphen) of the source owner. For example, if the SourceArn identifies a bucket,
  2071. // then this is the bucket owner's account ID. You can use this additional condition
  2072. // to ensure the bucket you specify is owned by a specific account (it is possible
  2073. // the bucket owner deleted the bucket and some other AWS account created the
  2074. // bucket). You can also use this condition to specify all sources (that is,
  2075. // you don't specify the SourceArn) owned by a specific account.
  2076. SourceAccount *string `type:"string"`
  2077. // This is optional; however, when granting Amazon S3 permission to invoke your
  2078. // function, you should specify this field with the Amazon Resource Name (ARN)
  2079. // as its value. This ensures that only events generated from the specified
  2080. // source can invoke the function.
  2081. //
  2082. // If you add a permission for the Amazon S3 principal without providing the
  2083. // source ARN, any AWS account that creates a mapping to your function ARN can
  2084. // send events to invoke your Lambda function from Amazon S3.
  2085. SourceArn *string `type:"string"`
  2086. // A unique statement identifier.
  2087. //
  2088. // StatementId is a required field
  2089. StatementId *string `min:"1" type:"string" required:"true"`
  2090. }
  2091. // String returns the string representation
  2092. func (s AddPermissionInput) String() string {
  2093. return awsutil.Prettify(s)
  2094. }
  2095. // GoString returns the string representation
  2096. func (s AddPermissionInput) GoString() string {
  2097. return s.String()
  2098. }
  2099. // Validate inspects the fields of the type to determine if they are valid.
  2100. func (s *AddPermissionInput) Validate() error {
  2101. invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
  2102. if s.Action == nil {
  2103. invalidParams.Add(request.NewErrParamRequired("Action"))
  2104. }
  2105. if s.FunctionName == nil {
  2106. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2107. }
  2108. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2109. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2110. }
  2111. if s.Principal == nil {
  2112. invalidParams.Add(request.NewErrParamRequired("Principal"))
  2113. }
  2114. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  2115. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  2116. }
  2117. if s.StatementId == nil {
  2118. invalidParams.Add(request.NewErrParamRequired("StatementId"))
  2119. }
  2120. if s.StatementId != nil && len(*s.StatementId) < 1 {
  2121. invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
  2122. }
  2123. if invalidParams.Len() > 0 {
  2124. return invalidParams
  2125. }
  2126. return nil
  2127. }
  2128. type AddPermissionOutput struct {
  2129. _ struct{} `type:"structure"`
  2130. // The permission statement you specified in the request. The response returns
  2131. // the same as a string using a backslash ("\") as an escape character in the
  2132. // JSON.
  2133. Statement *string `type:"string"`
  2134. }
  2135. // String returns the string representation
  2136. func (s AddPermissionOutput) String() string {
  2137. return awsutil.Prettify(s)
  2138. }
  2139. // GoString returns the string representation
  2140. func (s AddPermissionOutput) GoString() string {
  2141. return s.String()
  2142. }
  2143. // Provides configuration information about a Lambda function version alias.
  2144. type AliasConfiguration struct {
  2145. _ struct{} `type:"structure"`
  2146. // Lambda function ARN that is qualified using the alias name as the suffix.
  2147. // For example, if you create an alias called BETA that points to a helloworld
  2148. // function version, the ARN is arn:aws:lambda:aws-regions:acct-id:function:helloworld:BETA.
  2149. AliasArn *string `type:"string"`
  2150. // Alias description.
  2151. Description *string `type:"string"`
  2152. // Function version to which the alias points.
  2153. FunctionVersion *string `min:"1" type:"string"`
  2154. // Alias name.
  2155. Name *string `min:"1" type:"string"`
  2156. }
  2157. // String returns the string representation
  2158. func (s AliasConfiguration) String() string {
  2159. return awsutil.Prettify(s)
  2160. }
  2161. // GoString returns the string representation
  2162. func (s AliasConfiguration) GoString() string {
  2163. return s.String()
  2164. }
  2165. type CreateAliasInput struct {
  2166. _ struct{} `type:"structure"`
  2167. // Description of the alias.
  2168. Description *string `type:"string"`
  2169. // Name of the Lambda function for which you want to create an alias.
  2170. //
  2171. // FunctionName is a required field
  2172. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2173. // Lambda function version for which you are creating the alias.
  2174. //
  2175. // FunctionVersion is a required field
  2176. FunctionVersion *string `min:"1" type:"string" required:"true"`
  2177. // Name for the alias you are creating.
  2178. //
  2179. // Name is a required field
  2180. Name *string `min:"1" type:"string" required:"true"`
  2181. }
  2182. // String returns the string representation
  2183. func (s CreateAliasInput) String() string {
  2184. return awsutil.Prettify(s)
  2185. }
  2186. // GoString returns the string representation
  2187. func (s CreateAliasInput) GoString() string {
  2188. return s.String()
  2189. }
  2190. // Validate inspects the fields of the type to determine if they are valid.
  2191. func (s *CreateAliasInput) Validate() error {
  2192. invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"}
  2193. if s.FunctionName == nil {
  2194. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2195. }
  2196. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2197. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2198. }
  2199. if s.FunctionVersion == nil {
  2200. invalidParams.Add(request.NewErrParamRequired("FunctionVersion"))
  2201. }
  2202. if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
  2203. invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
  2204. }
  2205. if s.Name == nil {
  2206. invalidParams.Add(request.NewErrParamRequired("Name"))
  2207. }
  2208. if s.Name != nil && len(*s.Name) < 1 {
  2209. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  2210. }
  2211. if invalidParams.Len() > 0 {
  2212. return invalidParams
  2213. }
  2214. return nil
  2215. }
  2216. type CreateEventSourceMappingInput struct {
  2217. _ struct{} `type:"structure"`
  2218. // The largest number of records that AWS Lambda will retrieve from your event
  2219. // source at the time of invoking your function. Your function receives an event
  2220. // with all the retrieved records. The default is 100 records.
  2221. BatchSize *int64 `min:"1" type:"integer"`
  2222. // Indicates whether AWS Lambda should begin polling the event source. By default,
  2223. // Enabled is true.
  2224. Enabled *bool `type:"boolean"`
  2225. // The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB
  2226. // stream that is the event source. Any record added to this stream could cause
  2227. // AWS Lambda to invoke your Lambda function, it depends on the BatchSize. AWS
  2228. // Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda
  2229. // function as JSON.
  2230. //
  2231. // EventSourceArn is a required field
  2232. EventSourceArn *string `type:"string" required:"true"`
  2233. // The Lambda function to invoke when AWS Lambda detects an event on the stream.
  2234. //
  2235. // You can specify the function name (for example, Thumbnail) or you can specify
  2236. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2237. //
  2238. // If you are using versioning, you can also provide a qualified function ARN
  2239. // (ARN that is qualified with function version or alias name as suffix). For
  2240. // more information about versioning, see AWS Lambda Function Versioning and
  2241. // Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)
  2242. //
  2243. // AWS Lambda also allows you to specify only the function name with the account
  2244. // ID qualifier (for example, account-id:Thumbnail).
  2245. //
  2246. // Note that the length constraint applies only to the ARN. If you specify only
  2247. // the function name, it is limited to 64 character in length.
  2248. //
  2249. // FunctionName is a required field
  2250. FunctionName *string `min:"1" type:"string" required:"true"`
  2251. // The position in the stream where AWS Lambda should start reading. For more
  2252. // information, go to ShardIteratorType (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType)
  2253. // in the Amazon Kinesis API Reference.
  2254. //
  2255. // StartingPosition is a required field
  2256. StartingPosition *string `type:"string" required:"true" enum:"EventSourcePosition"`
  2257. }
  2258. // String returns the string representation
  2259. func (s CreateEventSourceMappingInput) String() string {
  2260. return awsutil.Prettify(s)
  2261. }
  2262. // GoString returns the string representation
  2263. func (s CreateEventSourceMappingInput) GoString() string {
  2264. return s.String()
  2265. }
  2266. // Validate inspects the fields of the type to determine if they are valid.
  2267. func (s *CreateEventSourceMappingInput) Validate() error {
  2268. invalidParams := request.ErrInvalidParams{Context: "CreateEventSourceMappingInput"}
  2269. if s.BatchSize != nil && *s.BatchSize < 1 {
  2270. invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1))
  2271. }
  2272. if s.EventSourceArn == nil {
  2273. invalidParams.Add(request.NewErrParamRequired("EventSourceArn"))
  2274. }
  2275. if s.FunctionName == nil {
  2276. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2277. }
  2278. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2279. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2280. }
  2281. if s.StartingPosition == nil {
  2282. invalidParams.Add(request.NewErrParamRequired("StartingPosition"))
  2283. }
  2284. if invalidParams.Len() > 0 {
  2285. return invalidParams
  2286. }
  2287. return nil
  2288. }
  2289. type CreateFunctionInput struct {
  2290. _ struct{} `type:"structure"`
  2291. // The code for the Lambda function.
  2292. //
  2293. // Code is a required field
  2294. Code *FunctionCode `type:"structure" required:"true"`
  2295. // A short, user-defined function description. Lambda does not use this value.
  2296. // Assign a meaningful description as you see fit.
  2297. Description *string `type:"string"`
  2298. // The name you want to assign to the function you are uploading. The function
  2299. // names appear in the console and are returned in the ListFunctions API. Function
  2300. // names are used to specify functions to other AWS Lambda APIs, such as Invoke.
  2301. //
  2302. // FunctionName is a required field
  2303. FunctionName *string `min:"1" type:"string" required:"true"`
  2304. // The function within your code that Lambda calls to begin execution. For Node.js,
  2305. // it is the module-name.export value in your function. For Java, it can be
  2306. // package.class-name::handler or package.class-name. For more information,
  2307. // see Lambda Function Handler (Java) (http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html).
  2308. //
  2309. // Handler is a required field
  2310. Handler *string `type:"string" required:"true"`
  2311. // The amount of memory, in MB, your Lambda function is given. Lambda uses this
  2312. // memory size to infer the amount of CPU and memory allocated to your function.
  2313. // Your function use-case determines your CPU and memory requirements. For example,
  2314. // a database operation might need less memory compared to an image processing
  2315. // function. The default value is 128 MB. The value must be a multiple of 64
  2316. // MB.
  2317. MemorySize *int64 `min:"128" type:"integer"`
  2318. // This boolean parameter can be used to request AWS Lambda to create the Lambda
  2319. // function and publish a version as an atomic operation.
  2320. Publish *bool `type:"boolean"`
  2321. // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it
  2322. // executes your function to access any other Amazon Web Services (AWS) resources.
  2323. // For more information, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html).
  2324. //
  2325. // Role is a required field
  2326. Role *string `type:"string" required:"true"`
  2327. // The runtime environment for the Lambda function you are uploading.
  2328. //
  2329. // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier
  2330. // runtime (v0.10.42), set the value to "nodejs".
  2331. //
  2332. // Runtime is a required field
  2333. Runtime *string `type:"string" required:"true" enum:"Runtime"`
  2334. // The function execution time at which Lambda should terminate the function.
  2335. // Because the execution time has cost implications, we recommend you set this
  2336. // value based on your expected execution time. The default is 3 seconds.
  2337. Timeout *int64 `min:"1" type:"integer"`
  2338. // If your Lambda function accesses resources in a VPC, you provide this parameter
  2339. // identifying the list of security group IDs and subnet IDs. These must belong
  2340. // to the same VPC. You must provide at least one security group and one subnet
  2341. // ID.
  2342. VpcConfig *VpcConfig `type:"structure"`
  2343. }
  2344. // String returns the string representation
  2345. func (s CreateFunctionInput) String() string {
  2346. return awsutil.Prettify(s)
  2347. }
  2348. // GoString returns the string representation
  2349. func (s CreateFunctionInput) GoString() string {
  2350. return s.String()
  2351. }
  2352. // Validate inspects the fields of the type to determine if they are valid.
  2353. func (s *CreateFunctionInput) Validate() error {
  2354. invalidParams := request.ErrInvalidParams{Context: "CreateFunctionInput"}
  2355. if s.Code == nil {
  2356. invalidParams.Add(request.NewErrParamRequired("Code"))
  2357. }
  2358. if s.FunctionName == nil {
  2359. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2360. }
  2361. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2362. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2363. }
  2364. if s.Handler == nil {
  2365. invalidParams.Add(request.NewErrParamRequired("Handler"))
  2366. }
  2367. if s.MemorySize != nil && *s.MemorySize < 128 {
  2368. invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128))
  2369. }
  2370. if s.Role == nil {
  2371. invalidParams.Add(request.NewErrParamRequired("Role"))
  2372. }
  2373. if s.Runtime == nil {
  2374. invalidParams.Add(request.NewErrParamRequired("Runtime"))
  2375. }
  2376. if s.Timeout != nil && *s.Timeout < 1 {
  2377. invalidParams.Add(request.NewErrParamMinValue("Timeout", 1))
  2378. }
  2379. if s.Code != nil {
  2380. if err := s.Code.Validate(); err != nil {
  2381. invalidParams.AddNested("Code", err.(request.ErrInvalidParams))
  2382. }
  2383. }
  2384. if invalidParams.Len() > 0 {
  2385. return invalidParams
  2386. }
  2387. return nil
  2388. }
  2389. type DeleteAliasInput struct {
  2390. _ struct{} `type:"structure"`
  2391. // The Lambda function name for which the alias is created. Deleting an alias
  2392. // does not delete the function version to which it is pointing.
  2393. //
  2394. // FunctionName is a required field
  2395. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2396. // Name of the alias to delete.
  2397. //
  2398. // Name is a required field
  2399. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"`
  2400. }
  2401. // String returns the string representation
  2402. func (s DeleteAliasInput) String() string {
  2403. return awsutil.Prettify(s)
  2404. }
  2405. // GoString returns the string representation
  2406. func (s DeleteAliasInput) GoString() string {
  2407. return s.String()
  2408. }
  2409. // Validate inspects the fields of the type to determine if they are valid.
  2410. func (s *DeleteAliasInput) Validate() error {
  2411. invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"}
  2412. if s.FunctionName == nil {
  2413. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2414. }
  2415. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2416. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2417. }
  2418. if s.Name == nil {
  2419. invalidParams.Add(request.NewErrParamRequired("Name"))
  2420. }
  2421. if s.Name != nil && len(*s.Name) < 1 {
  2422. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  2423. }
  2424. if invalidParams.Len() > 0 {
  2425. return invalidParams
  2426. }
  2427. return nil
  2428. }
  2429. type DeleteAliasOutput struct {
  2430. _ struct{} `type:"structure"`
  2431. }
  2432. // String returns the string representation
  2433. func (s DeleteAliasOutput) String() string {
  2434. return awsutil.Prettify(s)
  2435. }
  2436. // GoString returns the string representation
  2437. func (s DeleteAliasOutput) GoString() string {
  2438. return s.String()
  2439. }
  2440. type DeleteEventSourceMappingInput struct {
  2441. _ struct{} `type:"structure"`
  2442. // The event source mapping ID.
  2443. //
  2444. // UUID is a required field
  2445. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  2446. }
  2447. // String returns the string representation
  2448. func (s DeleteEventSourceMappingInput) String() string {
  2449. return awsutil.Prettify(s)
  2450. }
  2451. // GoString returns the string representation
  2452. func (s DeleteEventSourceMappingInput) GoString() string {
  2453. return s.String()
  2454. }
  2455. // Validate inspects the fields of the type to determine if they are valid.
  2456. func (s *DeleteEventSourceMappingInput) Validate() error {
  2457. invalidParams := request.ErrInvalidParams{Context: "DeleteEventSourceMappingInput"}
  2458. if s.UUID == nil {
  2459. invalidParams.Add(request.NewErrParamRequired("UUID"))
  2460. }
  2461. if invalidParams.Len() > 0 {
  2462. return invalidParams
  2463. }
  2464. return nil
  2465. }
  2466. type DeleteFunctionInput struct {
  2467. _ struct{} `type:"structure"`
  2468. // The Lambda function to delete.
  2469. //
  2470. // You can specify the function name (for example, Thumbnail) or you can specify
  2471. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2472. // If you are using versioning, you can also provide a qualified function ARN
  2473. // (ARN that is qualified with function version or alias name as suffix). AWS
  2474. // Lambda also allows you to specify only the function name with the account
  2475. // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint
  2476. // applies only to the ARN. If you specify only the function name, it is limited
  2477. // to 64 character in length.
  2478. //
  2479. // FunctionName is a required field
  2480. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2481. // Using this optional parameter you can specify a function version (but not
  2482. // the $LATEST version) to direct AWS Lambda to delete a specific function version.
  2483. // If the function version has one or more aliases pointing to it, you will
  2484. // get an error because you cannot have aliases pointing to it. You can delete
  2485. // any function version but not the $LATEST, that is, you cannot specify $LATEST
  2486. // as the value of this parameter. The $LATEST version can be deleted only when
  2487. // you want to delete all the function versions and aliases.
  2488. //
  2489. // You can only specify a function version, not an alias name, using this parameter.
  2490. // You cannot delete a function version using its alias.
  2491. //
  2492. // If you don't specify this parameter, AWS Lambda will delete the function,
  2493. // including all of its versions and aliases.
  2494. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  2495. }
  2496. // String returns the string representation
  2497. func (s DeleteFunctionInput) String() string {
  2498. return awsutil.Prettify(s)
  2499. }
  2500. // GoString returns the string representation
  2501. func (s DeleteFunctionInput) GoString() string {
  2502. return s.String()
  2503. }
  2504. // Validate inspects the fields of the type to determine if they are valid.
  2505. func (s *DeleteFunctionInput) Validate() error {
  2506. invalidParams := request.ErrInvalidParams{Context: "DeleteFunctionInput"}
  2507. if s.FunctionName == nil {
  2508. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2509. }
  2510. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2511. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2512. }
  2513. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  2514. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  2515. }
  2516. if invalidParams.Len() > 0 {
  2517. return invalidParams
  2518. }
  2519. return nil
  2520. }
  2521. type DeleteFunctionOutput struct {
  2522. _ struct{} `type:"structure"`
  2523. }
  2524. // String returns the string representation
  2525. func (s DeleteFunctionOutput) String() string {
  2526. return awsutil.Prettify(s)
  2527. }
  2528. // GoString returns the string representation
  2529. func (s DeleteFunctionOutput) GoString() string {
  2530. return s.String()
  2531. }
  2532. // Describes mapping between an Amazon Kinesis stream and a Lambda function.
  2533. type EventSourceMappingConfiguration struct {
  2534. _ struct{} `type:"structure"`
  2535. // The largest number of records that AWS Lambda will retrieve from your event
  2536. // source at the time of invoking your function. Your function receives an event
  2537. // with all the retrieved records.
  2538. BatchSize *int64 `min:"1" type:"integer"`
  2539. // The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source
  2540. // of events.
  2541. EventSourceArn *string `type:"string"`
  2542. // The Lambda function to invoke when AWS Lambda detects an event on the stream.
  2543. FunctionArn *string `type:"string"`
  2544. // The UTC time string indicating the last time the event mapping was updated.
  2545. LastModified *time.Time `type:"timestamp" timestampFormat:"unix"`
  2546. // The result of the last AWS Lambda invocation of your Lambda function.
  2547. LastProcessingResult *string `type:"string"`
  2548. // The state of the event source mapping. It can be Creating, Enabled, Disabled,
  2549. // Enabling, Disabling, Updating, or Deleting.
  2550. State *string `type:"string"`
  2551. // The reason the event source mapping is in its current state. It is either
  2552. // user-requested or an AWS Lambda-initiated state transition.
  2553. StateTransitionReason *string `type:"string"`
  2554. // The AWS Lambda assigned opaque identifier for the mapping.
  2555. UUID *string `type:"string"`
  2556. }
  2557. // String returns the string representation
  2558. func (s EventSourceMappingConfiguration) String() string {
  2559. return awsutil.Prettify(s)
  2560. }
  2561. // GoString returns the string representation
  2562. func (s EventSourceMappingConfiguration) GoString() string {
  2563. return s.String()
  2564. }
  2565. // The code for the Lambda function.
  2566. type FunctionCode struct {
  2567. _ struct{} `type:"structure"`
  2568. // Amazon S3 bucket name where the .zip file containing your deployment package
  2569. // is stored. This bucket must reside in the same AWS region where you are creating
  2570. // the Lambda function.
  2571. S3Bucket *string `min:"3" type:"string"`
  2572. // The Amazon S3 object (the deployment package) key name you want to upload.
  2573. S3Key *string `min:"1" type:"string"`
  2574. // The Amazon S3 object (the deployment package) version you want to upload.
  2575. S3ObjectVersion *string `min:"1" type:"string"`
  2576. // The contents of your zip file containing your deployment package. If you
  2577. // are using the web API directly, the contents of the zip file must be base64-encoded.
  2578. // If you are using the AWS SDKs or the AWS CLI, the SDKs or CLI will do the
  2579. // encoding for you. For more information about creating a .zip file, go to
  2580. // Execution Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html)
  2581. // in the AWS Lambda Developer Guide.
  2582. //
  2583. // ZipFile is automatically base64 encoded/decoded by the SDK.
  2584. ZipFile []byte `type:"blob"`
  2585. }
  2586. // String returns the string representation
  2587. func (s FunctionCode) String() string {
  2588. return awsutil.Prettify(s)
  2589. }
  2590. // GoString returns the string representation
  2591. func (s FunctionCode) GoString() string {
  2592. return s.String()
  2593. }
  2594. // Validate inspects the fields of the type to determine if they are valid.
  2595. func (s *FunctionCode) Validate() error {
  2596. invalidParams := request.ErrInvalidParams{Context: "FunctionCode"}
  2597. if s.S3Bucket != nil && len(*s.S3Bucket) < 3 {
  2598. invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3))
  2599. }
  2600. if s.S3Key != nil && len(*s.S3Key) < 1 {
  2601. invalidParams.Add(request.NewErrParamMinLen("S3Key", 1))
  2602. }
  2603. if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 {
  2604. invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1))
  2605. }
  2606. if invalidParams.Len() > 0 {
  2607. return invalidParams
  2608. }
  2609. return nil
  2610. }
  2611. // The object for the Lambda function location.
  2612. type FunctionCodeLocation struct {
  2613. _ struct{} `type:"structure"`
  2614. // The presigned URL you can use to download the function's .zip file that you
  2615. // previously uploaded. The URL is valid for up to 10 minutes.
  2616. Location *string `type:"string"`
  2617. // The repository from which you can download the function.
  2618. RepositoryType *string `type:"string"`
  2619. }
  2620. // String returns the string representation
  2621. func (s FunctionCodeLocation) String() string {
  2622. return awsutil.Prettify(s)
  2623. }
  2624. // GoString returns the string representation
  2625. func (s FunctionCodeLocation) GoString() string {
  2626. return s.String()
  2627. }
  2628. // A complex type that describes function metadata.
  2629. type FunctionConfiguration struct {
  2630. _ struct{} `type:"structure"`
  2631. // It is the SHA256 hash of your function deployment package.
  2632. CodeSha256 *string `type:"string"`
  2633. // The size, in bytes, of the function .zip file you uploaded.
  2634. CodeSize *int64 `type:"long"`
  2635. // The user-provided description.
  2636. Description *string `type:"string"`
  2637. // The Amazon Resource Name (ARN) assigned to the function.
  2638. FunctionArn *string `type:"string"`
  2639. // The name of the function.
  2640. FunctionName *string `min:"1" type:"string"`
  2641. // The function Lambda calls to begin executing your function.
  2642. Handler *string `type:"string"`
  2643. // The time stamp of the last time you updated the function.
  2644. LastModified *string `type:"string"`
  2645. // The memory size, in MB, you configured for the function. Must be a multiple
  2646. // of 64 MB.
  2647. MemorySize *int64 `min:"128" type:"integer"`
  2648. // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it
  2649. // executes your function to access any other Amazon Web Services (AWS) resources.
  2650. Role *string `type:"string"`
  2651. // The runtime environment for the Lambda function.
  2652. //
  2653. // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier
  2654. // runtime (v0.10.42), set the value to "nodejs".
  2655. Runtime *string `type:"string" enum:"Runtime"`
  2656. // The function execution time at which Lambda should terminate the function.
  2657. // Because the execution time has cost implications, we recommend you set this
  2658. // value based on your expected execution time. The default is 3 seconds.
  2659. Timeout *int64 `min:"1" type:"integer"`
  2660. // The version of the Lambda function.
  2661. Version *string `min:"1" type:"string"`
  2662. // VPC configuration associated with your Lambda function.
  2663. VpcConfig *VpcConfigResponse `type:"structure"`
  2664. }
  2665. // String returns the string representation
  2666. func (s FunctionConfiguration) String() string {
  2667. return awsutil.Prettify(s)
  2668. }
  2669. // GoString returns the string representation
  2670. func (s FunctionConfiguration) GoString() string {
  2671. return s.String()
  2672. }
  2673. type GetAliasInput struct {
  2674. _ struct{} `type:"structure"`
  2675. // Function name for which the alias is created. An alias is a subresource that
  2676. // exists only in the context of an existing Lambda function so you must specify
  2677. // the function name.
  2678. //
  2679. // FunctionName is a required field
  2680. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2681. // Name of the alias for which you want to retrieve information.
  2682. //
  2683. // Name is a required field
  2684. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"`
  2685. }
  2686. // String returns the string representation
  2687. func (s GetAliasInput) String() string {
  2688. return awsutil.Prettify(s)
  2689. }
  2690. // GoString returns the string representation
  2691. func (s GetAliasInput) GoString() string {
  2692. return s.String()
  2693. }
  2694. // Validate inspects the fields of the type to determine if they are valid.
  2695. func (s *GetAliasInput) Validate() error {
  2696. invalidParams := request.ErrInvalidParams{Context: "GetAliasInput"}
  2697. if s.FunctionName == nil {
  2698. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2699. }
  2700. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2701. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2702. }
  2703. if s.Name == nil {
  2704. invalidParams.Add(request.NewErrParamRequired("Name"))
  2705. }
  2706. if s.Name != nil && len(*s.Name) < 1 {
  2707. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  2708. }
  2709. if invalidParams.Len() > 0 {
  2710. return invalidParams
  2711. }
  2712. return nil
  2713. }
  2714. type GetEventSourceMappingInput struct {
  2715. _ struct{} `type:"structure"`
  2716. // The AWS Lambda assigned ID of the event source mapping.
  2717. //
  2718. // UUID is a required field
  2719. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  2720. }
  2721. // String returns the string representation
  2722. func (s GetEventSourceMappingInput) String() string {
  2723. return awsutil.Prettify(s)
  2724. }
  2725. // GoString returns the string representation
  2726. func (s GetEventSourceMappingInput) GoString() string {
  2727. return s.String()
  2728. }
  2729. // Validate inspects the fields of the type to determine if they are valid.
  2730. func (s *GetEventSourceMappingInput) Validate() error {
  2731. invalidParams := request.ErrInvalidParams{Context: "GetEventSourceMappingInput"}
  2732. if s.UUID == nil {
  2733. invalidParams.Add(request.NewErrParamRequired("UUID"))
  2734. }
  2735. if invalidParams.Len() > 0 {
  2736. return invalidParams
  2737. }
  2738. return nil
  2739. }
  2740. type GetFunctionConfigurationInput struct {
  2741. _ struct{} `type:"structure"`
  2742. // The name of the Lambda function for which you want to retrieve the configuration
  2743. // information.
  2744. //
  2745. // You can specify a function name (for example, Thumbnail) or you can specify
  2746. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2747. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  2748. // Note that the length constraint applies only to the ARN. If you specify only
  2749. // the function name, it is limited to 64 character in length.
  2750. //
  2751. // FunctionName is a required field
  2752. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2753. // Using this optional parameter you can specify a function version or an alias
  2754. // name. If you specify function version, the API uses qualified function ARN
  2755. // and returns information about the specific function version. If you specify
  2756. // an alias name, the API uses the alias ARN and returns information about the
  2757. // function version to which the alias points.
  2758. //
  2759. // If you don't specify this parameter, the API uses unqualified function ARN,
  2760. // and returns information about the $LATEST function version.
  2761. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  2762. }
  2763. // String returns the string representation
  2764. func (s GetFunctionConfigurationInput) String() string {
  2765. return awsutil.Prettify(s)
  2766. }
  2767. // GoString returns the string representation
  2768. func (s GetFunctionConfigurationInput) GoString() string {
  2769. return s.String()
  2770. }
  2771. // Validate inspects the fields of the type to determine if they are valid.
  2772. func (s *GetFunctionConfigurationInput) Validate() error {
  2773. invalidParams := request.ErrInvalidParams{Context: "GetFunctionConfigurationInput"}
  2774. if s.FunctionName == nil {
  2775. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2776. }
  2777. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2778. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2779. }
  2780. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  2781. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  2782. }
  2783. if invalidParams.Len() > 0 {
  2784. return invalidParams
  2785. }
  2786. return nil
  2787. }
  2788. type GetFunctionInput struct {
  2789. _ struct{} `type:"structure"`
  2790. // The Lambda function name.
  2791. //
  2792. // You can specify a function name (for example, Thumbnail) or you can specify
  2793. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2794. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  2795. // Note that the length constraint applies only to the ARN. If you specify only
  2796. // the function name, it is limited to 64 character in length.
  2797. //
  2798. // FunctionName is a required field
  2799. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2800. // Using this optional parameter to specify a function version or an alias name.
  2801. // If you specify function version, the API uses qualified function ARN for
  2802. // the request and returns information about the specific Lambda function version.
  2803. // If you specify an alias name, the API uses the alias ARN and returns information
  2804. // about the function version to which the alias points. If you don't provide
  2805. // this parameter, the API uses unqualified function ARN and returns information
  2806. // about the $LATEST version of the Lambda function.
  2807. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  2808. }
  2809. // String returns the string representation
  2810. func (s GetFunctionInput) String() string {
  2811. return awsutil.Prettify(s)
  2812. }
  2813. // GoString returns the string representation
  2814. func (s GetFunctionInput) GoString() string {
  2815. return s.String()
  2816. }
  2817. // Validate inspects the fields of the type to determine if they are valid.
  2818. func (s *GetFunctionInput) Validate() error {
  2819. invalidParams := request.ErrInvalidParams{Context: "GetFunctionInput"}
  2820. if s.FunctionName == nil {
  2821. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2822. }
  2823. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2824. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2825. }
  2826. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  2827. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  2828. }
  2829. if invalidParams.Len() > 0 {
  2830. return invalidParams
  2831. }
  2832. return nil
  2833. }
  2834. // This response contains the object for the Lambda function location (see .
  2835. type GetFunctionOutput struct {
  2836. _ struct{} `type:"structure"`
  2837. // The object for the Lambda function location.
  2838. Code *FunctionCodeLocation `type:"structure"`
  2839. // A complex type that describes function metadata.
  2840. Configuration *FunctionConfiguration `type:"structure"`
  2841. }
  2842. // String returns the string representation
  2843. func (s GetFunctionOutput) String() string {
  2844. return awsutil.Prettify(s)
  2845. }
  2846. // GoString returns the string representation
  2847. func (s GetFunctionOutput) GoString() string {
  2848. return s.String()
  2849. }
  2850. type GetPolicyInput struct {
  2851. _ struct{} `type:"structure"`
  2852. // Function name whose resource policy you want to retrieve.
  2853. //
  2854. // You can specify the function name (for example, Thumbnail) or you can specify
  2855. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2856. // If you are using versioning, you can also provide a qualified function ARN
  2857. // (ARN that is qualified with function version or alias name as suffix). AWS
  2858. // Lambda also allows you to specify only the function name with the account
  2859. // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint
  2860. // applies only to the ARN. If you specify only the function name, it is limited
  2861. // to 64 character in length.
  2862. //
  2863. // FunctionName is a required field
  2864. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2865. // You can specify this optional query parameter to specify a function version
  2866. // or an alias name in which case this API will return all permissions associated
  2867. // with the specific qualified ARN. If you don't provide this parameter, the
  2868. // API will return permissions that apply to the unqualified function ARN.
  2869. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  2870. }
  2871. // String returns the string representation
  2872. func (s GetPolicyInput) String() string {
  2873. return awsutil.Prettify(s)
  2874. }
  2875. // GoString returns the string representation
  2876. func (s GetPolicyInput) GoString() string {
  2877. return s.String()
  2878. }
  2879. // Validate inspects the fields of the type to determine if they are valid.
  2880. func (s *GetPolicyInput) Validate() error {
  2881. invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"}
  2882. if s.FunctionName == nil {
  2883. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2884. }
  2885. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2886. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2887. }
  2888. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  2889. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  2890. }
  2891. if invalidParams.Len() > 0 {
  2892. return invalidParams
  2893. }
  2894. return nil
  2895. }
  2896. type GetPolicyOutput struct {
  2897. _ struct{} `type:"structure"`
  2898. // The resource policy associated with the specified function. The response
  2899. // returns the same as a string using a backslash ("\") as an escape character
  2900. // in the JSON.
  2901. Policy *string `type:"string"`
  2902. }
  2903. // String returns the string representation
  2904. func (s GetPolicyOutput) String() string {
  2905. return awsutil.Prettify(s)
  2906. }
  2907. // GoString returns the string representation
  2908. func (s GetPolicyOutput) GoString() string {
  2909. return s.String()
  2910. }
  2911. type InvokeAsyncInput struct {
  2912. _ struct{} `deprecated:"true" type:"structure" payload:"InvokeArgs"`
  2913. // The Lambda function name.
  2914. //
  2915. // FunctionName is a required field
  2916. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2917. // JSON that you want to provide to your Lambda function as input.
  2918. //
  2919. // InvokeArgs is a required field
  2920. InvokeArgs io.ReadSeeker `type:"blob" required:"true"`
  2921. }
  2922. // String returns the string representation
  2923. func (s InvokeAsyncInput) String() string {
  2924. return awsutil.Prettify(s)
  2925. }
  2926. // GoString returns the string representation
  2927. func (s InvokeAsyncInput) GoString() string {
  2928. return s.String()
  2929. }
  2930. // Validate inspects the fields of the type to determine if they are valid.
  2931. func (s *InvokeAsyncInput) Validate() error {
  2932. invalidParams := request.ErrInvalidParams{Context: "InvokeAsyncInput"}
  2933. if s.FunctionName == nil {
  2934. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  2935. }
  2936. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  2937. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  2938. }
  2939. if s.InvokeArgs == nil {
  2940. invalidParams.Add(request.NewErrParamRequired("InvokeArgs"))
  2941. }
  2942. if invalidParams.Len() > 0 {
  2943. return invalidParams
  2944. }
  2945. return nil
  2946. }
  2947. // Upon success, it returns empty response. Otherwise, throws an exception.
  2948. type InvokeAsyncOutput struct {
  2949. _ struct{} `deprecated:"true" type:"structure"`
  2950. // It will be 202 upon success.
  2951. Status *int64 `location:"statusCode" type:"integer"`
  2952. }
  2953. // String returns the string representation
  2954. func (s InvokeAsyncOutput) String() string {
  2955. return awsutil.Prettify(s)
  2956. }
  2957. // GoString returns the string representation
  2958. func (s InvokeAsyncOutput) GoString() string {
  2959. return s.String()
  2960. }
  2961. type InvokeInput struct {
  2962. _ struct{} `type:"structure" payload:"Payload"`
  2963. // Using the ClientContext you can pass client-specific information to the Lambda
  2964. // function you are invoking. You can then process the client information in
  2965. // your Lambda function as you choose through the context variable. For an example
  2966. // of a ClientContext JSON, see PutEvents (http://docs.aws.amazon.com/mobileanalytics/latest/ug/PutEvents.html)
  2967. // in the Amazon Mobile Analytics API Reference and User Guide.
  2968. //
  2969. // The ClientContext JSON must be base64-encoded.
  2970. ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"`
  2971. // The Lambda function name.
  2972. //
  2973. // You can specify a function name (for example, Thumbnail) or you can specify
  2974. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  2975. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  2976. // Note that the length constraint applies only to the ARN. If you specify only
  2977. // the function name, it is limited to 64 character in length.
  2978. //
  2979. // FunctionName is a required field
  2980. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  2981. // By default, the Invoke API assumes RequestResponse invocation type. You can
  2982. // optionally request asynchronous execution by specifying Event as the InvocationType.
  2983. // You can also use this parameter to request AWS Lambda to not execute the
  2984. // function but do some verification, such as if the caller is authorized to
  2985. // invoke the function and if the inputs are valid. You request this by specifying
  2986. // DryRun as the InvocationType. This is useful in a cross-account scenario
  2987. // when you want to verify access to a function without running it.
  2988. InvocationType *string `location:"header" locationName:"X-Amz-Invocation-Type" type:"string" enum:"InvocationType"`
  2989. // You can set this optional parameter to Tail in the request only if you specify
  2990. // the InvocationType parameter with value RequestResponse. In this case, AWS
  2991. // Lambda returns the base64-encoded last 4 KB of log data produced by your
  2992. // Lambda function in the x-amz-log-result header.
  2993. LogType *string `location:"header" locationName:"X-Amz-Log-Type" type:"string" enum:"LogType"`
  2994. // JSON that you want to provide to your Lambda function as input.
  2995. Payload []byte `type:"blob"`
  2996. // You can use this optional parameter to specify a Lambda function version
  2997. // or alias name. If you specify a function version, the API uses the qualified
  2998. // function ARN to invoke a specific Lambda function. If you specify an alias
  2999. // name, the API uses the alias ARN to invoke the Lambda function version to
  3000. // which the alias points.
  3001. //
  3002. // If you don't provide this parameter, then the API uses unqualified function
  3003. // ARN which results in invocation of the $LATEST version.
  3004. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  3005. }
  3006. // String returns the string representation
  3007. func (s InvokeInput) String() string {
  3008. return awsutil.Prettify(s)
  3009. }
  3010. // GoString returns the string representation
  3011. func (s InvokeInput) GoString() string {
  3012. return s.String()
  3013. }
  3014. // Validate inspects the fields of the type to determine if they are valid.
  3015. func (s *InvokeInput) Validate() error {
  3016. invalidParams := request.ErrInvalidParams{Context: "InvokeInput"}
  3017. if s.FunctionName == nil {
  3018. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3019. }
  3020. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3021. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3022. }
  3023. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  3024. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  3025. }
  3026. if invalidParams.Len() > 0 {
  3027. return invalidParams
  3028. }
  3029. return nil
  3030. }
  3031. // Upon success, returns an empty response. Otherwise, throws an exception.
  3032. type InvokeOutput struct {
  3033. _ struct{} `type:"structure" payload:"Payload"`
  3034. // Indicates whether an error occurred while executing the Lambda function.
  3035. // If an error occurred this field will have one of two values; Handled or Unhandled.
  3036. // Handled errors are errors that are reported by the function while the Unhandled
  3037. // errors are those detected and reported by AWS Lambda. Unhandled errors include
  3038. // out of memory errors and function timeouts. For information about how to
  3039. // report an Handled error, see Programming Model (http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html).
  3040. FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"`
  3041. // It is the base64-encoded logs for the Lambda function invocation. This is
  3042. // present only if the invocation type is RequestResponse and the logs were
  3043. // requested.
  3044. LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"`
  3045. // It is the JSON representation of the object returned by the Lambda function.
  3046. // In This is present only if the invocation type is RequestResponse.
  3047. //
  3048. // In the event of a function error this field contains a message describing
  3049. // the error. For the Handled errors the Lambda function will report this message.
  3050. // For Unhandled errors AWS Lambda reports the message.
  3051. Payload []byte `type:"blob"`
  3052. // The HTTP status code will be in the 200 range for successful request. For
  3053. // the RequestResonse invocation type this status code will be 200. For the
  3054. // Event invocation type this status code will be 202. For the DryRun invocation
  3055. // type the status code will be 204.
  3056. StatusCode *int64 `location:"statusCode" type:"integer"`
  3057. }
  3058. // String returns the string representation
  3059. func (s InvokeOutput) String() string {
  3060. return awsutil.Prettify(s)
  3061. }
  3062. // GoString returns the string representation
  3063. func (s InvokeOutput) GoString() string {
  3064. return s.String()
  3065. }
  3066. type ListAliasesInput struct {
  3067. _ struct{} `type:"structure"`
  3068. // Lambda function name for which the alias is created.
  3069. //
  3070. // FunctionName is a required field
  3071. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3072. // If you specify this optional parameter, the API returns only the aliases
  3073. // that are pointing to the specific Lambda function version, otherwise the
  3074. // API returns all of the aliases created for the Lambda function.
  3075. FunctionVersion *string `location:"querystring" locationName:"FunctionVersion" min:"1" type:"string"`
  3076. // Optional string. An opaque pagination token returned from a previous ListAliases
  3077. // operation. If present, indicates where to continue the listing.
  3078. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  3079. // Optional integer. Specifies the maximum number of aliases to return in response.
  3080. // This parameter value must be greater than 0.
  3081. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"`
  3082. }
  3083. // String returns the string representation
  3084. func (s ListAliasesInput) String() string {
  3085. return awsutil.Prettify(s)
  3086. }
  3087. // GoString returns the string representation
  3088. func (s ListAliasesInput) GoString() string {
  3089. return s.String()
  3090. }
  3091. // Validate inspects the fields of the type to determine if they are valid.
  3092. func (s *ListAliasesInput) Validate() error {
  3093. invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"}
  3094. if s.FunctionName == nil {
  3095. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3096. }
  3097. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3098. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3099. }
  3100. if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
  3101. invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
  3102. }
  3103. if s.MaxItems != nil && *s.MaxItems < 1 {
  3104. invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
  3105. }
  3106. if invalidParams.Len() > 0 {
  3107. return invalidParams
  3108. }
  3109. return nil
  3110. }
  3111. type ListAliasesOutput struct {
  3112. _ struct{} `type:"structure"`
  3113. // A list of aliases.
  3114. Aliases []*AliasConfiguration `type:"list"`
  3115. // A string, present if there are more aliases.
  3116. NextMarker *string `type:"string"`
  3117. }
  3118. // String returns the string representation
  3119. func (s ListAliasesOutput) String() string {
  3120. return awsutil.Prettify(s)
  3121. }
  3122. // GoString returns the string representation
  3123. func (s ListAliasesOutput) GoString() string {
  3124. return s.String()
  3125. }
  3126. type ListEventSourceMappingsInput struct {
  3127. _ struct{} `type:"structure"`
  3128. // The Amazon Resource Name (ARN) of the Amazon Kinesis stream. (This parameter
  3129. // is optional.)
  3130. EventSourceArn *string `location:"querystring" locationName:"EventSourceArn" type:"string"`
  3131. // The name of the Lambda function.
  3132. //
  3133. // You can specify the function name (for example, Thumbnail) or you can specify
  3134. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3135. // If you are using versioning, you can also provide a qualified function ARN
  3136. // (ARN that is qualified with function version or alias name as suffix). AWS
  3137. // Lambda also allows you to specify only the function name with the account
  3138. // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint
  3139. // applies only to the ARN. If you specify only the function name, it is limited
  3140. // to 64 character in length.
  3141. FunctionName *string `location:"querystring" locationName:"FunctionName" min:"1" type:"string"`
  3142. // Optional string. An opaque pagination token returned from a previous ListEventSourceMappings
  3143. // operation. If present, specifies to continue the list from where the returning
  3144. // call left off.
  3145. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  3146. // Optional integer. Specifies the maximum number of event sources to return
  3147. // in response. This value must be greater than 0.
  3148. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"`
  3149. }
  3150. // String returns the string representation
  3151. func (s ListEventSourceMappingsInput) String() string {
  3152. return awsutil.Prettify(s)
  3153. }
  3154. // GoString returns the string representation
  3155. func (s ListEventSourceMappingsInput) GoString() string {
  3156. return s.String()
  3157. }
  3158. // Validate inspects the fields of the type to determine if they are valid.
  3159. func (s *ListEventSourceMappingsInput) Validate() error {
  3160. invalidParams := request.ErrInvalidParams{Context: "ListEventSourceMappingsInput"}
  3161. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3162. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3163. }
  3164. if s.MaxItems != nil && *s.MaxItems < 1 {
  3165. invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
  3166. }
  3167. if invalidParams.Len() > 0 {
  3168. return invalidParams
  3169. }
  3170. return nil
  3171. }
  3172. // Contains a list of event sources (see )
  3173. type ListEventSourceMappingsOutput struct {
  3174. _ struct{} `type:"structure"`
  3175. // An array of EventSourceMappingConfiguration objects.
  3176. EventSourceMappings []*EventSourceMappingConfiguration `type:"list"`
  3177. // A string, present if there are more event source mappings.
  3178. NextMarker *string `type:"string"`
  3179. }
  3180. // String returns the string representation
  3181. func (s ListEventSourceMappingsOutput) String() string {
  3182. return awsutil.Prettify(s)
  3183. }
  3184. // GoString returns the string representation
  3185. func (s ListEventSourceMappingsOutput) GoString() string {
  3186. return s.String()
  3187. }
  3188. type ListFunctionsInput struct {
  3189. _ struct{} `type:"structure"`
  3190. // Optional string. An opaque pagination token returned from a previous ListFunctions
  3191. // operation. If present, indicates where to continue the listing.
  3192. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  3193. // Optional integer. Specifies the maximum number of AWS Lambda functions to
  3194. // return in response. This parameter value must be greater than 0.
  3195. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"`
  3196. }
  3197. // String returns the string representation
  3198. func (s ListFunctionsInput) String() string {
  3199. return awsutil.Prettify(s)
  3200. }
  3201. // GoString returns the string representation
  3202. func (s ListFunctionsInput) GoString() string {
  3203. return s.String()
  3204. }
  3205. // Validate inspects the fields of the type to determine if they are valid.
  3206. func (s *ListFunctionsInput) Validate() error {
  3207. invalidParams := request.ErrInvalidParams{Context: "ListFunctionsInput"}
  3208. if s.MaxItems != nil && *s.MaxItems < 1 {
  3209. invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
  3210. }
  3211. if invalidParams.Len() > 0 {
  3212. return invalidParams
  3213. }
  3214. return nil
  3215. }
  3216. // Contains a list of AWS Lambda function configurations (see FunctionConfiguration.
  3217. type ListFunctionsOutput struct {
  3218. _ struct{} `type:"structure"`
  3219. // A list of Lambda functions.
  3220. Functions []*FunctionConfiguration `type:"list"`
  3221. // A string, present if there are more functions.
  3222. NextMarker *string `type:"string"`
  3223. }
  3224. // String returns the string representation
  3225. func (s ListFunctionsOutput) String() string {
  3226. return awsutil.Prettify(s)
  3227. }
  3228. // GoString returns the string representation
  3229. func (s ListFunctionsOutput) GoString() string {
  3230. return s.String()
  3231. }
  3232. type ListVersionsByFunctionInput struct {
  3233. _ struct{} `type:"structure"`
  3234. // Function name whose versions to list. You can specify a function name (for
  3235. // example, Thumbnail) or you can specify Amazon Resource Name (ARN) of the
  3236. // function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3237. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3238. // Note that the length constraint applies only to the ARN. If you specify only
  3239. // the function name, it is limited to 64 character in length.
  3240. //
  3241. // FunctionName is a required field
  3242. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3243. // Optional string. An opaque pagination token returned from a previous ListVersionsByFunction
  3244. // operation. If present, indicates where to continue the listing.
  3245. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  3246. // Optional integer. Specifies the maximum number of AWS Lambda function versions
  3247. // to return in response. This parameter value must be greater than 0.
  3248. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"`
  3249. }
  3250. // String returns the string representation
  3251. func (s ListVersionsByFunctionInput) String() string {
  3252. return awsutil.Prettify(s)
  3253. }
  3254. // GoString returns the string representation
  3255. func (s ListVersionsByFunctionInput) GoString() string {
  3256. return s.String()
  3257. }
  3258. // Validate inspects the fields of the type to determine if they are valid.
  3259. func (s *ListVersionsByFunctionInput) Validate() error {
  3260. invalidParams := request.ErrInvalidParams{Context: "ListVersionsByFunctionInput"}
  3261. if s.FunctionName == nil {
  3262. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3263. }
  3264. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3265. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3266. }
  3267. if s.MaxItems != nil && *s.MaxItems < 1 {
  3268. invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
  3269. }
  3270. if invalidParams.Len() > 0 {
  3271. return invalidParams
  3272. }
  3273. return nil
  3274. }
  3275. type ListVersionsByFunctionOutput struct {
  3276. _ struct{} `type:"structure"`
  3277. // A string, present if there are more function versions.
  3278. NextMarker *string `type:"string"`
  3279. // A list of Lambda function versions.
  3280. Versions []*FunctionConfiguration `type:"list"`
  3281. }
  3282. // String returns the string representation
  3283. func (s ListVersionsByFunctionOutput) String() string {
  3284. return awsutil.Prettify(s)
  3285. }
  3286. // GoString returns the string representation
  3287. func (s ListVersionsByFunctionOutput) GoString() string {
  3288. return s.String()
  3289. }
  3290. type PublishVersionInput struct {
  3291. _ struct{} `type:"structure"`
  3292. // The SHA256 hash of the deployment package you want to publish. This provides
  3293. // validation on the code you are publishing. If you provide this parameter
  3294. // value must match the SHA256 of the $LATEST version for the publication to
  3295. // succeed.
  3296. CodeSha256 *string `type:"string"`
  3297. // The description for the version you are publishing. If not provided, AWS
  3298. // Lambda copies the description from the $LATEST version.
  3299. Description *string `type:"string"`
  3300. // The Lambda function name. You can specify a function name (for example, Thumbnail)
  3301. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  3302. // arn:aws:lambda:us-west-2:account-id:function:ThumbNail). AWS Lambda also
  3303. // allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3304. // Note that the length constraint applies only to the ARN. If you specify only
  3305. // the function name, it is limited to 64 character in length.
  3306. //
  3307. // FunctionName is a required field
  3308. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3309. }
  3310. // String returns the string representation
  3311. func (s PublishVersionInput) String() string {
  3312. return awsutil.Prettify(s)
  3313. }
  3314. // GoString returns the string representation
  3315. func (s PublishVersionInput) GoString() string {
  3316. return s.String()
  3317. }
  3318. // Validate inspects the fields of the type to determine if they are valid.
  3319. func (s *PublishVersionInput) Validate() error {
  3320. invalidParams := request.ErrInvalidParams{Context: "PublishVersionInput"}
  3321. if s.FunctionName == nil {
  3322. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3323. }
  3324. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3325. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3326. }
  3327. if invalidParams.Len() > 0 {
  3328. return invalidParams
  3329. }
  3330. return nil
  3331. }
  3332. type RemovePermissionInput struct {
  3333. _ struct{} `type:"structure"`
  3334. // Lambda function whose resource policy you want to remove a permission from.
  3335. //
  3336. // You can specify a function name (for example, Thumbnail) or you can specify
  3337. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3338. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3339. // Note that the length constraint applies only to the ARN. If you specify only
  3340. // the function name, it is limited to 64 character in length.
  3341. //
  3342. // FunctionName is a required field
  3343. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3344. // You can specify this optional parameter to remove permission associated with
  3345. // a specific function version or function alias. If you don't specify this
  3346. // parameter, the API removes permission associated with the unqualified function
  3347. // ARN.
  3348. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
  3349. // Statement ID of the permission to remove.
  3350. //
  3351. // StatementId is a required field
  3352. StatementId *string `location:"uri" locationName:"StatementId" min:"1" type:"string" required:"true"`
  3353. }
  3354. // String returns the string representation
  3355. func (s RemovePermissionInput) String() string {
  3356. return awsutil.Prettify(s)
  3357. }
  3358. // GoString returns the string representation
  3359. func (s RemovePermissionInput) GoString() string {
  3360. return s.String()
  3361. }
  3362. // Validate inspects the fields of the type to determine if they are valid.
  3363. func (s *RemovePermissionInput) Validate() error {
  3364. invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
  3365. if s.FunctionName == nil {
  3366. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3367. }
  3368. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3369. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3370. }
  3371. if s.Qualifier != nil && len(*s.Qualifier) < 1 {
  3372. invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
  3373. }
  3374. if s.StatementId == nil {
  3375. invalidParams.Add(request.NewErrParamRequired("StatementId"))
  3376. }
  3377. if s.StatementId != nil && len(*s.StatementId) < 1 {
  3378. invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
  3379. }
  3380. if invalidParams.Len() > 0 {
  3381. return invalidParams
  3382. }
  3383. return nil
  3384. }
  3385. type RemovePermissionOutput struct {
  3386. _ struct{} `type:"structure"`
  3387. }
  3388. // String returns the string representation
  3389. func (s RemovePermissionOutput) String() string {
  3390. return awsutil.Prettify(s)
  3391. }
  3392. // GoString returns the string representation
  3393. func (s RemovePermissionOutput) GoString() string {
  3394. return s.String()
  3395. }
  3396. type UpdateAliasInput struct {
  3397. _ struct{} `type:"structure"`
  3398. // You can change the description of the alias using this parameter.
  3399. Description *string `type:"string"`
  3400. // The function name for which the alias is created.
  3401. //
  3402. // FunctionName is a required field
  3403. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3404. // Using this parameter you can change the Lambda function version to which
  3405. // the alias points.
  3406. FunctionVersion *string `min:"1" type:"string"`
  3407. // The alias name.
  3408. //
  3409. // Name is a required field
  3410. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"`
  3411. }
  3412. // String returns the string representation
  3413. func (s UpdateAliasInput) String() string {
  3414. return awsutil.Prettify(s)
  3415. }
  3416. // GoString returns the string representation
  3417. func (s UpdateAliasInput) GoString() string {
  3418. return s.String()
  3419. }
  3420. // Validate inspects the fields of the type to determine if they are valid.
  3421. func (s *UpdateAliasInput) Validate() error {
  3422. invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"}
  3423. if s.FunctionName == nil {
  3424. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3425. }
  3426. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3427. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3428. }
  3429. if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
  3430. invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
  3431. }
  3432. if s.Name == nil {
  3433. invalidParams.Add(request.NewErrParamRequired("Name"))
  3434. }
  3435. if s.Name != nil && len(*s.Name) < 1 {
  3436. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  3437. }
  3438. if invalidParams.Len() > 0 {
  3439. return invalidParams
  3440. }
  3441. return nil
  3442. }
  3443. type UpdateEventSourceMappingInput struct {
  3444. _ struct{} `type:"structure"`
  3445. // The maximum number of stream records that can be sent to your Lambda function
  3446. // for a single invocation.
  3447. BatchSize *int64 `min:"1" type:"integer"`
  3448. // Specifies whether AWS Lambda should actively poll the stream or not. If disabled,
  3449. // AWS Lambda will not poll the stream.
  3450. Enabled *bool `type:"boolean"`
  3451. // The Lambda function to which you want the stream records sent.
  3452. //
  3453. // You can specify a function name (for example, Thumbnail) or you can specify
  3454. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3455. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3456. //
  3457. // If you are using versioning, you can also provide a qualified function ARN
  3458. // (ARN that is qualified with function version or alias name as suffix). For
  3459. // more information about versioning, see AWS Lambda Function Versioning and
  3460. // Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)
  3461. //
  3462. // Note that the length constraint applies only to the ARN. If you specify only
  3463. // the function name, it is limited to 64 character in length.
  3464. FunctionName *string `min:"1" type:"string"`
  3465. // The event source mapping identifier.
  3466. //
  3467. // UUID is a required field
  3468. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  3469. }
  3470. // String returns the string representation
  3471. func (s UpdateEventSourceMappingInput) String() string {
  3472. return awsutil.Prettify(s)
  3473. }
  3474. // GoString returns the string representation
  3475. func (s UpdateEventSourceMappingInput) GoString() string {
  3476. return s.String()
  3477. }
  3478. // Validate inspects the fields of the type to determine if they are valid.
  3479. func (s *UpdateEventSourceMappingInput) Validate() error {
  3480. invalidParams := request.ErrInvalidParams{Context: "UpdateEventSourceMappingInput"}
  3481. if s.BatchSize != nil && *s.BatchSize < 1 {
  3482. invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1))
  3483. }
  3484. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3485. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3486. }
  3487. if s.UUID == nil {
  3488. invalidParams.Add(request.NewErrParamRequired("UUID"))
  3489. }
  3490. if invalidParams.Len() > 0 {
  3491. return invalidParams
  3492. }
  3493. return nil
  3494. }
  3495. type UpdateFunctionCodeInput struct {
  3496. _ struct{} `type:"structure"`
  3497. // The existing Lambda function name whose code you want to replace.
  3498. //
  3499. // You can specify a function name (for example, Thumbnail) or you can specify
  3500. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3501. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3502. // Note that the length constraint applies only to the ARN. If you specify only
  3503. // the function name, it is limited to 64 character in length.
  3504. //
  3505. // FunctionName is a required field
  3506. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3507. // This boolean parameter can be used to request AWS Lambda to update the Lambda
  3508. // function and publish a version as an atomic operation.
  3509. Publish *bool `type:"boolean"`
  3510. // Amazon S3 bucket name where the .zip file containing your deployment package
  3511. // is stored. This bucket must reside in the same AWS region where you are creating
  3512. // the Lambda function.
  3513. S3Bucket *string `min:"3" type:"string"`
  3514. // The Amazon S3 object (the deployment package) key name you want to upload.
  3515. S3Key *string `min:"1" type:"string"`
  3516. // The Amazon S3 object (the deployment package) version you want to upload.
  3517. S3ObjectVersion *string `min:"1" type:"string"`
  3518. // The contents of your zip file containing your deployment package. If you
  3519. // are using the web API directly, the contents of the zip file must be base64-encoded.
  3520. // If you are using the AWS SDKs or the AWS CLI, the SDKs or CLI will do the
  3521. // encoding for you. For more information about creating a .zip file, go to
  3522. // Execution Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html)
  3523. // in the AWS Lambda Developer Guide.
  3524. //
  3525. // ZipFile is automatically base64 encoded/decoded by the SDK.
  3526. ZipFile []byte `type:"blob"`
  3527. }
  3528. // String returns the string representation
  3529. func (s UpdateFunctionCodeInput) String() string {
  3530. return awsutil.Prettify(s)
  3531. }
  3532. // GoString returns the string representation
  3533. func (s UpdateFunctionCodeInput) GoString() string {
  3534. return s.String()
  3535. }
  3536. // Validate inspects the fields of the type to determine if they are valid.
  3537. func (s *UpdateFunctionCodeInput) Validate() error {
  3538. invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionCodeInput"}
  3539. if s.FunctionName == nil {
  3540. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3541. }
  3542. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3543. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3544. }
  3545. if s.S3Bucket != nil && len(*s.S3Bucket) < 3 {
  3546. invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3))
  3547. }
  3548. if s.S3Key != nil && len(*s.S3Key) < 1 {
  3549. invalidParams.Add(request.NewErrParamMinLen("S3Key", 1))
  3550. }
  3551. if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 {
  3552. invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1))
  3553. }
  3554. if invalidParams.Len() > 0 {
  3555. return invalidParams
  3556. }
  3557. return nil
  3558. }
  3559. type UpdateFunctionConfigurationInput struct {
  3560. _ struct{} `type:"structure"`
  3561. // A short user-defined function description. AWS Lambda does not use this value.
  3562. // Assign a meaningful description as you see fit.
  3563. Description *string `type:"string"`
  3564. // The name of the Lambda function.
  3565. //
  3566. // You can specify a function name (for example, Thumbnail) or you can specify
  3567. // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).
  3568. // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail).
  3569. // Note that the length constraint applies only to the ARN. If you specify only
  3570. // the function name, it is limited to 64 character in length.
  3571. //
  3572. // FunctionName is a required field
  3573. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
  3574. // The function that Lambda calls to begin executing your function. For Node.js,
  3575. // it is the module-name.export value in your function.
  3576. Handler *string `type:"string"`
  3577. // The amount of memory, in MB, your Lambda function is given. AWS Lambda uses
  3578. // this memory size to infer the amount of CPU allocated to your function. Your
  3579. // function use-case determines your CPU and memory requirements. For example,
  3580. // a database operation might need less memory compared to an image processing
  3581. // function. The default value is 128 MB. The value must be a multiple of 64
  3582. // MB.
  3583. MemorySize *int64 `min:"128" type:"integer"`
  3584. // The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when
  3585. // it executes your function.
  3586. Role *string `type:"string"`
  3587. // The runtime environment for the Lambda function.
  3588. //
  3589. // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier
  3590. // runtime (v0.10.42), set the value to "nodejs".
  3591. Runtime *string `type:"string" enum:"Runtime"`
  3592. // The function execution time at which AWS Lambda should terminate the function.
  3593. // Because the execution time has cost implications, we recommend you set this
  3594. // value based on your expected execution time. The default is 3 seconds.
  3595. Timeout *int64 `min:"1" type:"integer"`
  3596. // If your Lambda function accesses resources in a VPC, you provide this parameter
  3597. // identifying the list of security group IDs and subnet IDs. These must belong
  3598. // to the same VPC. You must provide at least one security group and one subnet
  3599. // ID.
  3600. VpcConfig *VpcConfig `type:"structure"`
  3601. }
  3602. // String returns the string representation
  3603. func (s UpdateFunctionConfigurationInput) String() string {
  3604. return awsutil.Prettify(s)
  3605. }
  3606. // GoString returns the string representation
  3607. func (s UpdateFunctionConfigurationInput) GoString() string {
  3608. return s.String()
  3609. }
  3610. // Validate inspects the fields of the type to determine if they are valid.
  3611. func (s *UpdateFunctionConfigurationInput) Validate() error {
  3612. invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionConfigurationInput"}
  3613. if s.FunctionName == nil {
  3614. invalidParams.Add(request.NewErrParamRequired("FunctionName"))
  3615. }
  3616. if s.FunctionName != nil && len(*s.FunctionName) < 1 {
  3617. invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
  3618. }
  3619. if s.MemorySize != nil && *s.MemorySize < 128 {
  3620. invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128))
  3621. }
  3622. if s.Timeout != nil && *s.Timeout < 1 {
  3623. invalidParams.Add(request.NewErrParamMinValue("Timeout", 1))
  3624. }
  3625. if invalidParams.Len() > 0 {
  3626. return invalidParams
  3627. }
  3628. return nil
  3629. }
  3630. // If your Lambda function accesses resources in a VPC, you provide this parameter
  3631. // identifying the list of security group IDs and subnet IDs. These must belong
  3632. // to the same VPC. You must provide at least one security group and one subnet
  3633. // ID.
  3634. type VpcConfig struct {
  3635. _ struct{} `type:"structure"`
  3636. // A list of one or more security groups IDs in your VPC.
  3637. SecurityGroupIds []*string `type:"list"`
  3638. // A list of one or more subnet IDs in your VPC.
  3639. SubnetIds []*string `type:"list"`
  3640. }
  3641. // String returns the string representation
  3642. func (s VpcConfig) String() string {
  3643. return awsutil.Prettify(s)
  3644. }
  3645. // GoString returns the string representation
  3646. func (s VpcConfig) GoString() string {
  3647. return s.String()
  3648. }
  3649. // VPC configuration associated with your Lambda function.
  3650. type VpcConfigResponse struct {
  3651. _ struct{} `type:"structure"`
  3652. // A list of security group IDs associated with the Lambda function.
  3653. SecurityGroupIds []*string `type:"list"`
  3654. // A list of subnet IDs associated with the Lambda function.
  3655. SubnetIds []*string `type:"list"`
  3656. // The VPC ID associated with you Lambda function.
  3657. VpcId *string `type:"string"`
  3658. }
  3659. // String returns the string representation
  3660. func (s VpcConfigResponse) String() string {
  3661. return awsutil.Prettify(s)
  3662. }
  3663. // GoString returns the string representation
  3664. func (s VpcConfigResponse) GoString() string {
  3665. return s.String()
  3666. }
  3667. const (
  3668. // EventSourcePositionTrimHorizon is a EventSourcePosition enum value
  3669. EventSourcePositionTrimHorizon = "TRIM_HORIZON"
  3670. // EventSourcePositionLatest is a EventSourcePosition enum value
  3671. EventSourcePositionLatest = "LATEST"
  3672. )
  3673. const (
  3674. // InvocationTypeEvent is a InvocationType enum value
  3675. InvocationTypeEvent = "Event"
  3676. // InvocationTypeRequestResponse is a InvocationType enum value
  3677. InvocationTypeRequestResponse = "RequestResponse"
  3678. // InvocationTypeDryRun is a InvocationType enum value
  3679. InvocationTypeDryRun = "DryRun"
  3680. )
  3681. const (
  3682. // LogTypeNone is a LogType enum value
  3683. LogTypeNone = "None"
  3684. // LogTypeTail is a LogType enum value
  3685. LogTypeTail = "Tail"
  3686. )
  3687. const (
  3688. // RuntimeNodejs is a Runtime enum value
  3689. RuntimeNodejs = "nodejs"
  3690. // RuntimeNodejs43 is a Runtime enum value
  3691. RuntimeNodejs43 = "nodejs4.3"
  3692. // RuntimeJava8 is a Runtime enum value
  3693. RuntimeJava8 = "java8"
  3694. // RuntimePython27 is a Runtime enum value
  3695. RuntimePython27 = "python2.7"
  3696. )
  3697. const (
  3698. // ThrottleReasonConcurrentInvocationLimitExceeded is a ThrottleReason enum value
  3699. ThrottleReasonConcurrentInvocationLimitExceeded = "ConcurrentInvocationLimitExceeded"
  3700. // ThrottleReasonFunctionInvocationRateLimitExceeded is a ThrottleReason enum value
  3701. ThrottleReasonFunctionInvocationRateLimitExceeded = "FunctionInvocationRateLimitExceeded"
  3702. // ThrottleReasonCallerRateLimitExceeded is a ThrottleReason enum value
  3703. ThrottleReasonCallerRateLimitExceeded = "CallerRateLimitExceeded"
  3704. )