api.go 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  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. )
  10. const opAddPermission = "AddPermission"
  11. // AddPermissionRequest generates a request for the AddPermission operation.
  12. func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) {
  13. op := &request.Operation{
  14. Name: opAddPermission,
  15. HTTPMethod: "POST",
  16. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/policy",
  17. }
  18. if input == nil {
  19. input = &AddPermissionInput{}
  20. }
  21. req = c.newRequest(op, input, output)
  22. output = &AddPermissionOutput{}
  23. req.Data = output
  24. return
  25. }
  26. // Adds a permission to the access policy associated with the specified AWS
  27. // Lambda function. In a "push event" model, the access policy attached to the
  28. // Lambda function grants Amazon S3 or a user application permission for the
  29. // Lambda lambda:Invoke action. For information about the push model, see AWS
  30. // Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html).
  31. // Each Lambda function has one access policy associated with it. You can use
  32. // the AddPermission API to add a permission to the policy. You have one access
  33. // policy but it can have multiple permission statements.
  34. //
  35. // This operation requires permission for the lambda:AddPermission action.
  36. func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
  37. req, out := c.AddPermissionRequest(input)
  38. err := req.Send()
  39. return out, err
  40. }
  41. const opCreateEventSourceMapping = "CreateEventSourceMapping"
  42. // CreateEventSourceMappingRequest generates a request for the CreateEventSourceMapping operation.
  43. func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  44. op := &request.Operation{
  45. Name: opCreateEventSourceMapping,
  46. HTTPMethod: "POST",
  47. HTTPPath: "/2015-03-31/event-source-mappings/",
  48. }
  49. if input == nil {
  50. input = &CreateEventSourceMappingInput{}
  51. }
  52. req = c.newRequest(op, input, output)
  53. output = &EventSourceMappingConfiguration{}
  54. req.Data = output
  55. return
  56. }
  57. // Identifies a stream as an event source for a Lambda function. It can be either
  58. // an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes
  59. // the specified function when records are posted to the stream.
  60. //
  61. // This is the pull model, where AWS Lambda invokes the function. For more
  62. // information, go to AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html)
  63. // in the AWS Lambda Developer Guide.
  64. //
  65. // This association between an Amazon Kinesis stream and a Lambda function
  66. // is called the event source mapping. You provide the configuration information
  67. // (for example, which stream to read from and which Lambda function to invoke)
  68. // for the event source mapping in the request body.
  69. //
  70. // Each event source, such as an Amazon Kinesis or a DynamoDB stream, can
  71. // be associated with multiple AWS Lambda function. A given Lambda function
  72. // can be associated with multiple AWS event sources.
  73. //
  74. // This operation requires permission for the lambda:CreateEventSourceMapping
  75. // action.
  76. func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  77. req, out := c.CreateEventSourceMappingRequest(input)
  78. err := req.Send()
  79. return out, err
  80. }
  81. const opCreateFunction = "CreateFunction"
  82. // CreateFunctionRequest generates a request for the CreateFunction operation.
  83. func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request.Request, output *FunctionConfiguration) {
  84. op := &request.Operation{
  85. Name: opCreateFunction,
  86. HTTPMethod: "POST",
  87. HTTPPath: "/2015-03-31/functions",
  88. }
  89. if input == nil {
  90. input = &CreateFunctionInput{}
  91. }
  92. req = c.newRequest(op, input, output)
  93. output = &FunctionConfiguration{}
  94. req.Data = output
  95. return
  96. }
  97. // Creates a new Lambda function. The function metadata is created from the
  98. // request parameters, and the code for the function is provided by a .zip file
  99. // in the request body. If the function name already exists, the operation will
  100. // fail. Note that the function name is case-sensitive.
  101. //
  102. // This operation requires permission for the lambda:CreateFunction action.
  103. func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error) {
  104. req, out := c.CreateFunctionRequest(input)
  105. err := req.Send()
  106. return out, err
  107. }
  108. const opDeleteEventSourceMapping = "DeleteEventSourceMapping"
  109. // DeleteEventSourceMappingRequest generates a request for the DeleteEventSourceMapping operation.
  110. func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  111. op := &request.Operation{
  112. Name: opDeleteEventSourceMapping,
  113. HTTPMethod: "DELETE",
  114. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  115. }
  116. if input == nil {
  117. input = &DeleteEventSourceMappingInput{}
  118. }
  119. req = c.newRequest(op, input, output)
  120. output = &EventSourceMappingConfiguration{}
  121. req.Data = output
  122. return
  123. }
  124. // Removes an event source mapping. This means AWS Lambda will no longer invoke
  125. // the function for events in the associated source.
  126. //
  127. // This operation requires permission for the lambda:DeleteEventSourceMapping
  128. // action.
  129. func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  130. req, out := c.DeleteEventSourceMappingRequest(input)
  131. err := req.Send()
  132. return out, err
  133. }
  134. const opDeleteFunction = "DeleteFunction"
  135. // DeleteFunctionRequest generates a request for the DeleteFunction operation.
  136. func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request.Request, output *DeleteFunctionOutput) {
  137. op := &request.Operation{
  138. Name: opDeleteFunction,
  139. HTTPMethod: "DELETE",
  140. HTTPPath: "/2015-03-31/functions/{FunctionName}",
  141. }
  142. if input == nil {
  143. input = &DeleteFunctionInput{}
  144. }
  145. req = c.newRequest(op, input, output)
  146. output = &DeleteFunctionOutput{}
  147. req.Data = output
  148. return
  149. }
  150. // Deletes the specified Lambda function code and configuration.
  151. //
  152. // When you delete a function the associated access policy is also deleted.
  153. // You will need to delete the event source mappings explicitly.
  154. //
  155. // This operation requires permission for the lambda:DeleteFunction action.
  156. func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error) {
  157. req, out := c.DeleteFunctionRequest(input)
  158. err := req.Send()
  159. return out, err
  160. }
  161. const opGetEventSourceMapping = "GetEventSourceMapping"
  162. // GetEventSourceMappingRequest generates a request for the GetEventSourceMapping operation.
  163. func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  164. op := &request.Operation{
  165. Name: opGetEventSourceMapping,
  166. HTTPMethod: "GET",
  167. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  168. }
  169. if input == nil {
  170. input = &GetEventSourceMappingInput{}
  171. }
  172. req = c.newRequest(op, input, output)
  173. output = &EventSourceMappingConfiguration{}
  174. req.Data = output
  175. return
  176. }
  177. // Returns configuration information for the specified event source mapping
  178. // (see CreateEventSourceMapping).
  179. //
  180. // This operation requires permission for the lambda:GetEventSourceMapping
  181. // action.
  182. func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  183. req, out := c.GetEventSourceMappingRequest(input)
  184. err := req.Send()
  185. return out, err
  186. }
  187. const opGetFunction = "GetFunction"
  188. // GetFunctionRequest generates a request for the GetFunction operation.
  189. func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput) {
  190. op := &request.Operation{
  191. Name: opGetFunction,
  192. HTTPMethod: "GET",
  193. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD",
  194. }
  195. if input == nil {
  196. input = &GetFunctionInput{}
  197. }
  198. req = c.newRequest(op, input, output)
  199. output = &GetFunctionOutput{}
  200. req.Data = output
  201. return
  202. }
  203. // Returns the configuration information of the Lambda function and a presigned
  204. // URL link to the .zip file you uploaded with CreateFunction so you can download
  205. // the .zip file. Note that the URL is valid for up to 10 minutes. The configuration
  206. // information is the same information you provided as parameters when uploading
  207. // the function.
  208. //
  209. // This operation requires permission for the lambda:GetFunction action.
  210. func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) {
  211. req, out := c.GetFunctionRequest(input)
  212. err := req.Send()
  213. return out, err
  214. }
  215. const opGetFunctionConfiguration = "GetFunctionConfiguration"
  216. // GetFunctionConfigurationRequest generates a request for the GetFunctionConfiguration operation.
  217. func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) {
  218. op := &request.Operation{
  219. Name: opGetFunctionConfiguration,
  220. HTTPMethod: "GET",
  221. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/configuration",
  222. }
  223. if input == nil {
  224. input = &GetFunctionConfigurationInput{}
  225. }
  226. req = c.newRequest(op, input, output)
  227. output = &FunctionConfiguration{}
  228. req.Data = output
  229. return
  230. }
  231. // Returns the configuration information of the Lambda function. This the same
  232. // information you provided as parameters when uploading the function by using
  233. // CreateFunction.
  234. //
  235. // This operation requires permission for the lambda:GetFunctionConfiguration
  236. // operation.
  237. func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) {
  238. req, out := c.GetFunctionConfigurationRequest(input)
  239. err := req.Send()
  240. return out, err
  241. }
  242. const opGetPolicy = "GetPolicy"
  243. // GetPolicyRequest generates a request for the GetPolicy operation.
  244. func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) {
  245. op := &request.Operation{
  246. Name: opGetPolicy,
  247. HTTPMethod: "GET",
  248. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/policy",
  249. }
  250. if input == nil {
  251. input = &GetPolicyInput{}
  252. }
  253. req = c.newRequest(op, input, output)
  254. output = &GetPolicyOutput{}
  255. req.Data = output
  256. return
  257. }
  258. // Returns the access policy, containing a list of permissions granted via the
  259. // AddPermission API, associated with the specified bucket.
  260. //
  261. // You need permission for the lambda:GetPolicy action.
  262. func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) {
  263. req, out := c.GetPolicyRequest(input)
  264. err := req.Send()
  265. return out, err
  266. }
  267. const opInvoke = "Invoke"
  268. // InvokeRequest generates a request for the Invoke operation.
  269. func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput) {
  270. op := &request.Operation{
  271. Name: opInvoke,
  272. HTTPMethod: "POST",
  273. HTTPPath: "/2015-03-31/functions/{FunctionName}/invocations",
  274. }
  275. if input == nil {
  276. input = &InvokeInput{}
  277. }
  278. req = c.newRequest(op, input, output)
  279. output = &InvokeOutput{}
  280. req.Data = output
  281. return
  282. }
  283. // Invokes a specified Lambda function.
  284. //
  285. // This operation requires permission for the lambda:InvokeFunction action.
  286. func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) {
  287. req, out := c.InvokeRequest(input)
  288. err := req.Send()
  289. return out, err
  290. }
  291. const opInvokeAsync = "InvokeAsync"
  292. // InvokeAsyncRequest generates a request for the InvokeAsync operation.
  293. func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Request, output *InvokeAsyncOutput) {
  294. op := &request.Operation{
  295. Name: opInvokeAsync,
  296. HTTPMethod: "POST",
  297. HTTPPath: "/2014-11-13/functions/{FunctionName}/invoke-async/",
  298. }
  299. if input == nil {
  300. input = &InvokeAsyncInput{}
  301. }
  302. req = c.newRequest(op, input, output)
  303. output = &InvokeAsyncOutput{}
  304. req.Data = output
  305. return
  306. }
  307. // This API is deprecated. We recommend you use Invoke API (see Invoke). Submits
  308. // an invocation request to AWS Lambda. Upon receiving the request, Lambda executes
  309. // the specified function asynchronously. To see the logs generated by the Lambda
  310. // function execution, see the CloudWatch logs console.
  311. //
  312. // This operation requires permission for the lambda:InvokeFunction action.
  313. func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error) {
  314. req, out := c.InvokeAsyncRequest(input)
  315. err := req.Send()
  316. return out, err
  317. }
  318. const opListEventSourceMappings = "ListEventSourceMappings"
  319. // ListEventSourceMappingsRequest generates a request for the ListEventSourceMappings operation.
  320. func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsInput) (req *request.Request, output *ListEventSourceMappingsOutput) {
  321. op := &request.Operation{
  322. Name: opListEventSourceMappings,
  323. HTTPMethod: "GET",
  324. HTTPPath: "/2015-03-31/event-source-mappings/",
  325. Paginator: &request.Paginator{
  326. InputTokens: []string{"Marker"},
  327. OutputTokens: []string{"NextMarker"},
  328. LimitToken: "MaxItems",
  329. TruncationToken: "",
  330. },
  331. }
  332. if input == nil {
  333. input = &ListEventSourceMappingsInput{}
  334. }
  335. req = c.newRequest(op, input, output)
  336. output = &ListEventSourceMappingsOutput{}
  337. req.Data = output
  338. return
  339. }
  340. // Returns a list of event source mappings you created using the CreateEventSourceMapping
  341. // (see CreateEventSourceMapping), where you identify a stream as an event source.
  342. // This list does not include Amazon S3 event sources.
  343. //
  344. // For each mapping, the API returns configuration information. You can optionally
  345. // specify filters to retrieve specific event source mappings.
  346. //
  347. // This operation requires permission for the lambda:ListEventSourceMappings
  348. // action.
  349. func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error) {
  350. req, out := c.ListEventSourceMappingsRequest(input)
  351. err := req.Send()
  352. return out, err
  353. }
  354. func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(p *ListEventSourceMappingsOutput, lastPage bool) (shouldContinue bool)) error {
  355. page, _ := c.ListEventSourceMappingsRequest(input)
  356. return page.EachPage(func(p interface{}, lastPage bool) bool {
  357. return fn(p.(*ListEventSourceMappingsOutput), lastPage)
  358. })
  359. }
  360. const opListFunctions = "ListFunctions"
  361. // ListFunctionsRequest generates a request for the ListFunctions operation.
  362. func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.Request, output *ListFunctionsOutput) {
  363. op := &request.Operation{
  364. Name: opListFunctions,
  365. HTTPMethod: "GET",
  366. HTTPPath: "/2015-03-31/functions/",
  367. Paginator: &request.Paginator{
  368. InputTokens: []string{"Marker"},
  369. OutputTokens: []string{"NextMarker"},
  370. LimitToken: "MaxItems",
  371. TruncationToken: "",
  372. },
  373. }
  374. if input == nil {
  375. input = &ListFunctionsInput{}
  376. }
  377. req = c.newRequest(op, input, output)
  378. output = &ListFunctionsOutput{}
  379. req.Data = output
  380. return
  381. }
  382. // Returns a list of your Lambda functions. For each function, the response
  383. // includes the function configuration information. You must use GetFunction
  384. // to retrieve the code for your function.
  385. //
  386. // This operation requires permission for the lambda:ListFunctions action.
  387. func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) {
  388. req, out := c.ListFunctionsRequest(input)
  389. err := req.Send()
  390. return out, err
  391. }
  392. func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(p *ListFunctionsOutput, lastPage bool) (shouldContinue bool)) error {
  393. page, _ := c.ListFunctionsRequest(input)
  394. return page.EachPage(func(p interface{}, lastPage bool) bool {
  395. return fn(p.(*ListFunctionsOutput), lastPage)
  396. })
  397. }
  398. const opRemovePermission = "RemovePermission"
  399. // RemovePermissionRequest generates a request for the RemovePermission operation.
  400. func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
  401. op := &request.Operation{
  402. Name: opRemovePermission,
  403. HTTPMethod: "DELETE",
  404. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/policy/{StatementId}",
  405. }
  406. if input == nil {
  407. input = &RemovePermissionInput{}
  408. }
  409. req = c.newRequest(op, input, output)
  410. output = &RemovePermissionOutput{}
  411. req.Data = output
  412. return
  413. }
  414. // You can remove individual permissions from an access policy associated with
  415. // a Lambda function by providing a Statement ID.
  416. //
  417. // Note that removal of a permission will cause an active event source to lose
  418. // permission to the function.
  419. //
  420. // You need permission for the lambda:RemovePermission action.
  421. func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
  422. req, out := c.RemovePermissionRequest(input)
  423. err := req.Send()
  424. return out, err
  425. }
  426. const opUpdateEventSourceMapping = "UpdateEventSourceMapping"
  427. // UpdateEventSourceMappingRequest generates a request for the UpdateEventSourceMapping operation.
  428. func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) {
  429. op := &request.Operation{
  430. Name: opUpdateEventSourceMapping,
  431. HTTPMethod: "PUT",
  432. HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
  433. }
  434. if input == nil {
  435. input = &UpdateEventSourceMappingInput{}
  436. }
  437. req = c.newRequest(op, input, output)
  438. output = &EventSourceMappingConfiguration{}
  439. req.Data = output
  440. return
  441. }
  442. // You can update an event source mapping. This is useful if you want to change
  443. // the parameters of the existing mapping without losing your position in the
  444. // stream. You can change which function will receive the stream records, but
  445. // to change the stream itself, you must create a new mapping.
  446. //
  447. // This operation requires permission for the lambda:UpdateEventSourceMapping
  448. // action.
  449. func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) {
  450. req, out := c.UpdateEventSourceMappingRequest(input)
  451. err := req.Send()
  452. return out, err
  453. }
  454. const opUpdateFunctionCode = "UpdateFunctionCode"
  455. // UpdateFunctionCodeRequest generates a request for the UpdateFunctionCode operation.
  456. func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req *request.Request, output *FunctionConfiguration) {
  457. op := &request.Operation{
  458. Name: opUpdateFunctionCode,
  459. HTTPMethod: "PUT",
  460. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/code",
  461. }
  462. if input == nil {
  463. input = &UpdateFunctionCodeInput{}
  464. }
  465. req = c.newRequest(op, input, output)
  466. output = &FunctionConfiguration{}
  467. req.Data = output
  468. return
  469. }
  470. // Updates the code for the specified Lambda function. This operation must only
  471. // be used on an existing Lambda function and cannot be used to update the function
  472. // configuration.
  473. //
  474. // This operation requires permission for the lambda:UpdateFunctionCode action.
  475. func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) {
  476. req, out := c.UpdateFunctionCodeRequest(input)
  477. err := req.Send()
  478. return out, err
  479. }
  480. const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration"
  481. // UpdateFunctionConfigurationRequest generates a request for the UpdateFunctionConfiguration operation.
  482. func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) {
  483. op := &request.Operation{
  484. Name: opUpdateFunctionConfiguration,
  485. HTTPMethod: "PUT",
  486. HTTPPath: "/2015-03-31/functions/{FunctionName}/versions/HEAD/configuration",
  487. }
  488. if input == nil {
  489. input = &UpdateFunctionConfigurationInput{}
  490. }
  491. req = c.newRequest(op, input, output)
  492. output = &FunctionConfiguration{}
  493. req.Data = output
  494. return
  495. }
  496. // Updates the configuration parameters for the specified Lambda function by
  497. // using the values provided in the request. You provide only the parameters
  498. // you want to change. This operation must only be used on an existing Lambda
  499. // function and cannot be used to update the function's code.
  500. //
  501. // This operation requires permission for the lambda:UpdateFunctionConfiguration
  502. // action.
  503. func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) {
  504. req, out := c.UpdateFunctionConfigurationRequest(input)
  505. err := req.Send()
  506. return out, err
  507. }
  508. type AddPermissionInput struct {
  509. // The AWS Lambda action you want to allow in this statement. Each Lambda action
  510. // is a string starting with "lambda:" followed by the API name (see Operations).
  511. // For example, "lambda:CreateFunction". You can use wildcard ("lambda:*") to
  512. // grant permission for all AWS Lambda actions.
  513. Action *string `type:"string" required:"true"`
  514. // Name of the Lambda function whose access policy you are updating by adding
  515. // a new permission.
  516. //
  517. // You can specify an unqualified function name (for example, "Thumbnail")
  518. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  519. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  520. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  521. // Note that the length constraint applies only to the ARN. If you specify only
  522. // the function name, it is limited to 64 character in length.
  523. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  524. // The principal who is getting this permission. It can be Amazon S3 service
  525. // Principal ("s3.amazonaws.com") if you want Amazon S3 to invoke the function,
  526. // an AWS account ID if you are granting cross-account permission, or any valid
  527. // AWS service principal such as "sns.amazonaws.com". For example, you might
  528. // want to allow a custom application in another AWS account to push events
  529. // to AWS Lambda by invoking your function.
  530. Principal *string `type:"string" required:"true"`
  531. // The AWS account ID (without a hyphen) of the source owner. For example, if
  532. // the SourceArn identifies a bucket, then this is the bucket owner's account
  533. // ID. You can use this additional condition to ensure the bucket you specify
  534. // is owned by a specific account (it is possible the bucket owner deleted the
  535. // bucket and some other AWS account created the bucket). You can also use this
  536. // condition to specify all sources (that is, you don't specify the SourceArn)
  537. // owned by a specific account.
  538. SourceAccount *string `type:"string"`
  539. // This is optional; however, when granting Amazon S3 permission to invoke your
  540. // function, you should specify this field with the bucket Amazon Resource Name
  541. // (ARN) as its value. This ensures that only events generated from the specified
  542. // bucket can invoke the function.
  543. //
  544. // If you add a permission for the Amazon S3 principal without providing the
  545. // source ARN, any AWS account that creates a mapping to your function ARN can
  546. // send events to invoke your Lambda function from Amazon S3.
  547. SourceArn *string `type:"string"`
  548. // A unique statement identifier.
  549. StatementId *string `type:"string" required:"true"`
  550. metadataAddPermissionInput `json:"-" xml:"-"`
  551. }
  552. type metadataAddPermissionInput struct {
  553. SDKShapeTraits bool `type:"structure"`
  554. }
  555. // String returns the string representation
  556. func (s AddPermissionInput) String() string {
  557. return awsutil.Prettify(s)
  558. }
  559. // GoString returns the string representation
  560. func (s AddPermissionInput) GoString() string {
  561. return s.String()
  562. }
  563. type AddPermissionOutput struct {
  564. // The permission statement you specified in the request. The response returns
  565. // the same as a string using "\" as an escape character in the JSON.
  566. Statement *string `type:"string"`
  567. metadataAddPermissionOutput `json:"-" xml:"-"`
  568. }
  569. type metadataAddPermissionOutput struct {
  570. SDKShapeTraits bool `type:"structure"`
  571. }
  572. // String returns the string representation
  573. func (s AddPermissionOutput) String() string {
  574. return awsutil.Prettify(s)
  575. }
  576. // GoString returns the string representation
  577. func (s AddPermissionOutput) GoString() string {
  578. return s.String()
  579. }
  580. type CreateEventSourceMappingInput struct {
  581. // The largest number of records that AWS Lambda will retrieve from your event
  582. // source at the time of invoking your function. Your function receives an event
  583. // with all the retrieved records. The default is 100 records.
  584. BatchSize *int64 `type:"integer"`
  585. // Indicates whether AWS Lambda should begin polling the event source, the default
  586. // is not enabled.
  587. Enabled *bool `type:"boolean"`
  588. // The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB
  589. // stream that is the event source. Any record added to this stream could cause
  590. // AWS Lambda to invoke your Lambda function, it depends on the BatchSize. AWS
  591. // Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda
  592. // function as JSON.
  593. EventSourceArn *string `type:"string" required:"true"`
  594. // The Lambda function to invoke when AWS Lambda detects an event on the stream.
  595. //
  596. // You can specify an unqualified function name (for example, "Thumbnail")
  597. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  598. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  599. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  600. // Note that the length constraint applies only to the ARN. If you specify only
  601. // the function name, it is limited to 64 character in length.
  602. FunctionName *string `type:"string" required:"true"`
  603. // The position in the stream where AWS Lambda should start reading. For more
  604. // information, go to ShardIteratorType (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType)
  605. // in the Amazon Kinesis API Reference.
  606. StartingPosition *string `type:"string" required:"true" enum:"EventSourcePosition"`
  607. metadataCreateEventSourceMappingInput `json:"-" xml:"-"`
  608. }
  609. type metadataCreateEventSourceMappingInput struct {
  610. SDKShapeTraits bool `type:"structure"`
  611. }
  612. // String returns the string representation
  613. func (s CreateEventSourceMappingInput) String() string {
  614. return awsutil.Prettify(s)
  615. }
  616. // GoString returns the string representation
  617. func (s CreateEventSourceMappingInput) GoString() string {
  618. return s.String()
  619. }
  620. type CreateFunctionInput struct {
  621. // The code for the Lambda function.
  622. Code *FunctionCode `type:"structure" required:"true"`
  623. // A short, user-defined function description. Lambda does not use this value.
  624. // Assign a meaningful description as you see fit.
  625. Description *string `type:"string"`
  626. // The name you want to assign to the function you are uploading. You can specify
  627. // an unqualified function name (for example, "Thumbnail") or you can specify
  628. // Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail").
  629. // AWS Lambda also allows you to specify only the account ID qualifier (for
  630. // example, "account-id:Thumbnail"). Note that the length constraint applies
  631. // only to the ARN. If you specify only the function name, it is limited to
  632. // 64 character in length. The function names appear in the console and are
  633. // returned in the ListFunctions API. Function names are used to specify functions
  634. // to other AWS Lambda APIs, such as Invoke.
  635. FunctionName *string `type:"string" required:"true"`
  636. // The function within your code that Lambda calls to begin execution. For Node.js,
  637. // it is the module-name.export value in your function. For Java, it can be
  638. // package.class-name::handler or package.class-name. For more information,
  639. // see Lambda Function Handler (Java) (http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html).
  640. Handler *string `type:"string" required:"true"`
  641. // The amount of memory, in MB, your Lambda function is given. Lambda uses this
  642. // memory size to infer the amount of CPU and memory allocated to your function.
  643. // Your function use-case determines your CPU and memory requirements. For example,
  644. // a database operation might need less memory compared to an image processing
  645. // function. The default value is 128 MB. The value must be a multiple of 64
  646. // MB.
  647. MemorySize *int64 `type:"integer"`
  648. // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it
  649. // executes your function to access any other Amazon Web Services (AWS) resources.
  650. // For more information, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html)
  651. Role *string `type:"string" required:"true"`
  652. // The runtime environment for the Lambda function you are uploading. Currently,
  653. // Lambda supports "java" and "nodejs" as the runtime.
  654. Runtime *string `type:"string" required:"true" enum:"Runtime"`
  655. // The function execution time at which Lambda should terminate the function.
  656. // Because the execution time has cost implications, we recommend you set this
  657. // value based on your expected execution time. The default is 3 seconds.
  658. Timeout *int64 `type:"integer"`
  659. metadataCreateFunctionInput `json:"-" xml:"-"`
  660. }
  661. type metadataCreateFunctionInput struct {
  662. SDKShapeTraits bool `type:"structure"`
  663. }
  664. // String returns the string representation
  665. func (s CreateFunctionInput) String() string {
  666. return awsutil.Prettify(s)
  667. }
  668. // GoString returns the string representation
  669. func (s CreateFunctionInput) GoString() string {
  670. return s.String()
  671. }
  672. type DeleteEventSourceMappingInput struct {
  673. // The event source mapping ID.
  674. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  675. metadataDeleteEventSourceMappingInput `json:"-" xml:"-"`
  676. }
  677. type metadataDeleteEventSourceMappingInput struct {
  678. SDKShapeTraits bool `type:"structure"`
  679. }
  680. // String returns the string representation
  681. func (s DeleteEventSourceMappingInput) String() string {
  682. return awsutil.Prettify(s)
  683. }
  684. // GoString returns the string representation
  685. func (s DeleteEventSourceMappingInput) GoString() string {
  686. return s.String()
  687. }
  688. type DeleteFunctionInput struct {
  689. // The Lambda function to delete.
  690. //
  691. // You can specify an unqualified function name (for example, "Thumbnail")
  692. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  693. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  694. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  695. // Note that the length constraint applies only to the ARN. If you specify only
  696. // the function name, it is limited to 64 character in length.
  697. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  698. metadataDeleteFunctionInput `json:"-" xml:"-"`
  699. }
  700. type metadataDeleteFunctionInput struct {
  701. SDKShapeTraits bool `type:"structure"`
  702. }
  703. // String returns the string representation
  704. func (s DeleteFunctionInput) String() string {
  705. return awsutil.Prettify(s)
  706. }
  707. // GoString returns the string representation
  708. func (s DeleteFunctionInput) GoString() string {
  709. return s.String()
  710. }
  711. type DeleteFunctionOutput struct {
  712. metadataDeleteFunctionOutput `json:"-" xml:"-"`
  713. }
  714. type metadataDeleteFunctionOutput struct {
  715. SDKShapeTraits bool `type:"structure"`
  716. }
  717. // String returns the string representation
  718. func (s DeleteFunctionOutput) String() string {
  719. return awsutil.Prettify(s)
  720. }
  721. // GoString returns the string representation
  722. func (s DeleteFunctionOutput) GoString() string {
  723. return s.String()
  724. }
  725. // Describes mapping between an Amazon Kinesis stream and a Lambda function.
  726. type EventSourceMappingConfiguration struct {
  727. // The largest number of records that AWS Lambda will retrieve from your event
  728. // source at the time of invoking your function. Your function receives an event
  729. // with all the retrieved records.
  730. BatchSize *int64 `type:"integer"`
  731. // The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source
  732. // of events.
  733. EventSourceArn *string `type:"string"`
  734. // The Lambda function to invoke when AWS Lambda detects an event on the stream.
  735. FunctionArn *string `type:"string"`
  736. // The UTC time string indicating the last time the event mapping was updated.
  737. LastModified *time.Time `type:"timestamp" timestampFormat:"unix"`
  738. // The result of the last AWS Lambda invocation of your Lambda function.
  739. LastProcessingResult *string `type:"string"`
  740. // The state of the event source mapping. It can be "Creating", "Enabled", "Disabled",
  741. // "Enabling", "Disabling", "Updating", or "Deleting".
  742. State *string `type:"string"`
  743. // The reason the event source mapping is in its current state. It is either
  744. // user-requested or an AWS Lambda-initiated state transition.
  745. StateTransitionReason *string `type:"string"`
  746. // The AWS Lambda assigned opaque identifier for the mapping.
  747. UUID *string `type:"string"`
  748. metadataEventSourceMappingConfiguration `json:"-" xml:"-"`
  749. }
  750. type metadataEventSourceMappingConfiguration struct {
  751. SDKShapeTraits bool `type:"structure"`
  752. }
  753. // String returns the string representation
  754. func (s EventSourceMappingConfiguration) String() string {
  755. return awsutil.Prettify(s)
  756. }
  757. // GoString returns the string representation
  758. func (s EventSourceMappingConfiguration) GoString() string {
  759. return s.String()
  760. }
  761. // The code for the Lambda function.
  762. type FunctionCode struct {
  763. // Amazon S3 bucket name where the .zip file containing your deployment package
  764. // is stored. This bucket must reside in the same AWS region where you are creating
  765. // the Lambda function.
  766. S3Bucket *string `type:"string"`
  767. // The Amazon S3 object (the deployment package) key name you want to upload.
  768. S3Key *string `type:"string"`
  769. // The Amazon S3 object (the deployment package) version you want to upload.
  770. S3ObjectVersion *string `type:"string"`
  771. // A base64-encoded .zip file containing your deployment package. For more information
  772. // about creating a .zip file, go to Execution Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html)
  773. // in the AWS Lambda Developer Guide.
  774. ZipFile []byte `type:"blob"`
  775. metadataFunctionCode `json:"-" xml:"-"`
  776. }
  777. type metadataFunctionCode struct {
  778. SDKShapeTraits bool `type:"structure"`
  779. }
  780. // String returns the string representation
  781. func (s FunctionCode) String() string {
  782. return awsutil.Prettify(s)
  783. }
  784. // GoString returns the string representation
  785. func (s FunctionCode) GoString() string {
  786. return s.String()
  787. }
  788. // The object for the Lambda function location.
  789. type FunctionCodeLocation struct {
  790. // The presigned URL you can use to download the function's .zip file that you
  791. // previously uploaded. The URL is valid for up to 10 minutes.
  792. Location *string `type:"string"`
  793. // The repository from which you can download the function.
  794. RepositoryType *string `type:"string"`
  795. metadataFunctionCodeLocation `json:"-" xml:"-"`
  796. }
  797. type metadataFunctionCodeLocation struct {
  798. SDKShapeTraits bool `type:"structure"`
  799. }
  800. // String returns the string representation
  801. func (s FunctionCodeLocation) String() string {
  802. return awsutil.Prettify(s)
  803. }
  804. // GoString returns the string representation
  805. func (s FunctionCodeLocation) GoString() string {
  806. return s.String()
  807. }
  808. // A complex type that describes function metadata.
  809. type FunctionConfiguration struct {
  810. // The size, in bytes, of the function .zip file you uploaded.
  811. CodeSize *int64 `type:"long"`
  812. // The user-provided description.
  813. Description *string `type:"string"`
  814. // The Amazon Resource Name (ARN) assigned to the function.
  815. FunctionArn *string `type:"string"`
  816. // The name of the function.
  817. FunctionName *string `type:"string"`
  818. // The function Lambda calls to begin executing your function.
  819. Handler *string `type:"string"`
  820. // The timestamp of the last time you updated the function.
  821. LastModified *string `type:"string"`
  822. // The memory size, in MB, you configured for the function. Must be a multiple
  823. // of 64 MB.
  824. MemorySize *int64 `type:"integer"`
  825. // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it
  826. // executes your function to access any other Amazon Web Services (AWS) resources.
  827. Role *string `type:"string"`
  828. // The runtime environment for the Lambda function.
  829. Runtime *string `type:"string" enum:"Runtime"`
  830. // The function execution time at which Lambda should terminate the function.
  831. // Because the execution time has cost implications, we recommend you set this
  832. // value based on your expected execution time. The default is 3 seconds.
  833. Timeout *int64 `type:"integer"`
  834. metadataFunctionConfiguration `json:"-" xml:"-"`
  835. }
  836. type metadataFunctionConfiguration struct {
  837. SDKShapeTraits bool `type:"structure"`
  838. }
  839. // String returns the string representation
  840. func (s FunctionConfiguration) String() string {
  841. return awsutil.Prettify(s)
  842. }
  843. // GoString returns the string representation
  844. func (s FunctionConfiguration) GoString() string {
  845. return s.String()
  846. }
  847. type GetEventSourceMappingInput struct {
  848. // The AWS Lambda assigned ID of the event source mapping.
  849. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  850. metadataGetEventSourceMappingInput `json:"-" xml:"-"`
  851. }
  852. type metadataGetEventSourceMappingInput struct {
  853. SDKShapeTraits bool `type:"structure"`
  854. }
  855. // String returns the string representation
  856. func (s GetEventSourceMappingInput) String() string {
  857. return awsutil.Prettify(s)
  858. }
  859. // GoString returns the string representation
  860. func (s GetEventSourceMappingInput) GoString() string {
  861. return s.String()
  862. }
  863. type GetFunctionConfigurationInput struct {
  864. // The name of the Lambda function for which you want to retrieve the configuration
  865. // information.
  866. //
  867. // You can specify an unqualified function name (for example, "Thumbnail")
  868. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  869. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  870. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  871. // Note that the length constraint applies only to the ARN. If you specify only
  872. // the function name, it is limited to 64 character in length.
  873. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  874. metadataGetFunctionConfigurationInput `json:"-" xml:"-"`
  875. }
  876. type metadataGetFunctionConfigurationInput struct {
  877. SDKShapeTraits bool `type:"structure"`
  878. }
  879. // String returns the string representation
  880. func (s GetFunctionConfigurationInput) String() string {
  881. return awsutil.Prettify(s)
  882. }
  883. // GoString returns the string representation
  884. func (s GetFunctionConfigurationInput) GoString() string {
  885. return s.String()
  886. }
  887. type GetFunctionInput struct {
  888. // The Lambda function name.
  889. //
  890. // You can specify an unqualified function name (for example, "Thumbnail")
  891. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  892. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  893. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  894. // Note that the length constraint applies only to the ARN. If you specify only
  895. // the function name, it is limited to 64 character in length.
  896. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  897. metadataGetFunctionInput `json:"-" xml:"-"`
  898. }
  899. type metadataGetFunctionInput struct {
  900. SDKShapeTraits bool `type:"structure"`
  901. }
  902. // String returns the string representation
  903. func (s GetFunctionInput) String() string {
  904. return awsutil.Prettify(s)
  905. }
  906. // GoString returns the string representation
  907. func (s GetFunctionInput) GoString() string {
  908. return s.String()
  909. }
  910. // This response contains the object for the Lambda function location (see API_FunctionCodeLocation
  911. type GetFunctionOutput struct {
  912. // The object for the Lambda function location.
  913. Code *FunctionCodeLocation `type:"structure"`
  914. // A complex type that describes function metadata.
  915. Configuration *FunctionConfiguration `type:"structure"`
  916. metadataGetFunctionOutput `json:"-" xml:"-"`
  917. }
  918. type metadataGetFunctionOutput struct {
  919. SDKShapeTraits bool `type:"structure"`
  920. }
  921. // String returns the string representation
  922. func (s GetFunctionOutput) String() string {
  923. return awsutil.Prettify(s)
  924. }
  925. // GoString returns the string representation
  926. func (s GetFunctionOutput) GoString() string {
  927. return s.String()
  928. }
  929. type GetPolicyInput struct {
  930. // Function name whose access policy you want to retrieve.
  931. //
  932. // You can specify an unqualified function name (for example, "Thumbnail")
  933. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  934. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  935. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  936. // Note that the length constraint applies only to the ARN. If you specify only
  937. // the function name, it is limited to 64 character in length.
  938. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  939. metadataGetPolicyInput `json:"-" xml:"-"`
  940. }
  941. type metadataGetPolicyInput struct {
  942. SDKShapeTraits bool `type:"structure"`
  943. }
  944. // String returns the string representation
  945. func (s GetPolicyInput) String() string {
  946. return awsutil.Prettify(s)
  947. }
  948. // GoString returns the string representation
  949. func (s GetPolicyInput) GoString() string {
  950. return s.String()
  951. }
  952. type GetPolicyOutput struct {
  953. // The access policy associated with the specified function. The response returns
  954. // the same as a string using "\" as an escape character in the JSON.
  955. Policy *string `type:"string"`
  956. metadataGetPolicyOutput `json:"-" xml:"-"`
  957. }
  958. type metadataGetPolicyOutput struct {
  959. SDKShapeTraits bool `type:"structure"`
  960. }
  961. // String returns the string representation
  962. func (s GetPolicyOutput) String() string {
  963. return awsutil.Prettify(s)
  964. }
  965. // GoString returns the string representation
  966. func (s GetPolicyOutput) GoString() string {
  967. return s.String()
  968. }
  969. type InvokeAsyncInput struct {
  970. // The Lambda function name.
  971. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  972. // JSON that you want to provide to your Lambda function as input.
  973. InvokeArgs io.ReadSeeker `type:"blob" required:"true"`
  974. metadataInvokeAsyncInput `json:"-" xml:"-"`
  975. }
  976. type metadataInvokeAsyncInput struct {
  977. SDKShapeTraits bool `type:"structure" payload:"InvokeArgs"`
  978. }
  979. // String returns the string representation
  980. func (s InvokeAsyncInput) String() string {
  981. return awsutil.Prettify(s)
  982. }
  983. // GoString returns the string representation
  984. func (s InvokeAsyncInput) GoString() string {
  985. return s.String()
  986. }
  987. // Upon success, it returns empty response. Otherwise, throws an exception.
  988. type InvokeAsyncOutput struct {
  989. // It will be 202 upon success.
  990. Status *int64 `location:"statusCode" type:"integer"`
  991. metadataInvokeAsyncOutput `json:"-" xml:"-"`
  992. }
  993. type metadataInvokeAsyncOutput struct {
  994. SDKShapeTraits bool `type:"structure"`
  995. }
  996. // String returns the string representation
  997. func (s InvokeAsyncOutput) String() string {
  998. return awsutil.Prettify(s)
  999. }
  1000. // GoString returns the string representation
  1001. func (s InvokeAsyncOutput) GoString() string {
  1002. return s.String()
  1003. }
  1004. type InvokeInput struct {
  1005. // Using the ClientContext you can pass client-specific information to the Lambda
  1006. // function you are invoking. You can then process the client information in
  1007. // your Lambda function as you choose through the context variable. For an example
  1008. // of a ClientContext JSON, go to PutEvents (http://docs.aws.amazon.com/mobileanalytics/latest/ug/PutEvents.html)
  1009. // in the Amazon Mobile Analytics API Reference and User Guide.
  1010. //
  1011. // The ClientContext JSON must be base64-encoded.
  1012. ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"`
  1013. // The Lambda function name.
  1014. //
  1015. // You can specify an unqualified function name (for example, "Thumbnail")
  1016. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1017. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1018. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1019. // Note that the length constraint applies only to the ARN. If you specify only
  1020. // the function name, it is limited to 64 character in length.
  1021. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  1022. // By default, the Invoke API assumes "RequestResponse" invocation type. You
  1023. // can optionally request asynchronous execution by specifying "Event" as the
  1024. // InvocationType. You can also use this parameter to request AWS Lambda to
  1025. // not execute the function but do some verification, such as if the caller
  1026. // is authorized to invoke the function and if the inputs are valid. You request
  1027. // this by specifying "DryRun" as the InvocationType. This is useful in a cross-account
  1028. // scenario when you want to verify access to a function without running it.
  1029. InvocationType *string `location:"header" locationName:"X-Amz-Invocation-Type" type:"string" enum:"InvocationType"`
  1030. // You can set this optional parameter to "Tail" in the request only if you
  1031. // specify the InvocationType parameter with value "RequestResponse". In this
  1032. // case, AWS Lambda returns the base64-encoded last 4 KB of log data produced
  1033. // by your Lambda function in the x-amz-log-results header.
  1034. LogType *string `location:"header" locationName:"X-Amz-Log-Type" type:"string" enum:"LogType"`
  1035. // JSON that you want to provide to your Lambda function as input.
  1036. Payload []byte `type:"blob"`
  1037. metadataInvokeInput `json:"-" xml:"-"`
  1038. }
  1039. type metadataInvokeInput struct {
  1040. SDKShapeTraits bool `type:"structure" payload:"Payload"`
  1041. }
  1042. // String returns the string representation
  1043. func (s InvokeInput) String() string {
  1044. return awsutil.Prettify(s)
  1045. }
  1046. // GoString returns the string representation
  1047. func (s InvokeInput) GoString() string {
  1048. return s.String()
  1049. }
  1050. // Upon success, returns an empty response. Otherwise, throws an exception.
  1051. type InvokeOutput struct {
  1052. // Indicates whether an error occurred while executing the Lambda function.
  1053. // If an error occurred this field will have one of two values; Handled or Unhandled.
  1054. // Handled errors are errors that are reported by the function while the Unhandled
  1055. // errors are those detected and reported by AWS Lambda. Unhandled errors include
  1056. // out of memory errors and function timeouts. For information about how to
  1057. // report an Handled error, see Programming Model (http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html).
  1058. FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"`
  1059. // It is the base64-encoded logs for the Lambda function invocation. This is
  1060. // present only if the invocation type is "RequestResponse" and the logs were
  1061. // requested.
  1062. LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"`
  1063. // It is the JSON representation of the object returned by the Lambda function.
  1064. // In This is present only if the invocation type is "RequestResponse".
  1065. //
  1066. // In the event of a function error this field contains a message describing
  1067. // the error. For the Handled errors the Lambda function will report this message.
  1068. // For Unhandled errors AWS Lambda reports the message.
  1069. Payload []byte `type:"blob"`
  1070. // The HTTP status code will be in the 200 range for successful request. For
  1071. // the "RequestResonse" invocation type this status code will be 200. For the
  1072. // "Event" invocation type this status code will be 202. For the "DryRun" invocation
  1073. // type the status code will be 204.
  1074. StatusCode *int64 `location:"statusCode" type:"integer"`
  1075. metadataInvokeOutput `json:"-" xml:"-"`
  1076. }
  1077. type metadataInvokeOutput struct {
  1078. SDKShapeTraits bool `type:"structure" payload:"Payload"`
  1079. }
  1080. // String returns the string representation
  1081. func (s InvokeOutput) String() string {
  1082. return awsutil.Prettify(s)
  1083. }
  1084. // GoString returns the string representation
  1085. func (s InvokeOutput) GoString() string {
  1086. return s.String()
  1087. }
  1088. type ListEventSourceMappingsInput struct {
  1089. // The Amazon Resource Name (ARN) of the Amazon Kinesis stream.
  1090. EventSourceArn *string `location:"querystring" locationName:"EventSourceArn" type:"string"`
  1091. // The name of the Lambda function.
  1092. //
  1093. // You can specify an unqualified function name (for example, "Thumbnail")
  1094. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1095. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1096. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1097. // Note that the length constraint applies only to the ARN. If you specify only
  1098. // the function name, it is limited to 64 character in length.
  1099. FunctionName *string `location:"querystring" locationName:"FunctionName" type:"string"`
  1100. // Optional string. An opaque pagination token returned from a previous ListEventSourceMappings
  1101. // operation. If present, specifies to continue the list from where the returning
  1102. // call left off.
  1103. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  1104. // Optional integer. Specifies the maximum number of event sources to return
  1105. // in response. This value must be greater than 0.
  1106. MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"`
  1107. metadataListEventSourceMappingsInput `json:"-" xml:"-"`
  1108. }
  1109. type metadataListEventSourceMappingsInput struct {
  1110. SDKShapeTraits bool `type:"structure"`
  1111. }
  1112. // String returns the string representation
  1113. func (s ListEventSourceMappingsInput) String() string {
  1114. return awsutil.Prettify(s)
  1115. }
  1116. // GoString returns the string representation
  1117. func (s ListEventSourceMappingsInput) GoString() string {
  1118. return s.String()
  1119. }
  1120. // Contains a list of event sources (see API_EventSourceMappingConfiguration)
  1121. type ListEventSourceMappingsOutput struct {
  1122. // An array of EventSourceMappingConfiguration objects.
  1123. EventSourceMappings []*EventSourceMappingConfiguration `type:"list"`
  1124. // A string, present if there are more event source mappings.
  1125. NextMarker *string `type:"string"`
  1126. metadataListEventSourceMappingsOutput `json:"-" xml:"-"`
  1127. }
  1128. type metadataListEventSourceMappingsOutput struct {
  1129. SDKShapeTraits bool `type:"structure"`
  1130. }
  1131. // String returns the string representation
  1132. func (s ListEventSourceMappingsOutput) String() string {
  1133. return awsutil.Prettify(s)
  1134. }
  1135. // GoString returns the string representation
  1136. func (s ListEventSourceMappingsOutput) GoString() string {
  1137. return s.String()
  1138. }
  1139. type ListFunctionsInput struct {
  1140. // Optional string. An opaque pagination token returned from a previous ListFunctions
  1141. // operation. If present, indicates where to continue the listing.
  1142. Marker *string `location:"querystring" locationName:"Marker" type:"string"`
  1143. // Optional integer. Specifies the maximum number of AWS Lambda functions to
  1144. // return in response. This parameter value must be greater than 0.
  1145. MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"`
  1146. metadataListFunctionsInput `json:"-" xml:"-"`
  1147. }
  1148. type metadataListFunctionsInput struct {
  1149. SDKShapeTraits bool `type:"structure"`
  1150. }
  1151. // String returns the string representation
  1152. func (s ListFunctionsInput) String() string {
  1153. return awsutil.Prettify(s)
  1154. }
  1155. // GoString returns the string representation
  1156. func (s ListFunctionsInput) GoString() string {
  1157. return s.String()
  1158. }
  1159. // Contains a list of AWS Lambda function configurations (see FunctionConfiguration.
  1160. type ListFunctionsOutput struct {
  1161. // A list of Lambda functions.
  1162. Functions []*FunctionConfiguration `type:"list"`
  1163. // A string, present if there are more functions.
  1164. NextMarker *string `type:"string"`
  1165. metadataListFunctionsOutput `json:"-" xml:"-"`
  1166. }
  1167. type metadataListFunctionsOutput struct {
  1168. SDKShapeTraits bool `type:"structure"`
  1169. }
  1170. // String returns the string representation
  1171. func (s ListFunctionsOutput) String() string {
  1172. return awsutil.Prettify(s)
  1173. }
  1174. // GoString returns the string representation
  1175. func (s ListFunctionsOutput) GoString() string {
  1176. return s.String()
  1177. }
  1178. type RemovePermissionInput struct {
  1179. // Lambda function whose access policy you want to remove a permission from.
  1180. //
  1181. // You can specify an unqualified function name (for example, "Thumbnail")
  1182. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1183. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1184. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1185. // Note that the length constraint applies only to the ARN. If you specify only
  1186. // the function name, it is limited to 64 character in length.
  1187. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  1188. // Statement ID of the permission to remove.
  1189. StatementId *string `location:"uri" locationName:"StatementId" type:"string" required:"true"`
  1190. metadataRemovePermissionInput `json:"-" xml:"-"`
  1191. }
  1192. type metadataRemovePermissionInput struct {
  1193. SDKShapeTraits bool `type:"structure"`
  1194. }
  1195. // String returns the string representation
  1196. func (s RemovePermissionInput) String() string {
  1197. return awsutil.Prettify(s)
  1198. }
  1199. // GoString returns the string representation
  1200. func (s RemovePermissionInput) GoString() string {
  1201. return s.String()
  1202. }
  1203. type RemovePermissionOutput struct {
  1204. metadataRemovePermissionOutput `json:"-" xml:"-"`
  1205. }
  1206. type metadataRemovePermissionOutput struct {
  1207. SDKShapeTraits bool `type:"structure"`
  1208. }
  1209. // String returns the string representation
  1210. func (s RemovePermissionOutput) String() string {
  1211. return awsutil.Prettify(s)
  1212. }
  1213. // GoString returns the string representation
  1214. func (s RemovePermissionOutput) GoString() string {
  1215. return s.String()
  1216. }
  1217. type UpdateEventSourceMappingInput struct {
  1218. // The maximum number of stream records that can be sent to your Lambda function
  1219. // for a single invocation.
  1220. BatchSize *int64 `type:"integer"`
  1221. // Specifies whether AWS Lambda should actively poll the stream or not. If disabled,
  1222. // AWS Lambda will not poll the stream.
  1223. Enabled *bool `type:"boolean"`
  1224. // The Lambda function to which you want the stream records sent.
  1225. //
  1226. // You can specify an unqualified function name (for example, "Thumbnail")
  1227. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1228. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1229. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1230. // Note that the length constraint applies only to the ARN. If you specify only
  1231. // the function name, it is limited to 64 character in length.
  1232. FunctionName *string `type:"string"`
  1233. // The event source mapping identifier.
  1234. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"`
  1235. metadataUpdateEventSourceMappingInput `json:"-" xml:"-"`
  1236. }
  1237. type metadataUpdateEventSourceMappingInput struct {
  1238. SDKShapeTraits bool `type:"structure"`
  1239. }
  1240. // String returns the string representation
  1241. func (s UpdateEventSourceMappingInput) String() string {
  1242. return awsutil.Prettify(s)
  1243. }
  1244. // GoString returns the string representation
  1245. func (s UpdateEventSourceMappingInput) GoString() string {
  1246. return s.String()
  1247. }
  1248. type UpdateFunctionCodeInput struct {
  1249. // The existing Lambda function name whose code you want to replace.
  1250. //
  1251. // You can specify an unqualified function name (for example, "Thumbnail")
  1252. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1253. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1254. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1255. // Note that the length constraint applies only to the ARN. If you specify only
  1256. // the function name, it is limited to 64 character in length.
  1257. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  1258. // Amazon S3 bucket name where the .zip file containing your deployment package
  1259. // is stored. This bucket must reside in the same AWS region where you are creating
  1260. // the Lambda function.
  1261. S3Bucket *string `type:"string"`
  1262. // The Amazon S3 object (the deployment package) key name you want to upload.
  1263. S3Key *string `type:"string"`
  1264. // The Amazon S3 object (the deployment package) version you want to upload.
  1265. S3ObjectVersion *string `type:"string"`
  1266. // Based64-encoded .zip file containing your packaged source code.
  1267. ZipFile []byte `type:"blob"`
  1268. metadataUpdateFunctionCodeInput `json:"-" xml:"-"`
  1269. }
  1270. type metadataUpdateFunctionCodeInput struct {
  1271. SDKShapeTraits bool `type:"structure"`
  1272. }
  1273. // String returns the string representation
  1274. func (s UpdateFunctionCodeInput) String() string {
  1275. return awsutil.Prettify(s)
  1276. }
  1277. // GoString returns the string representation
  1278. func (s UpdateFunctionCodeInput) GoString() string {
  1279. return s.String()
  1280. }
  1281. type UpdateFunctionConfigurationInput struct {
  1282. // A short user-defined function description. AWS Lambda does not use this value.
  1283. // Assign a meaningful description as you see fit.
  1284. Description *string `type:"string"`
  1285. // The name of the Lambda function.
  1286. //
  1287. // You can specify an unqualified function name (for example, "Thumbnail")
  1288. // or you can specify Amazon Resource Name (ARN) of the function (for example,
  1289. // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also
  1290. // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail").
  1291. // Note that the length constraint applies only to the ARN. If you specify only
  1292. // the function name, it is limited to 64 character in length.
  1293. FunctionName *string `location:"uri" locationName:"FunctionName" type:"string" required:"true"`
  1294. // The function that Lambda calls to begin executing your function. For Node.js,
  1295. // it is the module-name.export value in your function.
  1296. Handler *string `type:"string"`
  1297. // The amount of memory, in MB, your Lambda function is given. AWS Lambda uses
  1298. // this memory size to infer the amount of CPU allocated to your function. Your
  1299. // function use-case determines your CPU and memory requirements. For example,
  1300. // a database operation might need less memory compared to an image processing
  1301. // function. The default value is 128 MB. The value must be a multiple of 64
  1302. // MB.
  1303. MemorySize *int64 `type:"integer"`
  1304. // The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when
  1305. // it executes your function.
  1306. Role *string `type:"string"`
  1307. // The function execution time at which AWS Lambda should terminate the function.
  1308. // Because the execution time has cost implications, we recommend you set this
  1309. // value based on your expected execution time. The default is 3 seconds.
  1310. Timeout *int64 `type:"integer"`
  1311. metadataUpdateFunctionConfigurationInput `json:"-" xml:"-"`
  1312. }
  1313. type metadataUpdateFunctionConfigurationInput struct {
  1314. SDKShapeTraits bool `type:"structure"`
  1315. }
  1316. // String returns the string representation
  1317. func (s UpdateFunctionConfigurationInput) String() string {
  1318. return awsutil.Prettify(s)
  1319. }
  1320. // GoString returns the string representation
  1321. func (s UpdateFunctionConfigurationInput) GoString() string {
  1322. return s.String()
  1323. }
  1324. const (
  1325. // @enum EventSourcePosition
  1326. EventSourcePositionTrimHorizon = "TRIM_HORIZON"
  1327. // @enum EventSourcePosition
  1328. EventSourcePositionLatest = "LATEST"
  1329. )
  1330. const (
  1331. // @enum InvocationType
  1332. InvocationTypeEvent = "Event"
  1333. // @enum InvocationType
  1334. InvocationTypeRequestResponse = "RequestResponse"
  1335. // @enum InvocationType
  1336. InvocationTypeDryRun = "DryRun"
  1337. )
  1338. const (
  1339. // @enum LogType
  1340. LogTypeNone = "None"
  1341. // @enum LogType
  1342. LogTypeTail = "Tail"
  1343. )
  1344. const (
  1345. // @enum Runtime
  1346. RuntimeNodejs = "nodejs"
  1347. // @enum Runtime
  1348. RuntimeJava8 = "java8"
  1349. )