forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
1764 lines (1550 loc) · 59.7 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 mediastore
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opCreateContainer = "CreateContainer"
// CreateContainerRequest generates a "aws/request.Request" representing the
// client's request for the CreateContainer operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateContainer for more information on using the CreateContainer
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateContainerRequest method.
// req, resp := client.CreateContainerRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/CreateContainer
func (c *MediaStore) CreateContainerRequest(input *CreateContainerInput) (req *request.Request, output *CreateContainerOutput) {
op := &request.Operation{
Name: opCreateContainer,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateContainerInput{}
}
output = &CreateContainerOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateContainer API operation for AWS Elemental MediaStore.
//
// Creates a storage container to hold objects. A container is similar to a
// bucket in the Amazon S3 service.
//
// 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 AWS Elemental MediaStore's
// API operation CreateContainer for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// A service limit has been exceeded.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/CreateContainer
func (c *MediaStore) CreateContainer(input *CreateContainerInput) (*CreateContainerOutput, error) {
req, out := c.CreateContainerRequest(input)
return out, req.Send()
}
// CreateContainerWithContext is the same as CreateContainer with the addition of
// the ability to pass a context and additional request options.
//
// See CreateContainer 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 *MediaStore) CreateContainerWithContext(ctx aws.Context, input *CreateContainerInput, opts ...request.Option) (*CreateContainerOutput, error) {
req, out := c.CreateContainerRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteContainer = "DeleteContainer"
// DeleteContainerRequest generates a "aws/request.Request" representing the
// client's request for the DeleteContainer operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteContainer for more information on using the DeleteContainer
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteContainerRequest method.
// req, resp := client.DeleteContainerRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer
func (c *MediaStore) DeleteContainerRequest(input *DeleteContainerInput) (req *request.Request, output *DeleteContainerOutput) {
op := &request.Operation{
Name: opDeleteContainer,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteContainerInput{}
}
output = &DeleteContainerOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteContainer API operation for AWS Elemental MediaStore.
//
// Deletes the specified container. Before you make a DeleteContainer request,
// delete any objects in the container or in any folders in the container. You
// can delete only empty containers.
//
// 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 AWS Elemental MediaStore's
// API operation DeleteContainer for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer
func (c *MediaStore) DeleteContainer(input *DeleteContainerInput) (*DeleteContainerOutput, error) {
req, out := c.DeleteContainerRequest(input)
return out, req.Send()
}
// DeleteContainerWithContext is the same as DeleteContainer with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteContainer 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 *MediaStore) DeleteContainerWithContext(ctx aws.Context, input *DeleteContainerInput, opts ...request.Option) (*DeleteContainerOutput, error) {
req, out := c.DeleteContainerRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteContainerPolicy = "DeleteContainerPolicy"
// DeleteContainerPolicyRequest generates a "aws/request.Request" representing the
// client's request for the DeleteContainerPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteContainerPolicy for more information on using the DeleteContainerPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteContainerPolicyRequest method.
// req, resp := client.DeleteContainerPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainerPolicy
func (c *MediaStore) DeleteContainerPolicyRequest(input *DeleteContainerPolicyInput) (req *request.Request, output *DeleteContainerPolicyOutput) {
op := &request.Operation{
Name: opDeleteContainerPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteContainerPolicyInput{}
}
output = &DeleteContainerPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteContainerPolicy API operation for AWS Elemental MediaStore.
//
// Deletes the access policy that is associated with the specified container.
//
// 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 AWS Elemental MediaStore's
// API operation DeleteContainerPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodePolicyNotFoundException "PolicyNotFoundException"
// Could not perform an operation on a policy that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainerPolicy
func (c *MediaStore) DeleteContainerPolicy(input *DeleteContainerPolicyInput) (*DeleteContainerPolicyOutput, error) {
req, out := c.DeleteContainerPolicyRequest(input)
return out, req.Send()
}
// DeleteContainerPolicyWithContext is the same as DeleteContainerPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteContainerPolicy 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 *MediaStore) DeleteContainerPolicyWithContext(ctx aws.Context, input *DeleteContainerPolicyInput, opts ...request.Option) (*DeleteContainerPolicyOutput, error) {
req, out := c.DeleteContainerPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCorsPolicy = "DeleteCorsPolicy"
// DeleteCorsPolicyRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCorsPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteCorsPolicy for more information on using the DeleteCorsPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteCorsPolicyRequest method.
// req, resp := client.DeleteCorsPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteCorsPolicy
func (c *MediaStore) DeleteCorsPolicyRequest(input *DeleteCorsPolicyInput) (req *request.Request, output *DeleteCorsPolicyOutput) {
op := &request.Operation{
Name: opDeleteCorsPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteCorsPolicyInput{}
}
output = &DeleteCorsPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteCorsPolicy API operation for AWS Elemental MediaStore.
//
// Deletes the cross-origin resource sharing (CORS) configuration information
// that is set for the container.
//
// To use this operation, you must have permission to perform the MediaStore:DeleteCorsPolicy
// action. The container owner has this permission by default and can grant
// this permission to others.
//
// 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 AWS Elemental MediaStore's
// API operation DeleteCorsPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeCorsPolicyNotFoundException "CorsPolicyNotFoundException"
// Could not perform an operation on a policy that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteCorsPolicy
func (c *MediaStore) DeleteCorsPolicy(input *DeleteCorsPolicyInput) (*DeleteCorsPolicyOutput, error) {
req, out := c.DeleteCorsPolicyRequest(input)
return out, req.Send()
}
// DeleteCorsPolicyWithContext is the same as DeleteCorsPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCorsPolicy 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 *MediaStore) DeleteCorsPolicyWithContext(ctx aws.Context, input *DeleteCorsPolicyInput, opts ...request.Option) (*DeleteCorsPolicyOutput, error) {
req, out := c.DeleteCorsPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeContainer = "DescribeContainer"
// DescribeContainerRequest generates a "aws/request.Request" representing the
// client's request for the DescribeContainer operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeContainer for more information on using the DescribeContainer
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DescribeContainerRequest method.
// req, resp := client.DescribeContainerRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DescribeContainer
func (c *MediaStore) DescribeContainerRequest(input *DescribeContainerInput) (req *request.Request, output *DescribeContainerOutput) {
op := &request.Operation{
Name: opDescribeContainer,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeContainerInput{}
}
output = &DescribeContainerOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeContainer API operation for AWS Elemental MediaStore.
//
// Retrieves the properties of the requested container. This request is commonly
// used to retrieve the endpoint of a container. An endpoint is a value assigned
// by the service when a new container is created. A container's endpoint does
// not change after it has been assigned. The DescribeContainer request returns
// a single Container object based on ContainerName. To return all Container
// objects that are associated with a specified AWS account, use ListContainers.
//
// 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 AWS Elemental MediaStore's
// API operation DescribeContainer for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DescribeContainer
func (c *MediaStore) DescribeContainer(input *DescribeContainerInput) (*DescribeContainerOutput, error) {
req, out := c.DescribeContainerRequest(input)
return out, req.Send()
}
// DescribeContainerWithContext is the same as DescribeContainer with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeContainer 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 *MediaStore) DescribeContainerWithContext(ctx aws.Context, input *DescribeContainerInput, opts ...request.Option) (*DescribeContainerOutput, error) {
req, out := c.DescribeContainerRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetContainerPolicy = "GetContainerPolicy"
// GetContainerPolicyRequest generates a "aws/request.Request" representing the
// client's request for the GetContainerPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetContainerPolicy for more information on using the GetContainerPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetContainerPolicyRequest method.
// req, resp := client.GetContainerPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetContainerPolicy
func (c *MediaStore) GetContainerPolicyRequest(input *GetContainerPolicyInput) (req *request.Request, output *GetContainerPolicyOutput) {
op := &request.Operation{
Name: opGetContainerPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetContainerPolicyInput{}
}
output = &GetContainerPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// GetContainerPolicy API operation for AWS Elemental MediaStore.
//
// Retrieves the access policy for the specified container. For information
// about the data that is included in an access policy, see the AWS Identity
// and Access Management User Guide (https://aws.amazon.com/documentation/iam/).
//
// 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 AWS Elemental MediaStore's
// API operation GetContainerPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodePolicyNotFoundException "PolicyNotFoundException"
// Could not perform an operation on a policy that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetContainerPolicy
func (c *MediaStore) GetContainerPolicy(input *GetContainerPolicyInput) (*GetContainerPolicyOutput, error) {
req, out := c.GetContainerPolicyRequest(input)
return out, req.Send()
}
// GetContainerPolicyWithContext is the same as GetContainerPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See GetContainerPolicy 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 *MediaStore) GetContainerPolicyWithContext(ctx aws.Context, input *GetContainerPolicyInput, opts ...request.Option) (*GetContainerPolicyOutput, error) {
req, out := c.GetContainerPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetCorsPolicy = "GetCorsPolicy"
// GetCorsPolicyRequest generates a "aws/request.Request" representing the
// client's request for the GetCorsPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetCorsPolicy for more information on using the GetCorsPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetCorsPolicyRequest method.
// req, resp := client.GetCorsPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetCorsPolicy
func (c *MediaStore) GetCorsPolicyRequest(input *GetCorsPolicyInput) (req *request.Request, output *GetCorsPolicyOutput) {
op := &request.Operation{
Name: opGetCorsPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCorsPolicyInput{}
}
output = &GetCorsPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// GetCorsPolicy API operation for AWS Elemental MediaStore.
//
// Returns the cross-origin resource sharing (CORS) configuration information
// that is set for the container.
//
// To use this operation, you must have permission to perform the MediaStore:GetCorsPolicy
// action. By default, the container owner has this permission and can grant
// it to others.
//
// 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 AWS Elemental MediaStore's
// API operation GetCorsPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeCorsPolicyNotFoundException "CorsPolicyNotFoundException"
// Could not perform an operation on a policy that does not exist.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetCorsPolicy
func (c *MediaStore) GetCorsPolicy(input *GetCorsPolicyInput) (*GetCorsPolicyOutput, error) {
req, out := c.GetCorsPolicyRequest(input)
return out, req.Send()
}
// GetCorsPolicyWithContext is the same as GetCorsPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See GetCorsPolicy 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 *MediaStore) GetCorsPolicyWithContext(ctx aws.Context, input *GetCorsPolicyInput, opts ...request.Option) (*GetCorsPolicyOutput, error) {
req, out := c.GetCorsPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListContainers = "ListContainers"
// ListContainersRequest generates a "aws/request.Request" representing the
// client's request for the ListContainers operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListContainers for more information on using the ListContainers
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListContainersRequest method.
// req, resp := client.ListContainersRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers
func (c *MediaStore) ListContainersRequest(input *ListContainersInput) (req *request.Request, output *ListContainersOutput) {
op := &request.Operation{
Name: opListContainers,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListContainersInput{}
}
output = &ListContainersOutput{}
req = c.newRequest(op, input, output)
return
}
// ListContainers API operation for AWS Elemental MediaStore.
//
// Lists the properties of all containers in AWS Elemental MediaStore.
//
// You can query to receive all the containers in one response. Or you can include
// the MaxResults parameter to receive a limited number of containers in each
// response. In this case, the response includes a token. To get the next set
// of containers, send the command again, this time with the NextToken parameter
// (with the returned token as its value). The next set of responses appears,
// with a token if there are still more containers to receive.
//
// See also DescribeContainer, which gets the properties of one container.
//
// 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 AWS Elemental MediaStore's
// API operation ListContainers for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers
func (c *MediaStore) ListContainers(input *ListContainersInput) (*ListContainersOutput, error) {
req, out := c.ListContainersRequest(input)
return out, req.Send()
}
// ListContainersWithContext is the same as ListContainers with the addition of
// the ability to pass a context and additional request options.
//
// See ListContainers 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 *MediaStore) ListContainersWithContext(ctx aws.Context, input *ListContainersInput, opts ...request.Option) (*ListContainersOutput, error) {
req, out := c.ListContainersRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutContainerPolicy = "PutContainerPolicy"
// PutContainerPolicyRequest generates a "aws/request.Request" representing the
// client's request for the PutContainerPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutContainerPolicy for more information on using the PutContainerPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutContainerPolicyRequest method.
// req, resp := client.PutContainerPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutContainerPolicy
func (c *MediaStore) PutContainerPolicyRequest(input *PutContainerPolicyInput) (req *request.Request, output *PutContainerPolicyOutput) {
op := &request.Operation{
Name: opPutContainerPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutContainerPolicyInput{}
}
output = &PutContainerPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// PutContainerPolicy API operation for AWS Elemental MediaStore.
//
// Creates an access policy for the specified container to restrict the users
// and clients that can access it. For information about the data that is included
// in an access policy, see the AWS Identity and Access Management User Guide
// (https://aws.amazon.com/documentation/iam/).
//
// For this release of the REST API, you can create only one policy for a container.
// If you enter PutContainerPolicy twice, the second command modifies the existing
// policy.
//
// 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 AWS Elemental MediaStore's
// API operation PutContainerPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutContainerPolicy
func (c *MediaStore) PutContainerPolicy(input *PutContainerPolicyInput) (*PutContainerPolicyOutput, error) {
req, out := c.PutContainerPolicyRequest(input)
return out, req.Send()
}
// PutContainerPolicyWithContext is the same as PutContainerPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See PutContainerPolicy 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 *MediaStore) PutContainerPolicyWithContext(ctx aws.Context, input *PutContainerPolicyInput, opts ...request.Option) (*PutContainerPolicyOutput, error) {
req, out := c.PutContainerPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutCorsPolicy = "PutCorsPolicy"
// PutCorsPolicyRequest generates a "aws/request.Request" representing the
// client's request for the PutCorsPolicy operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutCorsPolicy for more information on using the PutCorsPolicy
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutCorsPolicyRequest method.
// req, resp := client.PutCorsPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy
func (c *MediaStore) PutCorsPolicyRequest(input *PutCorsPolicyInput) (req *request.Request, output *PutCorsPolicyOutput) {
op := &request.Operation{
Name: opPutCorsPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutCorsPolicyInput{}
}
output = &PutCorsPolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// PutCorsPolicy API operation for AWS Elemental MediaStore.
//
// Sets the cross-origin resource sharing (CORS) configuration on a container
// so that the container can service cross-origin requests. For example, you
// might want to enable a request whose origin is http://www.example.com to
// access your AWS Elemental MediaStore container at my.example.container.com
// by using the browser's XMLHttpRequest capability.
//
// To enable CORS on a container, you attach a CORS policy to the container.
// In the CORS policy, you configure rules that identify origins and the HTTP
// methods that can be executed on your container. The policy can contain up
// to 398,000 characters. You can add up to 100 rules to a CORS policy. If more
// than one rule applies, the service uses the first applicable rule listed.
//
// 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 AWS Elemental MediaStore's
// API operation PutCorsPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeContainerNotFoundException "ContainerNotFoundException"
// Could not perform an operation on a container that does not exist.
//
// * ErrCodeContainerInUseException "ContainerInUseException"
// Resource already exists or is being updated.
//
// * ErrCodeInternalServerError "InternalServerError"
// The service is temporarily unavailable.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy
func (c *MediaStore) PutCorsPolicy(input *PutCorsPolicyInput) (*PutCorsPolicyOutput, error) {
req, out := c.PutCorsPolicyRequest(input)
return out, req.Send()
}
// PutCorsPolicyWithContext is the same as PutCorsPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See PutCorsPolicy 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 *MediaStore) PutCorsPolicyWithContext(ctx aws.Context, input *PutCorsPolicyInput, opts ...request.Option) (*PutCorsPolicyOutput, error) {
req, out := c.PutCorsPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// This section describes operations that you can perform on an AWS Elemental
// MediaStore container.
type Container struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the container. The ARN has the following
// format:
//
// arn:aws:<region>:<account that owns this container>:container/<name of container>
//
// For example: arn:aws:mediastore:us-west-2:111122223333:container/movies
ARN *string `min:"1" type:"string"`
// Unix timestamp.
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// The DNS endpoint of the container. Use the endpoint to identify the specific
// container when sending requests to the data plane. The service assigns this
// value when the container is created. Once the value has been assigned, it
// does not change.
Endpoint *string `min:"1" type:"string"`
// The name of the container.
Name *string `min:"1" type:"string"`
// The status of container creation or deletion. The status is one of the following:
// CREATING, ACTIVE, or DELETING. While the service is creating the container,
// the status is CREATING. When the endpoint is available, the status changes
// to ACTIVE.
Status *string `min:"1" type:"string" enum:"ContainerStatus"`
}
// String returns the string representation
func (s Container) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Container) GoString() string {
return s.String()
}
// SetARN sets the ARN field's value.
func (s *Container) SetARN(v string) *Container {
s.ARN = &v
return s
}
// SetCreationTime sets the CreationTime field's value.
func (s *Container) SetCreationTime(v time.Time) *Container {
s.CreationTime = &v
return s
}
// SetEndpoint sets the Endpoint field's value.
func (s *Container) SetEndpoint(v string) *Container {
s.Endpoint = &v
return s
}
// SetName sets the Name field's value.
func (s *Container) SetName(v string) *Container {
s.Name = &v
return s
}
// SetStatus sets the Status field's value.
func (s *Container) SetStatus(v string) *Container {
s.Status = &v
return s
}
// A rule for a CORS policy. You can add up to 100 rules to a CORS policy. If
// more than one rule applies, the service uses the first applicable rule listed.
type CorsRule struct {
_ struct{} `type:"structure"`
// Specifies which headers are allowed in a preflight OPTIONS request through
// the Access-Control-Request-Headers header. Each header name that is specified
// in Access-Control-Request-Headers must have a corresponding entry in the
// rule. Only the headers that were requested are sent back.
//
// This element can contain only one wildcard character (*).
AllowedHeaders []*string `type:"list"`
// Identifies an HTTP method that the origin that is specified in the rule is
// allowed to execute.
//
// Each CORS rule must contain at least one AllowedMethod and one AllowedOrigin