forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
3723 lines (2984 loc) · 116 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 mediapackage
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
const opCreateChannel = "CreateChannel"
// CreateChannelRequest is a API request type for the CreateChannel API operation.
type CreateChannelRequest struct {
*aws.Request
Input *CreateChannelInput
Copy func(*CreateChannelInput) CreateChannelRequest
}
// Send marshals and sends the CreateChannel API request.
func (r CreateChannelRequest) Send() (*CreateChannelOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateChannelOutput), nil
}
// CreateChannelRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Creates a new Channel.
//
// // Example sending a request using the CreateChannelRequest method.
// req := client.CreateChannelRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateChannel
func (c *MediaPackage) CreateChannelRequest(input *CreateChannelInput) CreateChannelRequest {
op := &aws.Operation{
Name: opCreateChannel,
HTTPMethod: "POST",
HTTPPath: "/channels",
}
if input == nil {
input = &CreateChannelInput{}
}
output := &CreateChannelOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateChannelRequest{Request: req, Input: input, Copy: c.CreateChannelRequest}
}
const opCreateOriginEndpoint = "CreateOriginEndpoint"
// CreateOriginEndpointRequest is a API request type for the CreateOriginEndpoint API operation.
type CreateOriginEndpointRequest struct {
*aws.Request
Input *CreateOriginEndpointInput
Copy func(*CreateOriginEndpointInput) CreateOriginEndpointRequest
}
// Send marshals and sends the CreateOriginEndpoint API request.
func (r CreateOriginEndpointRequest) Send() (*CreateOriginEndpointOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateOriginEndpointOutput), nil
}
// CreateOriginEndpointRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Creates a new OriginEndpoint record.
//
// // Example sending a request using the CreateOriginEndpointRequest method.
// req := client.CreateOriginEndpointRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateOriginEndpoint
func (c *MediaPackage) CreateOriginEndpointRequest(input *CreateOriginEndpointInput) CreateOriginEndpointRequest {
op := &aws.Operation{
Name: opCreateOriginEndpoint,
HTTPMethod: "POST",
HTTPPath: "/origin_endpoints",
}
if input == nil {
input = &CreateOriginEndpointInput{}
}
output := &CreateOriginEndpointOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateOriginEndpointRequest{Request: req, Input: input, Copy: c.CreateOriginEndpointRequest}
}
const opDeleteChannel = "DeleteChannel"
// DeleteChannelRequest is a API request type for the DeleteChannel API operation.
type DeleteChannelRequest struct {
*aws.Request
Input *DeleteChannelInput
Copy func(*DeleteChannelInput) DeleteChannelRequest
}
// Send marshals and sends the DeleteChannel API request.
func (r DeleteChannelRequest) Send() (*DeleteChannelOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteChannelOutput), nil
}
// DeleteChannelRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Deletes an existing Channel.
//
// // Example sending a request using the DeleteChannelRequest method.
// req := client.DeleteChannelRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel
func (c *MediaPackage) DeleteChannelRequest(input *DeleteChannelInput) DeleteChannelRequest {
op := &aws.Operation{
Name: opDeleteChannel,
HTTPMethod: "DELETE",
HTTPPath: "/channels/{id}",
}
if input == nil {
input = &DeleteChannelInput{}
}
output := &DeleteChannelOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteChannelRequest{Request: req, Input: input, Copy: c.DeleteChannelRequest}
}
const opDeleteOriginEndpoint = "DeleteOriginEndpoint"
// DeleteOriginEndpointRequest is a API request type for the DeleteOriginEndpoint API operation.
type DeleteOriginEndpointRequest struct {
*aws.Request
Input *DeleteOriginEndpointInput
Copy func(*DeleteOriginEndpointInput) DeleteOriginEndpointRequest
}
// Send marshals and sends the DeleteOriginEndpoint API request.
func (r DeleteOriginEndpointRequest) Send() (*DeleteOriginEndpointOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteOriginEndpointOutput), nil
}
// DeleteOriginEndpointRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Deletes an existing OriginEndpoint.
//
// // Example sending a request using the DeleteOriginEndpointRequest method.
// req := client.DeleteOriginEndpointRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteOriginEndpoint
func (c *MediaPackage) DeleteOriginEndpointRequest(input *DeleteOriginEndpointInput) DeleteOriginEndpointRequest {
op := &aws.Operation{
Name: opDeleteOriginEndpoint,
HTTPMethod: "DELETE",
HTTPPath: "/origin_endpoints/{id}",
}
if input == nil {
input = &DeleteOriginEndpointInput{}
}
output := &DeleteOriginEndpointOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteOriginEndpointRequest{Request: req, Input: input, Copy: c.DeleteOriginEndpointRequest}
}
const opDescribeChannel = "DescribeChannel"
// DescribeChannelRequest is a API request type for the DescribeChannel API operation.
type DescribeChannelRequest struct {
*aws.Request
Input *DescribeChannelInput
Copy func(*DescribeChannelInput) DescribeChannelRequest
}
// Send marshals and sends the DescribeChannel API request.
func (r DescribeChannelRequest) Send() (*DescribeChannelOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeChannelOutput), nil
}
// DescribeChannelRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Gets details about a Channel.
//
// // Example sending a request using the DescribeChannelRequest method.
// req := client.DescribeChannelRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeChannel
func (c *MediaPackage) DescribeChannelRequest(input *DescribeChannelInput) DescribeChannelRequest {
op := &aws.Operation{
Name: opDescribeChannel,
HTTPMethod: "GET",
HTTPPath: "/channels/{id}",
}
if input == nil {
input = &DescribeChannelInput{}
}
output := &DescribeChannelOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeChannelRequest{Request: req, Input: input, Copy: c.DescribeChannelRequest}
}
const opDescribeOriginEndpoint = "DescribeOriginEndpoint"
// DescribeOriginEndpointRequest is a API request type for the DescribeOriginEndpoint API operation.
type DescribeOriginEndpointRequest struct {
*aws.Request
Input *DescribeOriginEndpointInput
Copy func(*DescribeOriginEndpointInput) DescribeOriginEndpointRequest
}
// Send marshals and sends the DescribeOriginEndpoint API request.
func (r DescribeOriginEndpointRequest) Send() (*DescribeOriginEndpointOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeOriginEndpointOutput), nil
}
// DescribeOriginEndpointRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Gets details about an existing OriginEndpoint.
//
// // Example sending a request using the DescribeOriginEndpointRequest method.
// req := client.DescribeOriginEndpointRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeOriginEndpoint
func (c *MediaPackage) DescribeOriginEndpointRequest(input *DescribeOriginEndpointInput) DescribeOriginEndpointRequest {
op := &aws.Operation{
Name: opDescribeOriginEndpoint,
HTTPMethod: "GET",
HTTPPath: "/origin_endpoints/{id}",
}
if input == nil {
input = &DescribeOriginEndpointInput{}
}
output := &DescribeOriginEndpointOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeOriginEndpointRequest{Request: req, Input: input, Copy: c.DescribeOriginEndpointRequest}
}
const opListChannels = "ListChannels"
// ListChannelsRequest is a API request type for the ListChannels API operation.
type ListChannelsRequest struct {
*aws.Request
Input *ListChannelsInput
Copy func(*ListChannelsInput) ListChannelsRequest
}
// Send marshals and sends the ListChannels API request.
func (r ListChannelsRequest) Send() (*ListChannelsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListChannelsOutput), nil
}
// ListChannelsRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Returns a collection of Channels.
//
// // Example sending a request using the ListChannelsRequest method.
// req := client.ListChannelsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListChannels
func (c *MediaPackage) ListChannelsRequest(input *ListChannelsInput) ListChannelsRequest {
op := &aws.Operation{
Name: opListChannels,
HTTPMethod: "GET",
HTTPPath: "/channels",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListChannelsInput{}
}
output := &ListChannelsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListChannelsRequest{Request: req, Input: input, Copy: c.ListChannelsRequest}
}
// Paginate pages iterates over the pages of a ListChannelsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListChannels operation.
// req := client.ListChannelsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *ListChannelsRequest) Paginate(opts ...aws.Option) ListChannelsPager {
return ListChannelsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *ListChannelsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// ListChannelsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type ListChannelsPager struct {
aws.Pager
}
func (p *ListChannelsPager) CurrentPage() *ListChannelsOutput {
return p.Pager.CurrentPage().(*ListChannelsOutput)
}
const opListOriginEndpoints = "ListOriginEndpoints"
// ListOriginEndpointsRequest is a API request type for the ListOriginEndpoints API operation.
type ListOriginEndpointsRequest struct {
*aws.Request
Input *ListOriginEndpointsInput
Copy func(*ListOriginEndpointsInput) ListOriginEndpointsRequest
}
// Send marshals and sends the ListOriginEndpoints API request.
func (r ListOriginEndpointsRequest) Send() (*ListOriginEndpointsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListOriginEndpointsOutput), nil
}
// ListOriginEndpointsRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Returns a collection of OriginEndpoint records.
//
// // Example sending a request using the ListOriginEndpointsRequest method.
// req := client.ListOriginEndpointsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListOriginEndpoints
func (c *MediaPackage) ListOriginEndpointsRequest(input *ListOriginEndpointsInput) ListOriginEndpointsRequest {
op := &aws.Operation{
Name: opListOriginEndpoints,
HTTPMethod: "GET",
HTTPPath: "/origin_endpoints",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListOriginEndpointsInput{}
}
output := &ListOriginEndpointsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListOriginEndpointsRequest{Request: req, Input: input, Copy: c.ListOriginEndpointsRequest}
}
// Paginate pages iterates over the pages of a ListOriginEndpointsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListOriginEndpoints operation.
// req := client.ListOriginEndpointsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *ListOriginEndpointsRequest) Paginate(opts ...aws.Option) ListOriginEndpointsPager {
return ListOriginEndpointsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *ListOriginEndpointsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// ListOriginEndpointsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type ListOriginEndpointsPager struct {
aws.Pager
}
func (p *ListOriginEndpointsPager) CurrentPage() *ListOriginEndpointsOutput {
return p.Pager.CurrentPage().(*ListOriginEndpointsOutput)
}
const opRotateChannelCredentials = "RotateChannelCredentials"
// RotateChannelCredentialsRequest is a API request type for the RotateChannelCredentials API operation.
type RotateChannelCredentialsRequest struct {
*aws.Request
Input *RotateChannelCredentialsInput
Copy func(*RotateChannelCredentialsInput) RotateChannelCredentialsRequest
}
// Send marshals and sends the RotateChannelCredentials API request.
func (r RotateChannelCredentialsRequest) Send() (*RotateChannelCredentialsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*RotateChannelCredentialsOutput), nil
}
// RotateChannelCredentialsRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Changes the Channel ingest username and password.
//
// // Example sending a request using the RotateChannelCredentialsRequest method.
// req := client.RotateChannelCredentialsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/RotateChannelCredentials
func (c *MediaPackage) RotateChannelCredentialsRequest(input *RotateChannelCredentialsInput) RotateChannelCredentialsRequest {
op := &aws.Operation{
Name: opRotateChannelCredentials,
HTTPMethod: "PUT",
HTTPPath: "/channels/{id}/credentials",
}
if input == nil {
input = &RotateChannelCredentialsInput{}
}
output := &RotateChannelCredentialsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return RotateChannelCredentialsRequest{Request: req, Input: input, Copy: c.RotateChannelCredentialsRequest}
}
const opUpdateChannel = "UpdateChannel"
// UpdateChannelRequest is a API request type for the UpdateChannel API operation.
type UpdateChannelRequest struct {
*aws.Request
Input *UpdateChannelInput
Copy func(*UpdateChannelInput) UpdateChannelRequest
}
// Send marshals and sends the UpdateChannel API request.
func (r UpdateChannelRequest) Send() (*UpdateChannelOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateChannelOutput), nil
}
// UpdateChannelRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Updates an existing Channel.
//
// // Example sending a request using the UpdateChannelRequest method.
// req := client.UpdateChannelRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/UpdateChannel
func (c *MediaPackage) UpdateChannelRequest(input *UpdateChannelInput) UpdateChannelRequest {
op := &aws.Operation{
Name: opUpdateChannel,
HTTPMethod: "PUT",
HTTPPath: "/channels/{id}",
}
if input == nil {
input = &UpdateChannelInput{}
}
output := &UpdateChannelOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateChannelRequest{Request: req, Input: input, Copy: c.UpdateChannelRequest}
}
const opUpdateOriginEndpoint = "UpdateOriginEndpoint"
// UpdateOriginEndpointRequest is a API request type for the UpdateOriginEndpoint API operation.
type UpdateOriginEndpointRequest struct {
*aws.Request
Input *UpdateOriginEndpointInput
Copy func(*UpdateOriginEndpointInput) UpdateOriginEndpointRequest
}
// Send marshals and sends the UpdateOriginEndpoint API request.
func (r UpdateOriginEndpointRequest) Send() (*UpdateOriginEndpointOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateOriginEndpointOutput), nil
}
// UpdateOriginEndpointRequest returns a request value for making API operation for
// AWS Elemental MediaPackage.
//
// Updates an existing OriginEndpoint.
//
// // Example sending a request using the UpdateOriginEndpointRequest method.
// req := client.UpdateOriginEndpointRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/UpdateOriginEndpoint
func (c *MediaPackage) UpdateOriginEndpointRequest(input *UpdateOriginEndpointInput) UpdateOriginEndpointRequest {
op := &aws.Operation{
Name: opUpdateOriginEndpoint,
HTTPMethod: "PUT",
HTTPPath: "/origin_endpoints/{id}",
}
if input == nil {
input = &UpdateOriginEndpointInput{}
}
output := &UpdateOriginEndpointOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateOriginEndpointRequest{Request: req, Input: input, Copy: c.UpdateOriginEndpointRequest}
}
// A Channel resource configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/Channel
type Channel struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) assigned to the Channel.
Arn *string `locationName:"arn" type:"string"`
// A short text description of the Channel.
Description *string `locationName:"description" type:"string"`
// An HTTP Live Streaming (HLS) ingest resource configuration.
HlsIngest *HlsIngest `locationName:"hlsIngest" type:"structure"`
// The ID of the Channel.
Id *string `locationName:"id" type:"string"`
}
// String returns the string representation
func (s Channel) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Channel) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Channel) MarshalFields(e protocol.FieldEncoder) error {
if s.Arn != nil {
v := *s.Arn
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "arn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Description != nil {
v := *s.Description
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.HlsIngest != nil {
v := s.HlsIngest
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "hlsIngest", v, metadata)
}
if s.Id != nil {
v := *s.Id
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "id", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// A Common Media Application Format (CMAF) encryption configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CmafEncryption
type CmafEncryption struct {
_ struct{} `type:"structure"`
// Time (in seconds) between each encryption key rotation.
KeyRotationIntervalSeconds *int64 `locationName:"keyRotationIntervalSeconds" type:"integer"`
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
//
// SpekeKeyProvider is a required field
SpekeKeyProvider *SpekeKeyProvider `locationName:"spekeKeyProvider" type:"structure" required:"true"`
}
// String returns the string representation
func (s CmafEncryption) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CmafEncryption) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CmafEncryption) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CmafEncryption"}
if s.SpekeKeyProvider == nil {
invalidParams.Add(aws.NewErrParamRequired("SpekeKeyProvider"))
}
if s.SpekeKeyProvider != nil {
if err := s.SpekeKeyProvider.Validate(); err != nil {
invalidParams.AddNested("SpekeKeyProvider", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CmafEncryption) MarshalFields(e protocol.FieldEncoder) error {
if s.KeyRotationIntervalSeconds != nil {
v := *s.KeyRotationIntervalSeconds
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "keyRotationIntervalSeconds", protocol.Int64Value(v), metadata)
}
if s.SpekeKeyProvider != nil {
v := s.SpekeKeyProvider
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "spekeKeyProvider", v, metadata)
}
return nil
}
// A Common Media Application Format (CMAF) packaging configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CmafPackage
type CmafPackage struct {
_ struct{} `type:"structure"`
// A Common Media Application Format (CMAF) encryption configuration.
Encryption *CmafEncryption `locationName:"encryption" type:"structure"`
// A list of HLS manifest configurations
HlsManifests []HlsManifest `locationName:"hlsManifests" type:"list"`
// Duration (in seconds) of each segment. Actual segments will berounded to
// the nearest multiple of the source segment duration.
SegmentDurationSeconds *int64 `locationName:"segmentDurationSeconds" type:"integer"`
// An optional custom string that is prepended to the name of each segment.
// If not specified, it defaults to the ChannelId.
SegmentPrefix *string `locationName:"segmentPrefix" type:"string"`
// A StreamSelection configuration.
StreamSelection *StreamSelection `locationName:"streamSelection" type:"structure"`
}
// String returns the string representation
func (s CmafPackage) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CmafPackage) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CmafPackage) MarshalFields(e protocol.FieldEncoder) error {
if s.Encryption != nil {
v := s.Encryption
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "encryption", v, metadata)
}
if len(s.HlsManifests) > 0 {
v := s.HlsManifests
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "hlsManifests", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.SegmentDurationSeconds != nil {
v := *s.SegmentDurationSeconds
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "segmentDurationSeconds", protocol.Int64Value(v), metadata)
}
if s.SegmentPrefix != nil {
v := *s.SegmentPrefix
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "segmentPrefix", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.StreamSelection != nil {
v := s.StreamSelection
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "streamSelection", v, metadata)
}
return nil
}
// A Common Media Application Format (CMAF) packaging configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CmafPackageCreateOrUpdateParameters
type CmafPackageCreateOrUpdateParameters struct {
_ struct{} `type:"structure"`
// A Common Media Application Format (CMAF) encryption configuration.
Encryption *CmafEncryption `locationName:"encryption" type:"structure"`
// A list of HLS manifest configurations
HlsManifests []HlsManifestCreateOrUpdateParameters `locationName:"hlsManifests" type:"list"`
// Duration (in seconds) of each segment. Actual segments will berounded to
// the nearest multiple of the source segment duration.
SegmentDurationSeconds *int64 `locationName:"segmentDurationSeconds" type:"integer"`
// An optional custom string that is prepended to the name of each segment.
// If not specified, it defaults to the ChannelId.
SegmentPrefix *string `locationName:"segmentPrefix" type:"string"`
// A StreamSelection configuration.
StreamSelection *StreamSelection `locationName:"streamSelection" type:"structure"`
}
// String returns the string representation
func (s CmafPackageCreateOrUpdateParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CmafPackageCreateOrUpdateParameters) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CmafPackageCreateOrUpdateParameters) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CmafPackageCreateOrUpdateParameters"}
if s.Encryption != nil {
if err := s.Encryption.Validate(); err != nil {
invalidParams.AddNested("Encryption", err.(aws.ErrInvalidParams))
}
}
if s.HlsManifests != nil {
for i, v := range s.HlsManifests {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HlsManifests", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CmafPackageCreateOrUpdateParameters) MarshalFields(e protocol.FieldEncoder) error {
if s.Encryption != nil {
v := s.Encryption
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "encryption", v, metadata)
}
if len(s.HlsManifests) > 0 {
v := s.HlsManifests
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "hlsManifests", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.SegmentDurationSeconds != nil {
v := *s.SegmentDurationSeconds
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "segmentDurationSeconds", protocol.Int64Value(v), metadata)
}
if s.SegmentPrefix != nil {
v := *s.SegmentPrefix
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "segmentPrefix", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.StreamSelection != nil {
v := s.StreamSelection
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "streamSelection", v, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateChannelRequest
type CreateChannelInput struct {
_ struct{} `type:"structure"`
Description *string `locationName:"description" type:"string"`
// Id is a required field
Id *string `locationName:"id" type:"string" required:"true"`
}
// String returns the string representation
func (s CreateChannelInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CreateChannelInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateChannelInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CreateChannelInput"}
if s.Id == nil {
invalidParams.Add(aws.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CreateChannelInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/x-amz-json-1.1"), protocol.Metadata{})
if s.Description != nil {
v := *s.Description
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Id != nil {
v := *s.Id