forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
6610 lines (5475 loc) · 224 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package lambda
import (
"io"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
"github.com/aws/aws-sdk-go-v2/private/protocol/restjson"
)
const opAddPermission = "AddPermission"
// AddPermissionRequest is a API request type for the AddPermission API operation.
type AddPermissionRequest struct {
*aws.Request
Input *AddPermissionInput
Copy func(*AddPermissionInput) AddPermissionRequest
}
// Send marshals and sends the AddPermission API request.
func (r AddPermissionRequest) Send() (*AddPermissionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*AddPermissionOutput), nil
}
// AddPermissionRequest returns a request value for making API operation for
// AWS Lambda.
//
// Adds a permission to the resource policy associated with the specified AWS
// Lambda function. You use resource policies to grant permissions to event
// sources that use push model. In a push model, event sources (such as Amazon
// S3 and custom applications) invoke your Lambda function. Each permission
// you add to the resource policy allows an event source, permission to invoke
// the Lambda function.
//
// For information about the push model, see Lambda Functions (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html).
//
// If you are using versioning, the permissions you add are specific to the
// Lambda function version or alias you specify in the AddPermission request
// via the Qualifier parameter. For more information about versioning, see AWS
// Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:AddPermission action.
//
// // Example sending a request using the AddPermissionRequest method.
// req := client.AddPermissionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/AddPermission
func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) AddPermissionRequest {
op := &aws.Operation{
Name: opAddPermission,
HTTPMethod: "POST",
HTTPPath: "/2015-03-31/functions/{FunctionName}/policy",
}
if input == nil {
input = &AddPermissionInput{}
}
output := &AddPermissionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return AddPermissionRequest{Request: req, Input: input, Copy: c.AddPermissionRequest}
}
const opCreateAlias = "CreateAlias"
// CreateAliasRequest is a API request type for the CreateAlias API operation.
type CreateAliasRequest struct {
*aws.Request
Input *CreateAliasInput
Copy func(*CreateAliasInput) CreateAliasRequest
}
// Send marshals and sends the CreateAlias API request.
func (r CreateAliasRequest) Send() (*UpdateAliasOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateAliasOutput), nil
}
// CreateAliasRequest returns a request value for making API operation for
// AWS Lambda.
//
// Creates an alias that points to the specified Lambda function version. For
// more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
//
// Alias names are unique for a given function. This requires permission for
// the lambda:CreateAlias action.
//
// // Example sending a request using the CreateAliasRequest method.
// req := client.CreateAliasRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateAlias
func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) CreateAliasRequest {
op := &aws.Operation{
Name: opCreateAlias,
HTTPMethod: "POST",
HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases",
}
if input == nil {
input = &CreateAliasInput{}
}
output := &UpdateAliasOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateAliasRequest{Request: req, Input: input, Copy: c.CreateAliasRequest}
}
const opCreateEventSourceMapping = "CreateEventSourceMapping"
// CreateEventSourceMappingRequest is a API request type for the CreateEventSourceMapping API operation.
type CreateEventSourceMappingRequest struct {
*aws.Request
Input *CreateEventSourceMappingInput
Copy func(*CreateEventSourceMappingInput) CreateEventSourceMappingRequest
}
// Send marshals and sends the CreateEventSourceMapping API request.
func (r CreateEventSourceMappingRequest) Send() (*UpdateEventSourceMappingOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateEventSourceMappingOutput), nil
}
// CreateEventSourceMappingRequest returns a request value for making API operation for
// AWS Lambda.
//
// Identifies a stream as an event source for a Lambda function. It can be either
// an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes
// the specified function when records are posted to the stream.
//
// This association between a stream source and a Lambda function is called
// the event source mapping.
//
// You provide mapping information (for example, which stream to read from and
// which Lambda function to invoke) in the request body.
//
// Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be
// associated with multiple AWS Lambda functions. A given Lambda function can
// be associated with multiple AWS event sources.
//
// If you are using versioning, you can specify a specific function version
// or an alias via the function name parameter. For more information about versioning,
// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:CreateEventSourceMapping
// action.
//
// // Example sending a request using the CreateEventSourceMappingRequest method.
// req := client.CreateEventSourceMappingRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateEventSourceMapping
func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) CreateEventSourceMappingRequest {
op := &aws.Operation{
Name: opCreateEventSourceMapping,
HTTPMethod: "POST",
HTTPPath: "/2015-03-31/event-source-mappings/",
}
if input == nil {
input = &CreateEventSourceMappingInput{}
}
output := &UpdateEventSourceMappingOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateEventSourceMappingRequest{Request: req, Input: input, Copy: c.CreateEventSourceMappingRequest}
}
const opCreateFunction = "CreateFunction"
// CreateFunctionRequest is a API request type for the CreateFunction API operation.
type CreateFunctionRequest struct {
*aws.Request
Input *CreateFunctionInput
Copy func(*CreateFunctionInput) CreateFunctionRequest
}
// Send marshals and sends the CreateFunction API request.
func (r CreateFunctionRequest) Send() (*UpdateFunctionConfigurationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateFunctionConfigurationOutput), nil
}
// CreateFunctionRequest returns a request value for making API operation for
// AWS Lambda.
//
// Creates a new Lambda function. The function metadata is created from the
// request parameters, and the code for the function is provided by a .zip file
// in the request body. If the function name already exists, the operation will
// fail. Note that the function name is case-sensitive.
//
// If you are using versioning, you can also publish a version of the Lambda
// function you are creating using the Publish parameter. For more information
// about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:CreateFunction action.
//
// // Example sending a request using the CreateFunctionRequest method.
// req := client.CreateFunctionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateFunction
func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) CreateFunctionRequest {
op := &aws.Operation{
Name: opCreateFunction,
HTTPMethod: "POST",
HTTPPath: "/2015-03-31/functions",
}
if input == nil {
input = &CreateFunctionInput{}
}
output := &UpdateFunctionConfigurationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateFunctionRequest{Request: req, Input: input, Copy: c.CreateFunctionRequest}
}
const opDeleteAlias = "DeleteAlias"
// DeleteAliasRequest is a API request type for the DeleteAlias API operation.
type DeleteAliasRequest struct {
*aws.Request
Input *DeleteAliasInput
Copy func(*DeleteAliasInput) DeleteAliasRequest
}
// Send marshals and sends the DeleteAlias API request.
func (r DeleteAliasRequest) Send() (*DeleteAliasOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteAliasOutput), nil
}
// DeleteAliasRequest returns a request value for making API operation for
// AWS Lambda.
//
// Deletes the specified Lambda function alias. For more information, see Introduction
// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
//
// This requires permission for the lambda:DeleteAlias action.
//
// // Example sending a request using the DeleteAliasRequest method.
// req := client.DeleteAliasRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteAlias
func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) DeleteAliasRequest {
op := &aws.Operation{
Name: opDeleteAlias,
HTTPMethod: "DELETE",
HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}",
}
if input == nil {
input = &DeleteAliasInput{}
}
output := &DeleteAliasOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteAliasRequest{Request: req, Input: input, Copy: c.DeleteAliasRequest}
}
const opDeleteEventSourceMapping = "DeleteEventSourceMapping"
// DeleteEventSourceMappingRequest is a API request type for the DeleteEventSourceMapping API operation.
type DeleteEventSourceMappingRequest struct {
*aws.Request
Input *DeleteEventSourceMappingInput
Copy func(*DeleteEventSourceMappingInput) DeleteEventSourceMappingRequest
}
// Send marshals and sends the DeleteEventSourceMapping API request.
func (r DeleteEventSourceMappingRequest) Send() (*UpdateEventSourceMappingOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateEventSourceMappingOutput), nil
}
// DeleteEventSourceMappingRequest returns a request value for making API operation for
// AWS Lambda.
//
// Removes an event source mapping. This means AWS Lambda will no longer invoke
// the function for events in the associated source.
//
// This operation requires permission for the lambda:DeleteEventSourceMapping
// action.
//
// // Example sending a request using the DeleteEventSourceMappingRequest method.
// req := client.DeleteEventSourceMappingRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteEventSourceMapping
func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) DeleteEventSourceMappingRequest {
op := &aws.Operation{
Name: opDeleteEventSourceMapping,
HTTPMethod: "DELETE",
HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
}
if input == nil {
input = &DeleteEventSourceMappingInput{}
}
output := &UpdateEventSourceMappingOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteEventSourceMappingRequest{Request: req, Input: input, Copy: c.DeleteEventSourceMappingRequest}
}
const opDeleteFunction = "DeleteFunction"
// DeleteFunctionRequest is a API request type for the DeleteFunction API operation.
type DeleteFunctionRequest struct {
*aws.Request
Input *DeleteFunctionInput
Copy func(*DeleteFunctionInput) DeleteFunctionRequest
}
// Send marshals and sends the DeleteFunction API request.
func (r DeleteFunctionRequest) Send() (*DeleteFunctionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteFunctionOutput), nil
}
// DeleteFunctionRequest returns a request value for making API operation for
// AWS Lambda.
//
// Deletes the specified Lambda function code and configuration.
//
// If you are using the versioning feature and you don't specify a function
// version in your DeleteFunction request, AWS Lambda will delete the function,
// including all its versions, and any aliases pointing to the function versions.
// To delete a specific function version, you must provide the function version
// via the Qualifier parameter. For information about function versioning, see
// AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// When you delete a function the associated resource policy is also deleted.
// You will need to delete the event source mappings explicitly.
//
// This operation requires permission for the lambda:DeleteFunction action.
//
// // Example sending a request using the DeleteFunctionRequest method.
// req := client.DeleteFunctionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunction
func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) DeleteFunctionRequest {
op := &aws.Operation{
Name: opDeleteFunction,
HTTPMethod: "DELETE",
HTTPPath: "/2015-03-31/functions/{FunctionName}",
}
if input == nil {
input = &DeleteFunctionInput{}
}
output := &DeleteFunctionOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteFunctionRequest{Request: req, Input: input, Copy: c.DeleteFunctionRequest}
}
const opDeleteFunctionConcurrency = "DeleteFunctionConcurrency"
// DeleteFunctionConcurrencyRequest is a API request type for the DeleteFunctionConcurrency API operation.
type DeleteFunctionConcurrencyRequest struct {
*aws.Request
Input *DeleteFunctionConcurrencyInput
Copy func(*DeleteFunctionConcurrencyInput) DeleteFunctionConcurrencyRequest
}
// Send marshals and sends the DeleteFunctionConcurrency API request.
func (r DeleteFunctionConcurrencyRequest) Send() (*DeleteFunctionConcurrencyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteFunctionConcurrencyOutput), nil
}
// DeleteFunctionConcurrencyRequest returns a request value for making API operation for
// AWS Lambda.
//
// Removes concurrent execution limits from this function. For more information,
// see concurrent-executions.
//
// // Example sending a request using the DeleteFunctionConcurrencyRequest method.
// req := client.DeleteFunctionConcurrencyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunctionConcurrency
func (c *Lambda) DeleteFunctionConcurrencyRequest(input *DeleteFunctionConcurrencyInput) DeleteFunctionConcurrencyRequest {
op := &aws.Operation{
Name: opDeleteFunctionConcurrency,
HTTPMethod: "DELETE",
HTTPPath: "/2017-10-31/functions/{FunctionName}/concurrency",
}
if input == nil {
input = &DeleteFunctionConcurrencyInput{}
}
output := &DeleteFunctionConcurrencyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteFunctionConcurrencyRequest{Request: req, Input: input, Copy: c.DeleteFunctionConcurrencyRequest}
}
const opGetAccountSettings = "GetAccountSettings"
// GetAccountSettingsRequest is a API request type for the GetAccountSettings API operation.
type GetAccountSettingsRequest struct {
*aws.Request
Input *GetAccountSettingsInput
Copy func(*GetAccountSettingsInput) GetAccountSettingsRequest
}
// Send marshals and sends the GetAccountSettings API request.
func (r GetAccountSettingsRequest) Send() (*GetAccountSettingsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetAccountSettingsOutput), nil
}
// GetAccountSettingsRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns a customer's account settings.
//
// You can use this operation to retrieve Lambda limits information, such as
// code size and concurrency limits. For more information about limits, see
// AWS Lambda Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html).
// You can also retrieve resource usage statistics, such as code storage usage
// and function count.
//
// // Example sending a request using the GetAccountSettingsRequest method.
// req := client.GetAccountSettingsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetAccountSettings
func (c *Lambda) GetAccountSettingsRequest(input *GetAccountSettingsInput) GetAccountSettingsRequest {
op := &aws.Operation{
Name: opGetAccountSettings,
HTTPMethod: "GET",
HTTPPath: "/2016-08-19/account-settings/",
}
if input == nil {
input = &GetAccountSettingsInput{}
}
output := &GetAccountSettingsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetAccountSettingsRequest{Request: req, Input: input, Copy: c.GetAccountSettingsRequest}
}
const opGetAlias = "GetAlias"
// GetAliasRequest is a API request type for the GetAlias API operation.
type GetAliasRequest struct {
*aws.Request
Input *GetAliasInput
Copy func(*GetAliasInput) GetAliasRequest
}
// Send marshals and sends the GetAlias API request.
func (r GetAliasRequest) Send() (*UpdateAliasOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateAliasOutput), nil
}
// GetAliasRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns the specified alias information such as the alias ARN, description,
// and function version it is pointing to. For more information, see Introduction
// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
//
// This requires permission for the lambda:GetAlias action.
//
// // Example sending a request using the GetAliasRequest method.
// req := client.GetAliasRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetAlias
func (c *Lambda) GetAliasRequest(input *GetAliasInput) GetAliasRequest {
op := &aws.Operation{
Name: opGetAlias,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}",
}
if input == nil {
input = &GetAliasInput{}
}
output := &UpdateAliasOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetAliasRequest{Request: req, Input: input, Copy: c.GetAliasRequest}
}
const opGetEventSourceMapping = "GetEventSourceMapping"
// GetEventSourceMappingRequest is a API request type for the GetEventSourceMapping API operation.
type GetEventSourceMappingRequest struct {
*aws.Request
Input *GetEventSourceMappingInput
Copy func(*GetEventSourceMappingInput) GetEventSourceMappingRequest
}
// Send marshals and sends the GetEventSourceMapping API request.
func (r GetEventSourceMappingRequest) Send() (*UpdateEventSourceMappingOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateEventSourceMappingOutput), nil
}
// GetEventSourceMappingRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns configuration information for the specified event source mapping
// (see CreateEventSourceMapping).
//
// This operation requires permission for the lambda:GetEventSourceMapping action.
//
// // Example sending a request using the GetEventSourceMappingRequest method.
// req := client.GetEventSourceMappingRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetEventSourceMapping
func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) GetEventSourceMappingRequest {
op := &aws.Operation{
Name: opGetEventSourceMapping,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/event-source-mappings/{UUID}",
}
if input == nil {
input = &GetEventSourceMappingInput{}
}
output := &UpdateEventSourceMappingOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetEventSourceMappingRequest{Request: req, Input: input, Copy: c.GetEventSourceMappingRequest}
}
const opGetFunction = "GetFunction"
// GetFunctionRequest is a API request type for the GetFunction API operation.
type GetFunctionRequest struct {
*aws.Request
Input *GetFunctionInput
Copy func(*GetFunctionInput) GetFunctionRequest
}
// Send marshals and sends the GetFunction API request.
func (r GetFunctionRequest) Send() (*GetFunctionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetFunctionOutput), nil
}
// GetFunctionRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns the configuration information of the Lambda function and a presigned
// URL link to the .zip file you uploaded with CreateFunction so you can download
// the .zip file. Note that the URL is valid for up to 10 minutes. The configuration
// information is the same information you provided as parameters when uploading
// the function.
//
// Using the optional Qualifier parameter, you can specify a specific function
// version for which you want this information. If you don't specify this parameter,
// the API uses unqualified function ARN which return information about the
// $LATEST version of the Lambda function. For more information, see AWS Lambda
// Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:GetFunction action.
//
// // Example sending a request using the GetFunctionRequest method.
// req := client.GetFunctionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunction
func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) GetFunctionRequest {
op := &aws.Operation{
Name: opGetFunction,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/functions/{FunctionName}",
}
if input == nil {
input = &GetFunctionInput{}
}
output := &GetFunctionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetFunctionRequest{Request: req, Input: input, Copy: c.GetFunctionRequest}
}
const opGetFunctionConfiguration = "GetFunctionConfiguration"
// GetFunctionConfigurationRequest is a API request type for the GetFunctionConfiguration API operation.
type GetFunctionConfigurationRequest struct {
*aws.Request
Input *GetFunctionConfigurationInput
Copy func(*GetFunctionConfigurationInput) GetFunctionConfigurationRequest
}
// Send marshals and sends the GetFunctionConfiguration API request.
func (r GetFunctionConfigurationRequest) Send() (*UpdateFunctionConfigurationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateFunctionConfigurationOutput), nil
}
// GetFunctionConfigurationRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns the configuration information of the Lambda function. This the same
// information you provided as parameters when uploading the function by using
// CreateFunction.
//
// If you are using the versioning feature, you can retrieve this information
// for a specific function version by using the optional Qualifier parameter
// and specifying the function version or alias that points to it. If you don't
// provide it, the API returns information about the $LATEST version of the
// function. For more information about versioning, see AWS Lambda Function
// Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:GetFunctionConfiguration
// operation.
//
// // Example sending a request using the GetFunctionConfigurationRequest method.
// req := client.GetFunctionConfigurationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionConfiguration
func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) GetFunctionConfigurationRequest {
op := &aws.Operation{
Name: opGetFunctionConfiguration,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/functions/{FunctionName}/configuration",
}
if input == nil {
input = &GetFunctionConfigurationInput{}
}
output := &UpdateFunctionConfigurationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetFunctionConfigurationRequest{Request: req, Input: input, Copy: c.GetFunctionConfigurationRequest}
}
const opGetPolicy = "GetPolicy"
// GetPolicyRequest is a API request type for the GetPolicy API operation.
type GetPolicyRequest struct {
*aws.Request
Input *GetPolicyInput
Copy func(*GetPolicyInput) GetPolicyRequest
}
// Send marshals and sends the GetPolicy API request.
func (r GetPolicyRequest) Send() (*GetPolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetPolicyOutput), nil
}
// GetPolicyRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns the resource policy associated with the specified Lambda function.
//
// If you are using the versioning feature, you can get the resource policy
// associated with the specific Lambda function version or alias by specifying
// the version or alias name using the Qualifier parameter. For more information
// about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// You need permission for the lambda:GetPolicy action.
//
// // Example sending a request using the GetPolicyRequest method.
// req := client.GetPolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetPolicy
func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) GetPolicyRequest {
op := &aws.Operation{
Name: opGetPolicy,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/functions/{FunctionName}/policy",
}
if input == nil {
input = &GetPolicyInput{}
}
output := &GetPolicyOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetPolicyRequest{Request: req, Input: input, Copy: c.GetPolicyRequest}
}
const opInvoke = "Invoke"
// InvokeRequest is a API request type for the Invoke API operation.
type InvokeRequest struct {
*aws.Request
Input *InvokeInput
Copy func(*InvokeInput) InvokeRequest
}
// Send marshals and sends the Invoke API request.
func (r InvokeRequest) Send() (*InvokeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*InvokeOutput), nil
}
// InvokeRequest returns a request value for making API operation for
// AWS Lambda.
//
// Invokes a specific Lambda function. For an example, see Create the Lambda
// Function and Test It Manually (http://docs.aws.amazon.com/lambda/latest/dg/with-dynamodb-create-function.html#with-dbb-invoke-manually).
//
// If you are using the versioning feature, you can invoke the specific function
// version by providing function version or alias name that is pointing to the
// function version using the Qualifier parameter in the request. If you don't
// provide the Qualifier parameter, the $LATEST version of the Lambda function
// is invoked. Invocations occur at least once in response to an event and functions
// must be idempotent to handle this. For information about the versioning feature,
// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
//
// This operation requires permission for the lambda:InvokeFunction action.
//
// The TooManyRequestsException noted below will return the following: ConcurrentInvocationLimitExceeded
// will be returned if you have no functions with reserved concurrency and have
// exceeded your account concurrent limit or if a function without reserved
// concurrency exceeds the account's unreserved concurrency limit. ReservedFunctionConcurrentInvocationLimitExceeded
// will be returned when a function with reserved concurrency exceeds its configured
// concurrency limit.
//
// // Example sending a request using the InvokeRequest method.
// req := client.InvokeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/Invoke
func (c *Lambda) InvokeRequest(input *InvokeInput) InvokeRequest {
op := &aws.Operation{
Name: opInvoke,
HTTPMethod: "POST",
HTTPPath: "/2015-03-31/functions/{FunctionName}/invocations",
}
if input == nil {
input = &InvokeInput{}
}
output := &InvokeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return InvokeRequest{Request: req, Input: input, Copy: c.InvokeRequest}
}
const opInvokeAsync = "InvokeAsync"
// InvokeAsyncRequest is a API request type for the InvokeAsync API operation.
type InvokeAsyncRequest struct {
*aws.Request
Input *InvokeAsyncInput
Copy func(*InvokeAsyncInput) InvokeAsyncRequest
}
// Send marshals and sends the InvokeAsync API request.
func (r InvokeAsyncRequest) Send() (*InvokeAsyncOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*InvokeAsyncOutput), nil
}
// InvokeAsyncRequest returns a request value for making API operation for
// AWS Lambda.
//
// This API is deprecated. We recommend you use Invoke API (see Invoke).
//
// Submits an invocation request to AWS Lambda. Upon receiving the request,
// Lambda executes the specified function asynchronously. To see the logs generated
// by the Lambda function execution, see the CloudWatch Logs console.
//
// This operation requires permission for the lambda:InvokeFunction action.
//
// // Example sending a request using the InvokeAsyncRequest method.
// req := client.InvokeAsyncRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/InvokeAsync
func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) InvokeAsyncRequest {
if c.Client.Config.Logger != nil {
c.Client.Config.Logger.Log("This operation, InvokeAsync, has been deprecated")
}
op := &aws.Operation{
Name: opInvokeAsync,
HTTPMethod: "POST",
HTTPPath: "/2014-11-13/functions/{FunctionName}/invoke-async/",
}
if input == nil {
input = &InvokeAsyncInput{}
}
output := &InvokeAsyncOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return InvokeAsyncRequest{Request: req, Input: input, Copy: c.InvokeAsyncRequest}
}
const opListAliases = "ListAliases"
// ListAliasesRequest is a API request type for the ListAliases API operation.
type ListAliasesRequest struct {
*aws.Request
Input *ListAliasesInput
Copy func(*ListAliasesInput) ListAliasesRequest
}
// Send marshals and sends the ListAliases API request.
func (r ListAliasesRequest) Send() (*ListAliasesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListAliasesOutput), nil
}
// ListAliasesRequest returns a request value for making API operation for
// AWS Lambda.
//
// Returns list of aliases created for a Lambda function. For each alias, the
// response includes information such as the alias ARN, description, alias name,
// and the function version to which it points. For more information, see Introduction
// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html).
//
// This requires permission for the lambda:ListAliases action.
//
// // Example sending a request using the ListAliasesRequest method.
// req := client.ListAliasesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListAliases
func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) ListAliasesRequest {
op := &aws.Operation{
Name: opListAliases,
HTTPMethod: "GET",
HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases",
}