forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
5432 lines (4486 loc) · 171 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 cloudwatchlogs
import (
"fmt"
"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/jsonrpc"
)
const opAssociateKmsKey = "AssociateKmsKey"
// AssociateKmsKeyRequest is a API request type for the AssociateKmsKey API operation.
type AssociateKmsKeyRequest struct {
*aws.Request
Input *AssociateKmsKeyInput
Copy func(*AssociateKmsKeyInput) AssociateKmsKeyRequest
}
// Send marshals and sends the AssociateKmsKey API request.
func (r AssociateKmsKeyRequest) Send() (*AssociateKmsKeyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*AssociateKmsKeyOutput), nil
}
// AssociateKmsKeyRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Associates the specified AWS Key Management Service (AWS KMS) customer master
// key (CMK) with the specified log group.
//
// Associating an AWS KMS CMK with a log group overrides any existing associations
// between the log group and a CMK. After a CMK is associated with a log group,
// all newly ingested data for the log group is encrypted using the CMK. This
// association is stored as long as the data encrypted with the CMK is still
// within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt
// this data whenever it is requested.
//
// Note that it can take up to 5 minutes for this operation to take effect.
//
// If you attempt to associate a CMK with a log group but the CMK does not exist
// or the CMK is disabled, you will receive an InvalidParameterException error.
//
// // Example sending a request using the AssociateKmsKeyRequest method.
// req := client.AssociateKmsKeyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/AssociateKmsKey
func (c *CloudWatchLogs) AssociateKmsKeyRequest(input *AssociateKmsKeyInput) AssociateKmsKeyRequest {
op := &aws.Operation{
Name: opAssociateKmsKey,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AssociateKmsKeyInput{}
}
output := &AssociateKmsKeyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return AssociateKmsKeyRequest{Request: req, Input: input, Copy: c.AssociateKmsKeyRequest}
}
const opCancelExportTask = "CancelExportTask"
// CancelExportTaskRequest is a API request type for the CancelExportTask API operation.
type CancelExportTaskRequest struct {
*aws.Request
Input *CancelExportTaskInput
Copy func(*CancelExportTaskInput) CancelExportTaskRequest
}
// Send marshals and sends the CancelExportTask API request.
func (r CancelExportTaskRequest) Send() (*CancelExportTaskOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CancelExportTaskOutput), nil
}
// CancelExportTaskRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Cancels the specified export task.
//
// The task must be in the PENDING or RUNNING state.
//
// // Example sending a request using the CancelExportTaskRequest method.
// req := client.CancelExportTaskRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTask
func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) CancelExportTaskRequest {
op := &aws.Operation{
Name: opCancelExportTask,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CancelExportTaskInput{}
}
output := &CancelExportTaskOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return CancelExportTaskRequest{Request: req, Input: input, Copy: c.CancelExportTaskRequest}
}
const opCreateExportTask = "CreateExportTask"
// CreateExportTaskRequest is a API request type for the CreateExportTask API operation.
type CreateExportTaskRequest struct {
*aws.Request
Input *CreateExportTaskInput
Copy func(*CreateExportTaskInput) CreateExportTaskRequest
}
// Send marshals and sends the CreateExportTask API request.
func (r CreateExportTaskRequest) Send() (*CreateExportTaskOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateExportTaskOutput), nil
}
// CreateExportTaskRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Creates an export task, which allows you to efficiently export data from
// a log group to an Amazon S3 bucket.
//
// This is an asynchronous call. If all the required information is provided,
// this operation initiates an export task and responds with the ID of the task.
// After the task has started, you can use DescribeExportTasks to get the status
// of the export task. Each account can only have one active (RUNNING or PENDING)
// export task at a time. To cancel an export task, use CancelExportTask.
//
// You can export logs from multiple log groups or multiple time ranges to the
// same S3 bucket. To separate out log data for each export task, you can specify
// a prefix to be used as the Amazon S3 key prefix for all exported objects.
//
// // Example sending a request using the CreateExportTaskRequest method.
// req := client.CreateExportTaskRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTask
func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) CreateExportTaskRequest {
op := &aws.Operation{
Name: opCreateExportTask,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateExportTaskInput{}
}
output := &CreateExportTaskOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateExportTaskRequest{Request: req, Input: input, Copy: c.CreateExportTaskRequest}
}
const opCreateLogGroup = "CreateLogGroup"
// CreateLogGroupRequest is a API request type for the CreateLogGroup API operation.
type CreateLogGroupRequest struct {
*aws.Request
Input *CreateLogGroupInput
Copy func(*CreateLogGroupInput) CreateLogGroupRequest
}
// Send marshals and sends the CreateLogGroup API request.
func (r CreateLogGroupRequest) Send() (*CreateLogGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateLogGroupOutput), nil
}
// CreateLogGroupRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Creates a log group with the specified name.
//
// You can create up to 5000 log groups per account.
//
// You must use the following guidelines when naming a log group:
//
// * Log group names must be unique within a region for an AWS account.
//
// * Log group names can be between 1 and 512 characters long.
//
// * Log group names consist of the following characters: a-z, A-Z, 0-9,
// '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
//
// If you associate a AWS Key Management Service (AWS KMS) customer master key
// (CMK) with the log group, ingested data is encrypted using the CMK. This
// association is stored as long as the data encrypted with the CMK is still
// within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt
// this data whenever it is requested.
//
// If you attempt to associate a CMK with the log group but the CMK does not
// exist or the CMK is disabled, you will receive an InvalidParameterException
// error.
//
// // Example sending a request using the CreateLogGroupRequest method.
// req := client.CreateLogGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroup
func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) CreateLogGroupRequest {
op := &aws.Operation{
Name: opCreateLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogGroupInput{}
}
output := &CreateLogGroupOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return CreateLogGroupRequest{Request: req, Input: input, Copy: c.CreateLogGroupRequest}
}
const opCreateLogStream = "CreateLogStream"
// CreateLogStreamRequest is a API request type for the CreateLogStream API operation.
type CreateLogStreamRequest struct {
*aws.Request
Input *CreateLogStreamInput
Copy func(*CreateLogStreamInput) CreateLogStreamRequest
}
// Send marshals and sends the CreateLogStream API request.
func (r CreateLogStreamRequest) Send() (*CreateLogStreamOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateLogStreamOutput), nil
}
// CreateLogStreamRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Creates a log stream for the specified log group.
//
// There is no limit on the number of log streams that you can create for a
// log group.
//
// You must use the following guidelines when naming a log stream:
//
// * Log stream names must be unique within the log group.
//
// * Log stream names can be between 1 and 512 characters long.
//
// * The ':' (colon) and '*' (asterisk) characters are not allowed.
//
// // Example sending a request using the CreateLogStreamRequest method.
// req := client.CreateLogStreamRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStream
func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) CreateLogStreamRequest {
op := &aws.Operation{
Name: opCreateLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogStreamInput{}
}
output := &CreateLogStreamOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return CreateLogStreamRequest{Request: req, Input: input, Copy: c.CreateLogStreamRequest}
}
const opDeleteDestination = "DeleteDestination"
// DeleteDestinationRequest is a API request type for the DeleteDestination API operation.
type DeleteDestinationRequest struct {
*aws.Request
Input *DeleteDestinationInput
Copy func(*DeleteDestinationInput) DeleteDestinationRequest
}
// Send marshals and sends the DeleteDestination API request.
func (r DeleteDestinationRequest) Send() (*DeleteDestinationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteDestinationOutput), nil
}
// DeleteDestinationRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified destination, and eventually disables all the subscription
// filters that publish to it. This operation does not delete the physical resource
// encapsulated by the destination.
//
// // Example sending a request using the DeleteDestinationRequest method.
// req := client.DeleteDestinationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestination
func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) DeleteDestinationRequest {
op := &aws.Operation{
Name: opDeleteDestination,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteDestinationInput{}
}
output := &DeleteDestinationOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteDestinationRequest{Request: req, Input: input, Copy: c.DeleteDestinationRequest}
}
const opDeleteLogGroup = "DeleteLogGroup"
// DeleteLogGroupRequest is a API request type for the DeleteLogGroup API operation.
type DeleteLogGroupRequest struct {
*aws.Request
Input *DeleteLogGroupInput
Copy func(*DeleteLogGroupInput) DeleteLogGroupRequest
}
// Send marshals and sends the DeleteLogGroup API request.
func (r DeleteLogGroupRequest) Send() (*DeleteLogGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteLogGroupOutput), nil
}
// DeleteLogGroupRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified log group and permanently deletes all the archived
// log events associated with the log group.
//
// // Example sending a request using the DeleteLogGroupRequest method.
// req := client.DeleteLogGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroup
func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) DeleteLogGroupRequest {
op := &aws.Operation{
Name: opDeleteLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogGroupInput{}
}
output := &DeleteLogGroupOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteLogGroupRequest{Request: req, Input: input, Copy: c.DeleteLogGroupRequest}
}
const opDeleteLogStream = "DeleteLogStream"
// DeleteLogStreamRequest is a API request type for the DeleteLogStream API operation.
type DeleteLogStreamRequest struct {
*aws.Request
Input *DeleteLogStreamInput
Copy func(*DeleteLogStreamInput) DeleteLogStreamRequest
}
// Send marshals and sends the DeleteLogStream API request.
func (r DeleteLogStreamRequest) Send() (*DeleteLogStreamOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteLogStreamOutput), nil
}
// DeleteLogStreamRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified log stream and permanently deletes all the archived
// log events associated with the log stream.
//
// // Example sending a request using the DeleteLogStreamRequest method.
// req := client.DeleteLogStreamRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStream
func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) DeleteLogStreamRequest {
op := &aws.Operation{
Name: opDeleteLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogStreamInput{}
}
output := &DeleteLogStreamOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteLogStreamRequest{Request: req, Input: input, Copy: c.DeleteLogStreamRequest}
}
const opDeleteMetricFilter = "DeleteMetricFilter"
// DeleteMetricFilterRequest is a API request type for the DeleteMetricFilter API operation.
type DeleteMetricFilterRequest struct {
*aws.Request
Input *DeleteMetricFilterInput
Copy func(*DeleteMetricFilterInput) DeleteMetricFilterRequest
}
// Send marshals and sends the DeleteMetricFilter API request.
func (r DeleteMetricFilterRequest) Send() (*DeleteMetricFilterOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteMetricFilterOutput), nil
}
// DeleteMetricFilterRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified metric filter.
//
// // Example sending a request using the DeleteMetricFilterRequest method.
// req := client.DeleteMetricFilterRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilter
func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) DeleteMetricFilterRequest {
op := &aws.Operation{
Name: opDeleteMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteMetricFilterInput{}
}
output := &DeleteMetricFilterOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteMetricFilterRequest{Request: req, Input: input, Copy: c.DeleteMetricFilterRequest}
}
const opDeleteResourcePolicy = "DeleteResourcePolicy"
// DeleteResourcePolicyRequest is a API request type for the DeleteResourcePolicy API operation.
type DeleteResourcePolicyRequest struct {
*aws.Request
Input *DeleteResourcePolicyInput
Copy func(*DeleteResourcePolicyInput) DeleteResourcePolicyRequest
}
// Send marshals and sends the DeleteResourcePolicy API request.
func (r DeleteResourcePolicyRequest) Send() (*DeleteResourcePolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteResourcePolicyOutput), nil
}
// DeleteResourcePolicyRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes a resource policy from this account. This revokes the access of the
// identities in that policy to put log events to this account.
//
// // Example sending a request using the DeleteResourcePolicyRequest method.
// req := client.DeleteResourcePolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteResourcePolicy
func (c *CloudWatchLogs) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) DeleteResourcePolicyRequest {
op := &aws.Operation{
Name: opDeleteResourcePolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteResourcePolicyInput{}
}
output := &DeleteResourcePolicyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteResourcePolicyRequest{Request: req, Input: input, Copy: c.DeleteResourcePolicyRequest}
}
const opDeleteRetentionPolicy = "DeleteRetentionPolicy"
// DeleteRetentionPolicyRequest is a API request type for the DeleteRetentionPolicy API operation.
type DeleteRetentionPolicyRequest struct {
*aws.Request
Input *DeleteRetentionPolicyInput
Copy func(*DeleteRetentionPolicyInput) DeleteRetentionPolicyRequest
}
// Send marshals and sends the DeleteRetentionPolicy API request.
func (r DeleteRetentionPolicyRequest) Send() (*DeleteRetentionPolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteRetentionPolicyOutput), nil
}
// DeleteRetentionPolicyRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified retention policy.
//
// Log events do not expire if they belong to log groups without a retention
// policy.
//
// // Example sending a request using the DeleteRetentionPolicyRequest method.
// req := client.DeleteRetentionPolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicy
func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) DeleteRetentionPolicyRequest {
op := &aws.Operation{
Name: opDeleteRetentionPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteRetentionPolicyInput{}
}
output := &DeleteRetentionPolicyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteRetentionPolicyRequest{Request: req, Input: input, Copy: c.DeleteRetentionPolicyRequest}
}
const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter"
// DeleteSubscriptionFilterRequest is a API request type for the DeleteSubscriptionFilter API operation.
type DeleteSubscriptionFilterRequest struct {
*aws.Request
Input *DeleteSubscriptionFilterInput
Copy func(*DeleteSubscriptionFilterInput) DeleteSubscriptionFilterRequest
}
// Send marshals and sends the DeleteSubscriptionFilter API request.
func (r DeleteSubscriptionFilterRequest) Send() (*DeleteSubscriptionFilterOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteSubscriptionFilterOutput), nil
}
// DeleteSubscriptionFilterRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Deletes the specified subscription filter.
//
// // Example sending a request using the DeleteSubscriptionFilterRequest method.
// req := client.DeleteSubscriptionFilterRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilter
func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) DeleteSubscriptionFilterRequest {
op := &aws.Operation{
Name: opDeleteSubscriptionFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteSubscriptionFilterInput{}
}
output := &DeleteSubscriptionFilterOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteSubscriptionFilterRequest{Request: req, Input: input, Copy: c.DeleteSubscriptionFilterRequest}
}
const opDescribeDestinations = "DescribeDestinations"
// DescribeDestinationsRequest is a API request type for the DescribeDestinations API operation.
type DescribeDestinationsRequest struct {
*aws.Request
Input *DescribeDestinationsInput
Copy func(*DescribeDestinationsInput) DescribeDestinationsRequest
}
// Send marshals and sends the DescribeDestinations API request.
func (r DescribeDestinationsRequest) Send() (*DescribeDestinationsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeDestinationsOutput), nil
}
// DescribeDestinationsRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Lists all your destinations. The results are ASCII-sorted by destination
// name.
//
// // Example sending a request using the DescribeDestinationsRequest method.
// req := client.DescribeDestinationsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinations
func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) DescribeDestinationsRequest {
op := &aws.Operation{
Name: opDescribeDestinations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeDestinationsInput{}
}
output := &DescribeDestinationsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeDestinationsRequest{Request: req, Input: input, Copy: c.DescribeDestinationsRequest}
}
// Paginate pages iterates over the pages of a DescribeDestinationsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeDestinations operation.
// req := client.DescribeDestinationsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *DescribeDestinationsRequest) Paginate(opts ...aws.Option) DescribeDestinationsPager {
return DescribeDestinationsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *DescribeDestinationsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// DescribeDestinationsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeDestinationsPager struct {
aws.Pager
}
func (p *DescribeDestinationsPager) CurrentPage() *DescribeDestinationsOutput {
return p.Pager.CurrentPage().(*DescribeDestinationsOutput)
}
const opDescribeExportTasks = "DescribeExportTasks"
// DescribeExportTasksRequest is a API request type for the DescribeExportTasks API operation.
type DescribeExportTasksRequest struct {
*aws.Request
Input *DescribeExportTasksInput
Copy func(*DescribeExportTasksInput) DescribeExportTasksRequest
}
// Send marshals and sends the DescribeExportTasks API request.
func (r DescribeExportTasksRequest) Send() (*DescribeExportTasksOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeExportTasksOutput), nil
}
// DescribeExportTasksRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Lists the specified export tasks. You can list all your export tasks or filter
// the results based on task ID or task status.
//
// // Example sending a request using the DescribeExportTasksRequest method.
// req := client.DescribeExportTasksRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasks
func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksInput) DescribeExportTasksRequest {
op := &aws.Operation{
Name: opDescribeExportTasks,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeExportTasksInput{}
}
output := &DescribeExportTasksOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeExportTasksRequest{Request: req, Input: input, Copy: c.DescribeExportTasksRequest}
}
const opDescribeLogGroups = "DescribeLogGroups"
// DescribeLogGroupsRequest is a API request type for the DescribeLogGroups API operation.
type DescribeLogGroupsRequest struct {
*aws.Request
Input *DescribeLogGroupsInput
Copy func(*DescribeLogGroupsInput) DescribeLogGroupsRequest
}
// Send marshals and sends the DescribeLogGroups API request.
func (r DescribeLogGroupsRequest) Send() (*DescribeLogGroupsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeLogGroupsOutput), nil
}
// DescribeLogGroupsRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Lists the specified log groups. You can list all your log groups or filter
// the results by prefix. The results are ASCII-sorted by log group name.
//
// // Example sending a request using the DescribeLogGroupsRequest method.
// req := client.DescribeLogGroupsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroups
func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) DescribeLogGroupsRequest {
op := &aws.Operation{
Name: opDescribeLogGroups,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeLogGroupsInput{}
}
output := &DescribeLogGroupsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeLogGroupsRequest{Request: req, Input: input, Copy: c.DescribeLogGroupsRequest}
}
// Paginate pages iterates over the pages of a DescribeLogGroupsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeLogGroups operation.
// req := client.DescribeLogGroupsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *DescribeLogGroupsRequest) Paginate(opts ...aws.Option) DescribeLogGroupsPager {
return DescribeLogGroupsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *DescribeLogGroupsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// DescribeLogGroupsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeLogGroupsPager struct {
aws.Pager
}
func (p *DescribeLogGroupsPager) CurrentPage() *DescribeLogGroupsOutput {
return p.Pager.CurrentPage().(*DescribeLogGroupsOutput)
}
const opDescribeLogStreams = "DescribeLogStreams"
// DescribeLogStreamsRequest is a API request type for the DescribeLogStreams API operation.
type DescribeLogStreamsRequest struct {
*aws.Request
Input *DescribeLogStreamsInput
Copy func(*DescribeLogStreamsInput) DescribeLogStreamsRequest
}
// Send marshals and sends the DescribeLogStreams API request.
func (r DescribeLogStreamsRequest) Send() (*DescribeLogStreamsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeLogStreamsOutput), nil
}
// DescribeLogStreamsRequest returns a request value for making API operation for
// Amazon CloudWatch Logs.
//
// Lists the log streams for the specified log group. You can list all the log
// streams or filter the results by prefix. You can also control how the results
// are ordered.
//
// This operation has a limit of five transactions per second, after which transactions
// are throttled.
//
// // Example sending a request using the DescribeLogStreamsRequest method.
// req := client.DescribeLogStreamsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreams
func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) DescribeLogStreamsRequest {
op := &aws.Operation{
Name: opDescribeLogStreams,
HTTPMethod: "POST",
HTTPPath: "/",