forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.go
4421 lines (3654 loc) · 158 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
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package cloudfront provides a client for Amazon CloudFront.
package cloudfront
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/restxml"
)
const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2016_01_28"
// CreateCloudFrontOriginAccessIdentityRequest generates a request for the CreateCloudFrontOriginAccessIdentity operation.
func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *CreateCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opCreateCloudFrontOriginAccessIdentity,
HTTPMethod: "POST",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront",
}
if input == nil {
input = &CreateCloudFrontOriginAccessIdentityInput{}
}
req = c.newRequest(op, input, output)
output = &CreateCloudFrontOriginAccessIdentityOutput{}
req.Data = output
return
}
// Create a new origin access identity.
func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFrontOriginAccessIdentityInput) (*CreateCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input)
err := req.Send()
return out, err
}
const opCreateDistribution = "CreateDistribution2016_01_28"
// CreateDistributionRequest generates a request for the CreateDistribution operation.
func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) (req *request.Request, output *CreateDistributionOutput) {
op := &request.Operation{
Name: opCreateDistribution,
HTTPMethod: "POST",
HTTPPath: "/2016-01-28/distribution",
}
if input == nil {
input = &CreateDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &CreateDistributionOutput{}
req.Data = output
return
}
// Create a new distribution.
func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*CreateDistributionOutput, error) {
req, out := c.CreateDistributionRequest(input)
err := req.Send()
return out, err
}
const opCreateInvalidation = "CreateInvalidation2016_01_28"
// CreateInvalidationRequest generates a request for the CreateInvalidation operation.
func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) (req *request.Request, output *CreateInvalidationOutput) {
op := &request.Operation{
Name: opCreateInvalidation,
HTTPMethod: "POST",
HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation",
}
if input == nil {
input = &CreateInvalidationInput{}
}
req = c.newRequest(op, input, output)
output = &CreateInvalidationOutput{}
req.Data = output
return
}
// Create a new invalidation.
func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*CreateInvalidationOutput, error) {
req, out := c.CreateInvalidationRequest(input)
err := req.Send()
return out, err
}
const opCreateStreamingDistribution = "CreateStreamingDistribution2016_01_28"
// CreateStreamingDistributionRequest generates a request for the CreateStreamingDistribution operation.
func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDistributionInput) (req *request.Request, output *CreateStreamingDistributionOutput) {
op := &request.Operation{
Name: opCreateStreamingDistribution,
HTTPMethod: "POST",
HTTPPath: "/2016-01-28/streaming-distribution",
}
if input == nil {
input = &CreateStreamingDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &CreateStreamingDistributionOutput{}
req.Data = output
return
}
// Create a new streaming distribution.
func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistributionInput) (*CreateStreamingDistributionOutput, error) {
req, out := c.CreateStreamingDistributionRequest(input)
err := req.Send()
return out, err
}
const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2016_01_28"
// DeleteCloudFrontOriginAccessIdentityRequest generates a request for the DeleteCloudFrontOriginAccessIdentity operation.
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCloudFrontOriginAccessIdentityInput) (req *request.Request, output *DeleteCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opDeleteCloudFrontOriginAccessIdentity,
HTTPMethod: "DELETE",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}",
}
if input == nil {
input = &DeleteCloudFrontOriginAccessIdentityInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteCloudFrontOriginAccessIdentityOutput{}
req.Data = output
return
}
// Delete an origin access identity.
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input)
err := req.Send()
return out, err
}
const opDeleteDistribution = "DeleteDistribution2016_01_28"
// DeleteDistributionRequest generates a request for the DeleteDistribution operation.
func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) (req *request.Request, output *DeleteDistributionOutput) {
op := &request.Operation{
Name: opDeleteDistribution,
HTTPMethod: "DELETE",
HTTPPath: "/2016-01-28/distribution/{Id}",
}
if input == nil {
input = &DeleteDistributionInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteDistributionOutput{}
req.Data = output
return
}
// Delete a distribution.
func (c *CloudFront) DeleteDistribution(input *DeleteDistributionInput) (*DeleteDistributionOutput, error) {
req, out := c.DeleteDistributionRequest(input)
err := req.Send()
return out, err
}
const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_01_28"
// DeleteStreamingDistributionRequest generates a request for the DeleteStreamingDistribution operation.
func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDistributionInput) (req *request.Request, output *DeleteStreamingDistributionOutput) {
op := &request.Operation{
Name: opDeleteStreamingDistribution,
HTTPMethod: "DELETE",
HTTPPath: "/2016-01-28/streaming-distribution/{Id}",
}
if input == nil {
input = &DeleteStreamingDistributionInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteStreamingDistributionOutput{}
req.Data = output
return
}
// Delete a streaming distribution.
func (c *CloudFront) DeleteStreamingDistribution(input *DeleteStreamingDistributionInput) (*DeleteStreamingDistributionOutput, error) {
req, out := c.DeleteStreamingDistributionRequest(input)
err := req.Send()
return out, err
}
const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2016_01_28"
// GetCloudFrontOriginAccessIdentityRequest generates a request for the GetCloudFrontOriginAccessIdentity operation.
func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFrontOriginAccessIdentityInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opGetCloudFrontOriginAccessIdentity,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}",
}
if input == nil {
input = &GetCloudFrontOriginAccessIdentityInput{}
}
req = c.newRequest(op, input, output)
output = &GetCloudFrontOriginAccessIdentityOutput{}
req.Data = output
return
}
// Get the information about an origin access identity.
func (c *CloudFront) GetCloudFrontOriginAccessIdentity(input *GetCloudFrontOriginAccessIdentityInput) (*GetCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.GetCloudFrontOriginAccessIdentityRequest(input)
err := req.Send()
return out, err
}
const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2016_01_28"
// GetCloudFrontOriginAccessIdentityConfigRequest generates a request for the GetCloudFrontOriginAccessIdentityConfig operation.
func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCloudFrontOriginAccessIdentityConfigInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityConfigOutput) {
op := &request.Operation{
Name: opGetCloudFrontOriginAccessIdentityConfig,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}/config",
}
if input == nil {
input = &GetCloudFrontOriginAccessIdentityConfigInput{}
}
req = c.newRequest(op, input, output)
output = &GetCloudFrontOriginAccessIdentityConfigOutput{}
req.Data = output
return
}
// Get the configuration information about an origin access identity.
func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfig(input *GetCloudFrontOriginAccessIdentityConfigInput) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) {
req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input)
err := req.Send()
return out, err
}
const opGetDistribution = "GetDistribution2016_01_28"
// GetDistributionRequest generates a request for the GetDistribution operation.
func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *request.Request, output *GetDistributionOutput) {
op := &request.Operation{
Name: opGetDistribution,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distribution/{Id}",
}
if input == nil {
input = &GetDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &GetDistributionOutput{}
req.Data = output
return
}
// Get the information about a distribution.
func (c *CloudFront) GetDistribution(input *GetDistributionInput) (*GetDistributionOutput, error) {
req, out := c.GetDistributionRequest(input)
err := req.Send()
return out, err
}
const opGetDistributionConfig = "GetDistributionConfig2016_01_28"
// GetDistributionConfigRequest generates a request for the GetDistributionConfig operation.
func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigInput) (req *request.Request, output *GetDistributionConfigOutput) {
op := &request.Operation{
Name: opGetDistributionConfig,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distribution/{Id}/config",
}
if input == nil {
input = &GetDistributionConfigInput{}
}
req = c.newRequest(op, input, output)
output = &GetDistributionConfigOutput{}
req.Data = output
return
}
// Get the configuration information about a distribution.
func (c *CloudFront) GetDistributionConfig(input *GetDistributionConfigInput) (*GetDistributionConfigOutput, error) {
req, out := c.GetDistributionConfigRequest(input)
err := req.Send()
return out, err
}
const opGetInvalidation = "GetInvalidation2016_01_28"
// GetInvalidationRequest generates a request for the GetInvalidation operation.
func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *request.Request, output *GetInvalidationOutput) {
op := &request.Operation{
Name: opGetInvalidation,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation/{Id}",
}
if input == nil {
input = &GetInvalidationInput{}
}
req = c.newRequest(op, input, output)
output = &GetInvalidationOutput{}
req.Data = output
return
}
// Get the information about an invalidation.
func (c *CloudFront) GetInvalidation(input *GetInvalidationInput) (*GetInvalidationOutput, error) {
req, out := c.GetInvalidationRequest(input)
err := req.Send()
return out, err
}
const opGetStreamingDistribution = "GetStreamingDistribution2016_01_28"
// GetStreamingDistributionRequest generates a request for the GetStreamingDistribution operation.
func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistributionInput) (req *request.Request, output *GetStreamingDistributionOutput) {
op := &request.Operation{
Name: opGetStreamingDistribution,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/streaming-distribution/{Id}",
}
if input == nil {
input = &GetStreamingDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &GetStreamingDistributionOutput{}
req.Data = output
return
}
// Get the information about a streaming distribution.
func (c *CloudFront) GetStreamingDistribution(input *GetStreamingDistributionInput) (*GetStreamingDistributionOutput, error) {
req, out := c.GetStreamingDistributionRequest(input)
err := req.Send()
return out, err
}
const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_01_28"
// GetStreamingDistributionConfigRequest generates a request for the GetStreamingDistributionConfig operation.
func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDistributionConfigInput) (req *request.Request, output *GetStreamingDistributionConfigOutput) {
op := &request.Operation{
Name: opGetStreamingDistributionConfig,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/streaming-distribution/{Id}/config",
}
if input == nil {
input = &GetStreamingDistributionConfigInput{}
}
req = c.newRequest(op, input, output)
output = &GetStreamingDistributionConfigOutput{}
req.Data = output
return
}
// Get the configuration information about a streaming distribution.
func (c *CloudFront) GetStreamingDistributionConfig(input *GetStreamingDistributionConfigInput) (*GetStreamingDistributionConfigOutput, error) {
req, out := c.GetStreamingDistributionConfigRequest(input)
err := req.Send()
return out, err
}
const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2016_01_28"
// ListCloudFrontOriginAccessIdentitiesRequest generates a request for the ListCloudFrontOriginAccessIdentities operation.
func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListCloudFrontOriginAccessIdentitiesInput) (req *request.Request, output *ListCloudFrontOriginAccessIdentitiesOutput) {
op := &request.Operation{
Name: opListCloudFrontOriginAccessIdentities,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront",
Paginator: &request.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"CloudFrontOriginAccessIdentityList.NextMarker"},
LimitToken: "MaxItems",
TruncationToken: "CloudFrontOriginAccessIdentityList.IsTruncated",
},
}
if input == nil {
input = &ListCloudFrontOriginAccessIdentitiesInput{}
}
req = c.newRequest(op, input, output)
output = &ListCloudFrontOriginAccessIdentitiesOutput{}
req.Data = output
return
}
// List origin access identities.
func (c *CloudFront) ListCloudFrontOriginAccessIdentities(input *ListCloudFrontOriginAccessIdentitiesInput) (*ListCloudFrontOriginAccessIdentitiesOutput, error) {
req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input)
err := req.Send()
return out, err
}
func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(p *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListCloudFrontOriginAccessIdentitiesOutput), lastPage)
})
}
const opListDistributions = "ListDistributions2016_01_28"
// ListDistributionsRequest generates a request for the ListDistributions operation.
func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (req *request.Request, output *ListDistributionsOutput) {
op := &request.Operation{
Name: opListDistributions,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distribution",
Paginator: &request.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"DistributionList.NextMarker"},
LimitToken: "MaxItems",
TruncationToken: "DistributionList.IsTruncated",
},
}
if input == nil {
input = &ListDistributionsInput{}
}
req = c.newRequest(op, input, output)
output = &ListDistributionsOutput{}
req.Data = output
return
}
// List distributions.
func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDistributionsOutput, error) {
req, out := c.ListDistributionsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn func(p *ListDistributionsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListDistributionsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListDistributionsOutput), lastPage)
})
}
const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_01_28"
// ListDistributionsByWebACLIdRequest generates a request for the ListDistributionsByWebACLId operation.
func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributionsByWebACLIdInput) (req *request.Request, output *ListDistributionsByWebACLIdOutput) {
op := &request.Operation{
Name: opListDistributionsByWebACLId,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distributionsByWebACLId/{WebACLId}",
}
if input == nil {
input = &ListDistributionsByWebACLIdInput{}
}
req = c.newRequest(op, input, output)
output = &ListDistributionsByWebACLIdOutput{}
req.Data = output
return
}
// List the distributions that are associated with a specified AWS WAF web ACL.
func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebACLIdInput) (*ListDistributionsByWebACLIdOutput, error) {
req, out := c.ListDistributionsByWebACLIdRequest(input)
err := req.Send()
return out, err
}
const opListInvalidations = "ListInvalidations2016_01_28"
// ListInvalidationsRequest generates a request for the ListInvalidations operation.
func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (req *request.Request, output *ListInvalidationsOutput) {
op := &request.Operation{
Name: opListInvalidations,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation",
Paginator: &request.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"InvalidationList.NextMarker"},
LimitToken: "MaxItems",
TruncationToken: "InvalidationList.IsTruncated",
},
}
if input == nil {
input = &ListInvalidationsInput{}
}
req = c.newRequest(op, input, output)
output = &ListInvalidationsOutput{}
req.Data = output
return
}
// List invalidation batches.
func (c *CloudFront) ListInvalidations(input *ListInvalidationsInput) (*ListInvalidationsOutput, error) {
req, out := c.ListInvalidationsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn func(p *ListInvalidationsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListInvalidationsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListInvalidationsOutput), lastPage)
})
}
const opListStreamingDistributions = "ListStreamingDistributions2016_01_28"
// ListStreamingDistributionsRequest generates a request for the ListStreamingDistributions operation.
func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistributionsInput) (req *request.Request, output *ListStreamingDistributionsOutput) {
op := &request.Operation{
Name: opListStreamingDistributions,
HTTPMethod: "GET",
HTTPPath: "/2016-01-28/streaming-distribution",
Paginator: &request.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"StreamingDistributionList.NextMarker"},
LimitToken: "MaxItems",
TruncationToken: "StreamingDistributionList.IsTruncated",
},
}
if input == nil {
input = &ListStreamingDistributionsInput{}
}
req = c.newRequest(op, input, output)
output = &ListStreamingDistributionsOutput{}
req.Data = output
return
}
// List streaming distributions.
func (c *CloudFront) ListStreamingDistributions(input *ListStreamingDistributionsInput) (*ListStreamingDistributionsOutput, error) {
req, out := c.ListStreamingDistributionsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistributionsInput, fn func(p *ListStreamingDistributionsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListStreamingDistributionsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListStreamingDistributionsOutput), lastPage)
})
}
const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2016_01_28"
// UpdateCloudFrontOriginAccessIdentityRequest generates a request for the UpdateCloudFrontOriginAccessIdentity operation.
func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *UpdateCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opUpdateCloudFrontOriginAccessIdentity,
HTTPMethod: "PUT",
HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}/config",
}
if input == nil {
input = &UpdateCloudFrontOriginAccessIdentityInput{}
}
req = c.newRequest(op, input, output)
output = &UpdateCloudFrontOriginAccessIdentityOutput{}
req.Data = output
return
}
// Update an origin access identity.
func (c *CloudFront) UpdateCloudFrontOriginAccessIdentity(input *UpdateCloudFrontOriginAccessIdentityInput) (*UpdateCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input)
err := req.Send()
return out, err
}
const opUpdateDistribution = "UpdateDistribution2016_01_28"
// UpdateDistributionRequest generates a request for the UpdateDistribution operation.
func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) (req *request.Request, output *UpdateDistributionOutput) {
op := &request.Operation{
Name: opUpdateDistribution,
HTTPMethod: "PUT",
HTTPPath: "/2016-01-28/distribution/{Id}/config",
}
if input == nil {
input = &UpdateDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &UpdateDistributionOutput{}
req.Data = output
return
}
// Update a distribution.
func (c *CloudFront) UpdateDistribution(input *UpdateDistributionInput) (*UpdateDistributionOutput, error) {
req, out := c.UpdateDistributionRequest(input)
err := req.Send()
return out, err
}
const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_01_28"
// UpdateStreamingDistributionRequest generates a request for the UpdateStreamingDistribution operation.
func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDistributionInput) (req *request.Request, output *UpdateStreamingDistributionOutput) {
op := &request.Operation{
Name: opUpdateStreamingDistribution,
HTTPMethod: "PUT",
HTTPPath: "/2016-01-28/streaming-distribution/{Id}/config",
}
if input == nil {
input = &UpdateStreamingDistributionInput{}
}
req = c.newRequest(op, input, output)
output = &UpdateStreamingDistributionOutput{}
req.Data = output
return
}
// Update a streaming distribution.
func (c *CloudFront) UpdateStreamingDistribution(input *UpdateStreamingDistributionInput) (*UpdateStreamingDistributionOutput, error) {
req, out := c.UpdateStreamingDistributionRequest(input)
err := req.Send()
return out, err
}
// A complex type that lists the AWS accounts, if any, that you included in
// the TrustedSigners complex type for the default cache behavior or for any
// of the other cache behaviors for this distribution. These are accounts that
// you want to allow to create signed URLs for private content.
type ActiveTrustedSigners struct {
_ struct{} `type:"structure"`
// Each active trusted signer.
Enabled *bool `type:"boolean" required:"true"`
// A complex type that contains one Signer complex type for each unique trusted
// signer that is specified in the TrustedSigners complex type, including trusted
// signers in the default cache behavior and in all of the other cache behaviors.
Items []*Signer `locationNameList:"Signer" type:"list"`
// The number of unique trusted signers included in all cache behaviors. For
// example, if three cache behaviors all list the same three AWS accounts, the
// value of Quantity for ActiveTrustedSigners will be 3.
Quantity *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s ActiveTrustedSigners) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ActiveTrustedSigners) GoString() string {
return s.String()
}
// A complex type that contains information about CNAMEs (alternate domain names),
// if any, for this distribution.
type Aliases struct {
_ struct{} `type:"structure"`
// Optional: A complex type that contains CNAME elements, if any, for this distribution.
// If Quantity is 0, you can omit Items.
Items []*string `locationNameList:"CNAME" type:"list"`
// The number of CNAMEs, if any, for this distribution.
Quantity *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s Aliases) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Aliases) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Aliases) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Aliases"}
if s.Quantity == nil {
invalidParams.Add(request.NewErrParamRequired("Quantity"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A complex type that controls which HTTP methods CloudFront processes and
// forwards to your Amazon S3 bucket or your custom origin. There are three
// choices: - CloudFront forwards only GET and HEAD requests. - CloudFront forwards
// only GET, HEAD and OPTIONS requests. - CloudFront forwards GET, HEAD, OPTIONS,
// PUT, PATCH, POST, and DELETE requests. If you pick the third choice, you
// may need to restrict access to your Amazon S3 bucket or to your custom origin
// so users can't perform operations that you don't want them to. For example,
// you may not want users to have permission to delete objects from your origin.
type AllowedMethods struct {
_ struct{} `type:"structure"`
// A complex type that controls whether CloudFront caches the response to requests
// using the specified HTTP methods. There are two choices: - CloudFront caches
// responses to GET and HEAD requests. - CloudFront caches responses to GET,
// HEAD, and OPTIONS requests. If you pick the second choice for your S3 Origin,
// you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers
// and Origin headers for the responses to be cached correctly.
CachedMethods *CachedMethods `type:"structure"`
// A complex type that contains the HTTP methods that you want CloudFront to
// process and forward to your origin.
Items []*string `locationNameList:"Method" type:"list" required:"true"`
// The number of HTTP methods that you want CloudFront to forward to your origin.
// Valid values are 2 (for GET and HEAD requests), 3 (for GET, HEAD and OPTIONS
// requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE requests).
Quantity *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s AllowedMethods) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AllowedMethods) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AllowedMethods) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AllowedMethods"}
if s.Items == nil {
invalidParams.Add(request.NewErrParamRequired("Items"))
}
if s.Quantity == nil {
invalidParams.Add(request.NewErrParamRequired("Quantity"))
}
if s.CachedMethods != nil {
if err := s.CachedMethods.Validate(); err != nil {
invalidParams.AddNested("CachedMethods", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A complex type that describes how CloudFront processes requests. You can
// create up to 10 cache behaviors.You must create at least as many cache behaviors
// (including the default cache behavior) as you have origins if you want CloudFront
// to distribute objects from all of the origins. Each cache behavior specifies
// the one origin from which you want CloudFront to get objects. If you have
// two origins and only the default cache behavior, the default cache behavior
// will cause CloudFront to get objects from one of the origins, but the other
// origin will never be used. If you don't want to specify any cache behaviors,
// include only an empty CacheBehaviors element. Don't include an empty CacheBehavior
// element, or CloudFront returns a MalformedXML error. To delete all cache
// behaviors in an existing distribution, update the distribution configuration
// and include only an empty CacheBehaviors element. To add, change, or remove
// one or more cache behaviors, update the distribution configuration and specify
// all of the cache behaviors that you want to include in the updated distribution.
type CacheBehavior struct {
_ struct{} `type:"structure"`
// A complex type that controls which HTTP methods CloudFront processes and
// forwards to your Amazon S3 bucket or your custom origin. There are three
// choices: - CloudFront forwards only GET and HEAD requests. - CloudFront forwards
// only GET, HEAD and OPTIONS requests. - CloudFront forwards GET, HEAD, OPTIONS,
// PUT, PATCH, POST, and DELETE requests. If you pick the third choice, you
// may need to restrict access to your Amazon S3 bucket or to your custom origin
// so users can't perform operations that you don't want them to. For example,
// you may not want users to have permission to delete objects from your origin.
AllowedMethods *AllowedMethods `type:"structure"`
// Whether you want CloudFront to automatically compress content for web requests
// that include Accept-Encoding: gzip in the request header. If so, specify
// true; if not, specify false. CloudFront compresses files larger than 1000
// bytes and less than 1 megabyte for both Amazon S3 and custom origins. When
// a CloudFront edge location is unusually busy, some files might not be compressed.
// The value of the Content-Type header must be on the list of file types that
// CloudFront will compress. For the current list, see Serving Compressed Content
// (http://docs.aws.amazon.com/console/cloudfront/compressed-content) in the
// Amazon CloudFront Developer Guide. If you configure CloudFront to compress
// content, CloudFront removes the ETag response header from the objects that
// it compresses. The ETag header indicates that the version in a CloudFront
// edge cache is identical to the version on the origin server, but after compression
// the two versions are no longer identical. As a result, for compressed objects,
// CloudFront can't use the ETag header to determine whether an expired object
// in the CloudFront edge cache is still the latest version.
Compress *bool `type:"boolean"`
// If you don't configure your origin to add a Cache-Control max-age directive
// or an Expires header, DefaultTTL is the default amount of time (in seconds)
// that an object is in a CloudFront cache before CloudFront forwards another
// request to your origin to determine whether the object has been updated.
// The value that you specify applies only when your origin does not add HTTP
// headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires
// to objects. You can specify a value from 0 to 3,153,600,000 seconds (100
// years).
DefaultTTL *int64 `type:"long"`
// A complex type that specifies how CloudFront handles query strings, cookies
// and headers.
ForwardedValues *ForwardedValues `type:"structure" required:"true"`
// The maximum amount of time (in seconds) that an object is in a CloudFront
// cache before CloudFront forwards another request to your origin to determine
// whether the object has been updated. The value that you specify applies only
// when your origin adds HTTP headers such as Cache-Control max-age, Cache-Control
// s-maxage, and Expires to objects. You can specify a value from 0 to 3,153,600,000
// seconds (100 years).
MaxTTL *int64 `type:"long"`
// The minimum amount of time that you want objects to stay in CloudFront caches
// before CloudFront queries your origin to see whether the object has been
// updated.You can specify a value from 0 to 3,153,600,000 seconds (100 years).
MinTTL *int64 `type:"long" required:"true"`
// The pattern (for example, images/*.jpg) that specifies which requests you
// want this cache behavior to apply to. When CloudFront receives an end-user
// request, the requested path is compared with path patterns in the order in
// which cache behaviors are listed in the distribution. The path pattern for
// the default cache behavior is * and cannot be changed. If the request for
// an object does not match the path pattern for any cache behaviors, CloudFront
// applies the behavior in the default cache behavior.
PathPattern *string `type:"string" required:"true"`
// Indicates whether you want to distribute media files in Microsoft Smooth
// Streaming format using the origin that is associated with this cache behavior.
// If so, specify true; if not, specify false.
SmoothStreaming *bool `type:"boolean"`
// The value of ID for the origin that you want CloudFront to route requests
// to when a request matches the path pattern either for a cache behavior or
// for the default cache behavior.
TargetOriginId *string `type:"string" required:"true"`
// A complex type that specifies the AWS accounts, if any, that you want to
// allow to create signed URLs for private content. If you want to require signed
// URLs in requests for objects in the target origin that match the PathPattern
// for this cache behavior, specify true for Enabled, and specify the applicable
// values for Quantity and Items. For more information, go to Using a Signed
// URL to Serve Private Content in the Amazon CloudFront Developer Guide. If
// you don't want to require signed URLs in requests for objects that match
// PathPattern, specify false for Enabled and 0 for Quantity. Omit Items. To
// add, change, or remove one or more trusted signers, change Enabled to true
// (if it's currently false), change Quantity as applicable, and specify all
// of the trusted signers that you want to include in the updated distribution.
TrustedSigners *TrustedSigners `type:"structure" required:"true"`
// Use this element to specify the protocol that users can use to access the
// files in the origin specified by TargetOriginId when a request matches the
// path pattern in PathPattern. If you want CloudFront to allow end users to
// use any available protocol, specify allow-all. If you want CloudFront to
// require HTTPS, specify https. If you want CloudFront to respond to an HTTP
// request with an HTTP status code of 301 (Moved Permanently) and the HTTPS
// URL, specify redirect-to-https. The viewer then resubmits the request using
// the HTTPS URL.
ViewerProtocolPolicy *string `type:"string" required:"true" enum:"ViewerProtocolPolicy"`
}
// String returns the string representation
func (s CacheBehavior) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CacheBehavior) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CacheBehavior) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CacheBehavior"}
if s.ForwardedValues == nil {
invalidParams.Add(request.NewErrParamRequired("ForwardedValues"))
}
if s.MinTTL == nil {
invalidParams.Add(request.NewErrParamRequired("MinTTL"))
}
if s.PathPattern == nil {
invalidParams.Add(request.NewErrParamRequired("PathPattern"))
}
if s.TargetOriginId == nil {
invalidParams.Add(request.NewErrParamRequired("TargetOriginId"))
}
if s.TrustedSigners == nil {
invalidParams.Add(request.NewErrParamRequired("TrustedSigners"))
}
if s.ViewerProtocolPolicy == nil {
invalidParams.Add(request.NewErrParamRequired("ViewerProtocolPolicy"))
}
if s.AllowedMethods != nil {
if err := s.AllowedMethods.Validate(); err != nil {
invalidParams.AddNested("AllowedMethods", err.(request.ErrInvalidParams))
}
}
if s.ForwardedValues != nil {
if err := s.ForwardedValues.Validate(); err != nil {
invalidParams.AddNested("ForwardedValues", err.(request.ErrInvalidParams))
}
}
if s.TrustedSigners != nil {
if err := s.TrustedSigners.Validate(); err != nil {
invalidParams.AddNested("TrustedSigners", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A complex type that contains zero or more CacheBehavior elements.
type CacheBehaviors struct {
_ struct{} `type:"structure"`
// Optional: A complex type that contains cache behaviors for this distribution.
// If Quantity is 0, you can omit Items.
Items []*CacheBehavior `locationNameList:"CacheBehavior" type:"list"`
// The number of cache behaviors for this distribution.
Quantity *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s CacheBehaviors) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CacheBehaviors) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CacheBehaviors) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CacheBehaviors"}
if s.Quantity == nil {
invalidParams.Add(request.NewErrParamRequired("Quantity"))
}
if s.Items != nil {
for i, v := range s.Items {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams))