forked from cPu1/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
10441 lines (9155 loc) · 381 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 cloudfront
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"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 = "CreateCloudFrontOriginAccessIdentity2017_03_25"
// CreateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the
// client's request for the CreateCloudFrontOriginAccessIdentity operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateCloudFrontOriginAccessIdentity for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateCloudFrontOriginAccessIdentity method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateCloudFrontOriginAccessIdentityRequest method.
// req, resp := client.CreateCloudFrontOriginAccessIdentityRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity
func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *CreateCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opCreateCloudFrontOriginAccessIdentity,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/origin-access-identity/cloudfront",
}
if input == nil {
input = &CreateCloudFrontOriginAccessIdentityInput{}
}
output = &CreateCloudFrontOriginAccessIdentityOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCloudFrontOriginAccessIdentity API operation for Amazon CloudFront.
//
// Creates a new origin access identity. If you're using Amazon S3 for your
// origin, you can use an origin access identity to require users to access
// your content using a CloudFront URL instead of the Amazon S3 URL. For more
// information about how to use origin access identities, see Serving Private
// Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html)
// in the Amazon CloudFront Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateCloudFrontOriginAccessIdentity for usage and error information.
//
// Returned Error Codes:
// * ErrCodeOriginAccessIdentityAlreadyExists "OriginAccessIdentityAlreadyExists"
// If the CallerReference is a value you already sent in a previous request
// to create an identity but the content of the CloudFrontOriginAccessIdentityConfig
// is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
// error.
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeTooManyCloudFrontOriginAccessIdentities "TooManyCloudFrontOriginAccessIdentities"
// Processing your request would cause you to exceed the maximum number of origin
// access identities allowed.
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity
func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFrontOriginAccessIdentityInput) (*CreateCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input)
return out, req.Send()
}
// CreateCloudFrontOriginAccessIdentityWithContext is the same as CreateCloudFrontOriginAccessIdentity with the addition of
// the ability to pass a context and additional request options.
//
// See CreateCloudFrontOriginAccessIdentity for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *CreateCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*CreateCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateDistribution = "CreateDistribution2017_03_25"
// CreateDistributionRequest generates a "aws/request.Request" representing the
// client's request for the CreateDistribution operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateDistribution for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateDistribution method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateDistributionRequest method.
// req, resp := client.CreateDistributionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution
func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) (req *request.Request, output *CreateDistributionOutput) {
op := &request.Operation{
Name: opCreateDistribution,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/distribution",
}
if input == nil {
input = &CreateDistributionInput{}
}
output = &CreateDistributionOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateDistribution API operation for Amazon CloudFront.
//
// Creates a new web distribution. Send a POST request to the /CloudFront API
// version/distribution/distribution ID resource.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateDistribution for usage and error information.
//
// Returned Error Codes:
// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists"
//
// * ErrCodeDistributionAlreadyExists "DistributionAlreadyExists"
// The caller reference you attempted to create the distribution with is associated
// with another distribution.
//
// * ErrCodeInvalidOrigin "InvalidOrigin"
// The Amazon S3 origin server specified does not refer to a valid Amazon S3
// bucket.
//
// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity"
// The origin access identity is not valid or doesn't exist.
//
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners"
// Your request contains more trusted signers than are allowed per distribution.
//
// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist"
// One or more of your trusted signers do not exist.
//
// * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate"
//
// * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion"
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeTooManyDistributionCNAMEs "TooManyDistributionCNAMEs"
// Your request contains more CNAMEs than are allowed per distribution.
//
// * ErrCodeTooManyDistributions "TooManyDistributions"
// Processing your request would cause you to exceed the maximum number of distributions
// allowed.
//
// * ErrCodeInvalidDefaultRootObject "InvalidDefaultRootObject"
// The default root object file name is too big or contains an invalid character.
//
// * ErrCodeInvalidRelativePath "InvalidRelativePath"
// The relative path is too big, is not URL-encoded, or does not begin with
// a slash (/).
//
// * ErrCodeInvalidErrorCode "InvalidErrorCode"
//
// * ErrCodeInvalidResponseCode "InvalidResponseCode"
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeInvalidRequiredProtocol "InvalidRequiredProtocol"
// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS
// protocol in your request, or omit the RequiredProtocols element from your
// distribution configuration.
//
// * ErrCodeNoSuchOrigin "NoSuchOrigin"
// No origin exists with the specified Origin Id.
//
// * ErrCodeTooManyOrigins "TooManyOrigins"
// You cannot create more origins for the distribution.
//
// * ErrCodeTooManyCacheBehaviors "TooManyCacheBehaviors"
// You cannot create more cache behaviors for the distribution.
//
// * ErrCodeTooManyCookieNamesInWhiteList "TooManyCookieNamesInWhiteList"
// Your request contains more cookie names in the whitelist than are allowed
// per cache behavior.
//
// * ErrCodeInvalidForwardCookies "InvalidForwardCookies"
// Your request contains forward cookies option which doesn't match with the
// expectation for the whitelisted list of cookie names. Either list of cookie
// names has been specified when not allowed or list of cookie names is missing
// when expected.
//
// * ErrCodeTooManyHeadersInForwardedValues "TooManyHeadersInForwardedValues"
//
// * ErrCodeInvalidHeadersForS3Origin "InvalidHeadersForS3Origin"
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// * ErrCodeTooManyCertificates "TooManyCertificates"
// You cannot create anymore custom SSL/TLS certificates.
//
// * ErrCodeInvalidLocationCode "InvalidLocationCode"
//
// * ErrCodeInvalidGeoRestrictionParameter "InvalidGeoRestrictionParameter"
//
// * ErrCodeInvalidProtocolSettings "InvalidProtocolSettings"
// You cannot specify SSLv3 as the minimum protocol version if you only want
// to support only clients that support Server Name Indication (SNI).
//
// * ErrCodeInvalidTTLOrder "InvalidTTLOrder"
//
// * ErrCodeInvalidWebACLId "InvalidWebACLId"
//
// * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders"
//
// * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters"
//
// * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters"
//
// * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations"
// Processing your request would cause the maximum number of distributions with
// Lambda function associations per owner to be exceeded.
//
// * ErrCodeTooManyLambdaFunctionAssociations "TooManyLambdaFunctionAssociations"
// Your request contains more Lambda function associations than are allowed
// per distribution.
//
// * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation"
// The specified Lambda function association is invalid.
//
// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout"
//
// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout"
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution
func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*CreateDistributionOutput, error) {
req, out := c.CreateDistributionRequest(input)
return out, req.Send()
}
// CreateDistributionWithContext is the same as CreateDistribution with the addition of
// the ability to pass a context and additional request options.
//
// See CreateDistribution for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateDistributionWithContext(ctx aws.Context, input *CreateDistributionInput, opts ...request.Option) (*CreateDistributionOutput, error) {
req, out := c.CreateDistributionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateDistributionWithTags = "CreateDistributionWithTags2017_03_25"
// CreateDistributionWithTagsRequest generates a "aws/request.Request" representing the
// client's request for the CreateDistributionWithTags operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateDistributionWithTags for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateDistributionWithTags method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateDistributionWithTagsRequest method.
// req, resp := client.CreateDistributionWithTagsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags
func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistributionWithTagsInput) (req *request.Request, output *CreateDistributionWithTagsOutput) {
op := &request.Operation{
Name: opCreateDistributionWithTags,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/distribution?WithTags",
}
if input == nil {
input = &CreateDistributionWithTagsInput{}
}
output = &CreateDistributionWithTagsOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateDistributionWithTags API operation for Amazon CloudFront.
//
// Create a new distribution with tags.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateDistributionWithTags for usage and error information.
//
// Returned Error Codes:
// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists"
//
// * ErrCodeDistributionAlreadyExists "DistributionAlreadyExists"
// The caller reference you attempted to create the distribution with is associated
// with another distribution.
//
// * ErrCodeInvalidOrigin "InvalidOrigin"
// The Amazon S3 origin server specified does not refer to a valid Amazon S3
// bucket.
//
// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity"
// The origin access identity is not valid or doesn't exist.
//
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners"
// Your request contains more trusted signers than are allowed per distribution.
//
// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist"
// One or more of your trusted signers do not exist.
//
// * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate"
//
// * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion"
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeTooManyDistributionCNAMEs "TooManyDistributionCNAMEs"
// Your request contains more CNAMEs than are allowed per distribution.
//
// * ErrCodeTooManyDistributions "TooManyDistributions"
// Processing your request would cause you to exceed the maximum number of distributions
// allowed.
//
// * ErrCodeInvalidDefaultRootObject "InvalidDefaultRootObject"
// The default root object file name is too big or contains an invalid character.
//
// * ErrCodeInvalidRelativePath "InvalidRelativePath"
// The relative path is too big, is not URL-encoded, or does not begin with
// a slash (/).
//
// * ErrCodeInvalidErrorCode "InvalidErrorCode"
//
// * ErrCodeInvalidResponseCode "InvalidResponseCode"
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeInvalidRequiredProtocol "InvalidRequiredProtocol"
// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS
// protocol in your request, or omit the RequiredProtocols element from your
// distribution configuration.
//
// * ErrCodeNoSuchOrigin "NoSuchOrigin"
// No origin exists with the specified Origin Id.
//
// * ErrCodeTooManyOrigins "TooManyOrigins"
// You cannot create more origins for the distribution.
//
// * ErrCodeTooManyCacheBehaviors "TooManyCacheBehaviors"
// You cannot create more cache behaviors for the distribution.
//
// * ErrCodeTooManyCookieNamesInWhiteList "TooManyCookieNamesInWhiteList"
// Your request contains more cookie names in the whitelist than are allowed
// per cache behavior.
//
// * ErrCodeInvalidForwardCookies "InvalidForwardCookies"
// Your request contains forward cookies option which doesn't match with the
// expectation for the whitelisted list of cookie names. Either list of cookie
// names has been specified when not allowed or list of cookie names is missing
// when expected.
//
// * ErrCodeTooManyHeadersInForwardedValues "TooManyHeadersInForwardedValues"
//
// * ErrCodeInvalidHeadersForS3Origin "InvalidHeadersForS3Origin"
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// * ErrCodeTooManyCertificates "TooManyCertificates"
// You cannot create anymore custom SSL/TLS certificates.
//
// * ErrCodeInvalidLocationCode "InvalidLocationCode"
//
// * ErrCodeInvalidGeoRestrictionParameter "InvalidGeoRestrictionParameter"
//
// * ErrCodeInvalidProtocolSettings "InvalidProtocolSettings"
// You cannot specify SSLv3 as the minimum protocol version if you only want
// to support only clients that support Server Name Indication (SNI).
//
// * ErrCodeInvalidTTLOrder "InvalidTTLOrder"
//
// * ErrCodeInvalidWebACLId "InvalidWebACLId"
//
// * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders"
//
// * ErrCodeInvalidTagging "InvalidTagging"
//
// * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters"
//
// * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters"
//
// * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations"
// Processing your request would cause the maximum number of distributions with
// Lambda function associations per owner to be exceeded.
//
// * ErrCodeTooManyLambdaFunctionAssociations "TooManyLambdaFunctionAssociations"
// Your request contains more Lambda function associations than are allowed
// per distribution.
//
// * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation"
// The specified Lambda function association is invalid.
//
// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout"
//
// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout"
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags
func (c *CloudFront) CreateDistributionWithTags(input *CreateDistributionWithTagsInput) (*CreateDistributionWithTagsOutput, error) {
req, out := c.CreateDistributionWithTagsRequest(input)
return out, req.Send()
}
// CreateDistributionWithTagsWithContext is the same as CreateDistributionWithTags with the addition of
// the ability to pass a context and additional request options.
//
// See CreateDistributionWithTags for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateDistributionWithTagsWithContext(ctx aws.Context, input *CreateDistributionWithTagsInput, opts ...request.Option) (*CreateDistributionWithTagsOutput, error) {
req, out := c.CreateDistributionWithTagsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateInvalidation = "CreateInvalidation2017_03_25"
// CreateInvalidationRequest generates a "aws/request.Request" representing the
// client's request for the CreateInvalidation operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateInvalidation for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateInvalidation method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateInvalidationRequest method.
// req, resp := client.CreateInvalidationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation
func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) (req *request.Request, output *CreateInvalidationOutput) {
op := &request.Operation{
Name: opCreateInvalidation,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation",
}
if input == nil {
input = &CreateInvalidationInput{}
}
output = &CreateInvalidationOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateInvalidation API operation for Amazon CloudFront.
//
// Create a new invalidation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateInvalidation for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeNoSuchDistribution "NoSuchDistribution"
// The specified distribution does not exist.
//
// * ErrCodeBatchTooLarge "BatchTooLarge"
//
// * ErrCodeTooManyInvalidationsInProgress "TooManyInvalidationsInProgress"
// You have exceeded the maximum number of allowable InProgress invalidation
// batch requests, or invalidation objects.
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation
func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*CreateInvalidationOutput, error) {
req, out := c.CreateInvalidationRequest(input)
return out, req.Send()
}
// CreateInvalidationWithContext is the same as CreateInvalidation with the addition of
// the ability to pass a context and additional request options.
//
// See CreateInvalidation for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateInvalidationWithContext(ctx aws.Context, input *CreateInvalidationInput, opts ...request.Option) (*CreateInvalidationOutput, error) {
req, out := c.CreateInvalidationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateStreamingDistribution = "CreateStreamingDistribution2017_03_25"
// CreateStreamingDistributionRequest generates a "aws/request.Request" representing the
// client's request for the CreateStreamingDistribution operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateStreamingDistribution for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateStreamingDistribution method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateStreamingDistributionRequest method.
// req, resp := client.CreateStreamingDistributionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution
func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDistributionInput) (req *request.Request, output *CreateStreamingDistributionOutput) {
op := &request.Operation{
Name: opCreateStreamingDistribution,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/streaming-distribution",
}
if input == nil {
input = &CreateStreamingDistributionInput{}
}
output = &CreateStreamingDistributionOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateStreamingDistribution API operation for Amazon CloudFront.
//
// Creates a new RMTP distribution. An RTMP distribution is similar to a web
// distribution, but an RTMP distribution streams media files using the Adobe
// Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP.
//
// To create a new web distribution, submit a POST request to the CloudFront
// API version/distribution resource. The request body must include a document
// with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig
// element and returns other information about the RTMP distribution.
//
// To get the status of your request, use the GET StreamingDistribution API
// action. When the value of Enabled is true and the value of Status is Deployed,
// your distribution is ready. A distribution usually deploys in less than 15
// minutes.
//
// For more information about web distributions, see Working with RTMP Distributions
// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp.html)
// in the Amazon CloudFront Developer Guide.
//
// Beginning with the 2012-05-05 version of the CloudFront API, we made substantial
// changes to the format of the XML document that you include in the request
// body when you create or update a web distribution or an RTMP distribution,
// and when you invalidate objects. With previous versions of the API, we discovered
// that it was too easy to accidentally delete one or more values for an element
// that accepts multiple values, for example, CNAMEs and trusted signers. Our
// changes for the 2012-05-05 release are intended to prevent these accidental
// deletions and to notify you when there's a mismatch between the number of
// values you say you're specifying in the Quantity element and the number of
// values specified.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateStreamingDistribution for usage and error information.
//
// Returned Error Codes:
// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists"
//
// * ErrCodeStreamingDistributionAlreadyExists "StreamingDistributionAlreadyExists"
//
// * ErrCodeInvalidOrigin "InvalidOrigin"
// The Amazon S3 origin server specified does not refer to a valid Amazon S3
// bucket.
//
// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity"
// The origin access identity is not valid or doesn't exist.
//
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners"
// Your request contains more trusted signers than are allowed per distribution.
//
// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist"
// One or more of your trusted signers do not exist.
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeTooManyStreamingDistributionCNAMEs "TooManyStreamingDistributionCNAMEs"
//
// * ErrCodeTooManyStreamingDistributions "TooManyStreamingDistributions"
// Processing your request would cause you to exceed the maximum number of streaming
// distributions allowed.
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution
func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistributionInput) (*CreateStreamingDistributionOutput, error) {
req, out := c.CreateStreamingDistributionRequest(input)
return out, req.Send()
}
// CreateStreamingDistributionWithContext is the same as CreateStreamingDistribution with the addition of
// the ability to pass a context and additional request options.
//
// See CreateStreamingDistribution for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateStreamingDistributionWithContext(ctx aws.Context, input *CreateStreamingDistributionInput, opts ...request.Option) (*CreateStreamingDistributionOutput, error) {
req, out := c.CreateStreamingDistributionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2017_03_25"
// CreateStreamingDistributionWithTagsRequest generates a "aws/request.Request" representing the
// client's request for the CreateStreamingDistributionWithTags operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateStreamingDistributionWithTags for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateStreamingDistributionWithTags method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateStreamingDistributionWithTagsRequest method.
// req, resp := client.CreateStreamingDistributionWithTagsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags
func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStreamingDistributionWithTagsInput) (req *request.Request, output *CreateStreamingDistributionWithTagsOutput) {
op := &request.Operation{
Name: opCreateStreamingDistributionWithTags,
HTTPMethod: "POST",
HTTPPath: "/2017-03-25/streaming-distribution?WithTags",
}
if input == nil {
input = &CreateStreamingDistributionWithTagsInput{}
}
output = &CreateStreamingDistributionWithTagsOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateStreamingDistributionWithTags API operation for Amazon CloudFront.
//
// Create a new streaming distribution with tags.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation CreateStreamingDistributionWithTags for usage and error information.
//
// Returned Error Codes:
// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists"
//
// * ErrCodeStreamingDistributionAlreadyExists "StreamingDistributionAlreadyExists"
//
// * ErrCodeInvalidOrigin "InvalidOrigin"
// The Amazon S3 origin server specified does not refer to a valid Amazon S3
// bucket.
//
// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity"
// The origin access identity is not valid or doesn't exist.
//
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners"
// Your request contains more trusted signers than are allowed per distribution.
//
// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist"
// One or more of your trusted signers do not exist.
//
// * ErrCodeMissingBody "MissingBody"
// This operation requires a body. Ensure that the body is present and the Content-Type
// header is set.
//
// * ErrCodeTooManyStreamingDistributionCNAMEs "TooManyStreamingDistributionCNAMEs"
//
// * ErrCodeTooManyStreamingDistributions "TooManyStreamingDistributions"
// Processing your request would cause you to exceed the maximum number of streaming
// distributions allowed.
//
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeInconsistentQuantities "InconsistentQuantities"
// The value of Quantity and the size of Items do not match.
//
// * ErrCodeInvalidTagging "InvalidTagging"
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags
func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) {
req, out := c.CreateStreamingDistributionWithTagsRequest(input)
return out, req.Send()
}
// CreateStreamingDistributionWithTagsWithContext is the same as CreateStreamingDistributionWithTags with the addition of
// the ability to pass a context and additional request options.
//
// See CreateStreamingDistributionWithTags for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) CreateStreamingDistributionWithTagsWithContext(ctx aws.Context, input *CreateStreamingDistributionWithTagsInput, opts ...request.Option) (*CreateStreamingDistributionWithTagsOutput, error) {
req, out := c.CreateStreamingDistributionWithTagsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2017_03_25"
// DeleteCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCloudFrontOriginAccessIdentity operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DeleteCloudFrontOriginAccessIdentity for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteCloudFrontOriginAccessIdentity method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteCloudFrontOriginAccessIdentityRequest method.
// req, resp := client.DeleteCloudFrontOriginAccessIdentityRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCloudFrontOriginAccessIdentityInput) (req *request.Request, output *DeleteCloudFrontOriginAccessIdentityOutput) {
op := &request.Operation{
Name: opDeleteCloudFrontOriginAccessIdentity,
HTTPMethod: "DELETE",
HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}",
}
if input == nil {
input = &DeleteCloudFrontOriginAccessIdentityInput{}
}
output = &DeleteCloudFrontOriginAccessIdentityOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteCloudFrontOriginAccessIdentity API operation for Amazon CloudFront.
//
// Delete an origin access identity.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation DeleteCloudFrontOriginAccessIdentity for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion"
// The If-Match version is missing or not valid for the distribution.
//
// * ErrCodeNoSuchCloudFrontOriginAccessIdentity "NoSuchCloudFrontOriginAccessIdentity"
// The specified origin access identity does not exist.
//
// * ErrCodePreconditionFailed "PreconditionFailed"
// The precondition given in one or more of the request-header fields evaluated
// to false.
//
// * ErrCodeOriginAccessIdentityInUse "OriginAccessIdentityInUse"
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input)
return out, req.Send()
}
// DeleteCloudFrontOriginAccessIdentityWithContext is the same as DeleteCloudFrontOriginAccessIdentity with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCloudFrontOriginAccessIdentity for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *DeleteCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*DeleteCloudFrontOriginAccessIdentityOutput, error) {
req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteDistribution = "DeleteDistribution2017_03_25"
// DeleteDistributionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDistribution operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DeleteDistribution for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteDistribution method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteDistributionRequest method.
// req, resp := client.DeleteDistributionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistribution
func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) (req *request.Request, output *DeleteDistributionOutput) {
op := &request.Operation{
Name: opDeleteDistribution,
HTTPMethod: "DELETE",
HTTPPath: "/2017-03-25/distribution/{Id}",
}
if input == nil {
input = &DeleteDistributionInput{}
}
output = &DeleteDistributionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)