1 package media
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "github.com/gofrs/uuid"
18 "net/http"
19 )
20
21
22 const fqdn = "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2020-05-01/media"
23
24
25 type AacAudio struct {
26
27 Profile AacAudioProfile `json:"profile,omitempty"`
28
29 Channels *int32 `json:"channels,omitempty"`
30
31 SamplingRate *int32 `json:"samplingRate,omitempty"`
32
33 Bitrate *int32 `json:"bitrate,omitempty"`
34
35 Label *string `json:"label,omitempty"`
36
37 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
38 }
39
40
41 func (aa AacAudio) MarshalJSON() ([]byte, error) {
42 aa.OdataType = OdataTypeMicrosoftMediaAacAudio
43 objectMap := make(map[string]interface{})
44 if aa.Profile != "" {
45 objectMap["profile"] = aa.Profile
46 }
47 if aa.Channels != nil {
48 objectMap["channels"] = aa.Channels
49 }
50 if aa.SamplingRate != nil {
51 objectMap["samplingRate"] = aa.SamplingRate
52 }
53 if aa.Bitrate != nil {
54 objectMap["bitrate"] = aa.Bitrate
55 }
56 if aa.Label != nil {
57 objectMap["label"] = aa.Label
58 }
59 if aa.OdataType != "" {
60 objectMap["@odata.type"] = aa.OdataType
61 }
62 return json.Marshal(objectMap)
63 }
64
65
66 func (aa AacAudio) AsAudio() (*Audio, bool) {
67 return nil, false
68 }
69
70
71 func (aa AacAudio) AsBasicAudio() (BasicAudio, bool) {
72 return &aa, true
73 }
74
75
76 func (aa AacAudio) AsAacAudio() (*AacAudio, bool) {
77 return &aa, true
78 }
79
80
81 func (aa AacAudio) AsVideo() (*Video, bool) {
82 return nil, false
83 }
84
85
86 func (aa AacAudio) AsBasicVideo() (BasicVideo, bool) {
87 return nil, false
88 }
89
90
91 func (aa AacAudio) AsH265Video() (*H265Video, bool) {
92 return nil, false
93 }
94
95
96 func (aa AacAudio) AsCopyVideo() (*CopyVideo, bool) {
97 return nil, false
98 }
99
100
101 func (aa AacAudio) AsImage() (*Image, bool) {
102 return nil, false
103 }
104
105
106 func (aa AacAudio) AsBasicImage() (BasicImage, bool) {
107 return nil, false
108 }
109
110
111 func (aa AacAudio) AsCopyAudio() (*CopyAudio, bool) {
112 return nil, false
113 }
114
115
116 func (aa AacAudio) AsH264Video() (*H264Video, bool) {
117 return nil, false
118 }
119
120
121 func (aa AacAudio) AsJpgImage() (*JpgImage, bool) {
122 return nil, false
123 }
124
125
126 func (aa AacAudio) AsPngImage() (*PngImage, bool) {
127 return nil, false
128 }
129
130
131 func (aa AacAudio) AsCodec() (*Codec, bool) {
132 return nil, false
133 }
134
135
136 func (aa AacAudio) AsBasicCodec() (BasicCodec, bool) {
137 return &aa, true
138 }
139
140
141
142
143 type AbsoluteClipTime struct {
144
145 Time *string `json:"time,omitempty"`
146
147 OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
148 }
149
150
151 func (act AbsoluteClipTime) MarshalJSON() ([]byte, error) {
152 act.OdataType = OdataTypeMicrosoftMediaAbsoluteClipTime
153 objectMap := make(map[string]interface{})
154 if act.Time != nil {
155 objectMap["time"] = act.Time
156 }
157 if act.OdataType != "" {
158 objectMap["@odata.type"] = act.OdataType
159 }
160 return json.Marshal(objectMap)
161 }
162
163
164 func (act AbsoluteClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
165 return &act, true
166 }
167
168
169 func (act AbsoluteClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
170 return nil, false
171 }
172
173
174 func (act AbsoluteClipTime) AsClipTime() (*ClipTime, bool) {
175 return nil, false
176 }
177
178
179 func (act AbsoluteClipTime) AsBasicClipTime() (BasicClipTime, bool) {
180 return &act, true
181 }
182
183
184 type AccountEncryption struct {
185
186 Type AccountEncryptionKeyType `json:"type,omitempty"`
187
188 KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
189 }
190
191
192 type AccountFilter struct {
193 autorest.Response `json:"-"`
194 *FilterProperties `json:"properties,omitempty"`
195
196 SystemData *SystemData `json:"systemData,omitempty"`
197
198 ID *string `json:"id,omitempty"`
199
200 Name *string `json:"name,omitempty"`
201
202 Type *string `json:"type,omitempty"`
203 }
204
205
206 func (af AccountFilter) MarshalJSON() ([]byte, error) {
207 objectMap := make(map[string]interface{})
208 if af.FilterProperties != nil {
209 objectMap["properties"] = af.FilterProperties
210 }
211 return json.Marshal(objectMap)
212 }
213
214
215 func (af *AccountFilter) UnmarshalJSON(body []byte) error {
216 var m map[string]*json.RawMessage
217 err := json.Unmarshal(body, &m)
218 if err != nil {
219 return err
220 }
221 for k, v := range m {
222 switch k {
223 case "properties":
224 if v != nil {
225 var filterProperties FilterProperties
226 err = json.Unmarshal(*v, &filterProperties)
227 if err != nil {
228 return err
229 }
230 af.FilterProperties = &filterProperties
231 }
232 case "systemData":
233 if v != nil {
234 var systemData SystemData
235 err = json.Unmarshal(*v, &systemData)
236 if err != nil {
237 return err
238 }
239 af.SystemData = &systemData
240 }
241 case "id":
242 if v != nil {
243 var ID string
244 err = json.Unmarshal(*v, &ID)
245 if err != nil {
246 return err
247 }
248 af.ID = &ID
249 }
250 case "name":
251 if v != nil {
252 var name string
253 err = json.Unmarshal(*v, &name)
254 if err != nil {
255 return err
256 }
257 af.Name = &name
258 }
259 case "type":
260 if v != nil {
261 var typeVar string
262 err = json.Unmarshal(*v, &typeVar)
263 if err != nil {
264 return err
265 }
266 af.Type = &typeVar
267 }
268 }
269 }
270
271 return nil
272 }
273
274
275 type AccountFilterCollection struct {
276 autorest.Response `json:"-"`
277
278 Value *[]AccountFilter `json:"value,omitempty"`
279
280 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
281 }
282
283
284 type AccountFilterCollectionIterator struct {
285 i int
286 page AccountFilterCollectionPage
287 }
288
289
290
291 func (iter *AccountFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
292 if tracing.IsEnabled() {
293 ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionIterator.NextWithContext")
294 defer func() {
295 sc := -1
296 if iter.Response().Response.Response != nil {
297 sc = iter.Response().Response.Response.StatusCode
298 }
299 tracing.EndSpan(ctx, sc, err)
300 }()
301 }
302 iter.i++
303 if iter.i < len(iter.page.Values()) {
304 return nil
305 }
306 err = iter.page.NextWithContext(ctx)
307 if err != nil {
308 iter.i--
309 return err
310 }
311 iter.i = 0
312 return nil
313 }
314
315
316
317
318 func (iter *AccountFilterCollectionIterator) Next() error {
319 return iter.NextWithContext(context.Background())
320 }
321
322
323 func (iter AccountFilterCollectionIterator) NotDone() bool {
324 return iter.page.NotDone() && iter.i < len(iter.page.Values())
325 }
326
327
328 func (iter AccountFilterCollectionIterator) Response() AccountFilterCollection {
329 return iter.page.Response()
330 }
331
332
333
334 func (iter AccountFilterCollectionIterator) Value() AccountFilter {
335 if !iter.page.NotDone() {
336 return AccountFilter{}
337 }
338 return iter.page.Values()[iter.i]
339 }
340
341
342 func NewAccountFilterCollectionIterator(page AccountFilterCollectionPage) AccountFilterCollectionIterator {
343 return AccountFilterCollectionIterator{page: page}
344 }
345
346
347 func (afc AccountFilterCollection) IsEmpty() bool {
348 return afc.Value == nil || len(*afc.Value) == 0
349 }
350
351
352 func (afc AccountFilterCollection) hasNextLink() bool {
353 return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
354 }
355
356
357
358 func (afc AccountFilterCollection) accountFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
359 if !afc.hasNextLink() {
360 return nil, nil
361 }
362 return autorest.Prepare((&http.Request{}).WithContext(ctx),
363 autorest.AsJSON(),
364 autorest.AsGet(),
365 autorest.WithBaseURL(to.String(afc.OdataNextLink)))
366 }
367
368
369 type AccountFilterCollectionPage struct {
370 fn func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)
371 afc AccountFilterCollection
372 }
373
374
375
376 func (page *AccountFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
377 if tracing.IsEnabled() {
378 ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionPage.NextWithContext")
379 defer func() {
380 sc := -1
381 if page.Response().Response.Response != nil {
382 sc = page.Response().Response.Response.StatusCode
383 }
384 tracing.EndSpan(ctx, sc, err)
385 }()
386 }
387 for {
388 next, err := page.fn(ctx, page.afc)
389 if err != nil {
390 return err
391 }
392 page.afc = next
393 if !next.hasNextLink() || !next.IsEmpty() {
394 break
395 }
396 }
397 return nil
398 }
399
400
401
402
403 func (page *AccountFilterCollectionPage) Next() error {
404 return page.NextWithContext(context.Background())
405 }
406
407
408 func (page AccountFilterCollectionPage) NotDone() bool {
409 return !page.afc.IsEmpty()
410 }
411
412
413 func (page AccountFilterCollectionPage) Response() AccountFilterCollection {
414 return page.afc
415 }
416
417
418 func (page AccountFilterCollectionPage) Values() []AccountFilter {
419 if page.afc.IsEmpty() {
420 return nil
421 }
422 return *page.afc.Value
423 }
424
425
426 func NewAccountFilterCollectionPage(cur AccountFilterCollection, getNextPage func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)) AccountFilterCollectionPage {
427 return AccountFilterCollectionPage{
428 fn: getNextPage,
429 afc: cur,
430 }
431 }
432
433
434 type AkamaiAccessControl struct {
435
436 AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"`
437 }
438
439
440 type AkamaiSignatureHeaderAuthenticationKey struct {
441
442 Identifier *string `json:"identifier,omitempty"`
443
444 Base64Key *string `json:"base64Key,omitempty"`
445
446 Expiration *date.Time `json:"expiration,omitempty"`
447 }
448
449
450 type APIError struct {
451
452 Error *ODataError `json:"error,omitempty"`
453 }
454
455
456 type Asset struct {
457 autorest.Response `json:"-"`
458
459 *AssetProperties `json:"properties,omitempty"`
460
461 SystemData *SystemData `json:"systemData,omitempty"`
462
463 ID *string `json:"id,omitempty"`
464
465 Name *string `json:"name,omitempty"`
466
467 Type *string `json:"type,omitempty"`
468 }
469
470
471 func (a Asset) MarshalJSON() ([]byte, error) {
472 objectMap := make(map[string]interface{})
473 if a.AssetProperties != nil {
474 objectMap["properties"] = a.AssetProperties
475 }
476 return json.Marshal(objectMap)
477 }
478
479
480 func (a *Asset) UnmarshalJSON(body []byte) error {
481 var m map[string]*json.RawMessage
482 err := json.Unmarshal(body, &m)
483 if err != nil {
484 return err
485 }
486 for k, v := range m {
487 switch k {
488 case "properties":
489 if v != nil {
490 var assetProperties AssetProperties
491 err = json.Unmarshal(*v, &assetProperties)
492 if err != nil {
493 return err
494 }
495 a.AssetProperties = &assetProperties
496 }
497 case "systemData":
498 if v != nil {
499 var systemData SystemData
500 err = json.Unmarshal(*v, &systemData)
501 if err != nil {
502 return err
503 }
504 a.SystemData = &systemData
505 }
506 case "id":
507 if v != nil {
508 var ID string
509 err = json.Unmarshal(*v, &ID)
510 if err != nil {
511 return err
512 }
513 a.ID = &ID
514 }
515 case "name":
516 if v != nil {
517 var name string
518 err = json.Unmarshal(*v, &name)
519 if err != nil {
520 return err
521 }
522 a.Name = &name
523 }
524 case "type":
525 if v != nil {
526 var typeVar string
527 err = json.Unmarshal(*v, &typeVar)
528 if err != nil {
529 return err
530 }
531 a.Type = &typeVar
532 }
533 }
534 }
535
536 return nil
537 }
538
539
540 type AssetCollection struct {
541 autorest.Response `json:"-"`
542
543 Value *[]Asset `json:"value,omitempty"`
544
545 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
546 }
547
548
549 type AssetCollectionIterator struct {
550 i int
551 page AssetCollectionPage
552 }
553
554
555
556 func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
557 if tracing.IsEnabled() {
558 ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext")
559 defer func() {
560 sc := -1
561 if iter.Response().Response.Response != nil {
562 sc = iter.Response().Response.Response.StatusCode
563 }
564 tracing.EndSpan(ctx, sc, err)
565 }()
566 }
567 iter.i++
568 if iter.i < len(iter.page.Values()) {
569 return nil
570 }
571 err = iter.page.NextWithContext(ctx)
572 if err != nil {
573 iter.i--
574 return err
575 }
576 iter.i = 0
577 return nil
578 }
579
580
581
582
583 func (iter *AssetCollectionIterator) Next() error {
584 return iter.NextWithContext(context.Background())
585 }
586
587
588 func (iter AssetCollectionIterator) NotDone() bool {
589 return iter.page.NotDone() && iter.i < len(iter.page.Values())
590 }
591
592
593 func (iter AssetCollectionIterator) Response() AssetCollection {
594 return iter.page.Response()
595 }
596
597
598
599 func (iter AssetCollectionIterator) Value() Asset {
600 if !iter.page.NotDone() {
601 return Asset{}
602 }
603 return iter.page.Values()[iter.i]
604 }
605
606
607 func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator {
608 return AssetCollectionIterator{page: page}
609 }
610
611
612 func (ac AssetCollection) IsEmpty() bool {
613 return ac.Value == nil || len(*ac.Value) == 0
614 }
615
616
617 func (ac AssetCollection) hasNextLink() bool {
618 return ac.OdataNextLink != nil && len(*ac.OdataNextLink) != 0
619 }
620
621
622
623 func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) {
624 if !ac.hasNextLink() {
625 return nil, nil
626 }
627 return autorest.Prepare((&http.Request{}).WithContext(ctx),
628 autorest.AsJSON(),
629 autorest.AsGet(),
630 autorest.WithBaseURL(to.String(ac.OdataNextLink)))
631 }
632
633
634 type AssetCollectionPage struct {
635 fn func(context.Context, AssetCollection) (AssetCollection, error)
636 ac AssetCollection
637 }
638
639
640
641 func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) {
642 if tracing.IsEnabled() {
643 ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext")
644 defer func() {
645 sc := -1
646 if page.Response().Response.Response != nil {
647 sc = page.Response().Response.Response.StatusCode
648 }
649 tracing.EndSpan(ctx, sc, err)
650 }()
651 }
652 for {
653 next, err := page.fn(ctx, page.ac)
654 if err != nil {
655 return err
656 }
657 page.ac = next
658 if !next.hasNextLink() || !next.IsEmpty() {
659 break
660 }
661 }
662 return nil
663 }
664
665
666
667
668 func (page *AssetCollectionPage) Next() error {
669 return page.NextWithContext(context.Background())
670 }
671
672
673 func (page AssetCollectionPage) NotDone() bool {
674 return !page.ac.IsEmpty()
675 }
676
677
678 func (page AssetCollectionPage) Response() AssetCollection {
679 return page.ac
680 }
681
682
683 func (page AssetCollectionPage) Values() []Asset {
684 if page.ac.IsEmpty() {
685 return nil
686 }
687 return *page.ac.Value
688 }
689
690
691 func NewAssetCollectionPage(cur AssetCollection, getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage {
692 return AssetCollectionPage{
693 fn: getNextPage,
694 ac: cur,
695 }
696 }
697
698
699 type AssetContainerSas struct {
700 autorest.Response `json:"-"`
701
702 AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"`
703 }
704
705
706 type AssetFileEncryptionMetadata struct {
707
708 InitializationVector *string `json:"initializationVector,omitempty"`
709
710 AssetFileName *string `json:"assetFileName,omitempty"`
711
712 AssetFileID *uuid.UUID `json:"assetFileId,omitempty"`
713 }
714
715
716 type AssetFilter struct {
717 autorest.Response `json:"-"`
718 *FilterProperties `json:"properties,omitempty"`
719
720 SystemData *SystemData `json:"systemData,omitempty"`
721
722 ID *string `json:"id,omitempty"`
723
724 Name *string `json:"name,omitempty"`
725
726 Type *string `json:"type,omitempty"`
727 }
728
729
730 func (af AssetFilter) MarshalJSON() ([]byte, error) {
731 objectMap := make(map[string]interface{})
732 if af.FilterProperties != nil {
733 objectMap["properties"] = af.FilterProperties
734 }
735 return json.Marshal(objectMap)
736 }
737
738
739 func (af *AssetFilter) UnmarshalJSON(body []byte) error {
740 var m map[string]*json.RawMessage
741 err := json.Unmarshal(body, &m)
742 if err != nil {
743 return err
744 }
745 for k, v := range m {
746 switch k {
747 case "properties":
748 if v != nil {
749 var filterProperties FilterProperties
750 err = json.Unmarshal(*v, &filterProperties)
751 if err != nil {
752 return err
753 }
754 af.FilterProperties = &filterProperties
755 }
756 case "systemData":
757 if v != nil {
758 var systemData SystemData
759 err = json.Unmarshal(*v, &systemData)
760 if err != nil {
761 return err
762 }
763 af.SystemData = &systemData
764 }
765 case "id":
766 if v != nil {
767 var ID string
768 err = json.Unmarshal(*v, &ID)
769 if err != nil {
770 return err
771 }
772 af.ID = &ID
773 }
774 case "name":
775 if v != nil {
776 var name string
777 err = json.Unmarshal(*v, &name)
778 if err != nil {
779 return err
780 }
781 af.Name = &name
782 }
783 case "type":
784 if v != nil {
785 var typeVar string
786 err = json.Unmarshal(*v, &typeVar)
787 if err != nil {
788 return err
789 }
790 af.Type = &typeVar
791 }
792 }
793 }
794
795 return nil
796 }
797
798
799 type AssetFilterCollection struct {
800 autorest.Response `json:"-"`
801
802 Value *[]AssetFilter `json:"value,omitempty"`
803
804 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
805 }
806
807
808 type AssetFilterCollectionIterator struct {
809 i int
810 page AssetFilterCollectionPage
811 }
812
813
814
815 func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
816 if tracing.IsEnabled() {
817 ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext")
818 defer func() {
819 sc := -1
820 if iter.Response().Response.Response != nil {
821 sc = iter.Response().Response.Response.StatusCode
822 }
823 tracing.EndSpan(ctx, sc, err)
824 }()
825 }
826 iter.i++
827 if iter.i < len(iter.page.Values()) {
828 return nil
829 }
830 err = iter.page.NextWithContext(ctx)
831 if err != nil {
832 iter.i--
833 return err
834 }
835 iter.i = 0
836 return nil
837 }
838
839
840
841
842 func (iter *AssetFilterCollectionIterator) Next() error {
843 return iter.NextWithContext(context.Background())
844 }
845
846
847 func (iter AssetFilterCollectionIterator) NotDone() bool {
848 return iter.page.NotDone() && iter.i < len(iter.page.Values())
849 }
850
851
852 func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection {
853 return iter.page.Response()
854 }
855
856
857
858 func (iter AssetFilterCollectionIterator) Value() AssetFilter {
859 if !iter.page.NotDone() {
860 return AssetFilter{}
861 }
862 return iter.page.Values()[iter.i]
863 }
864
865
866 func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator {
867 return AssetFilterCollectionIterator{page: page}
868 }
869
870
871 func (afc AssetFilterCollection) IsEmpty() bool {
872 return afc.Value == nil || len(*afc.Value) == 0
873 }
874
875
876 func (afc AssetFilterCollection) hasNextLink() bool {
877 return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
878 }
879
880
881
882 func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
883 if !afc.hasNextLink() {
884 return nil, nil
885 }
886 return autorest.Prepare((&http.Request{}).WithContext(ctx),
887 autorest.AsJSON(),
888 autorest.AsGet(),
889 autorest.WithBaseURL(to.String(afc.OdataNextLink)))
890 }
891
892
893 type AssetFilterCollectionPage struct {
894 fn func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)
895 afc AssetFilterCollection
896 }
897
898
899
900 func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
901 if tracing.IsEnabled() {
902 ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext")
903 defer func() {
904 sc := -1
905 if page.Response().Response.Response != nil {
906 sc = page.Response().Response.Response.StatusCode
907 }
908 tracing.EndSpan(ctx, sc, err)
909 }()
910 }
911 for {
912 next, err := page.fn(ctx, page.afc)
913 if err != nil {
914 return err
915 }
916 page.afc = next
917 if !next.hasNextLink() || !next.IsEmpty() {
918 break
919 }
920 }
921 return nil
922 }
923
924
925
926
927 func (page *AssetFilterCollectionPage) Next() error {
928 return page.NextWithContext(context.Background())
929 }
930
931
932 func (page AssetFilterCollectionPage) NotDone() bool {
933 return !page.afc.IsEmpty()
934 }
935
936
937 func (page AssetFilterCollectionPage) Response() AssetFilterCollection {
938 return page.afc
939 }
940
941
942 func (page AssetFilterCollectionPage) Values() []AssetFilter {
943 if page.afc.IsEmpty() {
944 return nil
945 }
946 return *page.afc.Value
947 }
948
949
950 func NewAssetFilterCollectionPage(cur AssetFilterCollection, getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage {
951 return AssetFilterCollectionPage{
952 fn: getNextPage,
953 afc: cur,
954 }
955 }
956
957
958 type AssetProperties struct {
959
960 AssetID *uuid.UUID `json:"assetId,omitempty"`
961
962 Created *date.Time `json:"created,omitempty"`
963
964 LastModified *date.Time `json:"lastModified,omitempty"`
965
966 AlternateID *string `json:"alternateId,omitempty"`
967
968 Description *string `json:"description,omitempty"`
969
970 Container *string `json:"container,omitempty"`
971
972 StorageAccountName *string `json:"storageAccountName,omitempty"`
973
974 StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"`
975 }
976
977
978 func (ap AssetProperties) MarshalJSON() ([]byte, error) {
979 objectMap := make(map[string]interface{})
980 if ap.AlternateID != nil {
981 objectMap["alternateId"] = ap.AlternateID
982 }
983 if ap.Description != nil {
984 objectMap["description"] = ap.Description
985 }
986 if ap.Container != nil {
987 objectMap["container"] = ap.Container
988 }
989 if ap.StorageAccountName != nil {
990 objectMap["storageAccountName"] = ap.StorageAccountName
991 }
992 return json.Marshal(objectMap)
993 }
994
995
996 type AssetStreamingLocator struct {
997
998 Name *string `json:"name,omitempty"`
999
1000 AssetName *string `json:"assetName,omitempty"`
1001
1002 Created *date.Time `json:"created,omitempty"`
1003
1004 StartTime *date.Time `json:"startTime,omitempty"`
1005
1006 EndTime *date.Time `json:"endTime,omitempty"`
1007
1008 StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
1009
1010 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
1011
1012 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
1013 }
1014
1015
1016 func (asl AssetStreamingLocator) MarshalJSON() ([]byte, error) {
1017 objectMap := make(map[string]interface{})
1018 return json.Marshal(objectMap)
1019 }
1020
1021
1022 type BasicAudio interface {
1023 AsAacAudio() (*AacAudio, bool)
1024 AsAudio() (*Audio, bool)
1025 }
1026
1027
1028 type Audio struct {
1029
1030 Channels *int32 `json:"channels,omitempty"`
1031
1032 SamplingRate *int32 `json:"samplingRate,omitempty"`
1033
1034 Bitrate *int32 `json:"bitrate,omitempty"`
1035
1036 Label *string `json:"label,omitempty"`
1037
1038 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
1039 }
1040
1041 func unmarshalBasicAudio(body []byte) (BasicAudio, error) {
1042 var m map[string]interface{}
1043 err := json.Unmarshal(body, &m)
1044 if err != nil {
1045 return nil, err
1046 }
1047
1048 switch m["@odata.type"] {
1049 case string(OdataTypeMicrosoftMediaAacAudio):
1050 var aa AacAudio
1051 err := json.Unmarshal(body, &aa)
1052 return aa, err
1053 default:
1054 var a Audio
1055 err := json.Unmarshal(body, &a)
1056 return a, err
1057 }
1058 }
1059 func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) {
1060 var rawMessages []*json.RawMessage
1061 err := json.Unmarshal(body, &rawMessages)
1062 if err != nil {
1063 return nil, err
1064 }
1065
1066 aArray := make([]BasicAudio, len(rawMessages))
1067
1068 for index, rawMessage := range rawMessages {
1069 a, err := unmarshalBasicAudio(*rawMessage)
1070 if err != nil {
1071 return nil, err
1072 }
1073 aArray[index] = a
1074 }
1075 return aArray, nil
1076 }
1077
1078
1079 func (a Audio) MarshalJSON() ([]byte, error) {
1080 a.OdataType = OdataTypeMicrosoftMediaAudio
1081 objectMap := make(map[string]interface{})
1082 if a.Channels != nil {
1083 objectMap["channels"] = a.Channels
1084 }
1085 if a.SamplingRate != nil {
1086 objectMap["samplingRate"] = a.SamplingRate
1087 }
1088 if a.Bitrate != nil {
1089 objectMap["bitrate"] = a.Bitrate
1090 }
1091 if a.Label != nil {
1092 objectMap["label"] = a.Label
1093 }
1094 if a.OdataType != "" {
1095 objectMap["@odata.type"] = a.OdataType
1096 }
1097 return json.Marshal(objectMap)
1098 }
1099
1100
1101 func (a Audio) AsAudio() (*Audio, bool) {
1102 return &a, true
1103 }
1104
1105
1106 func (a Audio) AsBasicAudio() (BasicAudio, bool) {
1107 return &a, true
1108 }
1109
1110
1111 func (a Audio) AsAacAudio() (*AacAudio, bool) {
1112 return nil, false
1113 }
1114
1115
1116 func (a Audio) AsVideo() (*Video, bool) {
1117 return nil, false
1118 }
1119
1120
1121 func (a Audio) AsBasicVideo() (BasicVideo, bool) {
1122 return nil, false
1123 }
1124
1125
1126 func (a Audio) AsH265Video() (*H265Video, bool) {
1127 return nil, false
1128 }
1129
1130
1131 func (a Audio) AsCopyVideo() (*CopyVideo, bool) {
1132 return nil, false
1133 }
1134
1135
1136 func (a Audio) AsImage() (*Image, bool) {
1137 return nil, false
1138 }
1139
1140
1141 func (a Audio) AsBasicImage() (BasicImage, bool) {
1142 return nil, false
1143 }
1144
1145
1146 func (a Audio) AsCopyAudio() (*CopyAudio, bool) {
1147 return nil, false
1148 }
1149
1150
1151 func (a Audio) AsH264Video() (*H264Video, bool) {
1152 return nil, false
1153 }
1154
1155
1156 func (a Audio) AsJpgImage() (*JpgImage, bool) {
1157 return nil, false
1158 }
1159
1160
1161 func (a Audio) AsPngImage() (*PngImage, bool) {
1162 return nil, false
1163 }
1164
1165
1166 func (a Audio) AsCodec() (*Codec, bool) {
1167 return nil, false
1168 }
1169
1170
1171 func (a Audio) AsBasicCodec() (BasicCodec, bool) {
1172 return &a, true
1173 }
1174
1175
1176
1177 type BasicAudioAnalyzerPreset interface {
1178 AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
1179 AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
1180 }
1181
1182
1183
1184
1185 type AudioAnalyzerPreset struct {
1186
1187 AudioLanguage *string `json:"audioLanguage,omitempty"`
1188
1189 Mode AudioAnalysisMode `json:"mode,omitempty"`
1190
1191 ExperimentalOptions map[string]*string `json:"experimentalOptions"`
1192
1193 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
1194 }
1195
1196 func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) {
1197 var m map[string]interface{}
1198 err := json.Unmarshal(body, &m)
1199 if err != nil {
1200 return nil, err
1201 }
1202
1203 switch m["@odata.type"] {
1204 case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset):
1205 var vap VideoAnalyzerPreset
1206 err := json.Unmarshal(body, &vap)
1207 return vap, err
1208 default:
1209 var aap AudioAnalyzerPreset
1210 err := json.Unmarshal(body, &aap)
1211 return aap, err
1212 }
1213 }
1214 func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) {
1215 var rawMessages []*json.RawMessage
1216 err := json.Unmarshal(body, &rawMessages)
1217 if err != nil {
1218 return nil, err
1219 }
1220
1221 aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages))
1222
1223 for index, rawMessage := range rawMessages {
1224 aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage)
1225 if err != nil {
1226 return nil, err
1227 }
1228 aapArray[index] = aap
1229 }
1230 return aapArray, nil
1231 }
1232
1233
1234 func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) {
1235 aap.OdataType = OdataTypeMicrosoftMediaAudioAnalyzerPreset
1236 objectMap := make(map[string]interface{})
1237 if aap.AudioLanguage != nil {
1238 objectMap["audioLanguage"] = aap.AudioLanguage
1239 }
1240 if aap.Mode != "" {
1241 objectMap["mode"] = aap.Mode
1242 }
1243 if aap.ExperimentalOptions != nil {
1244 objectMap["experimentalOptions"] = aap.ExperimentalOptions
1245 }
1246 if aap.OdataType != "" {
1247 objectMap["@odata.type"] = aap.OdataType
1248 }
1249 return json.Marshal(objectMap)
1250 }
1251
1252
1253 func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
1254 return nil, false
1255 }
1256
1257
1258 func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
1259 return &aap, true
1260 }
1261
1262
1263 func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
1264 return &aap, true
1265 }
1266
1267
1268 func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
1269 return nil, false
1270 }
1271
1272
1273 func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
1274 return nil, false
1275 }
1276
1277
1278 func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
1279 return nil, false
1280 }
1281
1282
1283 func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) {
1284 return nil, false
1285 }
1286
1287
1288 func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
1289 return &aap, true
1290 }
1291
1292
1293 type AudioOverlay struct {
1294
1295 InputLabel *string `json:"inputLabel,omitempty"`
1296
1297 Start *string `json:"start,omitempty"`
1298
1299 End *string `json:"end,omitempty"`
1300
1301 FadeInDuration *string `json:"fadeInDuration,omitempty"`
1302
1303 FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
1304
1305 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
1306
1307 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
1308 }
1309
1310
1311 func (ao AudioOverlay) MarshalJSON() ([]byte, error) {
1312 ao.OdataType = OdataTypeMicrosoftMediaAudioOverlay
1313 objectMap := make(map[string]interface{})
1314 if ao.InputLabel != nil {
1315 objectMap["inputLabel"] = ao.InputLabel
1316 }
1317 if ao.Start != nil {
1318 objectMap["start"] = ao.Start
1319 }
1320 if ao.End != nil {
1321 objectMap["end"] = ao.End
1322 }
1323 if ao.FadeInDuration != nil {
1324 objectMap["fadeInDuration"] = ao.FadeInDuration
1325 }
1326 if ao.FadeOutDuration != nil {
1327 objectMap["fadeOutDuration"] = ao.FadeOutDuration
1328 }
1329 if ao.AudioGainLevel != nil {
1330 objectMap["audioGainLevel"] = ao.AudioGainLevel
1331 }
1332 if ao.OdataType != "" {
1333 objectMap["@odata.type"] = ao.OdataType
1334 }
1335 return json.Marshal(objectMap)
1336 }
1337
1338
1339 func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
1340 return &ao, true
1341 }
1342
1343
1344 func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
1345 return nil, false
1346 }
1347
1348
1349 func (ao AudioOverlay) AsOverlay() (*Overlay, bool) {
1350 return nil, false
1351 }
1352
1353
1354 func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) {
1355 return &ao, true
1356 }
1357
1358
1359 type BasicAudioTrackDescriptor interface {
1360 AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
1361 AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
1362 AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
1363 }
1364
1365
1366 type AudioTrackDescriptor struct {
1367
1368 ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
1369
1370 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
1371 }
1372
1373 func unmarshalBasicAudioTrackDescriptor(body []byte) (BasicAudioTrackDescriptor, error) {
1374 var m map[string]interface{}
1375 err := json.Unmarshal(body, &m)
1376 if err != nil {
1377 return nil, err
1378 }
1379
1380 switch m["@odata.type"] {
1381 case string(OdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
1382 var satba SelectAudioTrackByAttribute
1383 err := json.Unmarshal(body, &satba)
1384 return satba, err
1385 case string(OdataTypeMicrosoftMediaSelectAudioTrackByID):
1386 var satbi SelectAudioTrackByID
1387 err := json.Unmarshal(body, &satbi)
1388 return satbi, err
1389 default:
1390 var atd AudioTrackDescriptor
1391 err := json.Unmarshal(body, &atd)
1392 return atd, err
1393 }
1394 }
1395 func unmarshalBasicAudioTrackDescriptorArray(body []byte) ([]BasicAudioTrackDescriptor, error) {
1396 var rawMessages []*json.RawMessage
1397 err := json.Unmarshal(body, &rawMessages)
1398 if err != nil {
1399 return nil, err
1400 }
1401
1402 atdArray := make([]BasicAudioTrackDescriptor, len(rawMessages))
1403
1404 for index, rawMessage := range rawMessages {
1405 atd, err := unmarshalBasicAudioTrackDescriptor(*rawMessage)
1406 if err != nil {
1407 return nil, err
1408 }
1409 atdArray[index] = atd
1410 }
1411 return atdArray, nil
1412 }
1413
1414
1415 func (atd AudioTrackDescriptor) MarshalJSON() ([]byte, error) {
1416 atd.OdataType = OdataTypeMicrosoftMediaAudioTrackDescriptor
1417 objectMap := make(map[string]interface{})
1418 if atd.ChannelMapping != "" {
1419 objectMap["channelMapping"] = atd.ChannelMapping
1420 }
1421 if atd.OdataType != "" {
1422 objectMap["@odata.type"] = atd.OdataType
1423 }
1424 return json.Marshal(objectMap)
1425 }
1426
1427
1428 func (atd AudioTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
1429 return &atd, true
1430 }
1431
1432
1433 func (atd AudioTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
1434 return &atd, true
1435 }
1436
1437
1438 func (atd AudioTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
1439 return nil, false
1440 }
1441
1442
1443 func (atd AudioTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
1444 return nil, false
1445 }
1446
1447
1448 func (atd AudioTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
1449 return nil, false
1450 }
1451
1452
1453 func (atd AudioTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
1454 return nil, false
1455 }
1456
1457
1458 func (atd AudioTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
1459 return nil, false
1460 }
1461
1462
1463 func (atd AudioTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
1464 return nil, false
1465 }
1466
1467
1468 func (atd AudioTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
1469 return nil, false
1470 }
1471
1472
1473 func (atd AudioTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
1474 return &atd, true
1475 }
1476
1477
1478 type AzureEntityResource struct {
1479
1480 Etag *string `json:"etag,omitempty"`
1481
1482 ID *string `json:"id,omitempty"`
1483
1484 Name *string `json:"name,omitempty"`
1485
1486 Type *string `json:"type,omitempty"`
1487 }
1488
1489
1490 func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
1491 objectMap := make(map[string]interface{})
1492 return json.Marshal(objectMap)
1493 }
1494
1495
1496
1497 type BuiltInStandardEncoderPreset struct {
1498
1499 PresetName EncoderNamedPreset `json:"presetName,omitempty"`
1500
1501 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
1502 }
1503
1504
1505 func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) {
1506 bisep.OdataType = OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset
1507 objectMap := make(map[string]interface{})
1508 if bisep.PresetName != "" {
1509 objectMap["presetName"] = bisep.PresetName
1510 }
1511 if bisep.OdataType != "" {
1512 objectMap["@odata.type"] = bisep.OdataType
1513 }
1514 return json.Marshal(objectMap)
1515 }
1516
1517
1518 func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
1519 return nil, false
1520 }
1521
1522
1523 func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
1524 return nil, false
1525 }
1526
1527
1528 func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
1529 return nil, false
1530 }
1531
1532
1533 func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
1534 return &bisep, true
1535 }
1536
1537
1538 func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
1539 return nil, false
1540 }
1541
1542
1543 func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
1544 return nil, false
1545 }
1546
1547
1548 func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) {
1549 return nil, false
1550 }
1551
1552
1553 func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
1554 return &bisep, true
1555 }
1556
1557
1558
1559 type CbcsDrmConfiguration struct {
1560
1561 FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"`
1562
1563 PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
1564
1565 Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
1566 }
1567
1568
1569
1570 type CencDrmConfiguration struct {
1571
1572 PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
1573
1574 Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
1575 }
1576
1577
1578 type CheckNameAvailabilityInput struct {
1579
1580 Name *string `json:"name,omitempty"`
1581
1582 Type *string `json:"type,omitempty"`
1583 }
1584
1585
1586
1587 type BasicClipTime interface {
1588 AsAbsoluteClipTime() (*AbsoluteClipTime, bool)
1589 AsUtcClipTime() (*UtcClipTime, bool)
1590 AsClipTime() (*ClipTime, bool)
1591 }
1592
1593
1594
1595 type ClipTime struct {
1596
1597 OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
1598 }
1599
1600 func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) {
1601 var m map[string]interface{}
1602 err := json.Unmarshal(body, &m)
1603 if err != nil {
1604 return nil, err
1605 }
1606
1607 switch m["@odata.type"] {
1608 case string(OdataTypeMicrosoftMediaAbsoluteClipTime):
1609 var act AbsoluteClipTime
1610 err := json.Unmarshal(body, &act)
1611 return act, err
1612 case string(OdataTypeMicrosoftMediaUtcClipTime):
1613 var uct UtcClipTime
1614 err := json.Unmarshal(body, &uct)
1615 return uct, err
1616 default:
1617 var ct ClipTime
1618 err := json.Unmarshal(body, &ct)
1619 return ct, err
1620 }
1621 }
1622 func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) {
1623 var rawMessages []*json.RawMessage
1624 err := json.Unmarshal(body, &rawMessages)
1625 if err != nil {
1626 return nil, err
1627 }
1628
1629 ctArray := make([]BasicClipTime, len(rawMessages))
1630
1631 for index, rawMessage := range rawMessages {
1632 ct, err := unmarshalBasicClipTime(*rawMessage)
1633 if err != nil {
1634 return nil, err
1635 }
1636 ctArray[index] = ct
1637 }
1638 return ctArray, nil
1639 }
1640
1641
1642 func (ct ClipTime) MarshalJSON() ([]byte, error) {
1643 ct.OdataType = OdataTypeClipTime
1644 objectMap := make(map[string]interface{})
1645 if ct.OdataType != "" {
1646 objectMap["@odata.type"] = ct.OdataType
1647 }
1648 return json.Marshal(objectMap)
1649 }
1650
1651
1652 func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
1653 return nil, false
1654 }
1655
1656
1657 func (ct ClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
1658 return nil, false
1659 }
1660
1661
1662 func (ct ClipTime) AsClipTime() (*ClipTime, bool) {
1663 return &ct, true
1664 }
1665
1666
1667 func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) {
1668 return &ct, true
1669 }
1670
1671
1672 type BasicCodec interface {
1673 AsAudio() (*Audio, bool)
1674 AsBasicAudio() (BasicAudio, bool)
1675 AsAacAudio() (*AacAudio, bool)
1676 AsVideo() (*Video, bool)
1677 AsBasicVideo() (BasicVideo, bool)
1678 AsH265Video() (*H265Video, bool)
1679 AsCopyVideo() (*CopyVideo, bool)
1680 AsImage() (*Image, bool)
1681 AsBasicImage() (BasicImage, bool)
1682 AsCopyAudio() (*CopyAudio, bool)
1683 AsH264Video() (*H264Video, bool)
1684 AsJpgImage() (*JpgImage, bool)
1685 AsPngImage() (*PngImage, bool)
1686 AsCodec() (*Codec, bool)
1687 }
1688
1689
1690 type Codec struct {
1691
1692 Label *string `json:"label,omitempty"`
1693
1694 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
1695 }
1696
1697 func unmarshalBasicCodec(body []byte) (BasicCodec, error) {
1698 var m map[string]interface{}
1699 err := json.Unmarshal(body, &m)
1700 if err != nil {
1701 return nil, err
1702 }
1703
1704 switch m["@odata.type"] {
1705 case string(OdataTypeMicrosoftMediaAudio):
1706 var a Audio
1707 err := json.Unmarshal(body, &a)
1708 return a, err
1709 case string(OdataTypeMicrosoftMediaAacAudio):
1710 var aa AacAudio
1711 err := json.Unmarshal(body, &aa)
1712 return aa, err
1713 case string(OdataTypeMicrosoftMediaVideo):
1714 var vVar Video
1715 err := json.Unmarshal(body, &vVar)
1716 return vVar, err
1717 case string(OdataTypeMicrosoftMediaH265Video):
1718 var hv H265Video
1719 err := json.Unmarshal(body, &hv)
1720 return hv, err
1721 case string(OdataTypeMicrosoftMediaCopyVideo):
1722 var cv CopyVideo
1723 err := json.Unmarshal(body, &cv)
1724 return cv, err
1725 case string(OdataTypeMicrosoftMediaImage):
1726 var i Image
1727 err := json.Unmarshal(body, &i)
1728 return i, err
1729 case string(OdataTypeMicrosoftMediaCopyAudio):
1730 var ca CopyAudio
1731 err := json.Unmarshal(body, &ca)
1732 return ca, err
1733 case string(OdataTypeMicrosoftMediaH264Video):
1734 var hv H264Video
1735 err := json.Unmarshal(body, &hv)
1736 return hv, err
1737 case string(OdataTypeMicrosoftMediaJpgImage):
1738 var ji JpgImage
1739 err := json.Unmarshal(body, &ji)
1740 return ji, err
1741 case string(OdataTypeMicrosoftMediaPngImage):
1742 var pi PngImage
1743 err := json.Unmarshal(body, &pi)
1744 return pi, err
1745 default:
1746 var c Codec
1747 err := json.Unmarshal(body, &c)
1748 return c, err
1749 }
1750 }
1751 func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) {
1752 var rawMessages []*json.RawMessage
1753 err := json.Unmarshal(body, &rawMessages)
1754 if err != nil {
1755 return nil, err
1756 }
1757
1758 cArray := make([]BasicCodec, len(rawMessages))
1759
1760 for index, rawMessage := range rawMessages {
1761 c, err := unmarshalBasicCodec(*rawMessage)
1762 if err != nil {
1763 return nil, err
1764 }
1765 cArray[index] = c
1766 }
1767 return cArray, nil
1768 }
1769
1770
1771 func (c Codec) MarshalJSON() ([]byte, error) {
1772 c.OdataType = OdataTypeCodec
1773 objectMap := make(map[string]interface{})
1774 if c.Label != nil {
1775 objectMap["label"] = c.Label
1776 }
1777 if c.OdataType != "" {
1778 objectMap["@odata.type"] = c.OdataType
1779 }
1780 return json.Marshal(objectMap)
1781 }
1782
1783
1784 func (c Codec) AsAudio() (*Audio, bool) {
1785 return nil, false
1786 }
1787
1788
1789 func (c Codec) AsBasicAudio() (BasicAudio, bool) {
1790 return nil, false
1791 }
1792
1793
1794 func (c Codec) AsAacAudio() (*AacAudio, bool) {
1795 return nil, false
1796 }
1797
1798
1799 func (c Codec) AsVideo() (*Video, bool) {
1800 return nil, false
1801 }
1802
1803
1804 func (c Codec) AsBasicVideo() (BasicVideo, bool) {
1805 return nil, false
1806 }
1807
1808
1809 func (c Codec) AsH265Video() (*H265Video, bool) {
1810 return nil, false
1811 }
1812
1813
1814 func (c Codec) AsCopyVideo() (*CopyVideo, bool) {
1815 return nil, false
1816 }
1817
1818
1819 func (c Codec) AsImage() (*Image, bool) {
1820 return nil, false
1821 }
1822
1823
1824 func (c Codec) AsBasicImage() (BasicImage, bool) {
1825 return nil, false
1826 }
1827
1828
1829 func (c Codec) AsCopyAudio() (*CopyAudio, bool) {
1830 return nil, false
1831 }
1832
1833
1834 func (c Codec) AsH264Video() (*H264Video, bool) {
1835 return nil, false
1836 }
1837
1838
1839 func (c Codec) AsJpgImage() (*JpgImage, bool) {
1840 return nil, false
1841 }
1842
1843
1844 func (c Codec) AsPngImage() (*PngImage, bool) {
1845 return nil, false
1846 }
1847
1848
1849 func (c Codec) AsCodec() (*Codec, bool) {
1850 return &c, true
1851 }
1852
1853
1854 func (c Codec) AsBasicCodec() (BasicCodec, bool) {
1855 return &c, true
1856 }
1857
1858
1859 type CommonEncryptionCbcs struct {
1860
1861 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
1862
1863 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
1864
1865 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
1866
1867 Drm *CbcsDrmConfiguration `json:"drm,omitempty"`
1868 }
1869
1870
1871 type CommonEncryptionCenc struct {
1872
1873 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
1874
1875 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
1876
1877 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
1878
1879 Drm *CencDrmConfiguration `json:"drm,omitempty"`
1880 }
1881
1882
1883 type ContentKeyPolicy struct {
1884 autorest.Response `json:"-"`
1885 *ContentKeyPolicyProperties `json:"properties,omitempty"`
1886
1887 SystemData *SystemData `json:"systemData,omitempty"`
1888
1889 ID *string `json:"id,omitempty"`
1890
1891 Name *string `json:"name,omitempty"`
1892
1893 Type *string `json:"type,omitempty"`
1894 }
1895
1896
1897 func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) {
1898 objectMap := make(map[string]interface{})
1899 if ckp.ContentKeyPolicyProperties != nil {
1900 objectMap["properties"] = ckp.ContentKeyPolicyProperties
1901 }
1902 return json.Marshal(objectMap)
1903 }
1904
1905
1906 func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error {
1907 var m map[string]*json.RawMessage
1908 err := json.Unmarshal(body, &m)
1909 if err != nil {
1910 return err
1911 }
1912 for k, v := range m {
1913 switch k {
1914 case "properties":
1915 if v != nil {
1916 var contentKeyPolicyProperties ContentKeyPolicyProperties
1917 err = json.Unmarshal(*v, &contentKeyPolicyProperties)
1918 if err != nil {
1919 return err
1920 }
1921 ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties
1922 }
1923 case "systemData":
1924 if v != nil {
1925 var systemData SystemData
1926 err = json.Unmarshal(*v, &systemData)
1927 if err != nil {
1928 return err
1929 }
1930 ckp.SystemData = &systemData
1931 }
1932 case "id":
1933 if v != nil {
1934 var ID string
1935 err = json.Unmarshal(*v, &ID)
1936 if err != nil {
1937 return err
1938 }
1939 ckp.ID = &ID
1940 }
1941 case "name":
1942 if v != nil {
1943 var name string
1944 err = json.Unmarshal(*v, &name)
1945 if err != nil {
1946 return err
1947 }
1948 ckp.Name = &name
1949 }
1950 case "type":
1951 if v != nil {
1952 var typeVar string
1953 err = json.Unmarshal(*v, &typeVar)
1954 if err != nil {
1955 return err
1956 }
1957 ckp.Type = &typeVar
1958 }
1959 }
1960 }
1961
1962 return nil
1963 }
1964
1965
1966 type ContentKeyPolicyClearKeyConfiguration struct {
1967
1968 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
1969 }
1970
1971
1972 func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) {
1973 ckpckc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration
1974 objectMap := make(map[string]interface{})
1975 if ckpckc.OdataType != "" {
1976 objectMap["@odata.type"] = ckpckc.OdataType
1977 }
1978 return json.Marshal(objectMap)
1979 }
1980
1981
1982 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
1983 return &ckpckc, true
1984 }
1985
1986
1987 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
1988 return nil, false
1989 }
1990
1991
1992 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
1993 return nil, false
1994 }
1995
1996
1997 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
1998 return nil, false
1999 }
2000
2001
2002 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2003 return nil, false
2004 }
2005
2006
2007 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2008 return nil, false
2009 }
2010
2011
2012 func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2013 return &ckpckc, true
2014 }
2015
2016
2017 type ContentKeyPolicyCollection struct {
2018 autorest.Response `json:"-"`
2019
2020 Value *[]ContentKeyPolicy `json:"value,omitempty"`
2021
2022 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
2023 }
2024
2025
2026 type ContentKeyPolicyCollectionIterator struct {
2027 i int
2028 page ContentKeyPolicyCollectionPage
2029 }
2030
2031
2032
2033 func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2034 if tracing.IsEnabled() {
2035 ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext")
2036 defer func() {
2037 sc := -1
2038 if iter.Response().Response.Response != nil {
2039 sc = iter.Response().Response.Response.StatusCode
2040 }
2041 tracing.EndSpan(ctx, sc, err)
2042 }()
2043 }
2044 iter.i++
2045 if iter.i < len(iter.page.Values()) {
2046 return nil
2047 }
2048 err = iter.page.NextWithContext(ctx)
2049 if err != nil {
2050 iter.i--
2051 return err
2052 }
2053 iter.i = 0
2054 return nil
2055 }
2056
2057
2058
2059
2060 func (iter *ContentKeyPolicyCollectionIterator) Next() error {
2061 return iter.NextWithContext(context.Background())
2062 }
2063
2064
2065 func (iter ContentKeyPolicyCollectionIterator) NotDone() bool {
2066 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2067 }
2068
2069
2070 func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection {
2071 return iter.page.Response()
2072 }
2073
2074
2075
2076 func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy {
2077 if !iter.page.NotDone() {
2078 return ContentKeyPolicy{}
2079 }
2080 return iter.page.Values()[iter.i]
2081 }
2082
2083
2084 func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator {
2085 return ContentKeyPolicyCollectionIterator{page: page}
2086 }
2087
2088
2089 func (ckpc ContentKeyPolicyCollection) IsEmpty() bool {
2090 return ckpc.Value == nil || len(*ckpc.Value) == 0
2091 }
2092
2093
2094 func (ckpc ContentKeyPolicyCollection) hasNextLink() bool {
2095 return ckpc.OdataNextLink != nil && len(*ckpc.OdataNextLink) != 0
2096 }
2097
2098
2099
2100 func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
2101 if !ckpc.hasNextLink() {
2102 return nil, nil
2103 }
2104 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2105 autorest.AsJSON(),
2106 autorest.AsGet(),
2107 autorest.WithBaseURL(to.String(ckpc.OdataNextLink)))
2108 }
2109
2110
2111 type ContentKeyPolicyCollectionPage struct {
2112 fn func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)
2113 ckpc ContentKeyPolicyCollection
2114 }
2115
2116
2117
2118 func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
2119 if tracing.IsEnabled() {
2120 ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext")
2121 defer func() {
2122 sc := -1
2123 if page.Response().Response.Response != nil {
2124 sc = page.Response().Response.Response.StatusCode
2125 }
2126 tracing.EndSpan(ctx, sc, err)
2127 }()
2128 }
2129 for {
2130 next, err := page.fn(ctx, page.ckpc)
2131 if err != nil {
2132 return err
2133 }
2134 page.ckpc = next
2135 if !next.hasNextLink() || !next.IsEmpty() {
2136 break
2137 }
2138 }
2139 return nil
2140 }
2141
2142
2143
2144
2145 func (page *ContentKeyPolicyCollectionPage) Next() error {
2146 return page.NextWithContext(context.Background())
2147 }
2148
2149
2150 func (page ContentKeyPolicyCollectionPage) NotDone() bool {
2151 return !page.ckpc.IsEmpty()
2152 }
2153
2154
2155 func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection {
2156 return page.ckpc
2157 }
2158
2159
2160 func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy {
2161 if page.ckpc.IsEmpty() {
2162 return nil
2163 }
2164 return *page.ckpc.Value
2165 }
2166
2167
2168 func NewContentKeyPolicyCollectionPage(cur ContentKeyPolicyCollection, getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage {
2169 return ContentKeyPolicyCollectionPage{
2170 fn: getNextPage,
2171 ckpc: cur,
2172 }
2173 }
2174
2175
2176
2177 type BasicContentKeyPolicyConfiguration interface {
2178 AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool)
2179 AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool)
2180 AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool)
2181 AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool)
2182 AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool)
2183 AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool)
2184 }
2185
2186
2187
2188 type ContentKeyPolicyConfiguration struct {
2189
2190 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2191 }
2192
2193 func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) {
2194 var m map[string]interface{}
2195 err := json.Unmarshal(body, &m)
2196 if err != nil {
2197 return nil, err
2198 }
2199
2200 switch m["@odata.type"] {
2201 case string(OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration):
2202 var ckpckc ContentKeyPolicyClearKeyConfiguration
2203 err := json.Unmarshal(body, &ckpckc)
2204 return ckpckc, err
2205 case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration):
2206 var ckpuc ContentKeyPolicyUnknownConfiguration
2207 err := json.Unmarshal(body, &ckpuc)
2208 return ckpuc, err
2209 case string(OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration):
2210 var ckpwc ContentKeyPolicyWidevineConfiguration
2211 err := json.Unmarshal(body, &ckpwc)
2212 return ckpwc, err
2213 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration):
2214 var ckpprc ContentKeyPolicyPlayReadyConfiguration
2215 err := json.Unmarshal(body, &ckpprc)
2216 return ckpprc, err
2217 case string(OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration):
2218 var ckpfpc ContentKeyPolicyFairPlayConfiguration
2219 err := json.Unmarshal(body, &ckpfpc)
2220 return ckpfpc, err
2221 default:
2222 var ckpc ContentKeyPolicyConfiguration
2223 err := json.Unmarshal(body, &ckpc)
2224 return ckpc, err
2225 }
2226 }
2227 func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) {
2228 var rawMessages []*json.RawMessage
2229 err := json.Unmarshal(body, &rawMessages)
2230 if err != nil {
2231 return nil, err
2232 }
2233
2234 ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages))
2235
2236 for index, rawMessage := range rawMessages {
2237 ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage)
2238 if err != nil {
2239 return nil, err
2240 }
2241 ckpcArray[index] = ckpc
2242 }
2243 return ckpcArray, nil
2244 }
2245
2246
2247 func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) {
2248 ckpc.OdataType = OdataTypeContentKeyPolicyConfiguration
2249 objectMap := make(map[string]interface{})
2250 if ckpc.OdataType != "" {
2251 objectMap["@odata.type"] = ckpc.OdataType
2252 }
2253 return json.Marshal(objectMap)
2254 }
2255
2256
2257 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2258 return nil, false
2259 }
2260
2261
2262 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2263 return nil, false
2264 }
2265
2266
2267 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2268 return nil, false
2269 }
2270
2271
2272 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2273 return nil, false
2274 }
2275
2276
2277 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2278 return nil, false
2279 }
2280
2281
2282 func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2283 return &ckpc, true
2284 }
2285
2286
2287 func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2288 return &ckpc, true
2289 }
2290
2291
2292 type ContentKeyPolicyFairPlayConfiguration struct {
2293
2294 Ask *[]byte `json:"ask,omitempty"`
2295
2296 FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"`
2297
2298 FairPlayPfx *string `json:"fairPlayPfx,omitempty"`
2299
2300 RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"`
2301
2302 RentalDuration *int64 `json:"rentalDuration,omitempty"`
2303
2304 OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"`
2305
2306 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2307 }
2308
2309
2310 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) {
2311 ckpfpc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration
2312 objectMap := make(map[string]interface{})
2313 if ckpfpc.Ask != nil {
2314 objectMap["ask"] = ckpfpc.Ask
2315 }
2316 if ckpfpc.FairPlayPfxPassword != nil {
2317 objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword
2318 }
2319 if ckpfpc.FairPlayPfx != nil {
2320 objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx
2321 }
2322 if ckpfpc.RentalAndLeaseKeyType != "" {
2323 objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType
2324 }
2325 if ckpfpc.RentalDuration != nil {
2326 objectMap["rentalDuration"] = ckpfpc.RentalDuration
2327 }
2328 if ckpfpc.OfflineRentalConfiguration != nil {
2329 objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration
2330 }
2331 if ckpfpc.OdataType != "" {
2332 objectMap["@odata.type"] = ckpfpc.OdataType
2333 }
2334 return json.Marshal(objectMap)
2335 }
2336
2337
2338 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2339 return nil, false
2340 }
2341
2342
2343 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2344 return nil, false
2345 }
2346
2347
2348 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2349 return nil, false
2350 }
2351
2352
2353 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2354 return nil, false
2355 }
2356
2357
2358 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2359 return &ckpfpc, true
2360 }
2361
2362
2363 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2364 return nil, false
2365 }
2366
2367
2368 func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2369 return &ckpfpc, true
2370 }
2371
2372
2373 type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct {
2374
2375 PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"`
2376
2377 StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"`
2378 }
2379
2380
2381
2382 type ContentKeyPolicyOpenRestriction struct {
2383
2384 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
2385 }
2386
2387
2388 func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) {
2389 ckpor.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction
2390 objectMap := make(map[string]interface{})
2391 if ckpor.OdataType != "" {
2392 objectMap["@odata.type"] = ckpor.OdataType
2393 }
2394 return json.Marshal(objectMap)
2395 }
2396
2397
2398 func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
2399 return &ckpor, true
2400 }
2401
2402
2403 func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
2404 return nil, false
2405 }
2406
2407
2408 func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
2409 return nil, false
2410 }
2411
2412
2413 func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
2414 return nil, false
2415 }
2416
2417
2418 func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
2419 return &ckpor, true
2420 }
2421
2422
2423 type ContentKeyPolicyOption struct {
2424
2425 PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"`
2426
2427 Name *string `json:"name,omitempty"`
2428
2429 Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"`
2430
2431 Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"`
2432 }
2433
2434
2435 func (ckpo ContentKeyPolicyOption) MarshalJSON() ([]byte, error) {
2436 objectMap := make(map[string]interface{})
2437 if ckpo.Name != nil {
2438 objectMap["name"] = ckpo.Name
2439 }
2440 objectMap["configuration"] = ckpo.Configuration
2441 objectMap["restriction"] = ckpo.Restriction
2442 return json.Marshal(objectMap)
2443 }
2444
2445
2446 func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error {
2447 var m map[string]*json.RawMessage
2448 err := json.Unmarshal(body, &m)
2449 if err != nil {
2450 return err
2451 }
2452 for k, v := range m {
2453 switch k {
2454 case "policyOptionId":
2455 if v != nil {
2456 var policyOptionID uuid.UUID
2457 err = json.Unmarshal(*v, &policyOptionID)
2458 if err != nil {
2459 return err
2460 }
2461 ckpo.PolicyOptionID = &policyOptionID
2462 }
2463 case "name":
2464 if v != nil {
2465 var name string
2466 err = json.Unmarshal(*v, &name)
2467 if err != nil {
2468 return err
2469 }
2470 ckpo.Name = &name
2471 }
2472 case "configuration":
2473 if v != nil {
2474 configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v)
2475 if err != nil {
2476 return err
2477 }
2478 ckpo.Configuration = configuration
2479 }
2480 case "restriction":
2481 if v != nil {
2482 restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v)
2483 if err != nil {
2484 return err
2485 }
2486 ckpo.Restriction = restriction
2487 }
2488 }
2489 }
2490
2491 return nil
2492 }
2493
2494
2495 type ContentKeyPolicyPlayReadyConfiguration struct {
2496
2497 Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"`
2498
2499 ResponseCustomData *string `json:"responseCustomData,omitempty"`
2500
2501 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2502 }
2503
2504
2505 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) {
2506 ckpprc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration
2507 objectMap := make(map[string]interface{})
2508 if ckpprc.Licenses != nil {
2509 objectMap["licenses"] = ckpprc.Licenses
2510 }
2511 if ckpprc.ResponseCustomData != nil {
2512 objectMap["responseCustomData"] = ckpprc.ResponseCustomData
2513 }
2514 if ckpprc.OdataType != "" {
2515 objectMap["@odata.type"] = ckpprc.OdataType
2516 }
2517 return json.Marshal(objectMap)
2518 }
2519
2520
2521 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2522 return nil, false
2523 }
2524
2525
2526 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2527 return nil, false
2528 }
2529
2530
2531 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2532 return nil, false
2533 }
2534
2535
2536 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2537 return &ckpprc, true
2538 }
2539
2540
2541 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2542 return nil, false
2543 }
2544
2545
2546 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2547 return nil, false
2548 }
2549
2550
2551 func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2552 return &ckpprc, true
2553 }
2554
2555
2556
2557 type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct {
2558
2559 OdataType OdataType `json:"@odata.type,omitempty"`
2560 }
2561
2562
2563 func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) {
2564 ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
2565 objectMap := make(map[string]interface{})
2566 if ckpprcekfh.OdataType != "" {
2567 objectMap["@odata.type"] = ckpprcekfh.OdataType
2568 }
2569 return json.Marshal(objectMap)
2570 }
2571
2572
2573 func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2574 return &ckpprcekfh, true
2575 }
2576
2577
2578 func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2579 return nil, false
2580 }
2581
2582
2583 func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2584 return nil, false
2585 }
2586
2587
2588 func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2589 return &ckpprcekfh, true
2590 }
2591
2592
2593
2594 type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct {
2595
2596 KeyID *uuid.UUID `json:"keyId,omitempty"`
2597
2598 OdataType OdataType `json:"@odata.type,omitempty"`
2599 }
2600
2601
2602 func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) {
2603 ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
2604 objectMap := make(map[string]interface{})
2605 if ckpprcekfki.KeyID != nil {
2606 objectMap["keyId"] = ckpprcekfki.KeyID
2607 }
2608 if ckpprcekfki.OdataType != "" {
2609 objectMap["@odata.type"] = ckpprcekfki.OdataType
2610 }
2611 return json.Marshal(objectMap)
2612 }
2613
2614
2615 func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2616 return nil, false
2617 }
2618
2619
2620 func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2621 return &ckpprcekfki, true
2622 }
2623
2624
2625 func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2626 return nil, false
2627 }
2628
2629
2630 func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2631 return &ckpprcekfki, true
2632 }
2633
2634
2635
2636 type BasicContentKeyPolicyPlayReadyContentKeyLocation interface {
2637 AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool)
2638 AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool)
2639 AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool)
2640 }
2641
2642
2643
2644 type ContentKeyPolicyPlayReadyContentKeyLocation struct {
2645
2646 OdataType OdataType `json:"@odata.type,omitempty"`
2647 }
2648
2649 func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
2650 var m map[string]interface{}
2651 err := json.Unmarshal(body, &m)
2652 if err != nil {
2653 return nil, err
2654 }
2655
2656 switch m["@odata.type"] {
2657 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader):
2658 var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
2659 err := json.Unmarshal(body, &ckpprcekfh)
2660 return ckpprcekfh, err
2661 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier):
2662 var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
2663 err := json.Unmarshal(body, &ckpprcekfki)
2664 return ckpprcekfki, err
2665 default:
2666 var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation
2667 err := json.Unmarshal(body, &ckpprckl)
2668 return ckpprckl, err
2669 }
2670 }
2671 func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
2672 var rawMessages []*json.RawMessage
2673 err := json.Unmarshal(body, &rawMessages)
2674 if err != nil {
2675 return nil, err
2676 }
2677
2678 ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages))
2679
2680 for index, rawMessage := range rawMessages {
2681 ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage)
2682 if err != nil {
2683 return nil, err
2684 }
2685 ckpprcklArray[index] = ckpprckl
2686 }
2687 return ckpprcklArray, nil
2688 }
2689
2690
2691 func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) {
2692 ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation
2693 objectMap := make(map[string]interface{})
2694 if ckpprckl.OdataType != "" {
2695 objectMap["@odata.type"] = ckpprckl.OdataType
2696 }
2697 return json.Marshal(objectMap)
2698 }
2699
2700
2701 func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2702 return nil, false
2703 }
2704
2705
2706 func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2707 return nil, false
2708 }
2709
2710
2711 func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2712 return &ckpprckl, true
2713 }
2714
2715
2716 func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2717 return &ckpprckl, true
2718 }
2719
2720
2721
2722 type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct {
2723
2724 BestEffort *bool `json:"bestEffort,omitempty"`
2725
2726 ConfigurationData *int32 `json:"configurationData,omitempty"`
2727 }
2728
2729
2730 type ContentKeyPolicyPlayReadyLicense struct {
2731
2732 AllowTestDevices *bool `json:"allowTestDevices,omitempty"`
2733
2734 BeginDate *date.Time `json:"beginDate,omitempty"`
2735
2736 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
2737
2738 RelativeBeginDate *string `json:"relativeBeginDate,omitempty"`
2739
2740 RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"`
2741
2742 GracePeriod *string `json:"gracePeriod,omitempty"`
2743
2744 PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"`
2745
2746 LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"`
2747
2748 ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"`
2749
2750 ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"`
2751 }
2752
2753
2754 func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error {
2755 var m map[string]*json.RawMessage
2756 err := json.Unmarshal(body, &m)
2757 if err != nil {
2758 return err
2759 }
2760 for k, v := range m {
2761 switch k {
2762 case "allowTestDevices":
2763 if v != nil {
2764 var allowTestDevices bool
2765 err = json.Unmarshal(*v, &allowTestDevices)
2766 if err != nil {
2767 return err
2768 }
2769 ckpprl.AllowTestDevices = &allowTestDevices
2770 }
2771 case "beginDate":
2772 if v != nil {
2773 var beginDate date.Time
2774 err = json.Unmarshal(*v, &beginDate)
2775 if err != nil {
2776 return err
2777 }
2778 ckpprl.BeginDate = &beginDate
2779 }
2780 case "expirationDate":
2781 if v != nil {
2782 var expirationDate date.Time
2783 err = json.Unmarshal(*v, &expirationDate)
2784 if err != nil {
2785 return err
2786 }
2787 ckpprl.ExpirationDate = &expirationDate
2788 }
2789 case "relativeBeginDate":
2790 if v != nil {
2791 var relativeBeginDate string
2792 err = json.Unmarshal(*v, &relativeBeginDate)
2793 if err != nil {
2794 return err
2795 }
2796 ckpprl.RelativeBeginDate = &relativeBeginDate
2797 }
2798 case "relativeExpirationDate":
2799 if v != nil {
2800 var relativeExpirationDate string
2801 err = json.Unmarshal(*v, &relativeExpirationDate)
2802 if err != nil {
2803 return err
2804 }
2805 ckpprl.RelativeExpirationDate = &relativeExpirationDate
2806 }
2807 case "gracePeriod":
2808 if v != nil {
2809 var gracePeriod string
2810 err = json.Unmarshal(*v, &gracePeriod)
2811 if err != nil {
2812 return err
2813 }
2814 ckpprl.GracePeriod = &gracePeriod
2815 }
2816 case "playRight":
2817 if v != nil {
2818 var playRight ContentKeyPolicyPlayReadyPlayRight
2819 err = json.Unmarshal(*v, &playRight)
2820 if err != nil {
2821 return err
2822 }
2823 ckpprl.PlayRight = &playRight
2824 }
2825 case "licenseType":
2826 if v != nil {
2827 var licenseType ContentKeyPolicyPlayReadyLicenseType
2828 err = json.Unmarshal(*v, &licenseType)
2829 if err != nil {
2830 return err
2831 }
2832 ckpprl.LicenseType = licenseType
2833 }
2834 case "contentKeyLocation":
2835 if v != nil {
2836 contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v)
2837 if err != nil {
2838 return err
2839 }
2840 ckpprl.ContentKeyLocation = contentKeyLocation
2841 }
2842 case "contentType":
2843 if v != nil {
2844 var contentType ContentKeyPolicyPlayReadyContentType
2845 err = json.Unmarshal(*v, &contentType)
2846 if err != nil {
2847 return err
2848 }
2849 ckpprl.ContentType = contentType
2850 }
2851 }
2852 }
2853
2854 return nil
2855 }
2856
2857
2858 type ContentKeyPolicyPlayReadyPlayRight struct {
2859
2860 FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"`
2861
2862 ScmsRestriction *int32 `json:"scmsRestriction,omitempty"`
2863
2864 AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"`
2865
2866 ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"`
2867
2868 DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"`
2869
2870 ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"`
2871
2872 ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"`
2873
2874 AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"`
2875
2876 UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"`
2877
2878 CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"`
2879
2880 AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"`
2881
2882 CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"`
2883
2884 UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"`
2885 }
2886
2887
2888 type ContentKeyPolicyProperties struct {
2889 autorest.Response `json:"-"`
2890
2891 PolicyID *uuid.UUID `json:"policyId,omitempty"`
2892
2893 Created *date.Time `json:"created,omitempty"`
2894
2895 LastModified *date.Time `json:"lastModified,omitempty"`
2896
2897 Description *string `json:"description,omitempty"`
2898
2899 Options *[]ContentKeyPolicyOption `json:"options,omitempty"`
2900 }
2901
2902
2903 func (ckpp ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) {
2904 objectMap := make(map[string]interface{})
2905 if ckpp.Description != nil {
2906 objectMap["description"] = ckpp.Description
2907 }
2908 if ckpp.Options != nil {
2909 objectMap["options"] = ckpp.Options
2910 }
2911 return json.Marshal(objectMap)
2912 }
2913
2914
2915
2916 type BasicContentKeyPolicyRestriction interface {
2917 AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool)
2918 AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool)
2919 AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool)
2920 AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool)
2921 }
2922
2923
2924
2925 type ContentKeyPolicyRestriction struct {
2926
2927 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
2928 }
2929
2930 func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) {
2931 var m map[string]interface{}
2932 err := json.Unmarshal(body, &m)
2933 if err != nil {
2934 return nil, err
2935 }
2936
2937 switch m["@odata.type"] {
2938 case string(OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction):
2939 var ckpor ContentKeyPolicyOpenRestriction
2940 err := json.Unmarshal(body, &ckpor)
2941 return ckpor, err
2942 case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction):
2943 var ckpur ContentKeyPolicyUnknownRestriction
2944 err := json.Unmarshal(body, &ckpur)
2945 return ckpur, err
2946 case string(OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction):
2947 var ckptr ContentKeyPolicyTokenRestriction
2948 err := json.Unmarshal(body, &ckptr)
2949 return ckptr, err
2950 default:
2951 var ckpr ContentKeyPolicyRestriction
2952 err := json.Unmarshal(body, &ckpr)
2953 return ckpr, err
2954 }
2955 }
2956 func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) {
2957 var rawMessages []*json.RawMessage
2958 err := json.Unmarshal(body, &rawMessages)
2959 if err != nil {
2960 return nil, err
2961 }
2962
2963 ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages))
2964
2965 for index, rawMessage := range rawMessages {
2966 ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage)
2967 if err != nil {
2968 return nil, err
2969 }
2970 ckprArray[index] = ckpr
2971 }
2972 return ckprArray, nil
2973 }
2974
2975
2976 func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) {
2977 ckpr.OdataType = OdataTypeContentKeyPolicyRestriction
2978 objectMap := make(map[string]interface{})
2979 if ckpr.OdataType != "" {
2980 objectMap["@odata.type"] = ckpr.OdataType
2981 }
2982 return json.Marshal(objectMap)
2983 }
2984
2985
2986 func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
2987 return nil, false
2988 }
2989
2990
2991 func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
2992 return nil, false
2993 }
2994
2995
2996 func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
2997 return nil, false
2998 }
2999
3000
3001 func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3002 return &ckpr, true
3003 }
3004
3005
3006 func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3007 return &ckpr, true
3008 }
3009
3010
3011
3012 type BasicContentKeyPolicyRestrictionTokenKey interface {
3013 AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool)
3014 AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool)
3015 AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool)
3016 AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool)
3017 }
3018
3019
3020
3021 type ContentKeyPolicyRestrictionTokenKey struct {
3022
3023 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3024 }
3025
3026 func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) {
3027 var m map[string]interface{}
3028 err := json.Unmarshal(body, &m)
3029 if err != nil {
3030 return nil, err
3031 }
3032
3033 switch m["@odata.type"] {
3034 case string(OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey):
3035 var ckpstk ContentKeyPolicySymmetricTokenKey
3036 err := json.Unmarshal(body, &ckpstk)
3037 return ckpstk, err
3038 case string(OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey):
3039 var ckprtk ContentKeyPolicyRsaTokenKey
3040 err := json.Unmarshal(body, &ckprtk)
3041 return ckprtk, err
3042 case string(OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey):
3043 var ckpxctk ContentKeyPolicyX509CertificateTokenKey
3044 err := json.Unmarshal(body, &ckpxctk)
3045 return ckpxctk, err
3046 default:
3047 var ckprtk ContentKeyPolicyRestrictionTokenKey
3048 err := json.Unmarshal(body, &ckprtk)
3049 return ckprtk, err
3050 }
3051 }
3052 func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) {
3053 var rawMessages []*json.RawMessage
3054 err := json.Unmarshal(body, &rawMessages)
3055 if err != nil {
3056 return nil, err
3057 }
3058
3059 ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages))
3060
3061 for index, rawMessage := range rawMessages {
3062 ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage)
3063 if err != nil {
3064 return nil, err
3065 }
3066 ckprtkArray[index] = ckprtk
3067 }
3068 return ckprtkArray, nil
3069 }
3070
3071
3072 func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) {
3073 ckprtk.OdataType = OdataTypeContentKeyPolicyRestrictionTokenKey
3074 objectMap := make(map[string]interface{})
3075 if ckprtk.OdataType != "" {
3076 objectMap["@odata.type"] = ckprtk.OdataType
3077 }
3078 return json.Marshal(objectMap)
3079 }
3080
3081
3082 func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3083 return nil, false
3084 }
3085
3086
3087 func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3088 return nil, false
3089 }
3090
3091
3092 func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3093 return nil, false
3094 }
3095
3096
3097 func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3098 return &ckprtk, true
3099 }
3100
3101
3102 func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3103 return &ckprtk, true
3104 }
3105
3106
3107 type ContentKeyPolicyRsaTokenKey struct {
3108
3109 Exponent *[]byte `json:"exponent,omitempty"`
3110
3111 Modulus *[]byte `json:"modulus,omitempty"`
3112
3113 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3114 }
3115
3116
3117 func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) {
3118 ckprtk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey
3119 objectMap := make(map[string]interface{})
3120 if ckprtk.Exponent != nil {
3121 objectMap["exponent"] = ckprtk.Exponent
3122 }
3123 if ckprtk.Modulus != nil {
3124 objectMap["modulus"] = ckprtk.Modulus
3125 }
3126 if ckprtk.OdataType != "" {
3127 objectMap["@odata.type"] = ckprtk.OdataType
3128 }
3129 return json.Marshal(objectMap)
3130 }
3131
3132
3133 func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3134 return nil, false
3135 }
3136
3137
3138 func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3139 return &ckprtk, true
3140 }
3141
3142
3143 func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3144 return nil, false
3145 }
3146
3147
3148 func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3149 return nil, false
3150 }
3151
3152
3153 func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3154 return &ckprtk, true
3155 }
3156
3157
3158 type ContentKeyPolicySymmetricTokenKey struct {
3159
3160 KeyValue *[]byte `json:"keyValue,omitempty"`
3161
3162 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3163 }
3164
3165
3166 func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) {
3167 ckpstk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey
3168 objectMap := make(map[string]interface{})
3169 if ckpstk.KeyValue != nil {
3170 objectMap["keyValue"] = ckpstk.KeyValue
3171 }
3172 if ckpstk.OdataType != "" {
3173 objectMap["@odata.type"] = ckpstk.OdataType
3174 }
3175 return json.Marshal(objectMap)
3176 }
3177
3178
3179 func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3180 return &ckpstk, true
3181 }
3182
3183
3184 func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3185 return nil, false
3186 }
3187
3188
3189 func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3190 return nil, false
3191 }
3192
3193
3194 func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3195 return nil, false
3196 }
3197
3198
3199 func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3200 return &ckpstk, true
3201 }
3202
3203
3204 type ContentKeyPolicyTokenClaim struct {
3205
3206 ClaimType *string `json:"claimType,omitempty"`
3207
3208 ClaimValue *string `json:"claimValue,omitempty"`
3209 }
3210
3211
3212
3213 type ContentKeyPolicyTokenRestriction struct {
3214
3215 Issuer *string `json:"issuer,omitempty"`
3216
3217 Audience *string `json:"audience,omitempty"`
3218
3219 PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"`
3220
3221 AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"`
3222
3223 RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"`
3224
3225 RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"`
3226
3227 OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"`
3228
3229 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
3230 }
3231
3232
3233 func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) {
3234 ckptr.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction
3235 objectMap := make(map[string]interface{})
3236 if ckptr.Issuer != nil {
3237 objectMap["issuer"] = ckptr.Issuer
3238 }
3239 if ckptr.Audience != nil {
3240 objectMap["audience"] = ckptr.Audience
3241 }
3242 objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey
3243 if ckptr.AlternateVerificationKeys != nil {
3244 objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys
3245 }
3246 if ckptr.RequiredClaims != nil {
3247 objectMap["requiredClaims"] = ckptr.RequiredClaims
3248 }
3249 if ckptr.RestrictionTokenType != "" {
3250 objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType
3251 }
3252 if ckptr.OpenIDConnectDiscoveryDocument != nil {
3253 objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument
3254 }
3255 if ckptr.OdataType != "" {
3256 objectMap["@odata.type"] = ckptr.OdataType
3257 }
3258 return json.Marshal(objectMap)
3259 }
3260
3261
3262 func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
3263 return nil, false
3264 }
3265
3266
3267 func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
3268 return nil, false
3269 }
3270
3271
3272 func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
3273 return &ckptr, true
3274 }
3275
3276
3277 func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3278 return nil, false
3279 }
3280
3281
3282 func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3283 return &ckptr, true
3284 }
3285
3286
3287 func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error {
3288 var m map[string]*json.RawMessage
3289 err := json.Unmarshal(body, &m)
3290 if err != nil {
3291 return err
3292 }
3293 for k, v := range m {
3294 switch k {
3295 case "issuer":
3296 if v != nil {
3297 var issuer string
3298 err = json.Unmarshal(*v, &issuer)
3299 if err != nil {
3300 return err
3301 }
3302 ckptr.Issuer = &issuer
3303 }
3304 case "audience":
3305 if v != nil {
3306 var audience string
3307 err = json.Unmarshal(*v, &audience)
3308 if err != nil {
3309 return err
3310 }
3311 ckptr.Audience = &audience
3312 }
3313 case "primaryVerificationKey":
3314 if v != nil {
3315 primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v)
3316 if err != nil {
3317 return err
3318 }
3319 ckptr.PrimaryVerificationKey = primaryVerificationKey
3320 }
3321 case "alternateVerificationKeys":
3322 if v != nil {
3323 alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v)
3324 if err != nil {
3325 return err
3326 }
3327 ckptr.AlternateVerificationKeys = &alternateVerificationKeys
3328 }
3329 case "requiredClaims":
3330 if v != nil {
3331 var requiredClaims []ContentKeyPolicyTokenClaim
3332 err = json.Unmarshal(*v, &requiredClaims)
3333 if err != nil {
3334 return err
3335 }
3336 ckptr.RequiredClaims = &requiredClaims
3337 }
3338 case "restrictionTokenType":
3339 if v != nil {
3340 var restrictionTokenType ContentKeyPolicyRestrictionTokenType
3341 err = json.Unmarshal(*v, &restrictionTokenType)
3342 if err != nil {
3343 return err
3344 }
3345 ckptr.RestrictionTokenType = restrictionTokenType
3346 }
3347 case "openIdConnectDiscoveryDocument":
3348 if v != nil {
3349 var openIDConnectDiscoveryDocument string
3350 err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument)
3351 if err != nil {
3352 return err
3353 }
3354 ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument
3355 }
3356 case "@odata.type":
3357 if v != nil {
3358 var odataType OdataTypeBasicContentKeyPolicyRestriction
3359 err = json.Unmarshal(*v, &odataType)
3360 if err != nil {
3361 return err
3362 }
3363 ckptr.OdataType = odataType
3364 }
3365 }
3366 }
3367
3368 return nil
3369 }
3370
3371
3372
3373 type ContentKeyPolicyUnknownConfiguration struct {
3374
3375 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
3376 }
3377
3378
3379 func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) {
3380 ckpuc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration
3381 objectMap := make(map[string]interface{})
3382 if ckpuc.OdataType != "" {
3383 objectMap["@odata.type"] = ckpuc.OdataType
3384 }
3385 return json.Marshal(objectMap)
3386 }
3387
3388
3389 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
3390 return nil, false
3391 }
3392
3393
3394 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
3395 return &ckpuc, true
3396 }
3397
3398
3399 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
3400 return nil, false
3401 }
3402
3403
3404 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
3405 return nil, false
3406 }
3407
3408
3409 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
3410 return nil, false
3411 }
3412
3413
3414 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
3415 return nil, false
3416 }
3417
3418
3419 func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
3420 return &ckpuc, true
3421 }
3422
3423
3424
3425 type ContentKeyPolicyUnknownRestriction struct {
3426
3427 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
3428 }
3429
3430
3431 func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) {
3432 ckpur.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction
3433 objectMap := make(map[string]interface{})
3434 if ckpur.OdataType != "" {
3435 objectMap["@odata.type"] = ckpur.OdataType
3436 }
3437 return json.Marshal(objectMap)
3438 }
3439
3440
3441 func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
3442 return nil, false
3443 }
3444
3445
3446 func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
3447 return &ckpur, true
3448 }
3449
3450
3451 func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
3452 return nil, false
3453 }
3454
3455
3456 func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3457 return nil, false
3458 }
3459
3460
3461 func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3462 return &ckpur, true
3463 }
3464
3465
3466 type ContentKeyPolicyWidevineConfiguration struct {
3467
3468 WidevineTemplate *string `json:"widevineTemplate,omitempty"`
3469
3470 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
3471 }
3472
3473
3474 func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) {
3475 ckpwc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration
3476 objectMap := make(map[string]interface{})
3477 if ckpwc.WidevineTemplate != nil {
3478 objectMap["widevineTemplate"] = ckpwc.WidevineTemplate
3479 }
3480 if ckpwc.OdataType != "" {
3481 objectMap["@odata.type"] = ckpwc.OdataType
3482 }
3483 return json.Marshal(objectMap)
3484 }
3485
3486
3487 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
3488 return nil, false
3489 }
3490
3491
3492 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
3493 return nil, false
3494 }
3495
3496
3497 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
3498 return &ckpwc, true
3499 }
3500
3501
3502 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
3503 return nil, false
3504 }
3505
3506
3507 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
3508 return nil, false
3509 }
3510
3511
3512 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
3513 return nil, false
3514 }
3515
3516
3517 func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
3518 return &ckpwc, true
3519 }
3520
3521
3522 type ContentKeyPolicyX509CertificateTokenKey struct {
3523
3524 RawBody *[]byte `json:"rawBody,omitempty"`
3525
3526 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3527 }
3528
3529
3530 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) {
3531 ckpxctk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey
3532 objectMap := make(map[string]interface{})
3533 if ckpxctk.RawBody != nil {
3534 objectMap["rawBody"] = ckpxctk.RawBody
3535 }
3536 if ckpxctk.OdataType != "" {
3537 objectMap["@odata.type"] = ckpxctk.OdataType
3538 }
3539 return json.Marshal(objectMap)
3540 }
3541
3542
3543 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3544 return nil, false
3545 }
3546
3547
3548 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3549 return nil, false
3550 }
3551
3552
3553 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3554 return &ckpxctk, true
3555 }
3556
3557
3558 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3559 return nil, false
3560 }
3561
3562
3563 func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3564 return &ckpxctk, true
3565 }
3566
3567
3568 type CopyAudio struct {
3569
3570 Label *string `json:"label,omitempty"`
3571
3572 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
3573 }
3574
3575
3576 func (ca CopyAudio) MarshalJSON() ([]byte, error) {
3577 ca.OdataType = OdataTypeMicrosoftMediaCopyAudio
3578 objectMap := make(map[string]interface{})
3579 if ca.Label != nil {
3580 objectMap["label"] = ca.Label
3581 }
3582 if ca.OdataType != "" {
3583 objectMap["@odata.type"] = ca.OdataType
3584 }
3585 return json.Marshal(objectMap)
3586 }
3587
3588
3589 func (ca CopyAudio) AsAudio() (*Audio, bool) {
3590 return nil, false
3591 }
3592
3593
3594 func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) {
3595 return nil, false
3596 }
3597
3598
3599 func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) {
3600 return nil, false
3601 }
3602
3603
3604 func (ca CopyAudio) AsVideo() (*Video, bool) {
3605 return nil, false
3606 }
3607
3608
3609 func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) {
3610 return nil, false
3611 }
3612
3613
3614 func (ca CopyAudio) AsH265Video() (*H265Video, bool) {
3615 return nil, false
3616 }
3617
3618
3619 func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) {
3620 return nil, false
3621 }
3622
3623
3624 func (ca CopyAudio) AsImage() (*Image, bool) {
3625 return nil, false
3626 }
3627
3628
3629 func (ca CopyAudio) AsBasicImage() (BasicImage, bool) {
3630 return nil, false
3631 }
3632
3633
3634 func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) {
3635 return &ca, true
3636 }
3637
3638
3639 func (ca CopyAudio) AsH264Video() (*H264Video, bool) {
3640 return nil, false
3641 }
3642
3643
3644 func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) {
3645 return nil, false
3646 }
3647
3648
3649 func (ca CopyAudio) AsPngImage() (*PngImage, bool) {
3650 return nil, false
3651 }
3652
3653
3654 func (ca CopyAudio) AsCodec() (*Codec, bool) {
3655 return nil, false
3656 }
3657
3658
3659 func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) {
3660 return &ca, true
3661 }
3662
3663
3664 type CopyVideo struct {
3665
3666 Label *string `json:"label,omitempty"`
3667
3668 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
3669 }
3670
3671
3672 func (cv CopyVideo) MarshalJSON() ([]byte, error) {
3673 cv.OdataType = OdataTypeMicrosoftMediaCopyVideo
3674 objectMap := make(map[string]interface{})
3675 if cv.Label != nil {
3676 objectMap["label"] = cv.Label
3677 }
3678 if cv.OdataType != "" {
3679 objectMap["@odata.type"] = cv.OdataType
3680 }
3681 return json.Marshal(objectMap)
3682 }
3683
3684
3685 func (cv CopyVideo) AsAudio() (*Audio, bool) {
3686 return nil, false
3687 }
3688
3689
3690 func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) {
3691 return nil, false
3692 }
3693
3694
3695 func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) {
3696 return nil, false
3697 }
3698
3699
3700 func (cv CopyVideo) AsVideo() (*Video, bool) {
3701 return nil, false
3702 }
3703
3704
3705 func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) {
3706 return nil, false
3707 }
3708
3709
3710 func (cv CopyVideo) AsH265Video() (*H265Video, bool) {
3711 return nil, false
3712 }
3713
3714
3715 func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) {
3716 return &cv, true
3717 }
3718
3719
3720 func (cv CopyVideo) AsImage() (*Image, bool) {
3721 return nil, false
3722 }
3723
3724
3725 func (cv CopyVideo) AsBasicImage() (BasicImage, bool) {
3726 return nil, false
3727 }
3728
3729
3730 func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) {
3731 return nil, false
3732 }
3733
3734
3735 func (cv CopyVideo) AsH264Video() (*H264Video, bool) {
3736 return nil, false
3737 }
3738
3739
3740 func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) {
3741 return nil, false
3742 }
3743
3744
3745 func (cv CopyVideo) AsPngImage() (*PngImage, bool) {
3746 return nil, false
3747 }
3748
3749
3750 func (cv CopyVideo) AsCodec() (*Codec, bool) {
3751 return nil, false
3752 }
3753
3754
3755 func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) {
3756 return &cv, true
3757 }
3758
3759
3760 type CrossSiteAccessPolicies struct {
3761
3762 ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"`
3763
3764 CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"`
3765 }
3766
3767
3768 type DefaultKey struct {
3769
3770 Label *string `json:"label,omitempty"`
3771
3772 PolicyName *string `json:"policyName,omitempty"`
3773 }
3774
3775
3776 type Deinterlace struct {
3777
3778 Parity DeinterlaceParity `json:"parity,omitempty"`
3779
3780 Mode DeinterlaceMode `json:"mode,omitempty"`
3781 }
3782
3783
3784 type EdgePolicies struct {
3785 autorest.Response `json:"-"`
3786 UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"`
3787 }
3788
3789
3790 type EdgeUsageDataCollectionPolicy struct {
3791
3792 DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"`
3793
3794 DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"`
3795
3796 MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"`
3797
3798 EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"`
3799 }
3800
3801
3802 type EdgeUsageDataEventHub struct {
3803
3804 Name *string `json:"name,omitempty"`
3805
3806 Namespace *string `json:"namespace,omitempty"`
3807
3808 Token *string `json:"token,omitempty"`
3809 }
3810
3811
3812 type EnabledProtocols struct {
3813
3814 Download *bool `json:"download,omitempty"`
3815
3816 Dash *bool `json:"dash,omitempty"`
3817
3818 Hls *bool `json:"hls,omitempty"`
3819
3820 SmoothStreaming *bool `json:"smoothStreaming,omitempty"`
3821 }
3822
3823
3824 type EntityNameAvailabilityCheckOutput struct {
3825 autorest.Response `json:"-"`
3826
3827 NameAvailable *bool `json:"nameAvailable,omitempty"`
3828
3829 Reason *string `json:"reason,omitempty"`
3830
3831 Message *string `json:"message,omitempty"`
3832 }
3833
3834
3835 type EnvelopeEncryption struct {
3836
3837 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
3838
3839 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
3840
3841 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
3842
3843 CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"`
3844 }
3845
3846
3847
3848 type FaceDetectorPreset struct {
3849
3850 Resolution AnalysisResolution `json:"resolution,omitempty"`
3851
3852 Mode FaceRedactorMode `json:"mode,omitempty"`
3853
3854 BlurType BlurType `json:"blurType,omitempty"`
3855
3856 ExperimentalOptions map[string]*string `json:"experimentalOptions"`
3857
3858 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
3859 }
3860
3861
3862 func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) {
3863 fdp.OdataType = OdataTypeMicrosoftMediaFaceDetectorPreset
3864 objectMap := make(map[string]interface{})
3865 if fdp.Resolution != "" {
3866 objectMap["resolution"] = fdp.Resolution
3867 }
3868 if fdp.Mode != "" {
3869 objectMap["mode"] = fdp.Mode
3870 }
3871 if fdp.BlurType != "" {
3872 objectMap["blurType"] = fdp.BlurType
3873 }
3874 if fdp.ExperimentalOptions != nil {
3875 objectMap["experimentalOptions"] = fdp.ExperimentalOptions
3876 }
3877 if fdp.OdataType != "" {
3878 objectMap["@odata.type"] = fdp.OdataType
3879 }
3880 return json.Marshal(objectMap)
3881 }
3882
3883
3884 func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
3885 return &fdp, true
3886 }
3887
3888
3889 func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
3890 return nil, false
3891 }
3892
3893
3894 func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
3895 return nil, false
3896 }
3897
3898
3899 func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
3900 return nil, false
3901 }
3902
3903
3904 func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
3905 return nil, false
3906 }
3907
3908
3909 func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
3910 return nil, false
3911 }
3912
3913
3914 func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) {
3915 return nil, false
3916 }
3917
3918
3919 func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) {
3920 return &fdp, true
3921 }
3922
3923
3924 type FilterProperties struct {
3925
3926 PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"`
3927
3928 FirstQuality *FirstQuality `json:"firstQuality,omitempty"`
3929
3930 Tracks *[]FilterTrackSelection `json:"tracks,omitempty"`
3931 }
3932
3933
3934
3935 type Filters struct {
3936
3937 Deinterlace *Deinterlace `json:"deinterlace,omitempty"`
3938
3939 Rotation Rotation `json:"rotation,omitempty"`
3940
3941 Crop *Rectangle `json:"crop,omitempty"`
3942
3943 Overlays *[]BasicOverlay `json:"overlays,omitempty"`
3944 }
3945
3946
3947 func (f *Filters) UnmarshalJSON(body []byte) error {
3948 var m map[string]*json.RawMessage
3949 err := json.Unmarshal(body, &m)
3950 if err != nil {
3951 return err
3952 }
3953 for k, v := range m {
3954 switch k {
3955 case "deinterlace":
3956 if v != nil {
3957 var deinterlace Deinterlace
3958 err = json.Unmarshal(*v, &deinterlace)
3959 if err != nil {
3960 return err
3961 }
3962 f.Deinterlace = &deinterlace
3963 }
3964 case "rotation":
3965 if v != nil {
3966 var rotation Rotation
3967 err = json.Unmarshal(*v, &rotation)
3968 if err != nil {
3969 return err
3970 }
3971 f.Rotation = rotation
3972 }
3973 case "crop":
3974 if v != nil {
3975 var crop Rectangle
3976 err = json.Unmarshal(*v, &crop)
3977 if err != nil {
3978 return err
3979 }
3980 f.Crop = &crop
3981 }
3982 case "overlays":
3983 if v != nil {
3984 overlays, err := unmarshalBasicOverlayArray(*v)
3985 if err != nil {
3986 return err
3987 }
3988 f.Overlays = &overlays
3989 }
3990 }
3991 }
3992
3993 return nil
3994 }
3995
3996
3997 type FilterTrackPropertyCondition struct {
3998
3999 Property FilterTrackPropertyType `json:"property,omitempty"`
4000
4001 Value *string `json:"value,omitempty"`
4002
4003 Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"`
4004 }
4005
4006
4007
4008 type FilterTrackSelection struct {
4009
4010 TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"`
4011 }
4012
4013
4014 type FirstQuality struct {
4015
4016 Bitrate *int32 `json:"bitrate,omitempty"`
4017 }
4018
4019
4020 type BasicFormat interface {
4021 AsImageFormat() (*ImageFormat, bool)
4022 AsBasicImageFormat() (BasicImageFormat, bool)
4023 AsJpgFormat() (*JpgFormat, bool)
4024 AsPngFormat() (*PngFormat, bool)
4025 AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
4026 AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool)
4027 AsMp4Format() (*Mp4Format, bool)
4028 AsTransportStreamFormat() (*TransportStreamFormat, bool)
4029 AsFormat() (*Format, bool)
4030 }
4031
4032
4033 type Format struct {
4034
4035 FilenamePattern *string `json:"filenamePattern,omitempty"`
4036
4037 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
4038 }
4039
4040 func unmarshalBasicFormat(body []byte) (BasicFormat, error) {
4041 var m map[string]interface{}
4042 err := json.Unmarshal(body, &m)
4043 if err != nil {
4044 return nil, err
4045 }
4046
4047 switch m["@odata.type"] {
4048 case string(OdataTypeMicrosoftMediaImageFormat):
4049 var ifVar ImageFormat
4050 err := json.Unmarshal(body, &ifVar)
4051 return ifVar, err
4052 case string(OdataTypeMicrosoftMediaJpgFormat):
4053 var jf JpgFormat
4054 err := json.Unmarshal(body, &jf)
4055 return jf, err
4056 case string(OdataTypeMicrosoftMediaPngFormat):
4057 var pf PngFormat
4058 err := json.Unmarshal(body, &pf)
4059 return pf, err
4060 case string(OdataTypeMicrosoftMediaMultiBitrateFormat):
4061 var mbf MultiBitrateFormat
4062 err := json.Unmarshal(body, &mbf)
4063 return mbf, err
4064 case string(OdataTypeMicrosoftMediaMp4Format):
4065 var m4f Mp4Format
4066 err := json.Unmarshal(body, &m4f)
4067 return m4f, err
4068 case string(OdataTypeMicrosoftMediaTransportStreamFormat):
4069 var tsf TransportStreamFormat
4070 err := json.Unmarshal(body, &tsf)
4071 return tsf, err
4072 default:
4073 var f Format
4074 err := json.Unmarshal(body, &f)
4075 return f, err
4076 }
4077 }
4078 func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) {
4079 var rawMessages []*json.RawMessage
4080 err := json.Unmarshal(body, &rawMessages)
4081 if err != nil {
4082 return nil, err
4083 }
4084
4085 fArray := make([]BasicFormat, len(rawMessages))
4086
4087 for index, rawMessage := range rawMessages {
4088 f, err := unmarshalBasicFormat(*rawMessage)
4089 if err != nil {
4090 return nil, err
4091 }
4092 fArray[index] = f
4093 }
4094 return fArray, nil
4095 }
4096
4097
4098 func (f Format) MarshalJSON() ([]byte, error) {
4099 f.OdataType = OdataTypeFormat
4100 objectMap := make(map[string]interface{})
4101 if f.FilenamePattern != nil {
4102 objectMap["filenamePattern"] = f.FilenamePattern
4103 }
4104 if f.OdataType != "" {
4105 objectMap["@odata.type"] = f.OdataType
4106 }
4107 return json.Marshal(objectMap)
4108 }
4109
4110
4111 func (f Format) AsImageFormat() (*ImageFormat, bool) {
4112 return nil, false
4113 }
4114
4115
4116 func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) {
4117 return nil, false
4118 }
4119
4120
4121 func (f Format) AsJpgFormat() (*JpgFormat, bool) {
4122 return nil, false
4123 }
4124
4125
4126 func (f Format) AsPngFormat() (*PngFormat, bool) {
4127 return nil, false
4128 }
4129
4130
4131 func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
4132 return nil, false
4133 }
4134
4135
4136 func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
4137 return nil, false
4138 }
4139
4140
4141 func (f Format) AsMp4Format() (*Mp4Format, bool) {
4142 return nil, false
4143 }
4144
4145
4146 func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
4147 return nil, false
4148 }
4149
4150
4151 func (f Format) AsFormat() (*Format, bool) {
4152 return &f, true
4153 }
4154
4155
4156 func (f Format) AsBasicFormat() (BasicFormat, bool) {
4157 return &f, true
4158 }
4159
4160
4161
4162
4163 type FromAllInputFile struct {
4164
4165 IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
4166
4167 OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
4168 }
4169
4170
4171 func (faif FromAllInputFile) MarshalJSON() ([]byte, error) {
4172 faif.OdataType = OdataTypeMicrosoftMediaFromAllInputFile
4173 objectMap := make(map[string]interface{})
4174 if faif.IncludedTracks != nil {
4175 objectMap["includedTracks"] = faif.IncludedTracks
4176 }
4177 if faif.OdataType != "" {
4178 objectMap["@odata.type"] = faif.OdataType
4179 }
4180 return json.Marshal(objectMap)
4181 }
4182
4183
4184 func (faif FromAllInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
4185 return &faif, true
4186 }
4187
4188
4189 func (faif FromAllInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
4190 return nil, false
4191 }
4192
4193
4194 func (faif FromAllInputFile) AsInputFile() (*InputFile, bool) {
4195 return nil, false
4196 }
4197
4198
4199 func (faif FromAllInputFile) AsInputDefinition() (*InputDefinition, bool) {
4200 return nil, false
4201 }
4202
4203
4204 func (faif FromAllInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
4205 return &faif, true
4206 }
4207
4208
4209 func (faif *FromAllInputFile) UnmarshalJSON(body []byte) error {
4210 var m map[string]*json.RawMessage
4211 err := json.Unmarshal(body, &m)
4212 if err != nil {
4213 return err
4214 }
4215 for k, v := range m {
4216 switch k {
4217 case "includedTracks":
4218 if v != nil {
4219 includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
4220 if err != nil {
4221 return err
4222 }
4223 faif.IncludedTracks = &includedTracks
4224 }
4225 case "@odata.type":
4226 if v != nil {
4227 var odataType OdataTypeBasicInputDefinition
4228 err = json.Unmarshal(*v, &odataType)
4229 if err != nil {
4230 return err
4231 }
4232 faif.OdataType = odataType
4233 }
4234 }
4235 }
4236
4237 return nil
4238 }
4239
4240
4241
4242
4243 type FromEachInputFile struct {
4244
4245 IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
4246
4247 OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
4248 }
4249
4250
4251 func (feif FromEachInputFile) MarshalJSON() ([]byte, error) {
4252 feif.OdataType = OdataTypeMicrosoftMediaFromEachInputFile
4253 objectMap := make(map[string]interface{})
4254 if feif.IncludedTracks != nil {
4255 objectMap["includedTracks"] = feif.IncludedTracks
4256 }
4257 if feif.OdataType != "" {
4258 objectMap["@odata.type"] = feif.OdataType
4259 }
4260 return json.Marshal(objectMap)
4261 }
4262
4263
4264 func (feif FromEachInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
4265 return nil, false
4266 }
4267
4268
4269 func (feif FromEachInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
4270 return &feif, true
4271 }
4272
4273
4274 func (feif FromEachInputFile) AsInputFile() (*InputFile, bool) {
4275 return nil, false
4276 }
4277
4278
4279 func (feif FromEachInputFile) AsInputDefinition() (*InputDefinition, bool) {
4280 return nil, false
4281 }
4282
4283
4284 func (feif FromEachInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
4285 return &feif, true
4286 }
4287
4288
4289 func (feif *FromEachInputFile) UnmarshalJSON(body []byte) error {
4290 var m map[string]*json.RawMessage
4291 err := json.Unmarshal(body, &m)
4292 if err != nil {
4293 return err
4294 }
4295 for k, v := range m {
4296 switch k {
4297 case "includedTracks":
4298 if v != nil {
4299 includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
4300 if err != nil {
4301 return err
4302 }
4303 feif.IncludedTracks = &includedTracks
4304 }
4305 case "@odata.type":
4306 if v != nil {
4307 var odataType OdataTypeBasicInputDefinition
4308 err = json.Unmarshal(*v, &odataType)
4309 if err != nil {
4310 return err
4311 }
4312 feif.OdataType = odataType
4313 }
4314 }
4315 }
4316
4317 return nil
4318 }
4319
4320
4321
4322 type H264Layer struct {
4323
4324 Profile H264VideoProfile `json:"profile,omitempty"`
4325
4326 Level *string `json:"level,omitempty"`
4327
4328 BufferWindow *string `json:"bufferWindow,omitempty"`
4329
4330 ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
4331
4332 EntropyMode EntropyMode `json:"entropyMode,omitempty"`
4333
4334 Bitrate *int32 `json:"bitrate,omitempty"`
4335
4336 MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4337
4338 BFrames *int32 `json:"bFrames,omitempty"`
4339
4340 FrameRate *string `json:"frameRate,omitempty"`
4341
4342 Slices *int32 `json:"slices,omitempty"`
4343
4344 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4345
4346 Width *string `json:"width,omitempty"`
4347
4348 Height *string `json:"height,omitempty"`
4349
4350 Label *string `json:"label,omitempty"`
4351
4352 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4353 }
4354
4355
4356 func (hl H264Layer) MarshalJSON() ([]byte, error) {
4357 hl.OdataType = OdataTypeMicrosoftMediaH264Layer
4358 objectMap := make(map[string]interface{})
4359 if hl.Profile != "" {
4360 objectMap["profile"] = hl.Profile
4361 }
4362 if hl.Level != nil {
4363 objectMap["level"] = hl.Level
4364 }
4365 if hl.BufferWindow != nil {
4366 objectMap["bufferWindow"] = hl.BufferWindow
4367 }
4368 if hl.ReferenceFrames != nil {
4369 objectMap["referenceFrames"] = hl.ReferenceFrames
4370 }
4371 if hl.EntropyMode != "" {
4372 objectMap["entropyMode"] = hl.EntropyMode
4373 }
4374 if hl.Bitrate != nil {
4375 objectMap["bitrate"] = hl.Bitrate
4376 }
4377 if hl.MaxBitrate != nil {
4378 objectMap["maxBitrate"] = hl.MaxBitrate
4379 }
4380 if hl.BFrames != nil {
4381 objectMap["bFrames"] = hl.BFrames
4382 }
4383 if hl.FrameRate != nil {
4384 objectMap["frameRate"] = hl.FrameRate
4385 }
4386 if hl.Slices != nil {
4387 objectMap["slices"] = hl.Slices
4388 }
4389 if hl.AdaptiveBFrame != nil {
4390 objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
4391 }
4392 if hl.Width != nil {
4393 objectMap["width"] = hl.Width
4394 }
4395 if hl.Height != nil {
4396 objectMap["height"] = hl.Height
4397 }
4398 if hl.Label != nil {
4399 objectMap["label"] = hl.Label
4400 }
4401 if hl.OdataType != "" {
4402 objectMap["@odata.type"] = hl.OdataType
4403 }
4404 return json.Marshal(objectMap)
4405 }
4406
4407
4408 func (hl H264Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4409 return nil, false
4410 }
4411
4412
4413 func (hl H264Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4414 return nil, false
4415 }
4416
4417
4418 func (hl H264Layer) AsH265Layer() (*H265Layer, bool) {
4419 return nil, false
4420 }
4421
4422
4423 func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) {
4424 return nil, false
4425 }
4426
4427
4428 func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4429 return &hl, true
4430 }
4431
4432
4433 func (hl H264Layer) AsH264Layer() (*H264Layer, bool) {
4434 return &hl, true
4435 }
4436
4437
4438 func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) {
4439 return nil, false
4440 }
4441
4442
4443 func (hl H264Layer) AsPngLayer() (*PngLayer, bool) {
4444 return nil, false
4445 }
4446
4447
4448 func (hl H264Layer) AsLayer() (*Layer, bool) {
4449 return nil, false
4450 }
4451
4452
4453 func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) {
4454 return &hl, true
4455 }
4456
4457
4458 type H264Video struct {
4459
4460 SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
4461
4462 Complexity H264Complexity `json:"complexity,omitempty"`
4463
4464 Layers *[]H264Layer `json:"layers,omitempty"`
4465
4466 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
4467
4468 StretchMode StretchMode `json:"stretchMode,omitempty"`
4469
4470 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
4471
4472 Label *string `json:"label,omitempty"`
4473
4474 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
4475 }
4476
4477
4478 func (hv H264Video) MarshalJSON() ([]byte, error) {
4479 hv.OdataType = OdataTypeMicrosoftMediaH264Video
4480 objectMap := make(map[string]interface{})
4481 if hv.SceneChangeDetection != nil {
4482 objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
4483 }
4484 if hv.Complexity != "" {
4485 objectMap["complexity"] = hv.Complexity
4486 }
4487 if hv.Layers != nil {
4488 objectMap["layers"] = hv.Layers
4489 }
4490 if hv.KeyFrameInterval != nil {
4491 objectMap["keyFrameInterval"] = hv.KeyFrameInterval
4492 }
4493 if hv.StretchMode != "" {
4494 objectMap["stretchMode"] = hv.StretchMode
4495 }
4496 if hv.SyncMode != "" {
4497 objectMap["syncMode"] = hv.SyncMode
4498 }
4499 if hv.Label != nil {
4500 objectMap["label"] = hv.Label
4501 }
4502 if hv.OdataType != "" {
4503 objectMap["@odata.type"] = hv.OdataType
4504 }
4505 return json.Marshal(objectMap)
4506 }
4507
4508
4509 func (hv H264Video) AsAudio() (*Audio, bool) {
4510 return nil, false
4511 }
4512
4513
4514 func (hv H264Video) AsBasicAudio() (BasicAudio, bool) {
4515 return nil, false
4516 }
4517
4518
4519 func (hv H264Video) AsAacAudio() (*AacAudio, bool) {
4520 return nil, false
4521 }
4522
4523
4524 func (hv H264Video) AsVideo() (*Video, bool) {
4525 return nil, false
4526 }
4527
4528
4529 func (hv H264Video) AsBasicVideo() (BasicVideo, bool) {
4530 return &hv, true
4531 }
4532
4533
4534 func (hv H264Video) AsH265Video() (*H265Video, bool) {
4535 return nil, false
4536 }
4537
4538
4539 func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) {
4540 return nil, false
4541 }
4542
4543
4544 func (hv H264Video) AsImage() (*Image, bool) {
4545 return nil, false
4546 }
4547
4548
4549 func (hv H264Video) AsBasicImage() (BasicImage, bool) {
4550 return nil, false
4551 }
4552
4553
4554 func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) {
4555 return nil, false
4556 }
4557
4558
4559 func (hv H264Video) AsH264Video() (*H264Video, bool) {
4560 return &hv, true
4561 }
4562
4563
4564 func (hv H264Video) AsJpgImage() (*JpgImage, bool) {
4565 return nil, false
4566 }
4567
4568
4569 func (hv H264Video) AsPngImage() (*PngImage, bool) {
4570 return nil, false
4571 }
4572
4573
4574 func (hv H264Video) AsCodec() (*Codec, bool) {
4575 return nil, false
4576 }
4577
4578
4579 func (hv H264Video) AsBasicCodec() (BasicCodec, bool) {
4580 return &hv, true
4581 }
4582
4583
4584
4585 type H265Layer struct {
4586
4587 Profile H265VideoProfile `json:"profile,omitempty"`
4588
4589 Level *string `json:"level,omitempty"`
4590
4591 BufferWindow *string `json:"bufferWindow,omitempty"`
4592
4593 ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
4594
4595 Bitrate *int32 `json:"bitrate,omitempty"`
4596
4597 MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4598
4599 BFrames *int32 `json:"bFrames,omitempty"`
4600
4601 FrameRate *string `json:"frameRate,omitempty"`
4602
4603 Slices *int32 `json:"slices,omitempty"`
4604
4605 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4606
4607 Width *string `json:"width,omitempty"`
4608
4609 Height *string `json:"height,omitempty"`
4610
4611 Label *string `json:"label,omitempty"`
4612
4613 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4614 }
4615
4616
4617 func (hl H265Layer) MarshalJSON() ([]byte, error) {
4618 hl.OdataType = OdataTypeMicrosoftMediaH265Layer
4619 objectMap := make(map[string]interface{})
4620 if hl.Profile != "" {
4621 objectMap["profile"] = hl.Profile
4622 }
4623 if hl.Level != nil {
4624 objectMap["level"] = hl.Level
4625 }
4626 if hl.BufferWindow != nil {
4627 objectMap["bufferWindow"] = hl.BufferWindow
4628 }
4629 if hl.ReferenceFrames != nil {
4630 objectMap["referenceFrames"] = hl.ReferenceFrames
4631 }
4632 if hl.Bitrate != nil {
4633 objectMap["bitrate"] = hl.Bitrate
4634 }
4635 if hl.MaxBitrate != nil {
4636 objectMap["maxBitrate"] = hl.MaxBitrate
4637 }
4638 if hl.BFrames != nil {
4639 objectMap["bFrames"] = hl.BFrames
4640 }
4641 if hl.FrameRate != nil {
4642 objectMap["frameRate"] = hl.FrameRate
4643 }
4644 if hl.Slices != nil {
4645 objectMap["slices"] = hl.Slices
4646 }
4647 if hl.AdaptiveBFrame != nil {
4648 objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
4649 }
4650 if hl.Width != nil {
4651 objectMap["width"] = hl.Width
4652 }
4653 if hl.Height != nil {
4654 objectMap["height"] = hl.Height
4655 }
4656 if hl.Label != nil {
4657 objectMap["label"] = hl.Label
4658 }
4659 if hl.OdataType != "" {
4660 objectMap["@odata.type"] = hl.OdataType
4661 }
4662 return json.Marshal(objectMap)
4663 }
4664
4665
4666 func (hl H265Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4667 return nil, false
4668 }
4669
4670
4671 func (hl H265Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4672 return &hl, true
4673 }
4674
4675
4676 func (hl H265Layer) AsH265Layer() (*H265Layer, bool) {
4677 return &hl, true
4678 }
4679
4680
4681 func (hl H265Layer) AsVideoLayer() (*VideoLayer, bool) {
4682 return nil, false
4683 }
4684
4685
4686 func (hl H265Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4687 return nil, false
4688 }
4689
4690
4691 func (hl H265Layer) AsH264Layer() (*H264Layer, bool) {
4692 return nil, false
4693 }
4694
4695
4696 func (hl H265Layer) AsJpgLayer() (*JpgLayer, bool) {
4697 return nil, false
4698 }
4699
4700
4701 func (hl H265Layer) AsPngLayer() (*PngLayer, bool) {
4702 return nil, false
4703 }
4704
4705
4706 func (hl H265Layer) AsLayer() (*Layer, bool) {
4707 return nil, false
4708 }
4709
4710
4711 func (hl H265Layer) AsBasicLayer() (BasicLayer, bool) {
4712 return &hl, true
4713 }
4714
4715
4716 type H265Video struct {
4717
4718 SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
4719
4720 Complexity H265Complexity `json:"complexity,omitempty"`
4721
4722 Layers *[]H265Layer `json:"layers,omitempty"`
4723
4724 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
4725
4726 StretchMode StretchMode `json:"stretchMode,omitempty"`
4727
4728 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
4729
4730 Label *string `json:"label,omitempty"`
4731
4732 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
4733 }
4734
4735
4736 func (hv H265Video) MarshalJSON() ([]byte, error) {
4737 hv.OdataType = OdataTypeMicrosoftMediaH265Video
4738 objectMap := make(map[string]interface{})
4739 if hv.SceneChangeDetection != nil {
4740 objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
4741 }
4742 if hv.Complexity != "" {
4743 objectMap["complexity"] = hv.Complexity
4744 }
4745 if hv.Layers != nil {
4746 objectMap["layers"] = hv.Layers
4747 }
4748 if hv.KeyFrameInterval != nil {
4749 objectMap["keyFrameInterval"] = hv.KeyFrameInterval
4750 }
4751 if hv.StretchMode != "" {
4752 objectMap["stretchMode"] = hv.StretchMode
4753 }
4754 if hv.SyncMode != "" {
4755 objectMap["syncMode"] = hv.SyncMode
4756 }
4757 if hv.Label != nil {
4758 objectMap["label"] = hv.Label
4759 }
4760 if hv.OdataType != "" {
4761 objectMap["@odata.type"] = hv.OdataType
4762 }
4763 return json.Marshal(objectMap)
4764 }
4765
4766
4767 func (hv H265Video) AsAudio() (*Audio, bool) {
4768 return nil, false
4769 }
4770
4771
4772 func (hv H265Video) AsBasicAudio() (BasicAudio, bool) {
4773 return nil, false
4774 }
4775
4776
4777 func (hv H265Video) AsAacAudio() (*AacAudio, bool) {
4778 return nil, false
4779 }
4780
4781
4782 func (hv H265Video) AsVideo() (*Video, bool) {
4783 return nil, false
4784 }
4785
4786
4787 func (hv H265Video) AsBasicVideo() (BasicVideo, bool) {
4788 return &hv, true
4789 }
4790
4791
4792 func (hv H265Video) AsH265Video() (*H265Video, bool) {
4793 return &hv, true
4794 }
4795
4796
4797 func (hv H265Video) AsCopyVideo() (*CopyVideo, bool) {
4798 return nil, false
4799 }
4800
4801
4802 func (hv H265Video) AsImage() (*Image, bool) {
4803 return nil, false
4804 }
4805
4806
4807 func (hv H265Video) AsBasicImage() (BasicImage, bool) {
4808 return nil, false
4809 }
4810
4811
4812 func (hv H265Video) AsCopyAudio() (*CopyAudio, bool) {
4813 return nil, false
4814 }
4815
4816
4817 func (hv H265Video) AsH264Video() (*H264Video, bool) {
4818 return nil, false
4819 }
4820
4821
4822 func (hv H265Video) AsJpgImage() (*JpgImage, bool) {
4823 return nil, false
4824 }
4825
4826
4827 func (hv H265Video) AsPngImage() (*PngImage, bool) {
4828 return nil, false
4829 }
4830
4831
4832 func (hv H265Video) AsCodec() (*Codec, bool) {
4833 return nil, false
4834 }
4835
4836
4837 func (hv H265Video) AsBasicCodec() (BasicCodec, bool) {
4838 return &hv, true
4839 }
4840
4841
4842
4843 type BasicH265VideoLayer interface {
4844 AsH265Layer() (*H265Layer, bool)
4845 AsH265VideoLayer() (*H265VideoLayer, bool)
4846 }
4847
4848
4849
4850 type H265VideoLayer struct {
4851
4852 Bitrate *int32 `json:"bitrate,omitempty"`
4853
4854 MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4855
4856 BFrames *int32 `json:"bFrames,omitempty"`
4857
4858 FrameRate *string `json:"frameRate,omitempty"`
4859
4860 Slices *int32 `json:"slices,omitempty"`
4861
4862 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4863
4864 Width *string `json:"width,omitempty"`
4865
4866 Height *string `json:"height,omitempty"`
4867
4868 Label *string `json:"label,omitempty"`
4869
4870 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4871 }
4872
4873 func unmarshalBasicH265VideoLayer(body []byte) (BasicH265VideoLayer, error) {
4874 var m map[string]interface{}
4875 err := json.Unmarshal(body, &m)
4876 if err != nil {
4877 return nil, err
4878 }
4879
4880 switch m["@odata.type"] {
4881 case string(OdataTypeMicrosoftMediaH265Layer):
4882 var hl H265Layer
4883 err := json.Unmarshal(body, &hl)
4884 return hl, err
4885 default:
4886 var hvl H265VideoLayer
4887 err := json.Unmarshal(body, &hvl)
4888 return hvl, err
4889 }
4890 }
4891 func unmarshalBasicH265VideoLayerArray(body []byte) ([]BasicH265VideoLayer, error) {
4892 var rawMessages []*json.RawMessage
4893 err := json.Unmarshal(body, &rawMessages)
4894 if err != nil {
4895 return nil, err
4896 }
4897
4898 hvlArray := make([]BasicH265VideoLayer, len(rawMessages))
4899
4900 for index, rawMessage := range rawMessages {
4901 hvl, err := unmarshalBasicH265VideoLayer(*rawMessage)
4902 if err != nil {
4903 return nil, err
4904 }
4905 hvlArray[index] = hvl
4906 }
4907 return hvlArray, nil
4908 }
4909
4910
4911 func (hvl H265VideoLayer) MarshalJSON() ([]byte, error) {
4912 hvl.OdataType = OdataTypeMicrosoftMediaH265VideoLayer
4913 objectMap := make(map[string]interface{})
4914 if hvl.Bitrate != nil {
4915 objectMap["bitrate"] = hvl.Bitrate
4916 }
4917 if hvl.MaxBitrate != nil {
4918 objectMap["maxBitrate"] = hvl.MaxBitrate
4919 }
4920 if hvl.BFrames != nil {
4921 objectMap["bFrames"] = hvl.BFrames
4922 }
4923 if hvl.FrameRate != nil {
4924 objectMap["frameRate"] = hvl.FrameRate
4925 }
4926 if hvl.Slices != nil {
4927 objectMap["slices"] = hvl.Slices
4928 }
4929 if hvl.AdaptiveBFrame != nil {
4930 objectMap["adaptiveBFrame"] = hvl.AdaptiveBFrame
4931 }
4932 if hvl.Width != nil {
4933 objectMap["width"] = hvl.Width
4934 }
4935 if hvl.Height != nil {
4936 objectMap["height"] = hvl.Height
4937 }
4938 if hvl.Label != nil {
4939 objectMap["label"] = hvl.Label
4940 }
4941 if hvl.OdataType != "" {
4942 objectMap["@odata.type"] = hvl.OdataType
4943 }
4944 return json.Marshal(objectMap)
4945 }
4946
4947
4948 func (hvl H265VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4949 return &hvl, true
4950 }
4951
4952
4953 func (hvl H265VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4954 return &hvl, true
4955 }
4956
4957
4958 func (hvl H265VideoLayer) AsH265Layer() (*H265Layer, bool) {
4959 return nil, false
4960 }
4961
4962
4963 func (hvl H265VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
4964 return nil, false
4965 }
4966
4967
4968 func (hvl H265VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4969 return nil, false
4970 }
4971
4972
4973 func (hvl H265VideoLayer) AsH264Layer() (*H264Layer, bool) {
4974 return nil, false
4975 }
4976
4977
4978 func (hvl H265VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
4979 return nil, false
4980 }
4981
4982
4983 func (hvl H265VideoLayer) AsPngLayer() (*PngLayer, bool) {
4984 return nil, false
4985 }
4986
4987
4988 func (hvl H265VideoLayer) AsLayer() (*Layer, bool) {
4989 return nil, false
4990 }
4991
4992
4993 func (hvl H265VideoLayer) AsBasicLayer() (BasicLayer, bool) {
4994 return &hvl, true
4995 }
4996
4997
4998 type Hls struct {
4999
5000 FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"`
5001 }
5002
5003
5004 type BasicImage interface {
5005 AsJpgImage() (*JpgImage, bool)
5006 AsPngImage() (*PngImage, bool)
5007 AsImage() (*Image, bool)
5008 }
5009
5010
5011 type Image struct {
5012
5013 Start *string `json:"start,omitempty"`
5014
5015 Step *string `json:"step,omitempty"`
5016
5017 Range *string `json:"range,omitempty"`
5018
5019 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
5020
5021 StretchMode StretchMode `json:"stretchMode,omitempty"`
5022
5023 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
5024
5025 Label *string `json:"label,omitempty"`
5026
5027 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
5028 }
5029
5030 func unmarshalBasicImage(body []byte) (BasicImage, error) {
5031 var m map[string]interface{}
5032 err := json.Unmarshal(body, &m)
5033 if err != nil {
5034 return nil, err
5035 }
5036
5037 switch m["@odata.type"] {
5038 case string(OdataTypeMicrosoftMediaJpgImage):
5039 var ji JpgImage
5040 err := json.Unmarshal(body, &ji)
5041 return ji, err
5042 case string(OdataTypeMicrosoftMediaPngImage):
5043 var pi PngImage
5044 err := json.Unmarshal(body, &pi)
5045 return pi, err
5046 default:
5047 var i Image
5048 err := json.Unmarshal(body, &i)
5049 return i, err
5050 }
5051 }
5052 func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) {
5053 var rawMessages []*json.RawMessage
5054 err := json.Unmarshal(body, &rawMessages)
5055 if err != nil {
5056 return nil, err
5057 }
5058
5059 iArray := make([]BasicImage, len(rawMessages))
5060
5061 for index, rawMessage := range rawMessages {
5062 i, err := unmarshalBasicImage(*rawMessage)
5063 if err != nil {
5064 return nil, err
5065 }
5066 iArray[index] = i
5067 }
5068 return iArray, nil
5069 }
5070
5071
5072 func (i Image) MarshalJSON() ([]byte, error) {
5073 i.OdataType = OdataTypeMicrosoftMediaImage
5074 objectMap := make(map[string]interface{})
5075 if i.Start != nil {
5076 objectMap["start"] = i.Start
5077 }
5078 if i.Step != nil {
5079 objectMap["step"] = i.Step
5080 }
5081 if i.Range != nil {
5082 objectMap["range"] = i.Range
5083 }
5084 if i.KeyFrameInterval != nil {
5085 objectMap["keyFrameInterval"] = i.KeyFrameInterval
5086 }
5087 if i.StretchMode != "" {
5088 objectMap["stretchMode"] = i.StretchMode
5089 }
5090 if i.SyncMode != "" {
5091 objectMap["syncMode"] = i.SyncMode
5092 }
5093 if i.Label != nil {
5094 objectMap["label"] = i.Label
5095 }
5096 if i.OdataType != "" {
5097 objectMap["@odata.type"] = i.OdataType
5098 }
5099 return json.Marshal(objectMap)
5100 }
5101
5102
5103 func (i Image) AsAudio() (*Audio, bool) {
5104 return nil, false
5105 }
5106
5107
5108 func (i Image) AsBasicAudio() (BasicAudio, bool) {
5109 return nil, false
5110 }
5111
5112
5113 func (i Image) AsAacAudio() (*AacAudio, bool) {
5114 return nil, false
5115 }
5116
5117
5118 func (i Image) AsVideo() (*Video, bool) {
5119 return nil, false
5120 }
5121
5122
5123 func (i Image) AsBasicVideo() (BasicVideo, bool) {
5124 return &i, true
5125 }
5126
5127
5128 func (i Image) AsH265Video() (*H265Video, bool) {
5129 return nil, false
5130 }
5131
5132
5133 func (i Image) AsCopyVideo() (*CopyVideo, bool) {
5134 return nil, false
5135 }
5136
5137
5138 func (i Image) AsImage() (*Image, bool) {
5139 return &i, true
5140 }
5141
5142
5143 func (i Image) AsBasicImage() (BasicImage, bool) {
5144 return &i, true
5145 }
5146
5147
5148 func (i Image) AsCopyAudio() (*CopyAudio, bool) {
5149 return nil, false
5150 }
5151
5152
5153 func (i Image) AsH264Video() (*H264Video, bool) {
5154 return nil, false
5155 }
5156
5157
5158 func (i Image) AsJpgImage() (*JpgImage, bool) {
5159 return nil, false
5160 }
5161
5162
5163 func (i Image) AsPngImage() (*PngImage, bool) {
5164 return nil, false
5165 }
5166
5167
5168 func (i Image) AsCodec() (*Codec, bool) {
5169 return nil, false
5170 }
5171
5172
5173 func (i Image) AsBasicCodec() (BasicCodec, bool) {
5174 return &i, true
5175 }
5176
5177
5178 type BasicImageFormat interface {
5179 AsJpgFormat() (*JpgFormat, bool)
5180 AsPngFormat() (*PngFormat, bool)
5181 AsImageFormat() (*ImageFormat, bool)
5182 }
5183
5184
5185 type ImageFormat struct {
5186
5187 FilenamePattern *string `json:"filenamePattern,omitempty"`
5188
5189 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
5190 }
5191
5192 func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) {
5193 var m map[string]interface{}
5194 err := json.Unmarshal(body, &m)
5195 if err != nil {
5196 return nil, err
5197 }
5198
5199 switch m["@odata.type"] {
5200 case string(OdataTypeMicrosoftMediaJpgFormat):
5201 var jf JpgFormat
5202 err := json.Unmarshal(body, &jf)
5203 return jf, err
5204 case string(OdataTypeMicrosoftMediaPngFormat):
5205 var pf PngFormat
5206 err := json.Unmarshal(body, &pf)
5207 return pf, err
5208 default:
5209 var ifVar ImageFormat
5210 err := json.Unmarshal(body, &ifVar)
5211 return ifVar, err
5212 }
5213 }
5214 func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) {
5215 var rawMessages []*json.RawMessage
5216 err := json.Unmarshal(body, &rawMessages)
5217 if err != nil {
5218 return nil, err
5219 }
5220
5221 ifVarArray := make([]BasicImageFormat, len(rawMessages))
5222
5223 for index, rawMessage := range rawMessages {
5224 ifVar, err := unmarshalBasicImageFormat(*rawMessage)
5225 if err != nil {
5226 return nil, err
5227 }
5228 ifVarArray[index] = ifVar
5229 }
5230 return ifVarArray, nil
5231 }
5232
5233
5234 func (ifVar ImageFormat) MarshalJSON() ([]byte, error) {
5235 ifVar.OdataType = OdataTypeMicrosoftMediaImageFormat
5236 objectMap := make(map[string]interface{})
5237 if ifVar.FilenamePattern != nil {
5238 objectMap["filenamePattern"] = ifVar.FilenamePattern
5239 }
5240 if ifVar.OdataType != "" {
5241 objectMap["@odata.type"] = ifVar.OdataType
5242 }
5243 return json.Marshal(objectMap)
5244 }
5245
5246
5247 func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) {
5248 return &ifVar, true
5249 }
5250
5251
5252 func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
5253 return &ifVar, true
5254 }
5255
5256
5257 func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) {
5258 return nil, false
5259 }
5260
5261
5262 func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) {
5263 return nil, false
5264 }
5265
5266
5267 func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
5268 return nil, false
5269 }
5270
5271
5272 func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
5273 return nil, false
5274 }
5275
5276
5277 func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) {
5278 return nil, false
5279 }
5280
5281
5282 func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
5283 return nil, false
5284 }
5285
5286
5287 func (ifVar ImageFormat) AsFormat() (*Format, bool) {
5288 return nil, false
5289 }
5290
5291
5292 func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) {
5293 return &ifVar, true
5294 }
5295
5296
5297
5298 type BasicInputDefinition interface {
5299 AsFromAllInputFile() (*FromAllInputFile, bool)
5300 AsFromEachInputFile() (*FromEachInputFile, bool)
5301 AsInputFile() (*InputFile, bool)
5302 AsInputDefinition() (*InputDefinition, bool)
5303 }
5304
5305
5306
5307 type InputDefinition struct {
5308
5309 IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
5310
5311 OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
5312 }
5313
5314 func unmarshalBasicInputDefinition(body []byte) (BasicInputDefinition, error) {
5315 var m map[string]interface{}
5316 err := json.Unmarshal(body, &m)
5317 if err != nil {
5318 return nil, err
5319 }
5320
5321 switch m["@odata.type"] {
5322 case string(OdataTypeMicrosoftMediaFromAllInputFile):
5323 var faif FromAllInputFile
5324 err := json.Unmarshal(body, &faif)
5325 return faif, err
5326 case string(OdataTypeMicrosoftMediaFromEachInputFile):
5327 var feif FromEachInputFile
5328 err := json.Unmarshal(body, &feif)
5329 return feif, err
5330 case string(OdataTypeMicrosoftMediaInputFile):
5331 var ifVar InputFile
5332 err := json.Unmarshal(body, &ifVar)
5333 return ifVar, err
5334 default:
5335 var ID InputDefinition
5336 err := json.Unmarshal(body, &ID)
5337 return ID, err
5338 }
5339 }
5340 func unmarshalBasicInputDefinitionArray(body []byte) ([]BasicInputDefinition, error) {
5341 var rawMessages []*json.RawMessage
5342 err := json.Unmarshal(body, &rawMessages)
5343 if err != nil {
5344 return nil, err
5345 }
5346
5347 IDArray := make([]BasicInputDefinition, len(rawMessages))
5348
5349 for index, rawMessage := range rawMessages {
5350 ID, err := unmarshalBasicInputDefinition(*rawMessage)
5351 if err != nil {
5352 return nil, err
5353 }
5354 IDArray[index] = ID
5355 }
5356 return IDArray, nil
5357 }
5358
5359
5360 func (ID InputDefinition) MarshalJSON() ([]byte, error) {
5361 ID.OdataType = OdataTypeInputDefinition
5362 objectMap := make(map[string]interface{})
5363 if ID.IncludedTracks != nil {
5364 objectMap["includedTracks"] = ID.IncludedTracks
5365 }
5366 if ID.OdataType != "" {
5367 objectMap["@odata.type"] = ID.OdataType
5368 }
5369 return json.Marshal(objectMap)
5370 }
5371
5372
5373 func (ID InputDefinition) AsFromAllInputFile() (*FromAllInputFile, bool) {
5374 return nil, false
5375 }
5376
5377
5378 func (ID InputDefinition) AsFromEachInputFile() (*FromEachInputFile, bool) {
5379 return nil, false
5380 }
5381
5382
5383 func (ID InputDefinition) AsInputFile() (*InputFile, bool) {
5384 return nil, false
5385 }
5386
5387
5388 func (ID InputDefinition) AsInputDefinition() (*InputDefinition, bool) {
5389 return &ID, true
5390 }
5391
5392
5393 func (ID InputDefinition) AsBasicInputDefinition() (BasicInputDefinition, bool) {
5394 return &ID, true
5395 }
5396
5397
5398 func (ID *InputDefinition) UnmarshalJSON(body []byte) error {
5399 var m map[string]*json.RawMessage
5400 err := json.Unmarshal(body, &m)
5401 if err != nil {
5402 return err
5403 }
5404 for k, v := range m {
5405 switch k {
5406 case "includedTracks":
5407 if v != nil {
5408 includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
5409 if err != nil {
5410 return err
5411 }
5412 ID.IncludedTracks = &includedTracks
5413 }
5414 case "@odata.type":
5415 if v != nil {
5416 var odataType OdataTypeBasicInputDefinition
5417 err = json.Unmarshal(*v, &odataType)
5418 if err != nil {
5419 return err
5420 }
5421 ID.OdataType = odataType
5422 }
5423 }
5424 }
5425
5426 return nil
5427 }
5428
5429
5430 type InputFile struct {
5431
5432 Filename *string `json:"filename,omitempty"`
5433
5434 IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
5435
5436 OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
5437 }
5438
5439
5440 func (ifVar InputFile) MarshalJSON() ([]byte, error) {
5441 ifVar.OdataType = OdataTypeMicrosoftMediaInputFile
5442 objectMap := make(map[string]interface{})
5443 if ifVar.Filename != nil {
5444 objectMap["filename"] = ifVar.Filename
5445 }
5446 if ifVar.IncludedTracks != nil {
5447 objectMap["includedTracks"] = ifVar.IncludedTracks
5448 }
5449 if ifVar.OdataType != "" {
5450 objectMap["@odata.type"] = ifVar.OdataType
5451 }
5452 return json.Marshal(objectMap)
5453 }
5454
5455
5456 func (ifVar InputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
5457 return nil, false
5458 }
5459
5460
5461 func (ifVar InputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
5462 return nil, false
5463 }
5464
5465
5466 func (ifVar InputFile) AsInputFile() (*InputFile, bool) {
5467 return &ifVar, true
5468 }
5469
5470
5471 func (ifVar InputFile) AsInputDefinition() (*InputDefinition, bool) {
5472 return nil, false
5473 }
5474
5475
5476 func (ifVar InputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
5477 return &ifVar, true
5478 }
5479
5480
5481 func (ifVar *InputFile) UnmarshalJSON(body []byte) error {
5482 var m map[string]*json.RawMessage
5483 err := json.Unmarshal(body, &m)
5484 if err != nil {
5485 return err
5486 }
5487 for k, v := range m {
5488 switch k {
5489 case "filename":
5490 if v != nil {
5491 var filename string
5492 err = json.Unmarshal(*v, &filename)
5493 if err != nil {
5494 return err
5495 }
5496 ifVar.Filename = &filename
5497 }
5498 case "includedTracks":
5499 if v != nil {
5500 includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
5501 if err != nil {
5502 return err
5503 }
5504 ifVar.IncludedTracks = &includedTracks
5505 }
5506 case "@odata.type":
5507 if v != nil {
5508 var odataType OdataTypeBasicInputDefinition
5509 err = json.Unmarshal(*v, &odataType)
5510 if err != nil {
5511 return err
5512 }
5513 ifVar.OdataType = odataType
5514 }
5515 }
5516 }
5517
5518 return nil
5519 }
5520
5521
5522 type IPAccessControl struct {
5523
5524 Allow *[]IPRange `json:"allow,omitempty"`
5525 }
5526
5527
5528 type IPRange struct {
5529
5530 Name *string `json:"name,omitempty"`
5531
5532 Address *string `json:"address,omitempty"`
5533
5534 SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"`
5535 }
5536
5537
5538
5539 type Job struct {
5540 autorest.Response `json:"-"`
5541
5542 *JobProperties `json:"properties,omitempty"`
5543
5544 SystemData *SystemData `json:"systemData,omitempty"`
5545
5546 ID *string `json:"id,omitempty"`
5547
5548 Name *string `json:"name,omitempty"`
5549
5550 Type *string `json:"type,omitempty"`
5551 }
5552
5553
5554 func (j Job) MarshalJSON() ([]byte, error) {
5555 objectMap := make(map[string]interface{})
5556 if j.JobProperties != nil {
5557 objectMap["properties"] = j.JobProperties
5558 }
5559 return json.Marshal(objectMap)
5560 }
5561
5562
5563 func (j *Job) UnmarshalJSON(body []byte) error {
5564 var m map[string]*json.RawMessage
5565 err := json.Unmarshal(body, &m)
5566 if err != nil {
5567 return err
5568 }
5569 for k, v := range m {
5570 switch k {
5571 case "properties":
5572 if v != nil {
5573 var jobProperties JobProperties
5574 err = json.Unmarshal(*v, &jobProperties)
5575 if err != nil {
5576 return err
5577 }
5578 j.JobProperties = &jobProperties
5579 }
5580 case "systemData":
5581 if v != nil {
5582 var systemData SystemData
5583 err = json.Unmarshal(*v, &systemData)
5584 if err != nil {
5585 return err
5586 }
5587 j.SystemData = &systemData
5588 }
5589 case "id":
5590 if v != nil {
5591 var ID string
5592 err = json.Unmarshal(*v, &ID)
5593 if err != nil {
5594 return err
5595 }
5596 j.ID = &ID
5597 }
5598 case "name":
5599 if v != nil {
5600 var name string
5601 err = json.Unmarshal(*v, &name)
5602 if err != nil {
5603 return err
5604 }
5605 j.Name = &name
5606 }
5607 case "type":
5608 if v != nil {
5609 var typeVar string
5610 err = json.Unmarshal(*v, &typeVar)
5611 if err != nil {
5612 return err
5613 }
5614 j.Type = &typeVar
5615 }
5616 }
5617 }
5618
5619 return nil
5620 }
5621
5622
5623 type JobCollection struct {
5624 autorest.Response `json:"-"`
5625
5626 Value *[]Job `json:"value,omitempty"`
5627
5628 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
5629 }
5630
5631
5632 type JobCollectionIterator struct {
5633 i int
5634 page JobCollectionPage
5635 }
5636
5637
5638
5639 func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5640 if tracing.IsEnabled() {
5641 ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext")
5642 defer func() {
5643 sc := -1
5644 if iter.Response().Response.Response != nil {
5645 sc = iter.Response().Response.Response.StatusCode
5646 }
5647 tracing.EndSpan(ctx, sc, err)
5648 }()
5649 }
5650 iter.i++
5651 if iter.i < len(iter.page.Values()) {
5652 return nil
5653 }
5654 err = iter.page.NextWithContext(ctx)
5655 if err != nil {
5656 iter.i--
5657 return err
5658 }
5659 iter.i = 0
5660 return nil
5661 }
5662
5663
5664
5665
5666 func (iter *JobCollectionIterator) Next() error {
5667 return iter.NextWithContext(context.Background())
5668 }
5669
5670
5671 func (iter JobCollectionIterator) NotDone() bool {
5672 return iter.page.NotDone() && iter.i < len(iter.page.Values())
5673 }
5674
5675
5676 func (iter JobCollectionIterator) Response() JobCollection {
5677 return iter.page.Response()
5678 }
5679
5680
5681
5682 func (iter JobCollectionIterator) Value() Job {
5683 if !iter.page.NotDone() {
5684 return Job{}
5685 }
5686 return iter.page.Values()[iter.i]
5687 }
5688
5689
5690 func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator {
5691 return JobCollectionIterator{page: page}
5692 }
5693
5694
5695 func (jc JobCollection) IsEmpty() bool {
5696 return jc.Value == nil || len(*jc.Value) == 0
5697 }
5698
5699
5700 func (jc JobCollection) hasNextLink() bool {
5701 return jc.OdataNextLink != nil && len(*jc.OdataNextLink) != 0
5702 }
5703
5704
5705
5706 func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) {
5707 if !jc.hasNextLink() {
5708 return nil, nil
5709 }
5710 return autorest.Prepare((&http.Request{}).WithContext(ctx),
5711 autorest.AsJSON(),
5712 autorest.AsGet(),
5713 autorest.WithBaseURL(to.String(jc.OdataNextLink)))
5714 }
5715
5716
5717 type JobCollectionPage struct {
5718 fn func(context.Context, JobCollection) (JobCollection, error)
5719 jc JobCollection
5720 }
5721
5722
5723
5724 func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) {
5725 if tracing.IsEnabled() {
5726 ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext")
5727 defer func() {
5728 sc := -1
5729 if page.Response().Response.Response != nil {
5730 sc = page.Response().Response.Response.StatusCode
5731 }
5732 tracing.EndSpan(ctx, sc, err)
5733 }()
5734 }
5735 for {
5736 next, err := page.fn(ctx, page.jc)
5737 if err != nil {
5738 return err
5739 }
5740 page.jc = next
5741 if !next.hasNextLink() || !next.IsEmpty() {
5742 break
5743 }
5744 }
5745 return nil
5746 }
5747
5748
5749
5750
5751 func (page *JobCollectionPage) Next() error {
5752 return page.NextWithContext(context.Background())
5753 }
5754
5755
5756 func (page JobCollectionPage) NotDone() bool {
5757 return !page.jc.IsEmpty()
5758 }
5759
5760
5761 func (page JobCollectionPage) Response() JobCollection {
5762 return page.jc
5763 }
5764
5765
5766 func (page JobCollectionPage) Values() []Job {
5767 if page.jc.IsEmpty() {
5768 return nil
5769 }
5770 return *page.jc.Value
5771 }
5772
5773
5774 func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage {
5775 return JobCollectionPage{
5776 fn: getNextPage,
5777 jc: cur,
5778 }
5779 }
5780
5781
5782 type JobError struct {
5783
5784 Code JobErrorCode `json:"code,omitempty"`
5785
5786 Message *string `json:"message,omitempty"`
5787
5788 Category JobErrorCategory `json:"category,omitempty"`
5789
5790 Retry JobRetry `json:"retry,omitempty"`
5791
5792 Details *[]JobErrorDetail `json:"details,omitempty"`
5793 }
5794
5795
5796 func (je JobError) MarshalJSON() ([]byte, error) {
5797 objectMap := make(map[string]interface{})
5798 return json.Marshal(objectMap)
5799 }
5800
5801
5802 type JobErrorDetail struct {
5803
5804 Code *string `json:"code,omitempty"`
5805
5806 Message *string `json:"message,omitempty"`
5807 }
5808
5809
5810 func (jed JobErrorDetail) MarshalJSON() ([]byte, error) {
5811 objectMap := make(map[string]interface{})
5812 return json.Marshal(objectMap)
5813 }
5814
5815
5816 type BasicJobInput interface {
5817 AsJobInputClip() (*JobInputClip, bool)
5818 AsBasicJobInputClip() (BasicJobInputClip, bool)
5819 AsJobInputs() (*JobInputs, bool)
5820 AsJobInputAsset() (*JobInputAsset, bool)
5821 AsJobInputHTTP() (*JobInputHTTP, bool)
5822 AsJobInputSequence() (*JobInputSequence, bool)
5823 AsJobInput() (*JobInput, bool)
5824 }
5825
5826
5827 type JobInput struct {
5828
5829 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
5830 }
5831
5832 func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) {
5833 var m map[string]interface{}
5834 err := json.Unmarshal(body, &m)
5835 if err != nil {
5836 return nil, err
5837 }
5838
5839 switch m["@odata.type"] {
5840 case string(OdataTypeMicrosoftMediaJobInputClip):
5841 var jic JobInputClip
5842 err := json.Unmarshal(body, &jic)
5843 return jic, err
5844 case string(OdataTypeMicrosoftMediaJobInputs):
5845 var ji JobInputs
5846 err := json.Unmarshal(body, &ji)
5847 return ji, err
5848 case string(OdataTypeMicrosoftMediaJobInputAsset):
5849 var jia JobInputAsset
5850 err := json.Unmarshal(body, &jia)
5851 return jia, err
5852 case string(OdataTypeMicrosoftMediaJobInputHTTP):
5853 var jih JobInputHTTP
5854 err := json.Unmarshal(body, &jih)
5855 return jih, err
5856 case string(OdataTypeMicrosoftMediaJobInputSequence):
5857 var jis JobInputSequence
5858 err := json.Unmarshal(body, &jis)
5859 return jis, err
5860 default:
5861 var ji JobInput
5862 err := json.Unmarshal(body, &ji)
5863 return ji, err
5864 }
5865 }
5866 func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) {
5867 var rawMessages []*json.RawMessage
5868 err := json.Unmarshal(body, &rawMessages)
5869 if err != nil {
5870 return nil, err
5871 }
5872
5873 jiArray := make([]BasicJobInput, len(rawMessages))
5874
5875 for index, rawMessage := range rawMessages {
5876 ji, err := unmarshalBasicJobInput(*rawMessage)
5877 if err != nil {
5878 return nil, err
5879 }
5880 jiArray[index] = ji
5881 }
5882 return jiArray, nil
5883 }
5884
5885
5886 func (ji JobInput) MarshalJSON() ([]byte, error) {
5887 ji.OdataType = OdataTypeJobInput
5888 objectMap := make(map[string]interface{})
5889 if ji.OdataType != "" {
5890 objectMap["@odata.type"] = ji.OdataType
5891 }
5892 return json.Marshal(objectMap)
5893 }
5894
5895
5896 func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) {
5897 return nil, false
5898 }
5899
5900
5901 func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) {
5902 return nil, false
5903 }
5904
5905
5906 func (ji JobInput) AsJobInputs() (*JobInputs, bool) {
5907 return nil, false
5908 }
5909
5910
5911 func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) {
5912 return nil, false
5913 }
5914
5915
5916 func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) {
5917 return nil, false
5918 }
5919
5920
5921 func (ji JobInput) AsJobInputSequence() (*JobInputSequence, bool) {
5922 return nil, false
5923 }
5924
5925
5926 func (ji JobInput) AsJobInput() (*JobInput, bool) {
5927 return &ji, true
5928 }
5929
5930
5931 func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) {
5932 return &ji, true
5933 }
5934
5935
5936 type JobInputAsset struct {
5937
5938 AssetName *string `json:"assetName,omitempty"`
5939
5940 Files *[]string `json:"files,omitempty"`
5941
5942 Start BasicClipTime `json:"start,omitempty"`
5943
5944 End BasicClipTime `json:"end,omitempty"`
5945
5946 Label *string `json:"label,omitempty"`
5947
5948 InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
5949
5950 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
5951 }
5952
5953
5954 func (jia JobInputAsset) MarshalJSON() ([]byte, error) {
5955 jia.OdataType = OdataTypeMicrosoftMediaJobInputAsset
5956 objectMap := make(map[string]interface{})
5957 if jia.AssetName != nil {
5958 objectMap["assetName"] = jia.AssetName
5959 }
5960 if jia.Files != nil {
5961 objectMap["files"] = jia.Files
5962 }
5963 objectMap["start"] = jia.Start
5964 objectMap["end"] = jia.End
5965 if jia.Label != nil {
5966 objectMap["label"] = jia.Label
5967 }
5968 if jia.InputDefinitions != nil {
5969 objectMap["inputDefinitions"] = jia.InputDefinitions
5970 }
5971 if jia.OdataType != "" {
5972 objectMap["@odata.type"] = jia.OdataType
5973 }
5974 return json.Marshal(objectMap)
5975 }
5976
5977
5978 func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) {
5979 return nil, false
5980 }
5981
5982
5983 func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) {
5984 return &jia, true
5985 }
5986
5987
5988 func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) {
5989 return nil, false
5990 }
5991
5992
5993 func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) {
5994 return &jia, true
5995 }
5996
5997
5998 func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) {
5999 return nil, false
6000 }
6001
6002
6003 func (jia JobInputAsset) AsJobInputSequence() (*JobInputSequence, bool) {
6004 return nil, false
6005 }
6006
6007
6008 func (jia JobInputAsset) AsJobInput() (*JobInput, bool) {
6009 return nil, false
6010 }
6011
6012
6013 func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) {
6014 return &jia, true
6015 }
6016
6017
6018 func (jia *JobInputAsset) UnmarshalJSON(body []byte) error {
6019 var m map[string]*json.RawMessage
6020 err := json.Unmarshal(body, &m)
6021 if err != nil {
6022 return err
6023 }
6024 for k, v := range m {
6025 switch k {
6026 case "assetName":
6027 if v != nil {
6028 var assetName string
6029 err = json.Unmarshal(*v, &assetName)
6030 if err != nil {
6031 return err
6032 }
6033 jia.AssetName = &assetName
6034 }
6035 case "files":
6036 if v != nil {
6037 var files []string
6038 err = json.Unmarshal(*v, &files)
6039 if err != nil {
6040 return err
6041 }
6042 jia.Files = &files
6043 }
6044 case "start":
6045 if v != nil {
6046 start, err := unmarshalBasicClipTime(*v)
6047 if err != nil {
6048 return err
6049 }
6050 jia.Start = start
6051 }
6052 case "end":
6053 if v != nil {
6054 end, err := unmarshalBasicClipTime(*v)
6055 if err != nil {
6056 return err
6057 }
6058 jia.End = end
6059 }
6060 case "label":
6061 if v != nil {
6062 var label string
6063 err = json.Unmarshal(*v, &label)
6064 if err != nil {
6065 return err
6066 }
6067 jia.Label = &label
6068 }
6069 case "inputDefinitions":
6070 if v != nil {
6071 inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6072 if err != nil {
6073 return err
6074 }
6075 jia.InputDefinitions = &inputDefinitions
6076 }
6077 case "@odata.type":
6078 if v != nil {
6079 var odataType OdataTypeBasicJobInput
6080 err = json.Unmarshal(*v, &odataType)
6081 if err != nil {
6082 return err
6083 }
6084 jia.OdataType = odataType
6085 }
6086 }
6087 }
6088
6089 return nil
6090 }
6091
6092
6093 type BasicJobInputClip interface {
6094 AsJobInputAsset() (*JobInputAsset, bool)
6095 AsJobInputHTTP() (*JobInputHTTP, bool)
6096 AsJobInputClip() (*JobInputClip, bool)
6097 }
6098
6099
6100 type JobInputClip struct {
6101
6102 Files *[]string `json:"files,omitempty"`
6103
6104 Start BasicClipTime `json:"start,omitempty"`
6105
6106 End BasicClipTime `json:"end,omitempty"`
6107
6108 Label *string `json:"label,omitempty"`
6109
6110 InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
6111
6112 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6113 }
6114
6115 func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) {
6116 var m map[string]interface{}
6117 err := json.Unmarshal(body, &m)
6118 if err != nil {
6119 return nil, err
6120 }
6121
6122 switch m["@odata.type"] {
6123 case string(OdataTypeMicrosoftMediaJobInputAsset):
6124 var jia JobInputAsset
6125 err := json.Unmarshal(body, &jia)
6126 return jia, err
6127 case string(OdataTypeMicrosoftMediaJobInputHTTP):
6128 var jih JobInputHTTP
6129 err := json.Unmarshal(body, &jih)
6130 return jih, err
6131 default:
6132 var jic JobInputClip
6133 err := json.Unmarshal(body, &jic)
6134 return jic, err
6135 }
6136 }
6137 func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) {
6138 var rawMessages []*json.RawMessage
6139 err := json.Unmarshal(body, &rawMessages)
6140 if err != nil {
6141 return nil, err
6142 }
6143
6144 jicArray := make([]BasicJobInputClip, len(rawMessages))
6145
6146 for index, rawMessage := range rawMessages {
6147 jic, err := unmarshalBasicJobInputClip(*rawMessage)
6148 if err != nil {
6149 return nil, err
6150 }
6151 jicArray[index] = jic
6152 }
6153 return jicArray, nil
6154 }
6155
6156
6157 func (jic JobInputClip) MarshalJSON() ([]byte, error) {
6158 jic.OdataType = OdataTypeMicrosoftMediaJobInputClip
6159 objectMap := make(map[string]interface{})
6160 if jic.Files != nil {
6161 objectMap["files"] = jic.Files
6162 }
6163 objectMap["start"] = jic.Start
6164 objectMap["end"] = jic.End
6165 if jic.Label != nil {
6166 objectMap["label"] = jic.Label
6167 }
6168 if jic.InputDefinitions != nil {
6169 objectMap["inputDefinitions"] = jic.InputDefinitions
6170 }
6171 if jic.OdataType != "" {
6172 objectMap["@odata.type"] = jic.OdataType
6173 }
6174 return json.Marshal(objectMap)
6175 }
6176
6177
6178 func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) {
6179 return &jic, true
6180 }
6181
6182
6183 func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6184 return &jic, true
6185 }
6186
6187
6188 func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) {
6189 return nil, false
6190 }
6191
6192
6193 func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) {
6194 return nil, false
6195 }
6196
6197
6198 func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) {
6199 return nil, false
6200 }
6201
6202
6203 func (jic JobInputClip) AsJobInputSequence() (*JobInputSequence, bool) {
6204 return nil, false
6205 }
6206
6207
6208 func (jic JobInputClip) AsJobInput() (*JobInput, bool) {
6209 return nil, false
6210 }
6211
6212
6213 func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) {
6214 return &jic, true
6215 }
6216
6217
6218 func (jic *JobInputClip) UnmarshalJSON(body []byte) error {
6219 var m map[string]*json.RawMessage
6220 err := json.Unmarshal(body, &m)
6221 if err != nil {
6222 return err
6223 }
6224 for k, v := range m {
6225 switch k {
6226 case "files":
6227 if v != nil {
6228 var files []string
6229 err = json.Unmarshal(*v, &files)
6230 if err != nil {
6231 return err
6232 }
6233 jic.Files = &files
6234 }
6235 case "start":
6236 if v != nil {
6237 start, err := unmarshalBasicClipTime(*v)
6238 if err != nil {
6239 return err
6240 }
6241 jic.Start = start
6242 }
6243 case "end":
6244 if v != nil {
6245 end, err := unmarshalBasicClipTime(*v)
6246 if err != nil {
6247 return err
6248 }
6249 jic.End = end
6250 }
6251 case "label":
6252 if v != nil {
6253 var label string
6254 err = json.Unmarshal(*v, &label)
6255 if err != nil {
6256 return err
6257 }
6258 jic.Label = &label
6259 }
6260 case "inputDefinitions":
6261 if v != nil {
6262 inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6263 if err != nil {
6264 return err
6265 }
6266 jic.InputDefinitions = &inputDefinitions
6267 }
6268 case "@odata.type":
6269 if v != nil {
6270 var odataType OdataTypeBasicJobInput
6271 err = json.Unmarshal(*v, &odataType)
6272 if err != nil {
6273 return err
6274 }
6275 jic.OdataType = odataType
6276 }
6277 }
6278 }
6279
6280 return nil
6281 }
6282
6283
6284 type JobInputHTTP struct {
6285
6286 BaseURI *string `json:"baseUri,omitempty"`
6287
6288 Files *[]string `json:"files,omitempty"`
6289
6290 Start BasicClipTime `json:"start,omitempty"`
6291
6292 End BasicClipTime `json:"end,omitempty"`
6293
6294 Label *string `json:"label,omitempty"`
6295
6296 InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
6297
6298 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6299 }
6300
6301
6302 func (jih JobInputHTTP) MarshalJSON() ([]byte, error) {
6303 jih.OdataType = OdataTypeMicrosoftMediaJobInputHTTP
6304 objectMap := make(map[string]interface{})
6305 if jih.BaseURI != nil {
6306 objectMap["baseUri"] = jih.BaseURI
6307 }
6308 if jih.Files != nil {
6309 objectMap["files"] = jih.Files
6310 }
6311 objectMap["start"] = jih.Start
6312 objectMap["end"] = jih.End
6313 if jih.Label != nil {
6314 objectMap["label"] = jih.Label
6315 }
6316 if jih.InputDefinitions != nil {
6317 objectMap["inputDefinitions"] = jih.InputDefinitions
6318 }
6319 if jih.OdataType != "" {
6320 objectMap["@odata.type"] = jih.OdataType
6321 }
6322 return json.Marshal(objectMap)
6323 }
6324
6325
6326 func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) {
6327 return nil, false
6328 }
6329
6330
6331 func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6332 return &jih, true
6333 }
6334
6335
6336 func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) {
6337 return nil, false
6338 }
6339
6340
6341 func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) {
6342 return nil, false
6343 }
6344
6345
6346 func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) {
6347 return &jih, true
6348 }
6349
6350
6351 func (jih JobInputHTTP) AsJobInputSequence() (*JobInputSequence, bool) {
6352 return nil, false
6353 }
6354
6355
6356 func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) {
6357 return nil, false
6358 }
6359
6360
6361 func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) {
6362 return &jih, true
6363 }
6364
6365
6366 func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error {
6367 var m map[string]*json.RawMessage
6368 err := json.Unmarshal(body, &m)
6369 if err != nil {
6370 return err
6371 }
6372 for k, v := range m {
6373 switch k {
6374 case "baseUri":
6375 if v != nil {
6376 var baseURI string
6377 err = json.Unmarshal(*v, &baseURI)
6378 if err != nil {
6379 return err
6380 }
6381 jih.BaseURI = &baseURI
6382 }
6383 case "files":
6384 if v != nil {
6385 var files []string
6386 err = json.Unmarshal(*v, &files)
6387 if err != nil {
6388 return err
6389 }
6390 jih.Files = &files
6391 }
6392 case "start":
6393 if v != nil {
6394 start, err := unmarshalBasicClipTime(*v)
6395 if err != nil {
6396 return err
6397 }
6398 jih.Start = start
6399 }
6400 case "end":
6401 if v != nil {
6402 end, err := unmarshalBasicClipTime(*v)
6403 if err != nil {
6404 return err
6405 }
6406 jih.End = end
6407 }
6408 case "label":
6409 if v != nil {
6410 var label string
6411 err = json.Unmarshal(*v, &label)
6412 if err != nil {
6413 return err
6414 }
6415 jih.Label = &label
6416 }
6417 case "inputDefinitions":
6418 if v != nil {
6419 inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6420 if err != nil {
6421 return err
6422 }
6423 jih.InputDefinitions = &inputDefinitions
6424 }
6425 case "@odata.type":
6426 if v != nil {
6427 var odataType OdataTypeBasicJobInput
6428 err = json.Unmarshal(*v, &odataType)
6429 if err != nil {
6430 return err
6431 }
6432 jih.OdataType = odataType
6433 }
6434 }
6435 }
6436
6437 return nil
6438 }
6439
6440
6441 type JobInputs struct {
6442
6443 Inputs *[]BasicJobInput `json:"inputs,omitempty"`
6444
6445 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6446 }
6447
6448
6449 func (ji JobInputs) MarshalJSON() ([]byte, error) {
6450 ji.OdataType = OdataTypeMicrosoftMediaJobInputs
6451 objectMap := make(map[string]interface{})
6452 if ji.Inputs != nil {
6453 objectMap["inputs"] = ji.Inputs
6454 }
6455 if ji.OdataType != "" {
6456 objectMap["@odata.type"] = ji.OdataType
6457 }
6458 return json.Marshal(objectMap)
6459 }
6460
6461
6462 func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) {
6463 return nil, false
6464 }
6465
6466
6467 func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6468 return nil, false
6469 }
6470
6471
6472 func (ji JobInputs) AsJobInputs() (*JobInputs, bool) {
6473 return &ji, true
6474 }
6475
6476
6477 func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) {
6478 return nil, false
6479 }
6480
6481
6482 func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) {
6483 return nil, false
6484 }
6485
6486
6487 func (ji JobInputs) AsJobInputSequence() (*JobInputSequence, bool) {
6488 return nil, false
6489 }
6490
6491
6492 func (ji JobInputs) AsJobInput() (*JobInput, bool) {
6493 return nil, false
6494 }
6495
6496
6497 func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) {
6498 return &ji, true
6499 }
6500
6501
6502 func (ji *JobInputs) UnmarshalJSON(body []byte) error {
6503 var m map[string]*json.RawMessage
6504 err := json.Unmarshal(body, &m)
6505 if err != nil {
6506 return err
6507 }
6508 for k, v := range m {
6509 switch k {
6510 case "inputs":
6511 if v != nil {
6512 inputs, err := unmarshalBasicJobInputArray(*v)
6513 if err != nil {
6514 return err
6515 }
6516 ji.Inputs = &inputs
6517 }
6518 case "@odata.type":
6519 if v != nil {
6520 var odataType OdataTypeBasicJobInput
6521 err = json.Unmarshal(*v, &odataType)
6522 if err != nil {
6523 return err
6524 }
6525 ji.OdataType = odataType
6526 }
6527 }
6528 }
6529
6530 return nil
6531 }
6532
6533
6534
6535 type JobInputSequence struct {
6536
6537 Inputs *[]BasicJobInputClip `json:"inputs,omitempty"`
6538
6539 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6540 }
6541
6542
6543 func (jis JobInputSequence) MarshalJSON() ([]byte, error) {
6544 jis.OdataType = OdataTypeMicrosoftMediaJobInputSequence
6545 objectMap := make(map[string]interface{})
6546 if jis.Inputs != nil {
6547 objectMap["inputs"] = jis.Inputs
6548 }
6549 if jis.OdataType != "" {
6550 objectMap["@odata.type"] = jis.OdataType
6551 }
6552 return json.Marshal(objectMap)
6553 }
6554
6555
6556 func (jis JobInputSequence) AsJobInputClip() (*JobInputClip, bool) {
6557 return nil, false
6558 }
6559
6560
6561 func (jis JobInputSequence) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6562 return nil, false
6563 }
6564
6565
6566 func (jis JobInputSequence) AsJobInputs() (*JobInputs, bool) {
6567 return nil, false
6568 }
6569
6570
6571 func (jis JobInputSequence) AsJobInputAsset() (*JobInputAsset, bool) {
6572 return nil, false
6573 }
6574
6575
6576 func (jis JobInputSequence) AsJobInputHTTP() (*JobInputHTTP, bool) {
6577 return nil, false
6578 }
6579
6580
6581 func (jis JobInputSequence) AsJobInputSequence() (*JobInputSequence, bool) {
6582 return &jis, true
6583 }
6584
6585
6586 func (jis JobInputSequence) AsJobInput() (*JobInput, bool) {
6587 return nil, false
6588 }
6589
6590
6591 func (jis JobInputSequence) AsBasicJobInput() (BasicJobInput, bool) {
6592 return &jis, true
6593 }
6594
6595
6596 func (jis *JobInputSequence) UnmarshalJSON(body []byte) error {
6597 var m map[string]*json.RawMessage
6598 err := json.Unmarshal(body, &m)
6599 if err != nil {
6600 return err
6601 }
6602 for k, v := range m {
6603 switch k {
6604 case "inputs":
6605 if v != nil {
6606 inputs, err := unmarshalBasicJobInputClipArray(*v)
6607 if err != nil {
6608 return err
6609 }
6610 jis.Inputs = &inputs
6611 }
6612 case "@odata.type":
6613 if v != nil {
6614 var odataType OdataTypeBasicJobInput
6615 err = json.Unmarshal(*v, &odataType)
6616 if err != nil {
6617 return err
6618 }
6619 jis.OdataType = odataType
6620 }
6621 }
6622 }
6623
6624 return nil
6625 }
6626
6627
6628 type BasicJobOutput interface {
6629 AsJobOutputAsset() (*JobOutputAsset, bool)
6630 AsJobOutput() (*JobOutput, bool)
6631 }
6632
6633
6634 type JobOutput struct {
6635
6636 Error *JobError `json:"error,omitempty"`
6637
6638 State JobState `json:"state,omitempty"`
6639
6640 Progress *int32 `json:"progress,omitempty"`
6641
6642 Label *string `json:"label,omitempty"`
6643
6644 StartTime *date.Time `json:"startTime,omitempty"`
6645
6646 EndTime *date.Time `json:"endTime,omitempty"`
6647
6648 OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
6649 }
6650
6651 func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) {
6652 var m map[string]interface{}
6653 err := json.Unmarshal(body, &m)
6654 if err != nil {
6655 return nil, err
6656 }
6657
6658 switch m["@odata.type"] {
6659 case string(OdataTypeMicrosoftMediaJobOutputAsset):
6660 var joa JobOutputAsset
6661 err := json.Unmarshal(body, &joa)
6662 return joa, err
6663 default:
6664 var jo JobOutput
6665 err := json.Unmarshal(body, &jo)
6666 return jo, err
6667 }
6668 }
6669 func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) {
6670 var rawMessages []*json.RawMessage
6671 err := json.Unmarshal(body, &rawMessages)
6672 if err != nil {
6673 return nil, err
6674 }
6675
6676 joArray := make([]BasicJobOutput, len(rawMessages))
6677
6678 for index, rawMessage := range rawMessages {
6679 jo, err := unmarshalBasicJobOutput(*rawMessage)
6680 if err != nil {
6681 return nil, err
6682 }
6683 joArray[index] = jo
6684 }
6685 return joArray, nil
6686 }
6687
6688
6689 func (jo JobOutput) MarshalJSON() ([]byte, error) {
6690 jo.OdataType = OdataTypeJobOutput
6691 objectMap := make(map[string]interface{})
6692 if jo.Label != nil {
6693 objectMap["label"] = jo.Label
6694 }
6695 if jo.OdataType != "" {
6696 objectMap["@odata.type"] = jo.OdataType
6697 }
6698 return json.Marshal(objectMap)
6699 }
6700
6701
6702 func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) {
6703 return nil, false
6704 }
6705
6706
6707 func (jo JobOutput) AsJobOutput() (*JobOutput, bool) {
6708 return &jo, true
6709 }
6710
6711
6712 func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) {
6713 return &jo, true
6714 }
6715
6716
6717 type JobOutputAsset struct {
6718
6719 AssetName *string `json:"assetName,omitempty"`
6720
6721 Error *JobError `json:"error,omitempty"`
6722
6723 State JobState `json:"state,omitempty"`
6724
6725 Progress *int32 `json:"progress,omitempty"`
6726
6727 Label *string `json:"label,omitempty"`
6728
6729 StartTime *date.Time `json:"startTime,omitempty"`
6730
6731 EndTime *date.Time `json:"endTime,omitempty"`
6732
6733 OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
6734 }
6735
6736
6737 func (joa JobOutputAsset) MarshalJSON() ([]byte, error) {
6738 joa.OdataType = OdataTypeMicrosoftMediaJobOutputAsset
6739 objectMap := make(map[string]interface{})
6740 if joa.AssetName != nil {
6741 objectMap["assetName"] = joa.AssetName
6742 }
6743 if joa.Label != nil {
6744 objectMap["label"] = joa.Label
6745 }
6746 if joa.OdataType != "" {
6747 objectMap["@odata.type"] = joa.OdataType
6748 }
6749 return json.Marshal(objectMap)
6750 }
6751
6752
6753 func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) {
6754 return &joa, true
6755 }
6756
6757
6758 func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) {
6759 return nil, false
6760 }
6761
6762
6763 func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) {
6764 return &joa, true
6765 }
6766
6767
6768 type JobProperties struct {
6769
6770 Created *date.Time `json:"created,omitempty"`
6771
6772 State JobState `json:"state,omitempty"`
6773
6774 Description *string `json:"description,omitempty"`
6775
6776 Input BasicJobInput `json:"input,omitempty"`
6777
6778 LastModified *date.Time `json:"lastModified,omitempty"`
6779
6780 Outputs *[]BasicJobOutput `json:"outputs,omitempty"`
6781
6782 Priority Priority `json:"priority,omitempty"`
6783
6784 CorrelationData map[string]*string `json:"correlationData"`
6785
6786 StartTime *date.Time `json:"startTime,omitempty"`
6787
6788 EndTime *date.Time `json:"endTime,omitempty"`
6789 }
6790
6791
6792 func (jp JobProperties) MarshalJSON() ([]byte, error) {
6793 objectMap := make(map[string]interface{})
6794 if jp.Description != nil {
6795 objectMap["description"] = jp.Description
6796 }
6797 objectMap["input"] = jp.Input
6798 if jp.Outputs != nil {
6799 objectMap["outputs"] = jp.Outputs
6800 }
6801 if jp.Priority != "" {
6802 objectMap["priority"] = jp.Priority
6803 }
6804 if jp.CorrelationData != nil {
6805 objectMap["correlationData"] = jp.CorrelationData
6806 }
6807 return json.Marshal(objectMap)
6808 }
6809
6810
6811 func (jp *JobProperties) UnmarshalJSON(body []byte) error {
6812 var m map[string]*json.RawMessage
6813 err := json.Unmarshal(body, &m)
6814 if err != nil {
6815 return err
6816 }
6817 for k, v := range m {
6818 switch k {
6819 case "created":
6820 if v != nil {
6821 var created date.Time
6822 err = json.Unmarshal(*v, &created)
6823 if err != nil {
6824 return err
6825 }
6826 jp.Created = &created
6827 }
6828 case "state":
6829 if v != nil {
6830 var state JobState
6831 err = json.Unmarshal(*v, &state)
6832 if err != nil {
6833 return err
6834 }
6835 jp.State = state
6836 }
6837 case "description":
6838 if v != nil {
6839 var description string
6840 err = json.Unmarshal(*v, &description)
6841 if err != nil {
6842 return err
6843 }
6844 jp.Description = &description
6845 }
6846 case "input":
6847 if v != nil {
6848 input, err := unmarshalBasicJobInput(*v)
6849 if err != nil {
6850 return err
6851 }
6852 jp.Input = input
6853 }
6854 case "lastModified":
6855 if v != nil {
6856 var lastModified date.Time
6857 err = json.Unmarshal(*v, &lastModified)
6858 if err != nil {
6859 return err
6860 }
6861 jp.LastModified = &lastModified
6862 }
6863 case "outputs":
6864 if v != nil {
6865 outputs, err := unmarshalBasicJobOutputArray(*v)
6866 if err != nil {
6867 return err
6868 }
6869 jp.Outputs = &outputs
6870 }
6871 case "priority":
6872 if v != nil {
6873 var priority Priority
6874 err = json.Unmarshal(*v, &priority)
6875 if err != nil {
6876 return err
6877 }
6878 jp.Priority = priority
6879 }
6880 case "correlationData":
6881 if v != nil {
6882 var correlationData map[string]*string
6883 err = json.Unmarshal(*v, &correlationData)
6884 if err != nil {
6885 return err
6886 }
6887 jp.CorrelationData = correlationData
6888 }
6889 case "startTime":
6890 if v != nil {
6891 var startTime date.Time
6892 err = json.Unmarshal(*v, &startTime)
6893 if err != nil {
6894 return err
6895 }
6896 jp.StartTime = &startTime
6897 }
6898 case "endTime":
6899 if v != nil {
6900 var endTime date.Time
6901 err = json.Unmarshal(*v, &endTime)
6902 if err != nil {
6903 return err
6904 }
6905 jp.EndTime = &endTime
6906 }
6907 }
6908 }
6909
6910 return nil
6911 }
6912
6913
6914 type JpgFormat struct {
6915
6916 FilenamePattern *string `json:"filenamePattern,omitempty"`
6917
6918 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
6919 }
6920
6921
6922 func (jf JpgFormat) MarshalJSON() ([]byte, error) {
6923 jf.OdataType = OdataTypeMicrosoftMediaJpgFormat
6924 objectMap := make(map[string]interface{})
6925 if jf.FilenamePattern != nil {
6926 objectMap["filenamePattern"] = jf.FilenamePattern
6927 }
6928 if jf.OdataType != "" {
6929 objectMap["@odata.type"] = jf.OdataType
6930 }
6931 return json.Marshal(objectMap)
6932 }
6933
6934
6935 func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) {
6936 return nil, false
6937 }
6938
6939
6940 func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
6941 return &jf, true
6942 }
6943
6944
6945 func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) {
6946 return &jf, true
6947 }
6948
6949
6950 func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) {
6951 return nil, false
6952 }
6953
6954
6955 func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
6956 return nil, false
6957 }
6958
6959
6960 func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
6961 return nil, false
6962 }
6963
6964
6965 func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) {
6966 return nil, false
6967 }
6968
6969
6970 func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
6971 return nil, false
6972 }
6973
6974
6975 func (jf JpgFormat) AsFormat() (*Format, bool) {
6976 return nil, false
6977 }
6978
6979
6980 func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) {
6981 return &jf, true
6982 }
6983
6984
6985 type JpgImage struct {
6986
6987 Layers *[]JpgLayer `json:"layers,omitempty"`
6988
6989 SpriteColumn *int32 `json:"spriteColumn,omitempty"`
6990
6991 Start *string `json:"start,omitempty"`
6992
6993 Step *string `json:"step,omitempty"`
6994
6995 Range *string `json:"range,omitempty"`
6996
6997 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
6998
6999 StretchMode StretchMode `json:"stretchMode,omitempty"`
7000
7001 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
7002
7003 Label *string `json:"label,omitempty"`
7004
7005 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
7006 }
7007
7008
7009 func (ji JpgImage) MarshalJSON() ([]byte, error) {
7010 ji.OdataType = OdataTypeMicrosoftMediaJpgImage
7011 objectMap := make(map[string]interface{})
7012 if ji.Layers != nil {
7013 objectMap["layers"] = ji.Layers
7014 }
7015 if ji.SpriteColumn != nil {
7016 objectMap["spriteColumn"] = ji.SpriteColumn
7017 }
7018 if ji.Start != nil {
7019 objectMap["start"] = ji.Start
7020 }
7021 if ji.Step != nil {
7022 objectMap["step"] = ji.Step
7023 }
7024 if ji.Range != nil {
7025 objectMap["range"] = ji.Range
7026 }
7027 if ji.KeyFrameInterval != nil {
7028 objectMap["keyFrameInterval"] = ji.KeyFrameInterval
7029 }
7030 if ji.StretchMode != "" {
7031 objectMap["stretchMode"] = ji.StretchMode
7032 }
7033 if ji.SyncMode != "" {
7034 objectMap["syncMode"] = ji.SyncMode
7035 }
7036 if ji.Label != nil {
7037 objectMap["label"] = ji.Label
7038 }
7039 if ji.OdataType != "" {
7040 objectMap["@odata.type"] = ji.OdataType
7041 }
7042 return json.Marshal(objectMap)
7043 }
7044
7045
7046 func (ji JpgImage) AsAudio() (*Audio, bool) {
7047 return nil, false
7048 }
7049
7050
7051 func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) {
7052 return nil, false
7053 }
7054
7055
7056 func (ji JpgImage) AsAacAudio() (*AacAudio, bool) {
7057 return nil, false
7058 }
7059
7060
7061 func (ji JpgImage) AsVideo() (*Video, bool) {
7062 return nil, false
7063 }
7064
7065
7066 func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) {
7067 return &ji, true
7068 }
7069
7070
7071 func (ji JpgImage) AsH265Video() (*H265Video, bool) {
7072 return nil, false
7073 }
7074
7075
7076 func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) {
7077 return nil, false
7078 }
7079
7080
7081 func (ji JpgImage) AsImage() (*Image, bool) {
7082 return nil, false
7083 }
7084
7085
7086 func (ji JpgImage) AsBasicImage() (BasicImage, bool) {
7087 return &ji, true
7088 }
7089
7090
7091 func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) {
7092 return nil, false
7093 }
7094
7095
7096 func (ji JpgImage) AsH264Video() (*H264Video, bool) {
7097 return nil, false
7098 }
7099
7100
7101 func (ji JpgImage) AsJpgImage() (*JpgImage, bool) {
7102 return &ji, true
7103 }
7104
7105
7106 func (ji JpgImage) AsPngImage() (*PngImage, bool) {
7107 return nil, false
7108 }
7109
7110
7111 func (ji JpgImage) AsCodec() (*Codec, bool) {
7112 return nil, false
7113 }
7114
7115
7116 func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) {
7117 return &ji, true
7118 }
7119
7120
7121 type JpgLayer struct {
7122
7123 Quality *int32 `json:"quality,omitempty"`
7124
7125 Width *string `json:"width,omitempty"`
7126
7127 Height *string `json:"height,omitempty"`
7128
7129 Label *string `json:"label,omitempty"`
7130
7131 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
7132 }
7133
7134
7135 func (jl JpgLayer) MarshalJSON() ([]byte, error) {
7136 jl.OdataType = OdataTypeMicrosoftMediaJpgLayer
7137 objectMap := make(map[string]interface{})
7138 if jl.Quality != nil {
7139 objectMap["quality"] = jl.Quality
7140 }
7141 if jl.Width != nil {
7142 objectMap["width"] = jl.Width
7143 }
7144 if jl.Height != nil {
7145 objectMap["height"] = jl.Height
7146 }
7147 if jl.Label != nil {
7148 objectMap["label"] = jl.Label
7149 }
7150 if jl.OdataType != "" {
7151 objectMap["@odata.type"] = jl.OdataType
7152 }
7153 return json.Marshal(objectMap)
7154 }
7155
7156
7157 func (jl JpgLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
7158 return nil, false
7159 }
7160
7161
7162 func (jl JpgLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
7163 return nil, false
7164 }
7165
7166
7167 func (jl JpgLayer) AsH265Layer() (*H265Layer, bool) {
7168 return nil, false
7169 }
7170
7171
7172 func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) {
7173 return nil, false
7174 }
7175
7176
7177 func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
7178 return nil, false
7179 }
7180
7181
7182 func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) {
7183 return nil, false
7184 }
7185
7186
7187 func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) {
7188 return &jl, true
7189 }
7190
7191
7192 func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) {
7193 return nil, false
7194 }
7195
7196
7197 func (jl JpgLayer) AsLayer() (*Layer, bool) {
7198 return nil, false
7199 }
7200
7201
7202 func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) {
7203 return &jl, true
7204 }
7205
7206
7207 type KeyVaultProperties struct {
7208
7209 KeyIdentifier *string `json:"keyIdentifier,omitempty"`
7210
7211 CurrentKeyIdentifier *string `json:"currentKeyIdentifier,omitempty"`
7212 }
7213
7214
7215 func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
7216 objectMap := make(map[string]interface{})
7217 if kvp.KeyIdentifier != nil {
7218 objectMap["keyIdentifier"] = kvp.KeyIdentifier
7219 }
7220 return json.Marshal(objectMap)
7221 }
7222
7223
7224
7225
7226 type BasicLayer interface {
7227 AsH265VideoLayer() (*H265VideoLayer, bool)
7228 AsBasicH265VideoLayer() (BasicH265VideoLayer, bool)
7229 AsH265Layer() (*H265Layer, bool)
7230 AsVideoLayer() (*VideoLayer, bool)
7231 AsBasicVideoLayer() (BasicVideoLayer, bool)
7232 AsH264Layer() (*H264Layer, bool)
7233 AsJpgLayer() (*JpgLayer, bool)
7234 AsPngLayer() (*PngLayer, bool)
7235 AsLayer() (*Layer, bool)
7236 }
7237
7238
7239
7240
7241 type Layer struct {
7242
7243 Width *string `json:"width,omitempty"`
7244
7245 Height *string `json:"height,omitempty"`
7246
7247 Label *string `json:"label,omitempty"`
7248
7249 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
7250 }
7251
7252 func unmarshalBasicLayer(body []byte) (BasicLayer, error) {
7253 var m map[string]interface{}
7254 err := json.Unmarshal(body, &m)
7255 if err != nil {
7256 return nil, err
7257 }
7258
7259 switch m["@odata.type"] {
7260 case string(OdataTypeMicrosoftMediaH265VideoLayer):
7261 var hvl H265VideoLayer
7262 err := json.Unmarshal(body, &hvl)
7263 return hvl, err
7264 case string(OdataTypeMicrosoftMediaH265Layer):
7265 var hl H265Layer
7266 err := json.Unmarshal(body, &hl)
7267 return hl, err
7268 case string(OdataTypeMicrosoftMediaVideoLayer):
7269 var vl VideoLayer
7270 err := json.Unmarshal(body, &vl)
7271 return vl, err
7272 case string(OdataTypeMicrosoftMediaH264Layer):
7273 var hl H264Layer
7274 err := json.Unmarshal(body, &hl)
7275 return hl, err
7276 case string(OdataTypeMicrosoftMediaJpgLayer):
7277 var jl JpgLayer
7278 err := json.Unmarshal(body, &jl)
7279 return jl, err
7280 case string(OdataTypeMicrosoftMediaPngLayer):
7281 var pl PngLayer
7282 err := json.Unmarshal(body, &pl)
7283 return pl, err
7284 default:
7285 var l Layer
7286 err := json.Unmarshal(body, &l)
7287 return l, err
7288 }
7289 }
7290 func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) {
7291 var rawMessages []*json.RawMessage
7292 err := json.Unmarshal(body, &rawMessages)
7293 if err != nil {
7294 return nil, err
7295 }
7296
7297 lArray := make([]BasicLayer, len(rawMessages))
7298
7299 for index, rawMessage := range rawMessages {
7300 l, err := unmarshalBasicLayer(*rawMessage)
7301 if err != nil {
7302 return nil, err
7303 }
7304 lArray[index] = l
7305 }
7306 return lArray, nil
7307 }
7308
7309
7310 func (l Layer) MarshalJSON() ([]byte, error) {
7311 l.OdataType = OdataTypeLayer
7312 objectMap := make(map[string]interface{})
7313 if l.Width != nil {
7314 objectMap["width"] = l.Width
7315 }
7316 if l.Height != nil {
7317 objectMap["height"] = l.Height
7318 }
7319 if l.Label != nil {
7320 objectMap["label"] = l.Label
7321 }
7322 if l.OdataType != "" {
7323 objectMap["@odata.type"] = l.OdataType
7324 }
7325 return json.Marshal(objectMap)
7326 }
7327
7328
7329 func (l Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
7330 return nil, false
7331 }
7332
7333
7334 func (l Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
7335 return nil, false
7336 }
7337
7338
7339 func (l Layer) AsH265Layer() (*H265Layer, bool) {
7340 return nil, false
7341 }
7342
7343
7344 func (l Layer) AsVideoLayer() (*VideoLayer, bool) {
7345 return nil, false
7346 }
7347
7348
7349 func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
7350 return nil, false
7351 }
7352
7353
7354 func (l Layer) AsH264Layer() (*H264Layer, bool) {
7355 return nil, false
7356 }
7357
7358
7359 func (l Layer) AsJpgLayer() (*JpgLayer, bool) {
7360 return nil, false
7361 }
7362
7363
7364 func (l Layer) AsPngLayer() (*PngLayer, bool) {
7365 return nil, false
7366 }
7367
7368
7369 func (l Layer) AsLayer() (*Layer, bool) {
7370 return &l, true
7371 }
7372
7373
7374 func (l Layer) AsBasicLayer() (BasicLayer, bool) {
7375 return &l, true
7376 }
7377
7378
7379 type ListContainerSasInput struct {
7380
7381 Permissions AssetContainerPermission `json:"permissions,omitempty"`
7382
7383 ExpiryTime *date.Time `json:"expiryTime,omitempty"`
7384 }
7385
7386
7387 type ListContentKeysResponse struct {
7388 autorest.Response `json:"-"`
7389
7390 ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
7391 }
7392
7393
7394 type ListEdgePoliciesInput struct {
7395
7396 DeviceID *string `json:"deviceId,omitempty"`
7397 }
7398
7399
7400 type ListPathsResponse struct {
7401 autorest.Response `json:"-"`
7402
7403 StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"`
7404
7405 DownloadPaths *[]string `json:"downloadPaths,omitempty"`
7406 }
7407
7408
7409 type ListStreamingLocatorsResponse struct {
7410 autorest.Response `json:"-"`
7411
7412 StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"`
7413 }
7414
7415
7416 func (lslr ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) {
7417 objectMap := make(map[string]interface{})
7418 return json.Marshal(objectMap)
7419 }
7420
7421
7422 type LiveEvent struct {
7423 autorest.Response `json:"-"`
7424
7425 *LiveEventProperties `json:"properties,omitempty"`
7426
7427 SystemData *SystemData `json:"systemData,omitempty"`
7428
7429 Tags map[string]*string `json:"tags"`
7430
7431 Location *string `json:"location,omitempty"`
7432
7433 ID *string `json:"id,omitempty"`
7434
7435 Name *string `json:"name,omitempty"`
7436
7437 Type *string `json:"type,omitempty"`
7438 }
7439
7440
7441 func (le LiveEvent) MarshalJSON() ([]byte, error) {
7442 objectMap := make(map[string]interface{})
7443 if le.LiveEventProperties != nil {
7444 objectMap["properties"] = le.LiveEventProperties
7445 }
7446 if le.Tags != nil {
7447 objectMap["tags"] = le.Tags
7448 }
7449 if le.Location != nil {
7450 objectMap["location"] = le.Location
7451 }
7452 return json.Marshal(objectMap)
7453 }
7454
7455
7456 func (le *LiveEvent) UnmarshalJSON(body []byte) error {
7457 var m map[string]*json.RawMessage
7458 err := json.Unmarshal(body, &m)
7459 if err != nil {
7460 return err
7461 }
7462 for k, v := range m {
7463 switch k {
7464 case "properties":
7465 if v != nil {
7466 var liveEventProperties LiveEventProperties
7467 err = json.Unmarshal(*v, &liveEventProperties)
7468 if err != nil {
7469 return err
7470 }
7471 le.LiveEventProperties = &liveEventProperties
7472 }
7473 case "systemData":
7474 if v != nil {
7475 var systemData SystemData
7476 err = json.Unmarshal(*v, &systemData)
7477 if err != nil {
7478 return err
7479 }
7480 le.SystemData = &systemData
7481 }
7482 case "tags":
7483 if v != nil {
7484 var tags map[string]*string
7485 err = json.Unmarshal(*v, &tags)
7486 if err != nil {
7487 return err
7488 }
7489 le.Tags = tags
7490 }
7491 case "location":
7492 if v != nil {
7493 var location string
7494 err = json.Unmarshal(*v, &location)
7495 if err != nil {
7496 return err
7497 }
7498 le.Location = &location
7499 }
7500 case "id":
7501 if v != nil {
7502 var ID string
7503 err = json.Unmarshal(*v, &ID)
7504 if err != nil {
7505 return err
7506 }
7507 le.ID = &ID
7508 }
7509 case "name":
7510 if v != nil {
7511 var name string
7512 err = json.Unmarshal(*v, &name)
7513 if err != nil {
7514 return err
7515 }
7516 le.Name = &name
7517 }
7518 case "type":
7519 if v != nil {
7520 var typeVar string
7521 err = json.Unmarshal(*v, &typeVar)
7522 if err != nil {
7523 return err
7524 }
7525 le.Type = &typeVar
7526 }
7527 }
7528 }
7529
7530 return nil
7531 }
7532
7533
7534 type LiveEventActionInput struct {
7535
7536 RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"`
7537 }
7538
7539
7540 type LiveEventEncoding struct {
7541
7542 EncodingType LiveEventEncodingType `json:"encodingType,omitempty"`
7543
7544 PresetName *string `json:"presetName,omitempty"`
7545
7546 StretchMode StretchMode `json:"stretchMode,omitempty"`
7547
7548 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
7549 }
7550
7551
7552 type LiveEventEndpoint struct {
7553
7554 Protocol *string `json:"protocol,omitempty"`
7555
7556 URL *string `json:"url,omitempty"`
7557 }
7558
7559
7560 type LiveEventInput struct {
7561
7562 StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"`
7563
7564 AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"`
7565
7566 KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"`
7567
7568 AccessToken *string `json:"accessToken,omitempty"`
7569
7570 Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
7571 }
7572
7573
7574 type LiveEventInputAccessControl struct {
7575
7576 IP *IPAccessControl `json:"ip,omitempty"`
7577 }
7578
7579
7580
7581 type LiveEventInputTrackSelection struct {
7582
7583 Property *string `json:"property,omitempty"`
7584
7585 Operation *string `json:"operation,omitempty"`
7586
7587 Value *string `json:"value,omitempty"`
7588 }
7589
7590
7591 type LiveEventListResult struct {
7592 autorest.Response `json:"-"`
7593
7594 Value *[]LiveEvent `json:"value,omitempty"`
7595
7596 OdataCount *int32 `json:"@odata.count,omitempty"`
7597
7598 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
7599 }
7600
7601
7602 type LiveEventListResultIterator struct {
7603 i int
7604 page LiveEventListResultPage
7605 }
7606
7607
7608
7609 func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) {
7610 if tracing.IsEnabled() {
7611 ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext")
7612 defer func() {
7613 sc := -1
7614 if iter.Response().Response.Response != nil {
7615 sc = iter.Response().Response.Response.StatusCode
7616 }
7617 tracing.EndSpan(ctx, sc, err)
7618 }()
7619 }
7620 iter.i++
7621 if iter.i < len(iter.page.Values()) {
7622 return nil
7623 }
7624 err = iter.page.NextWithContext(ctx)
7625 if err != nil {
7626 iter.i--
7627 return err
7628 }
7629 iter.i = 0
7630 return nil
7631 }
7632
7633
7634
7635
7636 func (iter *LiveEventListResultIterator) Next() error {
7637 return iter.NextWithContext(context.Background())
7638 }
7639
7640
7641 func (iter LiveEventListResultIterator) NotDone() bool {
7642 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7643 }
7644
7645
7646 func (iter LiveEventListResultIterator) Response() LiveEventListResult {
7647 return iter.page.Response()
7648 }
7649
7650
7651
7652 func (iter LiveEventListResultIterator) Value() LiveEvent {
7653 if !iter.page.NotDone() {
7654 return LiveEvent{}
7655 }
7656 return iter.page.Values()[iter.i]
7657 }
7658
7659
7660 func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator {
7661 return LiveEventListResultIterator{page: page}
7662 }
7663
7664
7665 func (lelr LiveEventListResult) IsEmpty() bool {
7666 return lelr.Value == nil || len(*lelr.Value) == 0
7667 }
7668
7669
7670 func (lelr LiveEventListResult) hasNextLink() bool {
7671 return lelr.OdataNextLink != nil && len(*lelr.OdataNextLink) != 0
7672 }
7673
7674
7675
7676 func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) {
7677 if !lelr.hasNextLink() {
7678 return nil, nil
7679 }
7680 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7681 autorest.AsJSON(),
7682 autorest.AsGet(),
7683 autorest.WithBaseURL(to.String(lelr.OdataNextLink)))
7684 }
7685
7686
7687 type LiveEventListResultPage struct {
7688 fn func(context.Context, LiveEventListResult) (LiveEventListResult, error)
7689 lelr LiveEventListResult
7690 }
7691
7692
7693
7694 func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) {
7695 if tracing.IsEnabled() {
7696 ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext")
7697 defer func() {
7698 sc := -1
7699 if page.Response().Response.Response != nil {
7700 sc = page.Response().Response.Response.StatusCode
7701 }
7702 tracing.EndSpan(ctx, sc, err)
7703 }()
7704 }
7705 for {
7706 next, err := page.fn(ctx, page.lelr)
7707 if err != nil {
7708 return err
7709 }
7710 page.lelr = next
7711 if !next.hasNextLink() || !next.IsEmpty() {
7712 break
7713 }
7714 }
7715 return nil
7716 }
7717
7718
7719
7720
7721 func (page *LiveEventListResultPage) Next() error {
7722 return page.NextWithContext(context.Background())
7723 }
7724
7725
7726 func (page LiveEventListResultPage) NotDone() bool {
7727 return !page.lelr.IsEmpty()
7728 }
7729
7730
7731 func (page LiveEventListResultPage) Response() LiveEventListResult {
7732 return page.lelr
7733 }
7734
7735
7736 func (page LiveEventListResultPage) Values() []LiveEvent {
7737 if page.lelr.IsEmpty() {
7738 return nil
7739 }
7740 return *page.lelr.Value
7741 }
7742
7743
7744 func NewLiveEventListResultPage(cur LiveEventListResult, getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage {
7745 return LiveEventListResultPage{
7746 fn: getNextPage,
7747 lelr: cur,
7748 }
7749 }
7750
7751
7752
7753
7754 type LiveEventOutputTranscriptionTrack struct {
7755
7756 TrackName *string `json:"trackName,omitempty"`
7757 }
7758
7759
7760 type LiveEventPreview struct {
7761
7762 Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
7763
7764 AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"`
7765
7766 PreviewLocator *string `json:"previewLocator,omitempty"`
7767
7768 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
7769
7770 AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
7771 }
7772
7773
7774 type LiveEventPreviewAccessControl struct {
7775
7776 IP *IPAccessControl `json:"ip,omitempty"`
7777 }
7778
7779
7780 type LiveEventProperties struct {
7781
7782 Description *string `json:"description,omitempty"`
7783
7784 Input *LiveEventInput `json:"input,omitempty"`
7785
7786 Preview *LiveEventPreview `json:"preview,omitempty"`
7787
7788 Encoding *LiveEventEncoding `json:"encoding,omitempty"`
7789
7790 Transcriptions *[]LiveEventTranscription `json:"transcriptions,omitempty"`
7791
7792 ProvisioningState *string `json:"provisioningState,omitempty"`
7793
7794 ResourceState LiveEventResourceState `json:"resourceState,omitempty"`
7795
7796 CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
7797
7798 UseStaticHostname *bool `json:"useStaticHostname,omitempty"`
7799
7800 HostnamePrefix *string `json:"hostnamePrefix,omitempty"`
7801
7802 StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"`
7803
7804 Created *date.Time `json:"created,omitempty"`
7805
7806 LastModified *date.Time `json:"lastModified,omitempty"`
7807 }
7808
7809
7810 func (lep LiveEventProperties) MarshalJSON() ([]byte, error) {
7811 objectMap := make(map[string]interface{})
7812 if lep.Description != nil {
7813 objectMap["description"] = lep.Description
7814 }
7815 if lep.Input != nil {
7816 objectMap["input"] = lep.Input
7817 }
7818 if lep.Preview != nil {
7819 objectMap["preview"] = lep.Preview
7820 }
7821 if lep.Encoding != nil {
7822 objectMap["encoding"] = lep.Encoding
7823 }
7824 if lep.Transcriptions != nil {
7825 objectMap["transcriptions"] = lep.Transcriptions
7826 }
7827 if lep.CrossSiteAccessPolicies != nil {
7828 objectMap["crossSiteAccessPolicies"] = lep.CrossSiteAccessPolicies
7829 }
7830 if lep.UseStaticHostname != nil {
7831 objectMap["useStaticHostname"] = lep.UseStaticHostname
7832 }
7833 if lep.HostnamePrefix != nil {
7834 objectMap["hostnamePrefix"] = lep.HostnamePrefix
7835 }
7836 if lep.StreamOptions != nil {
7837 objectMap["streamOptions"] = lep.StreamOptions
7838 }
7839 return json.Marshal(objectMap)
7840 }
7841
7842
7843
7844 type LiveEventsAllocateFuture struct {
7845 azure.FutureAPI
7846
7847
7848 Result func(LiveEventsClient) (autorest.Response, error)
7849 }
7850
7851
7852 func (future *LiveEventsAllocateFuture) UnmarshalJSON(body []byte) error {
7853 var azFuture azure.Future
7854 if err := json.Unmarshal(body, &azFuture); err != nil {
7855 return err
7856 }
7857 future.FutureAPI = &azFuture
7858 future.Result = future.result
7859 return nil
7860 }
7861
7862
7863 func (future *LiveEventsAllocateFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7864 var done bool
7865 done, err = future.DoneWithContext(context.Background(), client)
7866 if err != nil {
7867 err = autorest.NewErrorWithError(err, "media.LiveEventsAllocateFuture", "Result", future.Response(), "Polling failure")
7868 return
7869 }
7870 if !done {
7871 ar.Response = future.Response()
7872 err = azure.NewAsyncOpIncompleteError("media.LiveEventsAllocateFuture")
7873 return
7874 }
7875 ar.Response = future.Response()
7876 return
7877 }
7878
7879
7880
7881 type LiveEventsCreateFuture struct {
7882 azure.FutureAPI
7883
7884
7885 Result func(LiveEventsClient) (LiveEvent, error)
7886 }
7887
7888
7889 func (future *LiveEventsCreateFuture) UnmarshalJSON(body []byte) error {
7890 var azFuture azure.Future
7891 if err := json.Unmarshal(body, &azFuture); err != nil {
7892 return err
7893 }
7894 future.FutureAPI = &azFuture
7895 future.Result = future.result
7896 return nil
7897 }
7898
7899
7900 func (future *LiveEventsCreateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
7901 var done bool
7902 done, err = future.DoneWithContext(context.Background(), client)
7903 if err != nil {
7904 err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure")
7905 return
7906 }
7907 if !done {
7908 le.Response.Response = future.Response()
7909 err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture")
7910 return
7911 }
7912 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7913 if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
7914 le, err = client.CreateResponder(le.Response.Response)
7915 if err != nil {
7916 err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request")
7917 }
7918 }
7919 return
7920 }
7921
7922
7923
7924 type LiveEventsDeleteFuture struct {
7925 azure.FutureAPI
7926
7927
7928 Result func(LiveEventsClient) (autorest.Response, error)
7929 }
7930
7931
7932 func (future *LiveEventsDeleteFuture) UnmarshalJSON(body []byte) error {
7933 var azFuture azure.Future
7934 if err := json.Unmarshal(body, &azFuture); err != nil {
7935 return err
7936 }
7937 future.FutureAPI = &azFuture
7938 future.Result = future.result
7939 return nil
7940 }
7941
7942
7943 func (future *LiveEventsDeleteFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7944 var done bool
7945 done, err = future.DoneWithContext(context.Background(), client)
7946 if err != nil {
7947 err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure")
7948 return
7949 }
7950 if !done {
7951 ar.Response = future.Response()
7952 err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture")
7953 return
7954 }
7955 ar.Response = future.Response()
7956 return
7957 }
7958
7959
7960
7961 type LiveEventsResetFuture struct {
7962 azure.FutureAPI
7963
7964
7965 Result func(LiveEventsClient) (autorest.Response, error)
7966 }
7967
7968
7969 func (future *LiveEventsResetFuture) UnmarshalJSON(body []byte) error {
7970 var azFuture azure.Future
7971 if err := json.Unmarshal(body, &azFuture); err != nil {
7972 return err
7973 }
7974 future.FutureAPI = &azFuture
7975 future.Result = future.result
7976 return nil
7977 }
7978
7979
7980 func (future *LiveEventsResetFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7981 var done bool
7982 done, err = future.DoneWithContext(context.Background(), client)
7983 if err != nil {
7984 err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure")
7985 return
7986 }
7987 if !done {
7988 ar.Response = future.Response()
7989 err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture")
7990 return
7991 }
7992 ar.Response = future.Response()
7993 return
7994 }
7995
7996
7997
7998 type LiveEventsStartFuture struct {
7999 azure.FutureAPI
8000
8001
8002 Result func(LiveEventsClient) (autorest.Response, error)
8003 }
8004
8005
8006 func (future *LiveEventsStartFuture) UnmarshalJSON(body []byte) error {
8007 var azFuture azure.Future
8008 if err := json.Unmarshal(body, &azFuture); err != nil {
8009 return err
8010 }
8011 future.FutureAPI = &azFuture
8012 future.Result = future.result
8013 return nil
8014 }
8015
8016
8017 func (future *LiveEventsStartFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
8018 var done bool
8019 done, err = future.DoneWithContext(context.Background(), client)
8020 if err != nil {
8021 err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure")
8022 return
8023 }
8024 if !done {
8025 ar.Response = future.Response()
8026 err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture")
8027 return
8028 }
8029 ar.Response = future.Response()
8030 return
8031 }
8032
8033
8034
8035 type LiveEventsStopFuture struct {
8036 azure.FutureAPI
8037
8038
8039 Result func(LiveEventsClient) (autorest.Response, error)
8040 }
8041
8042
8043 func (future *LiveEventsStopFuture) UnmarshalJSON(body []byte) error {
8044 var azFuture azure.Future
8045 if err := json.Unmarshal(body, &azFuture); err != nil {
8046 return err
8047 }
8048 future.FutureAPI = &azFuture
8049 future.Result = future.result
8050 return nil
8051 }
8052
8053
8054 func (future *LiveEventsStopFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
8055 var done bool
8056 done, err = future.DoneWithContext(context.Background(), client)
8057 if err != nil {
8058 err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure")
8059 return
8060 }
8061 if !done {
8062 ar.Response = future.Response()
8063 err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture")
8064 return
8065 }
8066 ar.Response = future.Response()
8067 return
8068 }
8069
8070
8071
8072 type LiveEventsUpdateFuture struct {
8073 azure.FutureAPI
8074
8075
8076 Result func(LiveEventsClient) (LiveEvent, error)
8077 }
8078
8079
8080 func (future *LiveEventsUpdateFuture) UnmarshalJSON(body []byte) error {
8081 var azFuture azure.Future
8082 if err := json.Unmarshal(body, &azFuture); err != nil {
8083 return err
8084 }
8085 future.FutureAPI = &azFuture
8086 future.Result = future.result
8087 return nil
8088 }
8089
8090
8091 func (future *LiveEventsUpdateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
8092 var done bool
8093 done, err = future.DoneWithContext(context.Background(), client)
8094 if err != nil {
8095 err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure")
8096 return
8097 }
8098 if !done {
8099 le.Response.Response = future.Response()
8100 err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture")
8101 return
8102 }
8103 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8104 if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
8105 le, err = client.UpdateResponder(le.Response.Response)
8106 if err != nil {
8107 err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request")
8108 }
8109 }
8110 return
8111 }
8112
8113
8114
8115
8116 type LiveEventTranscription struct {
8117
8118 Language *string `json:"language,omitempty"`
8119
8120 InputTrackSelection *[]LiveEventInputTrackSelection `json:"inputTrackSelection,omitempty"`
8121
8122 OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"`
8123 }
8124
8125
8126 type LiveOutput struct {
8127 autorest.Response `json:"-"`
8128
8129 *LiveOutputProperties `json:"properties,omitempty"`
8130
8131 ID *string `json:"id,omitempty"`
8132
8133 Name *string `json:"name,omitempty"`
8134
8135 Type *string `json:"type,omitempty"`
8136 }
8137
8138
8139 func (lo LiveOutput) MarshalJSON() ([]byte, error) {
8140 objectMap := make(map[string]interface{})
8141 if lo.LiveOutputProperties != nil {
8142 objectMap["properties"] = lo.LiveOutputProperties
8143 }
8144 return json.Marshal(objectMap)
8145 }
8146
8147
8148 func (lo *LiveOutput) UnmarshalJSON(body []byte) error {
8149 var m map[string]*json.RawMessage
8150 err := json.Unmarshal(body, &m)
8151 if err != nil {
8152 return err
8153 }
8154 for k, v := range m {
8155 switch k {
8156 case "properties":
8157 if v != nil {
8158 var liveOutputProperties LiveOutputProperties
8159 err = json.Unmarshal(*v, &liveOutputProperties)
8160 if err != nil {
8161 return err
8162 }
8163 lo.LiveOutputProperties = &liveOutputProperties
8164 }
8165 case "id":
8166 if v != nil {
8167 var ID string
8168 err = json.Unmarshal(*v, &ID)
8169 if err != nil {
8170 return err
8171 }
8172 lo.ID = &ID
8173 }
8174 case "name":
8175 if v != nil {
8176 var name string
8177 err = json.Unmarshal(*v, &name)
8178 if err != nil {
8179 return err
8180 }
8181 lo.Name = &name
8182 }
8183 case "type":
8184 if v != nil {
8185 var typeVar string
8186 err = json.Unmarshal(*v, &typeVar)
8187 if err != nil {
8188 return err
8189 }
8190 lo.Type = &typeVar
8191 }
8192 }
8193 }
8194
8195 return nil
8196 }
8197
8198
8199 type LiveOutputListResult struct {
8200 autorest.Response `json:"-"`
8201
8202 Value *[]LiveOutput `json:"value,omitempty"`
8203
8204 OdataCount *int32 `json:"@odata.count,omitempty"`
8205
8206 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
8207 }
8208
8209
8210 type LiveOutputListResultIterator struct {
8211 i int
8212 page LiveOutputListResultPage
8213 }
8214
8215
8216
8217 func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
8218 if tracing.IsEnabled() {
8219 ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext")
8220 defer func() {
8221 sc := -1
8222 if iter.Response().Response.Response != nil {
8223 sc = iter.Response().Response.Response.StatusCode
8224 }
8225 tracing.EndSpan(ctx, sc, err)
8226 }()
8227 }
8228 iter.i++
8229 if iter.i < len(iter.page.Values()) {
8230 return nil
8231 }
8232 err = iter.page.NextWithContext(ctx)
8233 if err != nil {
8234 iter.i--
8235 return err
8236 }
8237 iter.i = 0
8238 return nil
8239 }
8240
8241
8242
8243
8244 func (iter *LiveOutputListResultIterator) Next() error {
8245 return iter.NextWithContext(context.Background())
8246 }
8247
8248
8249 func (iter LiveOutputListResultIterator) NotDone() bool {
8250 return iter.page.NotDone() && iter.i < len(iter.page.Values())
8251 }
8252
8253
8254 func (iter LiveOutputListResultIterator) Response() LiveOutputListResult {
8255 return iter.page.Response()
8256 }
8257
8258
8259
8260 func (iter LiveOutputListResultIterator) Value() LiveOutput {
8261 if !iter.page.NotDone() {
8262 return LiveOutput{}
8263 }
8264 return iter.page.Values()[iter.i]
8265 }
8266
8267
8268 func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator {
8269 return LiveOutputListResultIterator{page: page}
8270 }
8271
8272
8273 func (lolr LiveOutputListResult) IsEmpty() bool {
8274 return lolr.Value == nil || len(*lolr.Value) == 0
8275 }
8276
8277
8278 func (lolr LiveOutputListResult) hasNextLink() bool {
8279 return lolr.OdataNextLink != nil && len(*lolr.OdataNextLink) != 0
8280 }
8281
8282
8283
8284 func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) {
8285 if !lolr.hasNextLink() {
8286 return nil, nil
8287 }
8288 return autorest.Prepare((&http.Request{}).WithContext(ctx),
8289 autorest.AsJSON(),
8290 autorest.AsGet(),
8291 autorest.WithBaseURL(to.String(lolr.OdataNextLink)))
8292 }
8293
8294
8295 type LiveOutputListResultPage struct {
8296 fn func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)
8297 lolr LiveOutputListResult
8298 }
8299
8300
8301
8302 func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) {
8303 if tracing.IsEnabled() {
8304 ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext")
8305 defer func() {
8306 sc := -1
8307 if page.Response().Response.Response != nil {
8308 sc = page.Response().Response.Response.StatusCode
8309 }
8310 tracing.EndSpan(ctx, sc, err)
8311 }()
8312 }
8313 for {
8314 next, err := page.fn(ctx, page.lolr)
8315 if err != nil {
8316 return err
8317 }
8318 page.lolr = next
8319 if !next.hasNextLink() || !next.IsEmpty() {
8320 break
8321 }
8322 }
8323 return nil
8324 }
8325
8326
8327
8328
8329 func (page *LiveOutputListResultPage) Next() error {
8330 return page.NextWithContext(context.Background())
8331 }
8332
8333
8334 func (page LiveOutputListResultPage) NotDone() bool {
8335 return !page.lolr.IsEmpty()
8336 }
8337
8338
8339 func (page LiveOutputListResultPage) Response() LiveOutputListResult {
8340 return page.lolr
8341 }
8342
8343
8344 func (page LiveOutputListResultPage) Values() []LiveOutput {
8345 if page.lolr.IsEmpty() {
8346 return nil
8347 }
8348 return *page.lolr.Value
8349 }
8350
8351
8352 func NewLiveOutputListResultPage(cur LiveOutputListResult, getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage {
8353 return LiveOutputListResultPage{
8354 fn: getNextPage,
8355 lolr: cur,
8356 }
8357 }
8358
8359
8360 type LiveOutputProperties struct {
8361
8362 Description *string `json:"description,omitempty"`
8363
8364 AssetName *string `json:"assetName,omitempty"`
8365
8366 ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"`
8367
8368 ManifestName *string `json:"manifestName,omitempty"`
8369
8370 Hls *Hls `json:"hls,omitempty"`
8371
8372 OutputSnapTime *int64 `json:"outputSnapTime,omitempty"`
8373
8374 Created *date.Time `json:"created,omitempty"`
8375
8376 LastModified *date.Time `json:"lastModified,omitempty"`
8377
8378 ProvisioningState *string `json:"provisioningState,omitempty"`
8379
8380 ResourceState LiveOutputResourceState `json:"resourceState,omitempty"`
8381 }
8382
8383
8384 func (lop LiveOutputProperties) MarshalJSON() ([]byte, error) {
8385 objectMap := make(map[string]interface{})
8386 if lop.Description != nil {
8387 objectMap["description"] = lop.Description
8388 }
8389 if lop.AssetName != nil {
8390 objectMap["assetName"] = lop.AssetName
8391 }
8392 if lop.ArchiveWindowLength != nil {
8393 objectMap["archiveWindowLength"] = lop.ArchiveWindowLength
8394 }
8395 if lop.ManifestName != nil {
8396 objectMap["manifestName"] = lop.ManifestName
8397 }
8398 if lop.Hls != nil {
8399 objectMap["hls"] = lop.Hls
8400 }
8401 if lop.OutputSnapTime != nil {
8402 objectMap["outputSnapTime"] = lop.OutputSnapTime
8403 }
8404 return json.Marshal(objectMap)
8405 }
8406
8407
8408
8409 type LiveOutputsCreateFuture struct {
8410 azure.FutureAPI
8411
8412
8413 Result func(LiveOutputsClient) (LiveOutput, error)
8414 }
8415
8416
8417 func (future *LiveOutputsCreateFuture) UnmarshalJSON(body []byte) error {
8418 var azFuture azure.Future
8419 if err := json.Unmarshal(body, &azFuture); err != nil {
8420 return err
8421 }
8422 future.FutureAPI = &azFuture
8423 future.Result = future.result
8424 return nil
8425 }
8426
8427
8428 func (future *LiveOutputsCreateFuture) result(client LiveOutputsClient) (lo LiveOutput, err error) {
8429 var done bool
8430 done, err = future.DoneWithContext(context.Background(), client)
8431 if err != nil {
8432 err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure")
8433 return
8434 }
8435 if !done {
8436 lo.Response.Response = future.Response()
8437 err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture")
8438 return
8439 }
8440 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8441 if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent {
8442 lo, err = client.CreateResponder(lo.Response.Response)
8443 if err != nil {
8444 err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request")
8445 }
8446 }
8447 return
8448 }
8449
8450
8451
8452 type LiveOutputsDeleteFuture struct {
8453 azure.FutureAPI
8454
8455
8456 Result func(LiveOutputsClient) (autorest.Response, error)
8457 }
8458
8459
8460 func (future *LiveOutputsDeleteFuture) UnmarshalJSON(body []byte) error {
8461 var azFuture azure.Future
8462 if err := json.Unmarshal(body, &azFuture); err != nil {
8463 return err
8464 }
8465 future.FutureAPI = &azFuture
8466 future.Result = future.result
8467 return nil
8468 }
8469
8470
8471 func (future *LiveOutputsDeleteFuture) result(client LiveOutputsClient) (ar autorest.Response, err error) {
8472 var done bool
8473 done, err = future.DoneWithContext(context.Background(), client)
8474 if err != nil {
8475 err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure")
8476 return
8477 }
8478 if !done {
8479 ar.Response = future.Response()
8480 err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture")
8481 return
8482 }
8483 ar.Response = future.Response()
8484 return
8485 }
8486
8487
8488 type Location struct {
8489 Name *string `json:"name,omitempty"`
8490 }
8491
8492
8493 type LogSpecification struct {
8494
8495 Name *string `json:"name,omitempty"`
8496
8497 DisplayName *string `json:"displayName,omitempty"`
8498
8499 BlobDuration *string `json:"blobDuration,omitempty"`
8500 }
8501
8502
8503 func (ls LogSpecification) MarshalJSON() ([]byte, error) {
8504 objectMap := make(map[string]interface{})
8505 return json.Marshal(objectMap)
8506 }
8507
8508
8509 type MetricDimension struct {
8510
8511 Name *string `json:"name,omitempty"`
8512
8513 DisplayName *string `json:"displayName,omitempty"`
8514
8515 ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
8516 }
8517
8518
8519 func (md MetricDimension) MarshalJSON() ([]byte, error) {
8520 objectMap := make(map[string]interface{})
8521 return json.Marshal(objectMap)
8522 }
8523
8524
8525 type MetricSpecification struct {
8526
8527 Name *string `json:"name,omitempty"`
8528
8529 DisplayName *string `json:"displayName,omitempty"`
8530
8531 DisplayDescription *string `json:"displayDescription,omitempty"`
8532
8533 Unit MetricUnit `json:"unit,omitempty"`
8534
8535 AggregationType MetricAggregationType `json:"aggregationType,omitempty"`
8536
8537 LockAggregationType MetricAggregationType `json:"lockAggregationType,omitempty"`
8538
8539 SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
8540
8541 Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
8542 }
8543
8544
8545 func (ms MetricSpecification) MarshalJSON() ([]byte, error) {
8546 objectMap := make(map[string]interface{})
8547 if ms.SupportedAggregationTypes != nil {
8548 objectMap["supportedAggregationTypes"] = ms.SupportedAggregationTypes
8549 }
8550 return json.Marshal(objectMap)
8551 }
8552
8553
8554 type Mp4Format struct {
8555
8556 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
8557
8558 FilenamePattern *string `json:"filenamePattern,omitempty"`
8559
8560 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
8561 }
8562
8563
8564 func (m4f Mp4Format) MarshalJSON() ([]byte, error) {
8565 m4f.OdataType = OdataTypeMicrosoftMediaMp4Format
8566 objectMap := make(map[string]interface{})
8567 if m4f.OutputFiles != nil {
8568 objectMap["outputFiles"] = m4f.OutputFiles
8569 }
8570 if m4f.FilenamePattern != nil {
8571 objectMap["filenamePattern"] = m4f.FilenamePattern
8572 }
8573 if m4f.OdataType != "" {
8574 objectMap["@odata.type"] = m4f.OdataType
8575 }
8576 return json.Marshal(objectMap)
8577 }
8578
8579
8580 func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) {
8581 return nil, false
8582 }
8583
8584
8585 func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) {
8586 return nil, false
8587 }
8588
8589
8590 func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) {
8591 return nil, false
8592 }
8593
8594
8595 func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) {
8596 return nil, false
8597 }
8598
8599
8600 func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
8601 return nil, false
8602 }
8603
8604
8605 func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
8606 return &m4f, true
8607 }
8608
8609
8610 func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) {
8611 return &m4f, true
8612 }
8613
8614
8615 func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
8616 return nil, false
8617 }
8618
8619
8620 func (m4f Mp4Format) AsFormat() (*Format, bool) {
8621 return nil, false
8622 }
8623
8624
8625 func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) {
8626 return &m4f, true
8627 }
8628
8629
8630
8631
8632 type BasicMultiBitrateFormat interface {
8633 AsMp4Format() (*Mp4Format, bool)
8634 AsTransportStreamFormat() (*TransportStreamFormat, bool)
8635 AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
8636 }
8637
8638
8639
8640
8641 type MultiBitrateFormat struct {
8642
8643 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
8644
8645 FilenamePattern *string `json:"filenamePattern,omitempty"`
8646
8647 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
8648 }
8649
8650 func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) {
8651 var m map[string]interface{}
8652 err := json.Unmarshal(body, &m)
8653 if err != nil {
8654 return nil, err
8655 }
8656
8657 switch m["@odata.type"] {
8658 case string(OdataTypeMicrosoftMediaMp4Format):
8659 var m4f Mp4Format
8660 err := json.Unmarshal(body, &m4f)
8661 return m4f, err
8662 case string(OdataTypeMicrosoftMediaTransportStreamFormat):
8663 var tsf TransportStreamFormat
8664 err := json.Unmarshal(body, &tsf)
8665 return tsf, err
8666 default:
8667 var mbf MultiBitrateFormat
8668 err := json.Unmarshal(body, &mbf)
8669 return mbf, err
8670 }
8671 }
8672 func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) {
8673 var rawMessages []*json.RawMessage
8674 err := json.Unmarshal(body, &rawMessages)
8675 if err != nil {
8676 return nil, err
8677 }
8678
8679 mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages))
8680
8681 for index, rawMessage := range rawMessages {
8682 mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage)
8683 if err != nil {
8684 return nil, err
8685 }
8686 mbfArray[index] = mbf
8687 }
8688 return mbfArray, nil
8689 }
8690
8691
8692 func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) {
8693 mbf.OdataType = OdataTypeMicrosoftMediaMultiBitrateFormat
8694 objectMap := make(map[string]interface{})
8695 if mbf.OutputFiles != nil {
8696 objectMap["outputFiles"] = mbf.OutputFiles
8697 }
8698 if mbf.FilenamePattern != nil {
8699 objectMap["filenamePattern"] = mbf.FilenamePattern
8700 }
8701 if mbf.OdataType != "" {
8702 objectMap["@odata.type"] = mbf.OdataType
8703 }
8704 return json.Marshal(objectMap)
8705 }
8706
8707
8708 func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) {
8709 return nil, false
8710 }
8711
8712
8713 func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
8714 return nil, false
8715 }
8716
8717
8718 func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) {
8719 return nil, false
8720 }
8721
8722
8723 func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) {
8724 return nil, false
8725 }
8726
8727
8728 func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
8729 return &mbf, true
8730 }
8731
8732
8733 func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
8734 return &mbf, true
8735 }
8736
8737
8738 func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) {
8739 return nil, false
8740 }
8741
8742
8743 func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
8744 return nil, false
8745 }
8746
8747
8748 func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) {
8749 return nil, false
8750 }
8751
8752
8753 func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) {
8754 return &mbf, true
8755 }
8756
8757
8758 type NoEncryption struct {
8759
8760 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
8761 }
8762
8763
8764 type ODataError struct {
8765
8766 Code *string `json:"code,omitempty"`
8767
8768 Message *string `json:"message,omitempty"`
8769
8770 Target *string `json:"target,omitempty"`
8771
8772 Details *[]ODataError `json:"details,omitempty"`
8773 }
8774
8775
8776 type Operation struct {
8777
8778 Name *string `json:"name,omitempty"`
8779
8780 Display *OperationDisplay `json:"display,omitempty"`
8781
8782 Origin *string `json:"origin,omitempty"`
8783
8784 Properties *Properties `json:"properties,omitempty"`
8785 }
8786
8787
8788 type OperationCollection struct {
8789 autorest.Response `json:"-"`
8790
8791 Value *[]Operation `json:"value,omitempty"`
8792
8793 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
8794 }
8795
8796
8797 type OperationCollectionIterator struct {
8798 i int
8799 page OperationCollectionPage
8800 }
8801
8802
8803
8804 func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8805 if tracing.IsEnabled() {
8806 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
8807 defer func() {
8808 sc := -1
8809 if iter.Response().Response.Response != nil {
8810 sc = iter.Response().Response.Response.StatusCode
8811 }
8812 tracing.EndSpan(ctx, sc, err)
8813 }()
8814 }
8815 iter.i++
8816 if iter.i < len(iter.page.Values()) {
8817 return nil
8818 }
8819 err = iter.page.NextWithContext(ctx)
8820 if err != nil {
8821 iter.i--
8822 return err
8823 }
8824 iter.i = 0
8825 return nil
8826 }
8827
8828
8829
8830
8831 func (iter *OperationCollectionIterator) Next() error {
8832 return iter.NextWithContext(context.Background())
8833 }
8834
8835
8836 func (iter OperationCollectionIterator) NotDone() bool {
8837 return iter.page.NotDone() && iter.i < len(iter.page.Values())
8838 }
8839
8840
8841 func (iter OperationCollectionIterator) Response() OperationCollection {
8842 return iter.page.Response()
8843 }
8844
8845
8846
8847 func (iter OperationCollectionIterator) Value() Operation {
8848 if !iter.page.NotDone() {
8849 return Operation{}
8850 }
8851 return iter.page.Values()[iter.i]
8852 }
8853
8854
8855 func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
8856 return OperationCollectionIterator{page: page}
8857 }
8858
8859
8860 func (oc OperationCollection) IsEmpty() bool {
8861 return oc.Value == nil || len(*oc.Value) == 0
8862 }
8863
8864
8865 func (oc OperationCollection) hasNextLink() bool {
8866 return oc.OdataNextLink != nil && len(*oc.OdataNextLink) != 0
8867 }
8868
8869
8870
8871 func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
8872 if !oc.hasNextLink() {
8873 return nil, nil
8874 }
8875 return autorest.Prepare((&http.Request{}).WithContext(ctx),
8876 autorest.AsJSON(),
8877 autorest.AsGet(),
8878 autorest.WithBaseURL(to.String(oc.OdataNextLink)))
8879 }
8880
8881
8882 type OperationCollectionPage struct {
8883 fn func(context.Context, OperationCollection) (OperationCollection, error)
8884 oc OperationCollection
8885 }
8886
8887
8888
8889 func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
8890 if tracing.IsEnabled() {
8891 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
8892 defer func() {
8893 sc := -1
8894 if page.Response().Response.Response != nil {
8895 sc = page.Response().Response.Response.StatusCode
8896 }
8897 tracing.EndSpan(ctx, sc, err)
8898 }()
8899 }
8900 for {
8901 next, err := page.fn(ctx, page.oc)
8902 if err != nil {
8903 return err
8904 }
8905 page.oc = next
8906 if !next.hasNextLink() || !next.IsEmpty() {
8907 break
8908 }
8909 }
8910 return nil
8911 }
8912
8913
8914
8915
8916 func (page *OperationCollectionPage) Next() error {
8917 return page.NextWithContext(context.Background())
8918 }
8919
8920
8921 func (page OperationCollectionPage) NotDone() bool {
8922 return !page.oc.IsEmpty()
8923 }
8924
8925
8926 func (page OperationCollectionPage) Response() OperationCollection {
8927 return page.oc
8928 }
8929
8930
8931 func (page OperationCollectionPage) Values() []Operation {
8932 if page.oc.IsEmpty() {
8933 return nil
8934 }
8935 return *page.oc.Value
8936 }
8937
8938
8939 func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
8940 return OperationCollectionPage{
8941 fn: getNextPage,
8942 oc: cur,
8943 }
8944 }
8945
8946
8947 type OperationDisplay struct {
8948
8949 Provider *string `json:"provider,omitempty"`
8950
8951 Resource *string `json:"resource,omitempty"`
8952
8953 Operation *string `json:"operation,omitempty"`
8954
8955 Description *string `json:"description,omitempty"`
8956 }
8957
8958
8959 type OutputFile struct {
8960
8961 Labels *[]string `json:"labels,omitempty"`
8962 }
8963
8964
8965 type BasicOverlay interface {
8966 AsAudioOverlay() (*AudioOverlay, bool)
8967 AsVideoOverlay() (*VideoOverlay, bool)
8968 AsOverlay() (*Overlay, bool)
8969 }
8970
8971
8972 type Overlay struct {
8973
8974 InputLabel *string `json:"inputLabel,omitempty"`
8975
8976 Start *string `json:"start,omitempty"`
8977
8978 End *string `json:"end,omitempty"`
8979
8980 FadeInDuration *string `json:"fadeInDuration,omitempty"`
8981
8982 FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
8983
8984 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
8985
8986 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
8987 }
8988
8989 func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) {
8990 var m map[string]interface{}
8991 err := json.Unmarshal(body, &m)
8992 if err != nil {
8993 return nil, err
8994 }
8995
8996 switch m["@odata.type"] {
8997 case string(OdataTypeMicrosoftMediaAudioOverlay):
8998 var ao AudioOverlay
8999 err := json.Unmarshal(body, &ao)
9000 return ao, err
9001 case string(OdataTypeMicrosoftMediaVideoOverlay):
9002 var vo VideoOverlay
9003 err := json.Unmarshal(body, &vo)
9004 return vo, err
9005 default:
9006 var o Overlay
9007 err := json.Unmarshal(body, &o)
9008 return o, err
9009 }
9010 }
9011 func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) {
9012 var rawMessages []*json.RawMessage
9013 err := json.Unmarshal(body, &rawMessages)
9014 if err != nil {
9015 return nil, err
9016 }
9017
9018 oArray := make([]BasicOverlay, len(rawMessages))
9019
9020 for index, rawMessage := range rawMessages {
9021 o, err := unmarshalBasicOverlay(*rawMessage)
9022 if err != nil {
9023 return nil, err
9024 }
9025 oArray[index] = o
9026 }
9027 return oArray, nil
9028 }
9029
9030
9031 func (o Overlay) MarshalJSON() ([]byte, error) {
9032 o.OdataType = OdataTypeOverlay
9033 objectMap := make(map[string]interface{})
9034 if o.InputLabel != nil {
9035 objectMap["inputLabel"] = o.InputLabel
9036 }
9037 if o.Start != nil {
9038 objectMap["start"] = o.Start
9039 }
9040 if o.End != nil {
9041 objectMap["end"] = o.End
9042 }
9043 if o.FadeInDuration != nil {
9044 objectMap["fadeInDuration"] = o.FadeInDuration
9045 }
9046 if o.FadeOutDuration != nil {
9047 objectMap["fadeOutDuration"] = o.FadeOutDuration
9048 }
9049 if o.AudioGainLevel != nil {
9050 objectMap["audioGainLevel"] = o.AudioGainLevel
9051 }
9052 if o.OdataType != "" {
9053 objectMap["@odata.type"] = o.OdataType
9054 }
9055 return json.Marshal(objectMap)
9056 }
9057
9058
9059 func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) {
9060 return nil, false
9061 }
9062
9063
9064 func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) {
9065 return nil, false
9066 }
9067
9068
9069 func (o Overlay) AsOverlay() (*Overlay, bool) {
9070 return &o, true
9071 }
9072
9073
9074 func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) {
9075 return &o, true
9076 }
9077
9078
9079 type PngFormat struct {
9080
9081 FilenamePattern *string `json:"filenamePattern,omitempty"`
9082
9083 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
9084 }
9085
9086
9087 func (pf PngFormat) MarshalJSON() ([]byte, error) {
9088 pf.OdataType = OdataTypeMicrosoftMediaPngFormat
9089 objectMap := make(map[string]interface{})
9090 if pf.FilenamePattern != nil {
9091 objectMap["filenamePattern"] = pf.FilenamePattern
9092 }
9093 if pf.OdataType != "" {
9094 objectMap["@odata.type"] = pf.OdataType
9095 }
9096 return json.Marshal(objectMap)
9097 }
9098
9099
9100 func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) {
9101 return nil, false
9102 }
9103
9104
9105 func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
9106 return &pf, true
9107 }
9108
9109
9110 func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) {
9111 return nil, false
9112 }
9113
9114
9115 func (pf PngFormat) AsPngFormat() (*PngFormat, bool) {
9116 return &pf, true
9117 }
9118
9119
9120 func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
9121 return nil, false
9122 }
9123
9124
9125 func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
9126 return nil, false
9127 }
9128
9129
9130 func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) {
9131 return nil, false
9132 }
9133
9134
9135 func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
9136 return nil, false
9137 }
9138
9139
9140 func (pf PngFormat) AsFormat() (*Format, bool) {
9141 return nil, false
9142 }
9143
9144
9145 func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) {
9146 return &pf, true
9147 }
9148
9149
9150 type PngImage struct {
9151
9152 Layers *[]PngLayer `json:"layers,omitempty"`
9153
9154 Start *string `json:"start,omitempty"`
9155
9156 Step *string `json:"step,omitempty"`
9157
9158 Range *string `json:"range,omitempty"`
9159
9160 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
9161
9162 StretchMode StretchMode `json:"stretchMode,omitempty"`
9163
9164 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
9165
9166 Label *string `json:"label,omitempty"`
9167
9168 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
9169 }
9170
9171
9172 func (pi PngImage) MarshalJSON() ([]byte, error) {
9173 pi.OdataType = OdataTypeMicrosoftMediaPngImage
9174 objectMap := make(map[string]interface{})
9175 if pi.Layers != nil {
9176 objectMap["layers"] = pi.Layers
9177 }
9178 if pi.Start != nil {
9179 objectMap["start"] = pi.Start
9180 }
9181 if pi.Step != nil {
9182 objectMap["step"] = pi.Step
9183 }
9184 if pi.Range != nil {
9185 objectMap["range"] = pi.Range
9186 }
9187 if pi.KeyFrameInterval != nil {
9188 objectMap["keyFrameInterval"] = pi.KeyFrameInterval
9189 }
9190 if pi.StretchMode != "" {
9191 objectMap["stretchMode"] = pi.StretchMode
9192 }
9193 if pi.SyncMode != "" {
9194 objectMap["syncMode"] = pi.SyncMode
9195 }
9196 if pi.Label != nil {
9197 objectMap["label"] = pi.Label
9198 }
9199 if pi.OdataType != "" {
9200 objectMap["@odata.type"] = pi.OdataType
9201 }
9202 return json.Marshal(objectMap)
9203 }
9204
9205
9206 func (pi PngImage) AsAudio() (*Audio, bool) {
9207 return nil, false
9208 }
9209
9210
9211 func (pi PngImage) AsBasicAudio() (BasicAudio, bool) {
9212 return nil, false
9213 }
9214
9215
9216 func (pi PngImage) AsAacAudio() (*AacAudio, bool) {
9217 return nil, false
9218 }
9219
9220
9221 func (pi PngImage) AsVideo() (*Video, bool) {
9222 return nil, false
9223 }
9224
9225
9226 func (pi PngImage) AsBasicVideo() (BasicVideo, bool) {
9227 return &pi, true
9228 }
9229
9230
9231 func (pi PngImage) AsH265Video() (*H265Video, bool) {
9232 return nil, false
9233 }
9234
9235
9236 func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) {
9237 return nil, false
9238 }
9239
9240
9241 func (pi PngImage) AsImage() (*Image, bool) {
9242 return nil, false
9243 }
9244
9245
9246 func (pi PngImage) AsBasicImage() (BasicImage, bool) {
9247 return &pi, true
9248 }
9249
9250
9251 func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) {
9252 return nil, false
9253 }
9254
9255
9256 func (pi PngImage) AsH264Video() (*H264Video, bool) {
9257 return nil, false
9258 }
9259
9260
9261 func (pi PngImage) AsJpgImage() (*JpgImage, bool) {
9262 return nil, false
9263 }
9264
9265
9266 func (pi PngImage) AsPngImage() (*PngImage, bool) {
9267 return &pi, true
9268 }
9269
9270
9271 func (pi PngImage) AsCodec() (*Codec, bool) {
9272 return nil, false
9273 }
9274
9275
9276 func (pi PngImage) AsBasicCodec() (BasicCodec, bool) {
9277 return &pi, true
9278 }
9279
9280
9281 type PngLayer struct {
9282
9283 Width *string `json:"width,omitempty"`
9284
9285 Height *string `json:"height,omitempty"`
9286
9287 Label *string `json:"label,omitempty"`
9288
9289 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
9290 }
9291
9292
9293 func (pl PngLayer) MarshalJSON() ([]byte, error) {
9294 pl.OdataType = OdataTypeMicrosoftMediaPngLayer
9295 objectMap := make(map[string]interface{})
9296 if pl.Width != nil {
9297 objectMap["width"] = pl.Width
9298 }
9299 if pl.Height != nil {
9300 objectMap["height"] = pl.Height
9301 }
9302 if pl.Label != nil {
9303 objectMap["label"] = pl.Label
9304 }
9305 if pl.OdataType != "" {
9306 objectMap["@odata.type"] = pl.OdataType
9307 }
9308 return json.Marshal(objectMap)
9309 }
9310
9311
9312 func (pl PngLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
9313 return nil, false
9314 }
9315
9316
9317 func (pl PngLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
9318 return nil, false
9319 }
9320
9321
9322 func (pl PngLayer) AsH265Layer() (*H265Layer, bool) {
9323 return nil, false
9324 }
9325
9326
9327 func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) {
9328 return nil, false
9329 }
9330
9331
9332 func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
9333 return nil, false
9334 }
9335
9336
9337 func (pl PngLayer) AsH264Layer() (*H264Layer, bool) {
9338 return nil, false
9339 }
9340
9341
9342 func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) {
9343 return nil, false
9344 }
9345
9346
9347 func (pl PngLayer) AsPngLayer() (*PngLayer, bool) {
9348 return &pl, true
9349 }
9350
9351
9352 func (pl PngLayer) AsLayer() (*Layer, bool) {
9353 return nil, false
9354 }
9355
9356
9357 func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) {
9358 return &pl, true
9359 }
9360
9361
9362
9363 type PresentationTimeRange struct {
9364
9365 StartTimestamp *int64 `json:"startTimestamp,omitempty"`
9366
9367 EndTimestamp *int64 `json:"endTimestamp,omitempty"`
9368
9369 PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"`
9370
9371 LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"`
9372
9373 Timescale *int64 `json:"timescale,omitempty"`
9374
9375 ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"`
9376 }
9377
9378
9379
9380 type BasicPreset interface {
9381 AsFaceDetectorPreset() (*FaceDetectorPreset, bool)
9382 AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
9383 AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool)
9384 AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool)
9385 AsStandardEncoderPreset() (*StandardEncoderPreset, bool)
9386 AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
9387 AsPreset() (*Preset, bool)
9388 }
9389
9390
9391
9392 type Preset struct {
9393
9394 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
9395 }
9396
9397 func unmarshalBasicPreset(body []byte) (BasicPreset, error) {
9398 var m map[string]interface{}
9399 err := json.Unmarshal(body, &m)
9400 if err != nil {
9401 return nil, err
9402 }
9403
9404 switch m["@odata.type"] {
9405 case string(OdataTypeMicrosoftMediaFaceDetectorPreset):
9406 var fdp FaceDetectorPreset
9407 err := json.Unmarshal(body, &fdp)
9408 return fdp, err
9409 case string(OdataTypeMicrosoftMediaAudioAnalyzerPreset):
9410 var aap AudioAnalyzerPreset
9411 err := json.Unmarshal(body, &aap)
9412 return aap, err
9413 case string(OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset):
9414 var bisep BuiltInStandardEncoderPreset
9415 err := json.Unmarshal(body, &bisep)
9416 return bisep, err
9417 case string(OdataTypeMicrosoftMediaStandardEncoderPreset):
9418 var sep StandardEncoderPreset
9419 err := json.Unmarshal(body, &sep)
9420 return sep, err
9421 case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset):
9422 var vap VideoAnalyzerPreset
9423 err := json.Unmarshal(body, &vap)
9424 return vap, err
9425 default:
9426 var p Preset
9427 err := json.Unmarshal(body, &p)
9428 return p, err
9429 }
9430 }
9431 func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) {
9432 var rawMessages []*json.RawMessage
9433 err := json.Unmarshal(body, &rawMessages)
9434 if err != nil {
9435 return nil, err
9436 }
9437
9438 pArray := make([]BasicPreset, len(rawMessages))
9439
9440 for index, rawMessage := range rawMessages {
9441 p, err := unmarshalBasicPreset(*rawMessage)
9442 if err != nil {
9443 return nil, err
9444 }
9445 pArray[index] = p
9446 }
9447 return pArray, nil
9448 }
9449
9450
9451 func (p Preset) MarshalJSON() ([]byte, error) {
9452 p.OdataType = OdataTypePreset
9453 objectMap := make(map[string]interface{})
9454 if p.OdataType != "" {
9455 objectMap["@odata.type"] = p.OdataType
9456 }
9457 return json.Marshal(objectMap)
9458 }
9459
9460
9461 func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
9462 return nil, false
9463 }
9464
9465
9466 func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
9467 return nil, false
9468 }
9469
9470
9471 func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
9472 return nil, false
9473 }
9474
9475
9476 func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
9477 return nil, false
9478 }
9479
9480
9481 func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
9482 return nil, false
9483 }
9484
9485
9486 func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
9487 return nil, false
9488 }
9489
9490
9491 func (p Preset) AsPreset() (*Preset, bool) {
9492 return &p, true
9493 }
9494
9495
9496 func (p Preset) AsBasicPreset() (BasicPreset, bool) {
9497 return &p, true
9498 }
9499
9500
9501 type PrivateEndpoint struct {
9502
9503 ID *string `json:"id,omitempty"`
9504 }
9505
9506
9507 func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
9508 objectMap := make(map[string]interface{})
9509 return json.Marshal(objectMap)
9510 }
9511
9512
9513 type PrivateEndpointConnection struct {
9514 autorest.Response `json:"-"`
9515
9516 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
9517
9518 ID *string `json:"id,omitempty"`
9519
9520 Name *string `json:"name,omitempty"`
9521
9522 Type *string `json:"type,omitempty"`
9523 }
9524
9525
9526 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
9527 objectMap := make(map[string]interface{})
9528 if pec.PrivateEndpointConnectionProperties != nil {
9529 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
9530 }
9531 return json.Marshal(objectMap)
9532 }
9533
9534
9535 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
9536 var m map[string]*json.RawMessage
9537 err := json.Unmarshal(body, &m)
9538 if err != nil {
9539 return err
9540 }
9541 for k, v := range m {
9542 switch k {
9543 case "properties":
9544 if v != nil {
9545 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
9546 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
9547 if err != nil {
9548 return err
9549 }
9550 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
9551 }
9552 case "id":
9553 if v != nil {
9554 var ID string
9555 err = json.Unmarshal(*v, &ID)
9556 if err != nil {
9557 return err
9558 }
9559 pec.ID = &ID
9560 }
9561 case "name":
9562 if v != nil {
9563 var name string
9564 err = json.Unmarshal(*v, &name)
9565 if err != nil {
9566 return err
9567 }
9568 pec.Name = &name
9569 }
9570 case "type":
9571 if v != nil {
9572 var typeVar string
9573 err = json.Unmarshal(*v, &typeVar)
9574 if err != nil {
9575 return err
9576 }
9577 pec.Type = &typeVar
9578 }
9579 }
9580 }
9581
9582 return nil
9583 }
9584
9585
9586
9587 type PrivateEndpointConnectionListResult struct {
9588 autorest.Response `json:"-"`
9589
9590 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
9591 }
9592
9593
9594 type PrivateEndpointConnectionProperties struct {
9595
9596 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
9597
9598 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
9599
9600 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
9601 }
9602
9603
9604 type PrivateLinkResource struct {
9605 autorest.Response `json:"-"`
9606
9607 *PrivateLinkResourceProperties `json:"properties,omitempty"`
9608
9609 ID *string `json:"id,omitempty"`
9610
9611 Name *string `json:"name,omitempty"`
9612
9613 Type *string `json:"type,omitempty"`
9614 }
9615
9616
9617 func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
9618 objectMap := make(map[string]interface{})
9619 if plr.PrivateLinkResourceProperties != nil {
9620 objectMap["properties"] = plr.PrivateLinkResourceProperties
9621 }
9622 return json.Marshal(objectMap)
9623 }
9624
9625
9626 func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
9627 var m map[string]*json.RawMessage
9628 err := json.Unmarshal(body, &m)
9629 if err != nil {
9630 return err
9631 }
9632 for k, v := range m {
9633 switch k {
9634 case "properties":
9635 if v != nil {
9636 var privateLinkResourceProperties PrivateLinkResourceProperties
9637 err = json.Unmarshal(*v, &privateLinkResourceProperties)
9638 if err != nil {
9639 return err
9640 }
9641 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
9642 }
9643 case "id":
9644 if v != nil {
9645 var ID string
9646 err = json.Unmarshal(*v, &ID)
9647 if err != nil {
9648 return err
9649 }
9650 plr.ID = &ID
9651 }
9652 case "name":
9653 if v != nil {
9654 var name string
9655 err = json.Unmarshal(*v, &name)
9656 if err != nil {
9657 return err
9658 }
9659 plr.Name = &name
9660 }
9661 case "type":
9662 if v != nil {
9663 var typeVar string
9664 err = json.Unmarshal(*v, &typeVar)
9665 if err != nil {
9666 return err
9667 }
9668 plr.Type = &typeVar
9669 }
9670 }
9671 }
9672
9673 return nil
9674 }
9675
9676
9677 type PrivateLinkResourceListResult struct {
9678 autorest.Response `json:"-"`
9679
9680 Value *[]PrivateLinkResource `json:"value,omitempty"`
9681 }
9682
9683
9684 type PrivateLinkResourceProperties struct {
9685
9686 GroupID *string `json:"groupId,omitempty"`
9687
9688 RequiredMembers *[]string `json:"requiredMembers,omitempty"`
9689
9690 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
9691 }
9692
9693
9694 func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
9695 objectMap := make(map[string]interface{})
9696 if plrp.RequiredZoneNames != nil {
9697 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
9698 }
9699 return json.Marshal(objectMap)
9700 }
9701
9702
9703
9704 type PrivateLinkServiceConnectionState struct {
9705
9706 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
9707
9708 Description *string `json:"description,omitempty"`
9709
9710 ActionsRequired *string `json:"actionsRequired,omitempty"`
9711 }
9712
9713
9714 type Properties struct {
9715
9716 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
9717 }
9718
9719
9720 func (p Properties) MarshalJSON() ([]byte, error) {
9721 objectMap := make(map[string]interface{})
9722 return json.Marshal(objectMap)
9723 }
9724
9725
9726 type Provider struct {
9727
9728 ProviderName *string `json:"providerName,omitempty"`
9729 }
9730
9731
9732
9733 type ProxyResource struct {
9734
9735 ID *string `json:"id,omitempty"`
9736
9737 Name *string `json:"name,omitempty"`
9738
9739 Type *string `json:"type,omitempty"`
9740 }
9741
9742
9743 func (pr ProxyResource) MarshalJSON() ([]byte, error) {
9744 objectMap := make(map[string]interface{})
9745 return json.Marshal(objectMap)
9746 }
9747
9748
9749
9750 type Rectangle struct {
9751
9752 Left *string `json:"left,omitempty"`
9753
9754 Top *string `json:"top,omitempty"`
9755
9756 Width *string `json:"width,omitempty"`
9757
9758 Height *string `json:"height,omitempty"`
9759 }
9760
9761
9762 type Resource struct {
9763
9764 ID *string `json:"id,omitempty"`
9765
9766 Name *string `json:"name,omitempty"`
9767
9768 Type *string `json:"type,omitempty"`
9769 }
9770
9771
9772 func (r Resource) MarshalJSON() ([]byte, error) {
9773 objectMap := make(map[string]interface{})
9774 return json.Marshal(objectMap)
9775 }
9776
9777
9778
9779 type SelectAudioTrackByAttribute struct {
9780
9781 Attribute TrackAttribute `json:"attribute,omitempty"`
9782
9783 Filter AttributeFilter `json:"filter,omitempty"`
9784
9785 FilterValue *string `json:"filterValue,omitempty"`
9786
9787 ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
9788
9789 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9790 }
9791
9792
9793 func (satba SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) {
9794 satba.OdataType = OdataTypeMicrosoftMediaSelectAudioTrackByAttribute
9795 objectMap := make(map[string]interface{})
9796 if satba.Attribute != "" {
9797 objectMap["attribute"] = satba.Attribute
9798 }
9799 if satba.Filter != "" {
9800 objectMap["filter"] = satba.Filter
9801 }
9802 if satba.FilterValue != nil {
9803 objectMap["filterValue"] = satba.FilterValue
9804 }
9805 if satba.ChannelMapping != "" {
9806 objectMap["channelMapping"] = satba.ChannelMapping
9807 }
9808 if satba.OdataType != "" {
9809 objectMap["@odata.type"] = satba.OdataType
9810 }
9811 return json.Marshal(objectMap)
9812 }
9813
9814
9815 func (satba SelectAudioTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9816 return nil, false
9817 }
9818
9819
9820 func (satba SelectAudioTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9821 return &satba, true
9822 }
9823
9824
9825 func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9826 return &satba, true
9827 }
9828
9829
9830 func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9831 return nil, false
9832 }
9833
9834
9835 func (satba SelectAudioTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9836 return nil, false
9837 }
9838
9839
9840 func (satba SelectAudioTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9841 return nil, false
9842 }
9843
9844
9845 func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
9846 return nil, false
9847 }
9848
9849
9850 func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
9851 return nil, false
9852 }
9853
9854
9855 func (satba SelectAudioTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
9856 return nil, false
9857 }
9858
9859
9860 func (satba SelectAudioTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
9861 return &satba, true
9862 }
9863
9864
9865 type SelectAudioTrackByID struct {
9866
9867 TrackID *int64 `json:"trackId,omitempty"`
9868
9869 ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
9870
9871 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9872 }
9873
9874
9875 func (satbi SelectAudioTrackByID) MarshalJSON() ([]byte, error) {
9876 satbi.OdataType = OdataTypeMicrosoftMediaSelectAudioTrackByID
9877 objectMap := make(map[string]interface{})
9878 if satbi.TrackID != nil {
9879 objectMap["trackId"] = satbi.TrackID
9880 }
9881 if satbi.ChannelMapping != "" {
9882 objectMap["channelMapping"] = satbi.ChannelMapping
9883 }
9884 if satbi.OdataType != "" {
9885 objectMap["@odata.type"] = satbi.OdataType
9886 }
9887 return json.Marshal(objectMap)
9888 }
9889
9890
9891 func (satbi SelectAudioTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9892 return nil, false
9893 }
9894
9895
9896 func (satbi SelectAudioTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9897 return &satbi, true
9898 }
9899
9900
9901 func (satbi SelectAudioTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9902 return nil, false
9903 }
9904
9905
9906 func (satbi SelectAudioTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9907 return &satbi, true
9908 }
9909
9910
9911 func (satbi SelectAudioTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9912 return nil, false
9913 }
9914
9915
9916 func (satbi SelectAudioTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9917 return nil, false
9918 }
9919
9920
9921 func (satbi SelectAudioTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
9922 return nil, false
9923 }
9924
9925
9926 func (satbi SelectAudioTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
9927 return nil, false
9928 }
9929
9930
9931 func (satbi SelectAudioTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
9932 return nil, false
9933 }
9934
9935
9936 func (satbi SelectAudioTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
9937 return &satbi, true
9938 }
9939
9940
9941
9942 type SelectVideoTrackByAttribute struct {
9943
9944 Attribute TrackAttribute `json:"attribute,omitempty"`
9945
9946 Filter AttributeFilter `json:"filter,omitempty"`
9947
9948 FilterValue *string `json:"filterValue,omitempty"`
9949
9950 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9951 }
9952
9953
9954 func (svtba SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) {
9955 svtba.OdataType = OdataTypeMicrosoftMediaSelectVideoTrackByAttribute
9956 objectMap := make(map[string]interface{})
9957 if svtba.Attribute != "" {
9958 objectMap["attribute"] = svtba.Attribute
9959 }
9960 if svtba.Filter != "" {
9961 objectMap["filter"] = svtba.Filter
9962 }
9963 if svtba.FilterValue != nil {
9964 objectMap["filterValue"] = svtba.FilterValue
9965 }
9966 if svtba.OdataType != "" {
9967 objectMap["@odata.type"] = svtba.OdataType
9968 }
9969 return json.Marshal(objectMap)
9970 }
9971
9972
9973 func (svtba SelectVideoTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9974 return nil, false
9975 }
9976
9977
9978 func (svtba SelectVideoTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9979 return nil, false
9980 }
9981
9982
9983 func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9984 return nil, false
9985 }
9986
9987
9988 func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9989 return nil, false
9990 }
9991
9992
9993 func (svtba SelectVideoTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9994 return nil, false
9995 }
9996
9997
9998 func (svtba SelectVideoTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9999 return &svtba, true
10000 }
10001
10002
10003 func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
10004 return &svtba, true
10005 }
10006
10007
10008 func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
10009 return nil, false
10010 }
10011
10012
10013 func (svtba SelectVideoTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
10014 return nil, false
10015 }
10016
10017
10018 func (svtba SelectVideoTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
10019 return &svtba, true
10020 }
10021
10022
10023 type SelectVideoTrackByID struct {
10024
10025 TrackID *int64 `json:"trackId,omitempty"`
10026
10027 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
10028 }
10029
10030
10031 func (svtbi SelectVideoTrackByID) MarshalJSON() ([]byte, error) {
10032 svtbi.OdataType = OdataTypeMicrosoftMediaSelectVideoTrackByID
10033 objectMap := make(map[string]interface{})
10034 if svtbi.TrackID != nil {
10035 objectMap["trackId"] = svtbi.TrackID
10036 }
10037 if svtbi.OdataType != "" {
10038 objectMap["@odata.type"] = svtbi.OdataType
10039 }
10040 return json.Marshal(objectMap)
10041 }
10042
10043
10044 func (svtbi SelectVideoTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
10045 return nil, false
10046 }
10047
10048
10049 func (svtbi SelectVideoTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
10050 return nil, false
10051 }
10052
10053
10054 func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
10055 return nil, false
10056 }
10057
10058
10059 func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
10060 return nil, false
10061 }
10062
10063
10064 func (svtbi SelectVideoTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
10065 return nil, false
10066 }
10067
10068
10069 func (svtbi SelectVideoTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
10070 return &svtbi, true
10071 }
10072
10073
10074 func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
10075 return nil, false
10076 }
10077
10078
10079 func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
10080 return &svtbi, true
10081 }
10082
10083
10084 func (svtbi SelectVideoTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
10085 return nil, false
10086 }
10087
10088
10089 func (svtbi SelectVideoTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
10090 return &svtbi, true
10091 }
10092
10093
10094 type Service struct {
10095 autorest.Response `json:"-"`
10096
10097 *ServiceProperties `json:"properties,omitempty"`
10098
10099 Identity *ServiceIdentity `json:"identity,omitempty"`
10100
10101 SystemData *SystemData `json:"systemData,omitempty"`
10102
10103 Tags map[string]*string `json:"tags"`
10104
10105 Location *string `json:"location,omitempty"`
10106
10107 ID *string `json:"id,omitempty"`
10108
10109 Name *string `json:"name,omitempty"`
10110
10111 Type *string `json:"type,omitempty"`
10112 }
10113
10114
10115 func (s Service) MarshalJSON() ([]byte, error) {
10116 objectMap := make(map[string]interface{})
10117 if s.ServiceProperties != nil {
10118 objectMap["properties"] = s.ServiceProperties
10119 }
10120 if s.Identity != nil {
10121 objectMap["identity"] = s.Identity
10122 }
10123 if s.Tags != nil {
10124 objectMap["tags"] = s.Tags
10125 }
10126 if s.Location != nil {
10127 objectMap["location"] = s.Location
10128 }
10129 return json.Marshal(objectMap)
10130 }
10131
10132
10133 func (s *Service) UnmarshalJSON(body []byte) error {
10134 var m map[string]*json.RawMessage
10135 err := json.Unmarshal(body, &m)
10136 if err != nil {
10137 return err
10138 }
10139 for k, v := range m {
10140 switch k {
10141 case "properties":
10142 if v != nil {
10143 var serviceProperties ServiceProperties
10144 err = json.Unmarshal(*v, &serviceProperties)
10145 if err != nil {
10146 return err
10147 }
10148 s.ServiceProperties = &serviceProperties
10149 }
10150 case "identity":
10151 if v != nil {
10152 var identity ServiceIdentity
10153 err = json.Unmarshal(*v, &identity)
10154 if err != nil {
10155 return err
10156 }
10157 s.Identity = &identity
10158 }
10159 case "systemData":
10160 if v != nil {
10161 var systemData SystemData
10162 err = json.Unmarshal(*v, &systemData)
10163 if err != nil {
10164 return err
10165 }
10166 s.SystemData = &systemData
10167 }
10168 case "tags":
10169 if v != nil {
10170 var tags map[string]*string
10171 err = json.Unmarshal(*v, &tags)
10172 if err != nil {
10173 return err
10174 }
10175 s.Tags = tags
10176 }
10177 case "location":
10178 if v != nil {
10179 var location string
10180 err = json.Unmarshal(*v, &location)
10181 if err != nil {
10182 return err
10183 }
10184 s.Location = &location
10185 }
10186 case "id":
10187 if v != nil {
10188 var ID string
10189 err = json.Unmarshal(*v, &ID)
10190 if err != nil {
10191 return err
10192 }
10193 s.ID = &ID
10194 }
10195 case "name":
10196 if v != nil {
10197 var name string
10198 err = json.Unmarshal(*v, &name)
10199 if err != nil {
10200 return err
10201 }
10202 s.Name = &name
10203 }
10204 case "type":
10205 if v != nil {
10206 var typeVar string
10207 err = json.Unmarshal(*v, &typeVar)
10208 if err != nil {
10209 return err
10210 }
10211 s.Type = &typeVar
10212 }
10213 }
10214 }
10215
10216 return nil
10217 }
10218
10219
10220 type ServiceCollection struct {
10221 autorest.Response `json:"-"`
10222
10223 Value *[]Service `json:"value,omitempty"`
10224
10225 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
10226 }
10227
10228
10229 type ServiceCollectionIterator struct {
10230 i int
10231 page ServiceCollectionPage
10232 }
10233
10234
10235
10236 func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10237 if tracing.IsEnabled() {
10238 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext")
10239 defer func() {
10240 sc := -1
10241 if iter.Response().Response.Response != nil {
10242 sc = iter.Response().Response.Response.StatusCode
10243 }
10244 tracing.EndSpan(ctx, sc, err)
10245 }()
10246 }
10247 iter.i++
10248 if iter.i < len(iter.page.Values()) {
10249 return nil
10250 }
10251 err = iter.page.NextWithContext(ctx)
10252 if err != nil {
10253 iter.i--
10254 return err
10255 }
10256 iter.i = 0
10257 return nil
10258 }
10259
10260
10261
10262
10263 func (iter *ServiceCollectionIterator) Next() error {
10264 return iter.NextWithContext(context.Background())
10265 }
10266
10267
10268 func (iter ServiceCollectionIterator) NotDone() bool {
10269 return iter.page.NotDone() && iter.i < len(iter.page.Values())
10270 }
10271
10272
10273 func (iter ServiceCollectionIterator) Response() ServiceCollection {
10274 return iter.page.Response()
10275 }
10276
10277
10278
10279 func (iter ServiceCollectionIterator) Value() Service {
10280 if !iter.page.NotDone() {
10281 return Service{}
10282 }
10283 return iter.page.Values()[iter.i]
10284 }
10285
10286
10287 func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator {
10288 return ServiceCollectionIterator{page: page}
10289 }
10290
10291
10292 func (sc ServiceCollection) IsEmpty() bool {
10293 return sc.Value == nil || len(*sc.Value) == 0
10294 }
10295
10296
10297 func (sc ServiceCollection) hasNextLink() bool {
10298 return sc.OdataNextLink != nil && len(*sc.OdataNextLink) != 0
10299 }
10300
10301
10302
10303 func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) {
10304 if !sc.hasNextLink() {
10305 return nil, nil
10306 }
10307 return autorest.Prepare((&http.Request{}).WithContext(ctx),
10308 autorest.AsJSON(),
10309 autorest.AsGet(),
10310 autorest.WithBaseURL(to.String(sc.OdataNextLink)))
10311 }
10312
10313
10314 type ServiceCollectionPage struct {
10315 fn func(context.Context, ServiceCollection) (ServiceCollection, error)
10316 sc ServiceCollection
10317 }
10318
10319
10320
10321 func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
10322 if tracing.IsEnabled() {
10323 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext")
10324 defer func() {
10325 sc := -1
10326 if page.Response().Response.Response != nil {
10327 sc = page.Response().Response.Response.StatusCode
10328 }
10329 tracing.EndSpan(ctx, sc, err)
10330 }()
10331 }
10332 for {
10333 next, err := page.fn(ctx, page.sc)
10334 if err != nil {
10335 return err
10336 }
10337 page.sc = next
10338 if !next.hasNextLink() || !next.IsEmpty() {
10339 break
10340 }
10341 }
10342 return nil
10343 }
10344
10345
10346
10347
10348 func (page *ServiceCollectionPage) Next() error {
10349 return page.NextWithContext(context.Background())
10350 }
10351
10352
10353 func (page ServiceCollectionPage) NotDone() bool {
10354 return !page.sc.IsEmpty()
10355 }
10356
10357
10358 func (page ServiceCollectionPage) Response() ServiceCollection {
10359 return page.sc
10360 }
10361
10362
10363 func (page ServiceCollectionPage) Values() []Service {
10364 if page.sc.IsEmpty() {
10365 return nil
10366 }
10367 return *page.sc.Value
10368 }
10369
10370
10371 func NewServiceCollectionPage(cur ServiceCollection, getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage {
10372 return ServiceCollectionPage{
10373 fn: getNextPage,
10374 sc: cur,
10375 }
10376 }
10377
10378
10379 type ServiceIdentity struct {
10380
10381 Type ManagedIdentityType `json:"type,omitempty"`
10382
10383 PrincipalID *string `json:"principalId,omitempty"`
10384
10385 TenantID *string `json:"tenantId,omitempty"`
10386 }
10387
10388
10389 func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
10390 objectMap := make(map[string]interface{})
10391 if si.Type != "" {
10392 objectMap["type"] = si.Type
10393 }
10394 return json.Marshal(objectMap)
10395 }
10396
10397
10398 type ServiceProperties struct {
10399
10400 MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"`
10401
10402 StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
10403
10404 StorageAuthentication StorageAuthentication `json:"storageAuthentication,omitempty"`
10405
10406 Encryption *AccountEncryption `json:"encryption,omitempty"`
10407 }
10408
10409
10410 func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
10411 objectMap := make(map[string]interface{})
10412 if sp.StorageAccounts != nil {
10413 objectMap["storageAccounts"] = sp.StorageAccounts
10414 }
10415 if sp.StorageAuthentication != "" {
10416 objectMap["storageAuthentication"] = sp.StorageAuthentication
10417 }
10418 if sp.Encryption != nil {
10419 objectMap["encryption"] = sp.Encryption
10420 }
10421 return json.Marshal(objectMap)
10422 }
10423
10424
10425 type ServiceSpecification struct {
10426
10427 LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
10428
10429 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
10430 }
10431
10432
10433 func (ss ServiceSpecification) MarshalJSON() ([]byte, error) {
10434 objectMap := make(map[string]interface{})
10435 return json.Marshal(objectMap)
10436 }
10437
10438
10439
10440 type StandardEncoderPreset struct {
10441
10442 Filters *Filters `json:"filters,omitempty"`
10443
10444 Codecs *[]BasicCodec `json:"codecs,omitempty"`
10445
10446 Formats *[]BasicFormat `json:"formats,omitempty"`
10447
10448 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
10449 }
10450
10451
10452 func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) {
10453 sep.OdataType = OdataTypeMicrosoftMediaStandardEncoderPreset
10454 objectMap := make(map[string]interface{})
10455 if sep.Filters != nil {
10456 objectMap["filters"] = sep.Filters
10457 }
10458 if sep.Codecs != nil {
10459 objectMap["codecs"] = sep.Codecs
10460 }
10461 if sep.Formats != nil {
10462 objectMap["formats"] = sep.Formats
10463 }
10464 if sep.OdataType != "" {
10465 objectMap["@odata.type"] = sep.OdataType
10466 }
10467 return json.Marshal(objectMap)
10468 }
10469
10470
10471 func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
10472 return nil, false
10473 }
10474
10475
10476 func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
10477 return nil, false
10478 }
10479
10480
10481 func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
10482 return nil, false
10483 }
10484
10485
10486 func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
10487 return nil, false
10488 }
10489
10490
10491 func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
10492 return &sep, true
10493 }
10494
10495
10496 func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
10497 return nil, false
10498 }
10499
10500
10501 func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) {
10502 return nil, false
10503 }
10504
10505
10506 func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
10507 return &sep, true
10508 }
10509
10510
10511 func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error {
10512 var m map[string]*json.RawMessage
10513 err := json.Unmarshal(body, &m)
10514 if err != nil {
10515 return err
10516 }
10517 for k, v := range m {
10518 switch k {
10519 case "filters":
10520 if v != nil {
10521 var filters Filters
10522 err = json.Unmarshal(*v, &filters)
10523 if err != nil {
10524 return err
10525 }
10526 sep.Filters = &filters
10527 }
10528 case "codecs":
10529 if v != nil {
10530 codecs, err := unmarshalBasicCodecArray(*v)
10531 if err != nil {
10532 return err
10533 }
10534 sep.Codecs = &codecs
10535 }
10536 case "formats":
10537 if v != nil {
10538 formats, err := unmarshalBasicFormatArray(*v)
10539 if err != nil {
10540 return err
10541 }
10542 sep.Formats = &formats
10543 }
10544 case "@odata.type":
10545 if v != nil {
10546 var odataType OdataTypeBasicPreset
10547 err = json.Unmarshal(*v, &odataType)
10548 if err != nil {
10549 return err
10550 }
10551 sep.OdataType = odataType
10552 }
10553 }
10554 }
10555
10556 return nil
10557 }
10558
10559
10560 type StorageAccount struct {
10561
10562 ID *string `json:"id,omitempty"`
10563
10564 Type StorageAccountType `json:"type,omitempty"`
10565 }
10566
10567
10568
10569 type StorageEncryptedAssetDecryptionData struct {
10570 autorest.Response `json:"-"`
10571
10572 Key *[]byte `json:"key,omitempty"`
10573
10574 AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"`
10575 }
10576
10577
10578 type StreamingEndpoint struct {
10579 autorest.Response `json:"-"`
10580
10581 *StreamingEndpointProperties `json:"properties,omitempty"`
10582
10583 SystemData *SystemData `json:"systemData,omitempty"`
10584
10585 Tags map[string]*string `json:"tags"`
10586
10587 Location *string `json:"location,omitempty"`
10588
10589 ID *string `json:"id,omitempty"`
10590
10591 Name *string `json:"name,omitempty"`
10592
10593 Type *string `json:"type,omitempty"`
10594 }
10595
10596
10597 func (se StreamingEndpoint) MarshalJSON() ([]byte, error) {
10598 objectMap := make(map[string]interface{})
10599 if se.StreamingEndpointProperties != nil {
10600 objectMap["properties"] = se.StreamingEndpointProperties
10601 }
10602 if se.Tags != nil {
10603 objectMap["tags"] = se.Tags
10604 }
10605 if se.Location != nil {
10606 objectMap["location"] = se.Location
10607 }
10608 return json.Marshal(objectMap)
10609 }
10610
10611
10612 func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error {
10613 var m map[string]*json.RawMessage
10614 err := json.Unmarshal(body, &m)
10615 if err != nil {
10616 return err
10617 }
10618 for k, v := range m {
10619 switch k {
10620 case "properties":
10621 if v != nil {
10622 var streamingEndpointProperties StreamingEndpointProperties
10623 err = json.Unmarshal(*v, &streamingEndpointProperties)
10624 if err != nil {
10625 return err
10626 }
10627 se.StreamingEndpointProperties = &streamingEndpointProperties
10628 }
10629 case "systemData":
10630 if v != nil {
10631 var systemData SystemData
10632 err = json.Unmarshal(*v, &systemData)
10633 if err != nil {
10634 return err
10635 }
10636 se.SystemData = &systemData
10637 }
10638 case "tags":
10639 if v != nil {
10640 var tags map[string]*string
10641 err = json.Unmarshal(*v, &tags)
10642 if err != nil {
10643 return err
10644 }
10645 se.Tags = tags
10646 }
10647 case "location":
10648 if v != nil {
10649 var location string
10650 err = json.Unmarshal(*v, &location)
10651 if err != nil {
10652 return err
10653 }
10654 se.Location = &location
10655 }
10656 case "id":
10657 if v != nil {
10658 var ID string
10659 err = json.Unmarshal(*v, &ID)
10660 if err != nil {
10661 return err
10662 }
10663 se.ID = &ID
10664 }
10665 case "name":
10666 if v != nil {
10667 var name string
10668 err = json.Unmarshal(*v, &name)
10669 if err != nil {
10670 return err
10671 }
10672 se.Name = &name
10673 }
10674 case "type":
10675 if v != nil {
10676 var typeVar string
10677 err = json.Unmarshal(*v, &typeVar)
10678 if err != nil {
10679 return err
10680 }
10681 se.Type = &typeVar
10682 }
10683 }
10684 }
10685
10686 return nil
10687 }
10688
10689
10690 type StreamingEndpointAccessControl struct {
10691
10692 Akamai *AkamaiAccessControl `json:"akamai,omitempty"`
10693
10694 IP *IPAccessControl `json:"ip,omitempty"`
10695 }
10696
10697
10698 type StreamingEndpointListResult struct {
10699 autorest.Response `json:"-"`
10700
10701 Value *[]StreamingEndpoint `json:"value,omitempty"`
10702
10703 OdataCount *int32 `json:"@odata.count,omitempty"`
10704
10705 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
10706 }
10707
10708
10709 type StreamingEndpointListResultIterator struct {
10710 i int
10711 page StreamingEndpointListResultPage
10712 }
10713
10714
10715
10716 func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
10717 if tracing.IsEnabled() {
10718 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext")
10719 defer func() {
10720 sc := -1
10721 if iter.Response().Response.Response != nil {
10722 sc = iter.Response().Response.Response.StatusCode
10723 }
10724 tracing.EndSpan(ctx, sc, err)
10725 }()
10726 }
10727 iter.i++
10728 if iter.i < len(iter.page.Values()) {
10729 return nil
10730 }
10731 err = iter.page.NextWithContext(ctx)
10732 if err != nil {
10733 iter.i--
10734 return err
10735 }
10736 iter.i = 0
10737 return nil
10738 }
10739
10740
10741
10742
10743 func (iter *StreamingEndpointListResultIterator) Next() error {
10744 return iter.NextWithContext(context.Background())
10745 }
10746
10747
10748 func (iter StreamingEndpointListResultIterator) NotDone() bool {
10749 return iter.page.NotDone() && iter.i < len(iter.page.Values())
10750 }
10751
10752
10753 func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult {
10754 return iter.page.Response()
10755 }
10756
10757
10758
10759 func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint {
10760 if !iter.page.NotDone() {
10761 return StreamingEndpoint{}
10762 }
10763 return iter.page.Values()[iter.i]
10764 }
10765
10766
10767 func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator {
10768 return StreamingEndpointListResultIterator{page: page}
10769 }
10770
10771
10772 func (selr StreamingEndpointListResult) IsEmpty() bool {
10773 return selr.Value == nil || len(*selr.Value) == 0
10774 }
10775
10776
10777 func (selr StreamingEndpointListResult) hasNextLink() bool {
10778 return selr.OdataNextLink != nil && len(*selr.OdataNextLink) != 0
10779 }
10780
10781
10782
10783 func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
10784 if !selr.hasNextLink() {
10785 return nil, nil
10786 }
10787 return autorest.Prepare((&http.Request{}).WithContext(ctx),
10788 autorest.AsJSON(),
10789 autorest.AsGet(),
10790 autorest.WithBaseURL(to.String(selr.OdataNextLink)))
10791 }
10792
10793
10794 type StreamingEndpointListResultPage struct {
10795 fn func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)
10796 selr StreamingEndpointListResult
10797 }
10798
10799
10800
10801 func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
10802 if tracing.IsEnabled() {
10803 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext")
10804 defer func() {
10805 sc := -1
10806 if page.Response().Response.Response != nil {
10807 sc = page.Response().Response.Response.StatusCode
10808 }
10809 tracing.EndSpan(ctx, sc, err)
10810 }()
10811 }
10812 for {
10813 next, err := page.fn(ctx, page.selr)
10814 if err != nil {
10815 return err
10816 }
10817 page.selr = next
10818 if !next.hasNextLink() || !next.IsEmpty() {
10819 break
10820 }
10821 }
10822 return nil
10823 }
10824
10825
10826
10827
10828 func (page *StreamingEndpointListResultPage) Next() error {
10829 return page.NextWithContext(context.Background())
10830 }
10831
10832
10833 func (page StreamingEndpointListResultPage) NotDone() bool {
10834 return !page.selr.IsEmpty()
10835 }
10836
10837
10838 func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult {
10839 return page.selr
10840 }
10841
10842
10843 func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint {
10844 if page.selr.IsEmpty() {
10845 return nil
10846 }
10847 return *page.selr.Value
10848 }
10849
10850
10851 func NewStreamingEndpointListResultPage(cur StreamingEndpointListResult, getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage {
10852 return StreamingEndpointListResultPage{
10853 fn: getNextPage,
10854 selr: cur,
10855 }
10856 }
10857
10858
10859 type StreamingEndpointProperties struct {
10860
10861 Description *string `json:"description,omitempty"`
10862
10863 ScaleUnits *int32 `json:"scaleUnits,omitempty"`
10864
10865 AvailabilitySetName *string `json:"availabilitySetName,omitempty"`
10866
10867 AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"`
10868
10869 MaxCacheAge *int64 `json:"maxCacheAge,omitempty"`
10870
10871 CustomHostNames *[]string `json:"customHostNames,omitempty"`
10872
10873 HostName *string `json:"hostName,omitempty"`
10874
10875 CdnEnabled *bool `json:"cdnEnabled,omitempty"`
10876
10877 CdnProvider *string `json:"cdnProvider,omitempty"`
10878
10879 CdnProfile *string `json:"cdnProfile,omitempty"`
10880
10881 ProvisioningState *string `json:"provisioningState,omitempty"`
10882
10883 ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"`
10884
10885 CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
10886
10887 FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"`
10888
10889 Created *date.Time `json:"created,omitempty"`
10890
10891 LastModified *date.Time `json:"lastModified,omitempty"`
10892 }
10893
10894
10895 func (sep StreamingEndpointProperties) MarshalJSON() ([]byte, error) {
10896 objectMap := make(map[string]interface{})
10897 if sep.Description != nil {
10898 objectMap["description"] = sep.Description
10899 }
10900 if sep.ScaleUnits != nil {
10901 objectMap["scaleUnits"] = sep.ScaleUnits
10902 }
10903 if sep.AvailabilitySetName != nil {
10904 objectMap["availabilitySetName"] = sep.AvailabilitySetName
10905 }
10906 if sep.AccessControl != nil {
10907 objectMap["accessControl"] = sep.AccessControl
10908 }
10909 if sep.MaxCacheAge != nil {
10910 objectMap["maxCacheAge"] = sep.MaxCacheAge
10911 }
10912 if sep.CustomHostNames != nil {
10913 objectMap["customHostNames"] = sep.CustomHostNames
10914 }
10915 if sep.CdnEnabled != nil {
10916 objectMap["cdnEnabled"] = sep.CdnEnabled
10917 }
10918 if sep.CdnProvider != nil {
10919 objectMap["cdnProvider"] = sep.CdnProvider
10920 }
10921 if sep.CdnProfile != nil {
10922 objectMap["cdnProfile"] = sep.CdnProfile
10923 }
10924 if sep.CrossSiteAccessPolicies != nil {
10925 objectMap["crossSiteAccessPolicies"] = sep.CrossSiteAccessPolicies
10926 }
10927 return json.Marshal(objectMap)
10928 }
10929
10930
10931
10932 type StreamingEndpointsCreateFuture struct {
10933 azure.FutureAPI
10934
10935
10936 Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
10937 }
10938
10939
10940 func (future *StreamingEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
10941 var azFuture azure.Future
10942 if err := json.Unmarshal(body, &azFuture); err != nil {
10943 return err
10944 }
10945 future.FutureAPI = &azFuture
10946 future.Result = future.result
10947 return nil
10948 }
10949
10950
10951 func (future *StreamingEndpointsCreateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
10952 var done bool
10953 done, err = future.DoneWithContext(context.Background(), client)
10954 if err != nil {
10955 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
10956 return
10957 }
10958 if !done {
10959 se.Response.Response = future.Response()
10960 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture")
10961 return
10962 }
10963 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10964 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
10965 se, err = client.CreateResponder(se.Response.Response)
10966 if err != nil {
10967 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
10968 }
10969 }
10970 return
10971 }
10972
10973
10974
10975 type StreamingEndpointsDeleteFuture struct {
10976 azure.FutureAPI
10977
10978
10979 Result func(StreamingEndpointsClient) (autorest.Response, error)
10980 }
10981
10982
10983 func (future *StreamingEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
10984 var azFuture azure.Future
10985 if err := json.Unmarshal(body, &azFuture); err != nil {
10986 return err
10987 }
10988 future.FutureAPI = &azFuture
10989 future.Result = future.result
10990 return nil
10991 }
10992
10993
10994 func (future *StreamingEndpointsDeleteFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
10995 var done bool
10996 done, err = future.DoneWithContext(context.Background(), client)
10997 if err != nil {
10998 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
10999 return
11000 }
11001 if !done {
11002 ar.Response = future.Response()
11003 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture")
11004 return
11005 }
11006 ar.Response = future.Response()
11007 return
11008 }
11009
11010
11011
11012 type StreamingEndpointsScaleFuture struct {
11013 azure.FutureAPI
11014
11015
11016 Result func(StreamingEndpointsClient) (autorest.Response, error)
11017 }
11018
11019
11020 func (future *StreamingEndpointsScaleFuture) UnmarshalJSON(body []byte) error {
11021 var azFuture azure.Future
11022 if err := json.Unmarshal(body, &azFuture); err != nil {
11023 return err
11024 }
11025 future.FutureAPI = &azFuture
11026 future.Result = future.result
11027 return nil
11028 }
11029
11030
11031 func (future *StreamingEndpointsScaleFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11032 var done bool
11033 done, err = future.DoneWithContext(context.Background(), client)
11034 if err != nil {
11035 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure")
11036 return
11037 }
11038 if !done {
11039 ar.Response = future.Response()
11040 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture")
11041 return
11042 }
11043 ar.Response = future.Response()
11044 return
11045 }
11046
11047
11048
11049 type StreamingEndpointsStartFuture struct {
11050 azure.FutureAPI
11051
11052
11053 Result func(StreamingEndpointsClient) (autorest.Response, error)
11054 }
11055
11056
11057 func (future *StreamingEndpointsStartFuture) UnmarshalJSON(body []byte) error {
11058 var azFuture azure.Future
11059 if err := json.Unmarshal(body, &azFuture); err != nil {
11060 return err
11061 }
11062 future.FutureAPI = &azFuture
11063 future.Result = future.result
11064 return nil
11065 }
11066
11067
11068 func (future *StreamingEndpointsStartFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11069 var done bool
11070 done, err = future.DoneWithContext(context.Background(), client)
11071 if err != nil {
11072 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure")
11073 return
11074 }
11075 if !done {
11076 ar.Response = future.Response()
11077 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture")
11078 return
11079 }
11080 ar.Response = future.Response()
11081 return
11082 }
11083
11084
11085
11086 type StreamingEndpointsStopFuture struct {
11087 azure.FutureAPI
11088
11089
11090 Result func(StreamingEndpointsClient) (autorest.Response, error)
11091 }
11092
11093
11094 func (future *StreamingEndpointsStopFuture) UnmarshalJSON(body []byte) error {
11095 var azFuture azure.Future
11096 if err := json.Unmarshal(body, &azFuture); err != nil {
11097 return err
11098 }
11099 future.FutureAPI = &azFuture
11100 future.Result = future.result
11101 return nil
11102 }
11103
11104
11105 func (future *StreamingEndpointsStopFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11106 var done bool
11107 done, err = future.DoneWithContext(context.Background(), client)
11108 if err != nil {
11109 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure")
11110 return
11111 }
11112 if !done {
11113 ar.Response = future.Response()
11114 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture")
11115 return
11116 }
11117 ar.Response = future.Response()
11118 return
11119 }
11120
11121
11122
11123 type StreamingEndpointsUpdateFuture struct {
11124 azure.FutureAPI
11125
11126
11127 Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
11128 }
11129
11130
11131 func (future *StreamingEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
11132 var azFuture azure.Future
11133 if err := json.Unmarshal(body, &azFuture); err != nil {
11134 return err
11135 }
11136 future.FutureAPI = &azFuture
11137 future.Result = future.result
11138 return nil
11139 }
11140
11141
11142 func (future *StreamingEndpointsUpdateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
11143 var done bool
11144 done, err = future.DoneWithContext(context.Background(), client)
11145 if err != nil {
11146 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
11147 return
11148 }
11149 if !done {
11150 se.Response.Response = future.Response()
11151 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture")
11152 return
11153 }
11154 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11155 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
11156 se, err = client.UpdateResponder(se.Response.Response)
11157 if err != nil {
11158 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
11159 }
11160 }
11161 return
11162 }
11163
11164
11165 type StreamingEntityScaleUnit struct {
11166
11167 ScaleUnit *int32 `json:"scaleUnit,omitempty"`
11168 }
11169
11170
11171 type StreamingLocator struct {
11172 autorest.Response `json:"-"`
11173 *StreamingLocatorProperties `json:"properties,omitempty"`
11174
11175 SystemData *SystemData `json:"systemData,omitempty"`
11176
11177 ID *string `json:"id,omitempty"`
11178
11179 Name *string `json:"name,omitempty"`
11180
11181 Type *string `json:"type,omitempty"`
11182 }
11183
11184
11185 func (sl StreamingLocator) MarshalJSON() ([]byte, error) {
11186 objectMap := make(map[string]interface{})
11187 if sl.StreamingLocatorProperties != nil {
11188 objectMap["properties"] = sl.StreamingLocatorProperties
11189 }
11190 return json.Marshal(objectMap)
11191 }
11192
11193
11194 func (sl *StreamingLocator) UnmarshalJSON(body []byte) error {
11195 var m map[string]*json.RawMessage
11196 err := json.Unmarshal(body, &m)
11197 if err != nil {
11198 return err
11199 }
11200 for k, v := range m {
11201 switch k {
11202 case "properties":
11203 if v != nil {
11204 var streamingLocatorProperties StreamingLocatorProperties
11205 err = json.Unmarshal(*v, &streamingLocatorProperties)
11206 if err != nil {
11207 return err
11208 }
11209 sl.StreamingLocatorProperties = &streamingLocatorProperties
11210 }
11211 case "systemData":
11212 if v != nil {
11213 var systemData SystemData
11214 err = json.Unmarshal(*v, &systemData)
11215 if err != nil {
11216 return err
11217 }
11218 sl.SystemData = &systemData
11219 }
11220 case "id":
11221 if v != nil {
11222 var ID string
11223 err = json.Unmarshal(*v, &ID)
11224 if err != nil {
11225 return err
11226 }
11227 sl.ID = &ID
11228 }
11229 case "name":
11230 if v != nil {
11231 var name string
11232 err = json.Unmarshal(*v, &name)
11233 if err != nil {
11234 return err
11235 }
11236 sl.Name = &name
11237 }
11238 case "type":
11239 if v != nil {
11240 var typeVar string
11241 err = json.Unmarshal(*v, &typeVar)
11242 if err != nil {
11243 return err
11244 }
11245 sl.Type = &typeVar
11246 }
11247 }
11248 }
11249
11250 return nil
11251 }
11252
11253
11254 type StreamingLocatorCollection struct {
11255 autorest.Response `json:"-"`
11256
11257 Value *[]StreamingLocator `json:"value,omitempty"`
11258
11259 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
11260 }
11261
11262
11263 type StreamingLocatorCollectionIterator struct {
11264 i int
11265 page StreamingLocatorCollectionPage
11266 }
11267
11268
11269
11270 func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11271 if tracing.IsEnabled() {
11272 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext")
11273 defer func() {
11274 sc := -1
11275 if iter.Response().Response.Response != nil {
11276 sc = iter.Response().Response.Response.StatusCode
11277 }
11278 tracing.EndSpan(ctx, sc, err)
11279 }()
11280 }
11281 iter.i++
11282 if iter.i < len(iter.page.Values()) {
11283 return nil
11284 }
11285 err = iter.page.NextWithContext(ctx)
11286 if err != nil {
11287 iter.i--
11288 return err
11289 }
11290 iter.i = 0
11291 return nil
11292 }
11293
11294
11295
11296
11297 func (iter *StreamingLocatorCollectionIterator) Next() error {
11298 return iter.NextWithContext(context.Background())
11299 }
11300
11301
11302 func (iter StreamingLocatorCollectionIterator) NotDone() bool {
11303 return iter.page.NotDone() && iter.i < len(iter.page.Values())
11304 }
11305
11306
11307 func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection {
11308 return iter.page.Response()
11309 }
11310
11311
11312
11313 func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator {
11314 if !iter.page.NotDone() {
11315 return StreamingLocator{}
11316 }
11317 return iter.page.Values()[iter.i]
11318 }
11319
11320
11321 func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator {
11322 return StreamingLocatorCollectionIterator{page: page}
11323 }
11324
11325
11326 func (slc StreamingLocatorCollection) IsEmpty() bool {
11327 return slc.Value == nil || len(*slc.Value) == 0
11328 }
11329
11330
11331 func (slc StreamingLocatorCollection) hasNextLink() bool {
11332 return slc.OdataNextLink != nil && len(*slc.OdataNextLink) != 0
11333 }
11334
11335
11336
11337 func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) {
11338 if !slc.hasNextLink() {
11339 return nil, nil
11340 }
11341 return autorest.Prepare((&http.Request{}).WithContext(ctx),
11342 autorest.AsJSON(),
11343 autorest.AsGet(),
11344 autorest.WithBaseURL(to.String(slc.OdataNextLink)))
11345 }
11346
11347
11348 type StreamingLocatorCollectionPage struct {
11349 fn func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)
11350 slc StreamingLocatorCollection
11351 }
11352
11353
11354
11355 func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) {
11356 if tracing.IsEnabled() {
11357 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext")
11358 defer func() {
11359 sc := -1
11360 if page.Response().Response.Response != nil {
11361 sc = page.Response().Response.Response.StatusCode
11362 }
11363 tracing.EndSpan(ctx, sc, err)
11364 }()
11365 }
11366 for {
11367 next, err := page.fn(ctx, page.slc)
11368 if err != nil {
11369 return err
11370 }
11371 page.slc = next
11372 if !next.hasNextLink() || !next.IsEmpty() {
11373 break
11374 }
11375 }
11376 return nil
11377 }
11378
11379
11380
11381
11382 func (page *StreamingLocatorCollectionPage) Next() error {
11383 return page.NextWithContext(context.Background())
11384 }
11385
11386
11387 func (page StreamingLocatorCollectionPage) NotDone() bool {
11388 return !page.slc.IsEmpty()
11389 }
11390
11391
11392 func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection {
11393 return page.slc
11394 }
11395
11396
11397 func (page StreamingLocatorCollectionPage) Values() []StreamingLocator {
11398 if page.slc.IsEmpty() {
11399 return nil
11400 }
11401 return *page.slc.Value
11402 }
11403
11404
11405 func NewStreamingLocatorCollectionPage(cur StreamingLocatorCollection, getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage {
11406 return StreamingLocatorCollectionPage{
11407 fn: getNextPage,
11408 slc: cur,
11409 }
11410 }
11411
11412
11413 type StreamingLocatorContentKey struct {
11414
11415 ID *uuid.UUID `json:"id,omitempty"`
11416
11417 Type StreamingLocatorContentKeyType `json:"type,omitempty"`
11418
11419 LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"`
11420
11421 Value *string `json:"value,omitempty"`
11422
11423 PolicyName *string `json:"policyName,omitempty"`
11424
11425 Tracks *[]TrackSelection `json:"tracks,omitempty"`
11426 }
11427
11428
11429 func (slck StreamingLocatorContentKey) MarshalJSON() ([]byte, error) {
11430 objectMap := make(map[string]interface{})
11431 if slck.ID != nil {
11432 objectMap["id"] = slck.ID
11433 }
11434 if slck.LabelReferenceInStreamingPolicy != nil {
11435 objectMap["labelReferenceInStreamingPolicy"] = slck.LabelReferenceInStreamingPolicy
11436 }
11437 if slck.Value != nil {
11438 objectMap["value"] = slck.Value
11439 }
11440 return json.Marshal(objectMap)
11441 }
11442
11443
11444 type StreamingLocatorProperties struct {
11445
11446 AssetName *string `json:"assetName,omitempty"`
11447
11448 Created *date.Time `json:"created,omitempty"`
11449
11450 StartTime *date.Time `json:"startTime,omitempty"`
11451
11452 EndTime *date.Time `json:"endTime,omitempty"`
11453
11454 StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
11455
11456 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
11457
11458 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
11459
11460 ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
11461
11462 AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
11463
11464 Filters *[]string `json:"filters,omitempty"`
11465 }
11466
11467
11468 func (slp StreamingLocatorProperties) MarshalJSON() ([]byte, error) {
11469 objectMap := make(map[string]interface{})
11470 if slp.AssetName != nil {
11471 objectMap["assetName"] = slp.AssetName
11472 }
11473 if slp.StartTime != nil {
11474 objectMap["startTime"] = slp.StartTime
11475 }
11476 if slp.EndTime != nil {
11477 objectMap["endTime"] = slp.EndTime
11478 }
11479 if slp.StreamingLocatorID != nil {
11480 objectMap["streamingLocatorId"] = slp.StreamingLocatorID
11481 }
11482 if slp.StreamingPolicyName != nil {
11483 objectMap["streamingPolicyName"] = slp.StreamingPolicyName
11484 }
11485 if slp.DefaultContentKeyPolicyName != nil {
11486 objectMap["defaultContentKeyPolicyName"] = slp.DefaultContentKeyPolicyName
11487 }
11488 if slp.ContentKeys != nil {
11489 objectMap["contentKeys"] = slp.ContentKeys
11490 }
11491 if slp.AlternativeMediaID != nil {
11492 objectMap["alternativeMediaId"] = slp.AlternativeMediaID
11493 }
11494 if slp.Filters != nil {
11495 objectMap["filters"] = slp.Filters
11496 }
11497 return json.Marshal(objectMap)
11498 }
11499
11500
11501 type StreamingPath struct {
11502
11503 StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"`
11504
11505 EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"`
11506
11507 Paths *[]string `json:"paths,omitempty"`
11508 }
11509
11510
11511 type StreamingPolicy struct {
11512 autorest.Response `json:"-"`
11513 *StreamingPolicyProperties `json:"properties,omitempty"`
11514
11515 SystemData *SystemData `json:"systemData,omitempty"`
11516
11517 ID *string `json:"id,omitempty"`
11518
11519 Name *string `json:"name,omitempty"`
11520
11521 Type *string `json:"type,omitempty"`
11522 }
11523
11524
11525 func (sp StreamingPolicy) MarshalJSON() ([]byte, error) {
11526 objectMap := make(map[string]interface{})
11527 if sp.StreamingPolicyProperties != nil {
11528 objectMap["properties"] = sp.StreamingPolicyProperties
11529 }
11530 return json.Marshal(objectMap)
11531 }
11532
11533
11534 func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error {
11535 var m map[string]*json.RawMessage
11536 err := json.Unmarshal(body, &m)
11537 if err != nil {
11538 return err
11539 }
11540 for k, v := range m {
11541 switch k {
11542 case "properties":
11543 if v != nil {
11544 var streamingPolicyProperties StreamingPolicyProperties
11545 err = json.Unmarshal(*v, &streamingPolicyProperties)
11546 if err != nil {
11547 return err
11548 }
11549 sp.StreamingPolicyProperties = &streamingPolicyProperties
11550 }
11551 case "systemData":
11552 if v != nil {
11553 var systemData SystemData
11554 err = json.Unmarshal(*v, &systemData)
11555 if err != nil {
11556 return err
11557 }
11558 sp.SystemData = &systemData
11559 }
11560 case "id":
11561 if v != nil {
11562 var ID string
11563 err = json.Unmarshal(*v, &ID)
11564 if err != nil {
11565 return err
11566 }
11567 sp.ID = &ID
11568 }
11569 case "name":
11570 if v != nil {
11571 var name string
11572 err = json.Unmarshal(*v, &name)
11573 if err != nil {
11574 return err
11575 }
11576 sp.Name = &name
11577 }
11578 case "type":
11579 if v != nil {
11580 var typeVar string
11581 err = json.Unmarshal(*v, &typeVar)
11582 if err != nil {
11583 return err
11584 }
11585 sp.Type = &typeVar
11586 }
11587 }
11588 }
11589
11590 return nil
11591 }
11592
11593
11594 type StreamingPolicyCollection struct {
11595 autorest.Response `json:"-"`
11596
11597 Value *[]StreamingPolicy `json:"value,omitempty"`
11598
11599 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
11600 }
11601
11602
11603 type StreamingPolicyCollectionIterator struct {
11604 i int
11605 page StreamingPolicyCollectionPage
11606 }
11607
11608
11609
11610 func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11611 if tracing.IsEnabled() {
11612 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext")
11613 defer func() {
11614 sc := -1
11615 if iter.Response().Response.Response != nil {
11616 sc = iter.Response().Response.Response.StatusCode
11617 }
11618 tracing.EndSpan(ctx, sc, err)
11619 }()
11620 }
11621 iter.i++
11622 if iter.i < len(iter.page.Values()) {
11623 return nil
11624 }
11625 err = iter.page.NextWithContext(ctx)
11626 if err != nil {
11627 iter.i--
11628 return err
11629 }
11630 iter.i = 0
11631 return nil
11632 }
11633
11634
11635
11636
11637 func (iter *StreamingPolicyCollectionIterator) Next() error {
11638 return iter.NextWithContext(context.Background())
11639 }
11640
11641
11642 func (iter StreamingPolicyCollectionIterator) NotDone() bool {
11643 return iter.page.NotDone() && iter.i < len(iter.page.Values())
11644 }
11645
11646
11647 func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection {
11648 return iter.page.Response()
11649 }
11650
11651
11652
11653 func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy {
11654 if !iter.page.NotDone() {
11655 return StreamingPolicy{}
11656 }
11657 return iter.page.Values()[iter.i]
11658 }
11659
11660
11661 func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator {
11662 return StreamingPolicyCollectionIterator{page: page}
11663 }
11664
11665
11666 func (spc StreamingPolicyCollection) IsEmpty() bool {
11667 return spc.Value == nil || len(*spc.Value) == 0
11668 }
11669
11670
11671 func (spc StreamingPolicyCollection) hasNextLink() bool {
11672 return spc.OdataNextLink != nil && len(*spc.OdataNextLink) != 0
11673 }
11674
11675
11676
11677 func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
11678 if !spc.hasNextLink() {
11679 return nil, nil
11680 }
11681 return autorest.Prepare((&http.Request{}).WithContext(ctx),
11682 autorest.AsJSON(),
11683 autorest.AsGet(),
11684 autorest.WithBaseURL(to.String(spc.OdataNextLink)))
11685 }
11686
11687
11688 type StreamingPolicyCollectionPage struct {
11689 fn func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)
11690 spc StreamingPolicyCollection
11691 }
11692
11693
11694
11695 func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
11696 if tracing.IsEnabled() {
11697 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext")
11698 defer func() {
11699 sc := -1
11700 if page.Response().Response.Response != nil {
11701 sc = page.Response().Response.Response.StatusCode
11702 }
11703 tracing.EndSpan(ctx, sc, err)
11704 }()
11705 }
11706 for {
11707 next, err := page.fn(ctx, page.spc)
11708 if err != nil {
11709 return err
11710 }
11711 page.spc = next
11712 if !next.hasNextLink() || !next.IsEmpty() {
11713 break
11714 }
11715 }
11716 return nil
11717 }
11718
11719
11720
11721
11722 func (page *StreamingPolicyCollectionPage) Next() error {
11723 return page.NextWithContext(context.Background())
11724 }
11725
11726
11727 func (page StreamingPolicyCollectionPage) NotDone() bool {
11728 return !page.spc.IsEmpty()
11729 }
11730
11731
11732 func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection {
11733 return page.spc
11734 }
11735
11736
11737 func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy {
11738 if page.spc.IsEmpty() {
11739 return nil
11740 }
11741 return *page.spc.Value
11742 }
11743
11744
11745 func NewStreamingPolicyCollectionPage(cur StreamingPolicyCollection, getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage {
11746 return StreamingPolicyCollectionPage{
11747 fn: getNextPage,
11748 spc: cur,
11749 }
11750 }
11751
11752
11753 type StreamingPolicyContentKey struct {
11754
11755 Label *string `json:"label,omitempty"`
11756
11757 PolicyName *string `json:"policyName,omitempty"`
11758
11759 Tracks *[]TrackSelection `json:"tracks,omitempty"`
11760 }
11761
11762
11763 type StreamingPolicyContentKeys struct {
11764
11765 DefaultKey *DefaultKey `json:"defaultKey,omitempty"`
11766
11767 KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"`
11768 }
11769
11770
11771 type StreamingPolicyFairPlayConfiguration struct {
11772
11773 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11774
11775 AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"`
11776 }
11777
11778
11779 type StreamingPolicyPlayReadyConfiguration struct {
11780
11781 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11782
11783 PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"`
11784 }
11785
11786
11787 type StreamingPolicyProperties struct {
11788
11789 Created *date.Time `json:"created,omitempty"`
11790
11791 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
11792
11793 EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"`
11794
11795 CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"`
11796
11797 CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"`
11798
11799 NoEncryption *NoEncryption `json:"noEncryption,omitempty"`
11800 }
11801
11802
11803 func (spp StreamingPolicyProperties) MarshalJSON() ([]byte, error) {
11804 objectMap := make(map[string]interface{})
11805 if spp.DefaultContentKeyPolicyName != nil {
11806 objectMap["defaultContentKeyPolicyName"] = spp.DefaultContentKeyPolicyName
11807 }
11808 if spp.EnvelopeEncryption != nil {
11809 objectMap["envelopeEncryption"] = spp.EnvelopeEncryption
11810 }
11811 if spp.CommonEncryptionCenc != nil {
11812 objectMap["commonEncryptionCenc"] = spp.CommonEncryptionCenc
11813 }
11814 if spp.CommonEncryptionCbcs != nil {
11815 objectMap["commonEncryptionCbcs"] = spp.CommonEncryptionCbcs
11816 }
11817 if spp.NoEncryption != nil {
11818 objectMap["noEncryption"] = spp.NoEncryption
11819 }
11820 return json.Marshal(objectMap)
11821 }
11822
11823
11824 type StreamingPolicyWidevineConfiguration struct {
11825
11826 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11827 }
11828
11829
11830 type SyncStorageKeysInput struct {
11831
11832 ID *string `json:"id,omitempty"`
11833 }
11834
11835
11836 type SystemData struct {
11837
11838 CreatedBy *string `json:"createdBy,omitempty"`
11839
11840 CreatedByType CreatedByType `json:"createdByType,omitempty"`
11841
11842 CreatedAt *date.Time `json:"createdAt,omitempty"`
11843
11844 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
11845
11846 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
11847
11848 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
11849 }
11850
11851
11852
11853 type BasicTrackDescriptor interface {
11854 AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
11855 AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool)
11856 AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
11857 AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
11858 AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
11859 AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool)
11860 AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
11861 AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
11862 AsTrackDescriptor() (*TrackDescriptor, bool)
11863 }
11864
11865
11866
11867 type TrackDescriptor struct {
11868
11869 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
11870 }
11871
11872 func unmarshalBasicTrackDescriptor(body []byte) (BasicTrackDescriptor, error) {
11873 var m map[string]interface{}
11874 err := json.Unmarshal(body, &m)
11875 if err != nil {
11876 return nil, err
11877 }
11878
11879 switch m["@odata.type"] {
11880 case string(OdataTypeMicrosoftMediaAudioTrackDescriptor):
11881 var atd AudioTrackDescriptor
11882 err := json.Unmarshal(body, &atd)
11883 return atd, err
11884 case string(OdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
11885 var satba SelectAudioTrackByAttribute
11886 err := json.Unmarshal(body, &satba)
11887 return satba, err
11888 case string(OdataTypeMicrosoftMediaSelectAudioTrackByID):
11889 var satbi SelectAudioTrackByID
11890 err := json.Unmarshal(body, &satbi)
11891 return satbi, err
11892 case string(OdataTypeMicrosoftMediaVideoTrackDescriptor):
11893 var vtd VideoTrackDescriptor
11894 err := json.Unmarshal(body, &vtd)
11895 return vtd, err
11896 case string(OdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
11897 var svtba SelectVideoTrackByAttribute
11898 err := json.Unmarshal(body, &svtba)
11899 return svtba, err
11900 case string(OdataTypeMicrosoftMediaSelectVideoTrackByID):
11901 var svtbi SelectVideoTrackByID
11902 err := json.Unmarshal(body, &svtbi)
11903 return svtbi, err
11904 default:
11905 var td TrackDescriptor
11906 err := json.Unmarshal(body, &td)
11907 return td, err
11908 }
11909 }
11910 func unmarshalBasicTrackDescriptorArray(body []byte) ([]BasicTrackDescriptor, error) {
11911 var rawMessages []*json.RawMessage
11912 err := json.Unmarshal(body, &rawMessages)
11913 if err != nil {
11914 return nil, err
11915 }
11916
11917 tdArray := make([]BasicTrackDescriptor, len(rawMessages))
11918
11919 for index, rawMessage := range rawMessages {
11920 td, err := unmarshalBasicTrackDescriptor(*rawMessage)
11921 if err != nil {
11922 return nil, err
11923 }
11924 tdArray[index] = td
11925 }
11926 return tdArray, nil
11927 }
11928
11929
11930 func (td TrackDescriptor) MarshalJSON() ([]byte, error) {
11931 td.OdataType = OdataTypeTrackDescriptor
11932 objectMap := make(map[string]interface{})
11933 if td.OdataType != "" {
11934 objectMap["@odata.type"] = td.OdataType
11935 }
11936 return json.Marshal(objectMap)
11937 }
11938
11939
11940 func (td TrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
11941 return nil, false
11942 }
11943
11944
11945 func (td TrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
11946 return nil, false
11947 }
11948
11949
11950 func (td TrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
11951 return nil, false
11952 }
11953
11954
11955 func (td TrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
11956 return nil, false
11957 }
11958
11959
11960 func (td TrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
11961 return nil, false
11962 }
11963
11964
11965 func (td TrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
11966 return nil, false
11967 }
11968
11969
11970 func (td TrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
11971 return nil, false
11972 }
11973
11974
11975 func (td TrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
11976 return nil, false
11977 }
11978
11979
11980 func (td TrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
11981 return &td, true
11982 }
11983
11984
11985 func (td TrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
11986 return &td, true
11987 }
11988
11989
11990
11991 type TrackedResource struct {
11992
11993 Tags map[string]*string `json:"tags"`
11994
11995 Location *string `json:"location,omitempty"`
11996
11997 ID *string `json:"id,omitempty"`
11998
11999 Name *string `json:"name,omitempty"`
12000
12001 Type *string `json:"type,omitempty"`
12002 }
12003
12004
12005 func (tr TrackedResource) MarshalJSON() ([]byte, error) {
12006 objectMap := make(map[string]interface{})
12007 if tr.Tags != nil {
12008 objectMap["tags"] = tr.Tags
12009 }
12010 if tr.Location != nil {
12011 objectMap["location"] = tr.Location
12012 }
12013 return json.Marshal(objectMap)
12014 }
12015
12016
12017 type TrackPropertyCondition struct {
12018
12019 Property TrackPropertyType `json:"property,omitempty"`
12020
12021 Operation TrackPropertyCompareOperation `json:"operation,omitempty"`
12022
12023 Value *string `json:"value,omitempty"`
12024 }
12025
12026
12027 type TrackSelection struct {
12028
12029 TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"`
12030 }
12031
12032
12033
12034
12035 type Transform struct {
12036 autorest.Response `json:"-"`
12037
12038 *TransformProperties `json:"properties,omitempty"`
12039
12040 SystemData *SystemData `json:"systemData,omitempty"`
12041
12042 ID *string `json:"id,omitempty"`
12043
12044 Name *string `json:"name,omitempty"`
12045
12046 Type *string `json:"type,omitempty"`
12047 }
12048
12049
12050 func (t Transform) MarshalJSON() ([]byte, error) {
12051 objectMap := make(map[string]interface{})
12052 if t.TransformProperties != nil {
12053 objectMap["properties"] = t.TransformProperties
12054 }
12055 return json.Marshal(objectMap)
12056 }
12057
12058
12059 func (t *Transform) UnmarshalJSON(body []byte) error {
12060 var m map[string]*json.RawMessage
12061 err := json.Unmarshal(body, &m)
12062 if err != nil {
12063 return err
12064 }
12065 for k, v := range m {
12066 switch k {
12067 case "properties":
12068 if v != nil {
12069 var transformProperties TransformProperties
12070 err = json.Unmarshal(*v, &transformProperties)
12071 if err != nil {
12072 return err
12073 }
12074 t.TransformProperties = &transformProperties
12075 }
12076 case "systemData":
12077 if v != nil {
12078 var systemData SystemData
12079 err = json.Unmarshal(*v, &systemData)
12080 if err != nil {
12081 return err
12082 }
12083 t.SystemData = &systemData
12084 }
12085 case "id":
12086 if v != nil {
12087 var ID string
12088 err = json.Unmarshal(*v, &ID)
12089 if err != nil {
12090 return err
12091 }
12092 t.ID = &ID
12093 }
12094 case "name":
12095 if v != nil {
12096 var name string
12097 err = json.Unmarshal(*v, &name)
12098 if err != nil {
12099 return err
12100 }
12101 t.Name = &name
12102 }
12103 case "type":
12104 if v != nil {
12105 var typeVar string
12106 err = json.Unmarshal(*v, &typeVar)
12107 if err != nil {
12108 return err
12109 }
12110 t.Type = &typeVar
12111 }
12112 }
12113 }
12114
12115 return nil
12116 }
12117
12118
12119 type TransformCollection struct {
12120 autorest.Response `json:"-"`
12121
12122 Value *[]Transform `json:"value,omitempty"`
12123
12124 OdataNextLink *string `json:"@odata.nextLink,omitempty"`
12125 }
12126
12127
12128 type TransformCollectionIterator struct {
12129 i int
12130 page TransformCollectionPage
12131 }
12132
12133
12134
12135 func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12136 if tracing.IsEnabled() {
12137 ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext")
12138 defer func() {
12139 sc := -1
12140 if iter.Response().Response.Response != nil {
12141 sc = iter.Response().Response.Response.StatusCode
12142 }
12143 tracing.EndSpan(ctx, sc, err)
12144 }()
12145 }
12146 iter.i++
12147 if iter.i < len(iter.page.Values()) {
12148 return nil
12149 }
12150 err = iter.page.NextWithContext(ctx)
12151 if err != nil {
12152 iter.i--
12153 return err
12154 }
12155 iter.i = 0
12156 return nil
12157 }
12158
12159
12160
12161
12162 func (iter *TransformCollectionIterator) Next() error {
12163 return iter.NextWithContext(context.Background())
12164 }
12165
12166
12167 func (iter TransformCollectionIterator) NotDone() bool {
12168 return iter.page.NotDone() && iter.i < len(iter.page.Values())
12169 }
12170
12171
12172 func (iter TransformCollectionIterator) Response() TransformCollection {
12173 return iter.page.Response()
12174 }
12175
12176
12177
12178 func (iter TransformCollectionIterator) Value() Transform {
12179 if !iter.page.NotDone() {
12180 return Transform{}
12181 }
12182 return iter.page.Values()[iter.i]
12183 }
12184
12185
12186 func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator {
12187 return TransformCollectionIterator{page: page}
12188 }
12189
12190
12191 func (tc TransformCollection) IsEmpty() bool {
12192 return tc.Value == nil || len(*tc.Value) == 0
12193 }
12194
12195
12196 func (tc TransformCollection) hasNextLink() bool {
12197 return tc.OdataNextLink != nil && len(*tc.OdataNextLink) != 0
12198 }
12199
12200
12201
12202 func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) {
12203 if !tc.hasNextLink() {
12204 return nil, nil
12205 }
12206 return autorest.Prepare((&http.Request{}).WithContext(ctx),
12207 autorest.AsJSON(),
12208 autorest.AsGet(),
12209 autorest.WithBaseURL(to.String(tc.OdataNextLink)))
12210 }
12211
12212
12213 type TransformCollectionPage struct {
12214 fn func(context.Context, TransformCollection) (TransformCollection, error)
12215 tc TransformCollection
12216 }
12217
12218
12219
12220 func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) {
12221 if tracing.IsEnabled() {
12222 ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext")
12223 defer func() {
12224 sc := -1
12225 if page.Response().Response.Response != nil {
12226 sc = page.Response().Response.Response.StatusCode
12227 }
12228 tracing.EndSpan(ctx, sc, err)
12229 }()
12230 }
12231 for {
12232 next, err := page.fn(ctx, page.tc)
12233 if err != nil {
12234 return err
12235 }
12236 page.tc = next
12237 if !next.hasNextLink() || !next.IsEmpty() {
12238 break
12239 }
12240 }
12241 return nil
12242 }
12243
12244
12245
12246
12247 func (page *TransformCollectionPage) Next() error {
12248 return page.NextWithContext(context.Background())
12249 }
12250
12251
12252 func (page TransformCollectionPage) NotDone() bool {
12253 return !page.tc.IsEmpty()
12254 }
12255
12256
12257 func (page TransformCollectionPage) Response() TransformCollection {
12258 return page.tc
12259 }
12260
12261
12262 func (page TransformCollectionPage) Values() []Transform {
12263 if page.tc.IsEmpty() {
12264 return nil
12265 }
12266 return *page.tc.Value
12267 }
12268
12269
12270 func NewTransformCollectionPage(cur TransformCollection, getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage {
12271 return TransformCollectionPage{
12272 fn: getNextPage,
12273 tc: cur,
12274 }
12275 }
12276
12277
12278
12279 type TransformOutput struct {
12280
12281 OnError OnErrorType `json:"onError,omitempty"`
12282
12283 RelativePriority Priority `json:"relativePriority,omitempty"`
12284
12285 Preset BasicPreset `json:"preset,omitempty"`
12286 }
12287
12288
12289 func (toVar *TransformOutput) UnmarshalJSON(body []byte) error {
12290 var m map[string]*json.RawMessage
12291 err := json.Unmarshal(body, &m)
12292 if err != nil {
12293 return err
12294 }
12295 for k, v := range m {
12296 switch k {
12297 case "onError":
12298 if v != nil {
12299 var onError OnErrorType
12300 err = json.Unmarshal(*v, &onError)
12301 if err != nil {
12302 return err
12303 }
12304 toVar.OnError = onError
12305 }
12306 case "relativePriority":
12307 if v != nil {
12308 var relativePriority Priority
12309 err = json.Unmarshal(*v, &relativePriority)
12310 if err != nil {
12311 return err
12312 }
12313 toVar.RelativePriority = relativePriority
12314 }
12315 case "preset":
12316 if v != nil {
12317 preset, err := unmarshalBasicPreset(*v)
12318 if err != nil {
12319 return err
12320 }
12321 toVar.Preset = preset
12322 }
12323 }
12324 }
12325
12326 return nil
12327 }
12328
12329
12330 type TransformProperties struct {
12331
12332 Created *date.Time `json:"created,omitempty"`
12333
12334 Description *string `json:"description,omitempty"`
12335
12336 LastModified *date.Time `json:"lastModified,omitempty"`
12337
12338 Outputs *[]TransformOutput `json:"outputs,omitempty"`
12339 }
12340
12341
12342 func (tp TransformProperties) MarshalJSON() ([]byte, error) {
12343 objectMap := make(map[string]interface{})
12344 if tp.Description != nil {
12345 objectMap["description"] = tp.Description
12346 }
12347 if tp.Outputs != nil {
12348 objectMap["outputs"] = tp.Outputs
12349 }
12350 return json.Marshal(objectMap)
12351 }
12352
12353
12354
12355 type TransportStreamFormat struct {
12356
12357 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
12358
12359 FilenamePattern *string `json:"filenamePattern,omitempty"`
12360
12361 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
12362 }
12363
12364
12365 func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) {
12366 tsf.OdataType = OdataTypeMicrosoftMediaTransportStreamFormat
12367 objectMap := make(map[string]interface{})
12368 if tsf.OutputFiles != nil {
12369 objectMap["outputFiles"] = tsf.OutputFiles
12370 }
12371 if tsf.FilenamePattern != nil {
12372 objectMap["filenamePattern"] = tsf.FilenamePattern
12373 }
12374 if tsf.OdataType != "" {
12375 objectMap["@odata.type"] = tsf.OdataType
12376 }
12377 return json.Marshal(objectMap)
12378 }
12379
12380
12381 func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) {
12382 return nil, false
12383 }
12384
12385
12386 func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
12387 return nil, false
12388 }
12389
12390
12391 func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) {
12392 return nil, false
12393 }
12394
12395
12396 func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) {
12397 return nil, false
12398 }
12399
12400
12401 func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
12402 return nil, false
12403 }
12404
12405
12406 func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
12407 return &tsf, true
12408 }
12409
12410
12411 func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) {
12412 return nil, false
12413 }
12414
12415
12416 func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
12417 return &tsf, true
12418 }
12419
12420
12421 func (tsf TransportStreamFormat) AsFormat() (*Format, bool) {
12422 return nil, false
12423 }
12424
12425
12426 func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) {
12427 return &tsf, true
12428 }
12429
12430
12431
12432 type UtcClipTime struct {
12433
12434 Time *date.Time `json:"time,omitempty"`
12435
12436 OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
12437 }
12438
12439
12440 func (uct UtcClipTime) MarshalJSON() ([]byte, error) {
12441 uct.OdataType = OdataTypeMicrosoftMediaUtcClipTime
12442 objectMap := make(map[string]interface{})
12443 if uct.Time != nil {
12444 objectMap["time"] = uct.Time
12445 }
12446 if uct.OdataType != "" {
12447 objectMap["@odata.type"] = uct.OdataType
12448 }
12449 return json.Marshal(objectMap)
12450 }
12451
12452
12453 func (uct UtcClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
12454 return nil, false
12455 }
12456
12457
12458 func (uct UtcClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
12459 return &uct, true
12460 }
12461
12462
12463 func (uct UtcClipTime) AsClipTime() (*ClipTime, bool) {
12464 return nil, false
12465 }
12466
12467
12468 func (uct UtcClipTime) AsBasicClipTime() (BasicClipTime, bool) {
12469 return &uct, true
12470 }
12471
12472
12473 type BasicVideo interface {
12474 AsH265Video() (*H265Video, bool)
12475 AsImage() (*Image, bool)
12476 AsBasicImage() (BasicImage, bool)
12477 AsH264Video() (*H264Video, bool)
12478 AsJpgImage() (*JpgImage, bool)
12479 AsPngImage() (*PngImage, bool)
12480 AsVideo() (*Video, bool)
12481 }
12482
12483
12484 type Video struct {
12485
12486 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
12487
12488 StretchMode StretchMode `json:"stretchMode,omitempty"`
12489
12490 SyncMode VideoSyncMode `json:"syncMode,omitempty"`
12491
12492 Label *string `json:"label,omitempty"`
12493
12494 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
12495 }
12496
12497 func unmarshalBasicVideo(body []byte) (BasicVideo, error) {
12498 var m map[string]interface{}
12499 err := json.Unmarshal(body, &m)
12500 if err != nil {
12501 return nil, err
12502 }
12503
12504 switch m["@odata.type"] {
12505 case string(OdataTypeMicrosoftMediaH265Video):
12506 var hv H265Video
12507 err := json.Unmarshal(body, &hv)
12508 return hv, err
12509 case string(OdataTypeMicrosoftMediaImage):
12510 var i Image
12511 err := json.Unmarshal(body, &i)
12512 return i, err
12513 case string(OdataTypeMicrosoftMediaH264Video):
12514 var hv H264Video
12515 err := json.Unmarshal(body, &hv)
12516 return hv, err
12517 case string(OdataTypeMicrosoftMediaJpgImage):
12518 var ji JpgImage
12519 err := json.Unmarshal(body, &ji)
12520 return ji, err
12521 case string(OdataTypeMicrosoftMediaPngImage):
12522 var pi PngImage
12523 err := json.Unmarshal(body, &pi)
12524 return pi, err
12525 default:
12526 var vVar Video
12527 err := json.Unmarshal(body, &vVar)
12528 return vVar, err
12529 }
12530 }
12531 func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) {
12532 var rawMessages []*json.RawMessage
12533 err := json.Unmarshal(body, &rawMessages)
12534 if err != nil {
12535 return nil, err
12536 }
12537
12538 vVarArray := make([]BasicVideo, len(rawMessages))
12539
12540 for index, rawMessage := range rawMessages {
12541 vVar, err := unmarshalBasicVideo(*rawMessage)
12542 if err != nil {
12543 return nil, err
12544 }
12545 vVarArray[index] = vVar
12546 }
12547 return vVarArray, nil
12548 }
12549
12550
12551 func (vVar Video) MarshalJSON() ([]byte, error) {
12552 vVar.OdataType = OdataTypeMicrosoftMediaVideo
12553 objectMap := make(map[string]interface{})
12554 if vVar.KeyFrameInterval != nil {
12555 objectMap["keyFrameInterval"] = vVar.KeyFrameInterval
12556 }
12557 if vVar.StretchMode != "" {
12558 objectMap["stretchMode"] = vVar.StretchMode
12559 }
12560 if vVar.SyncMode != "" {
12561 objectMap["syncMode"] = vVar.SyncMode
12562 }
12563 if vVar.Label != nil {
12564 objectMap["label"] = vVar.Label
12565 }
12566 if vVar.OdataType != "" {
12567 objectMap["@odata.type"] = vVar.OdataType
12568 }
12569 return json.Marshal(objectMap)
12570 }
12571
12572
12573 func (vVar Video) AsAudio() (*Audio, bool) {
12574 return nil, false
12575 }
12576
12577
12578 func (vVar Video) AsBasicAudio() (BasicAudio, bool) {
12579 return nil, false
12580 }
12581
12582
12583 func (vVar Video) AsAacAudio() (*AacAudio, bool) {
12584 return nil, false
12585 }
12586
12587
12588 func (vVar Video) AsVideo() (*Video, bool) {
12589 return &vVar, true
12590 }
12591
12592
12593 func (vVar Video) AsBasicVideo() (BasicVideo, bool) {
12594 return &vVar, true
12595 }
12596
12597
12598 func (vVar Video) AsH265Video() (*H265Video, bool) {
12599 return nil, false
12600 }
12601
12602
12603 func (vVar Video) AsCopyVideo() (*CopyVideo, bool) {
12604 return nil, false
12605 }
12606
12607
12608 func (vVar Video) AsImage() (*Image, bool) {
12609 return nil, false
12610 }
12611
12612
12613 func (vVar Video) AsBasicImage() (BasicImage, bool) {
12614 return nil, false
12615 }
12616
12617
12618 func (vVar Video) AsCopyAudio() (*CopyAudio, bool) {
12619 return nil, false
12620 }
12621
12622
12623 func (vVar Video) AsH264Video() (*H264Video, bool) {
12624 return nil, false
12625 }
12626
12627
12628 func (vVar Video) AsJpgImage() (*JpgImage, bool) {
12629 return nil, false
12630 }
12631
12632
12633 func (vVar Video) AsPngImage() (*PngImage, bool) {
12634 return nil, false
12635 }
12636
12637
12638 func (vVar Video) AsCodec() (*Codec, bool) {
12639 return nil, false
12640 }
12641
12642
12643 func (vVar Video) AsBasicCodec() (BasicCodec, bool) {
12644 return &vVar, true
12645 }
12646
12647
12648
12649 type VideoAnalyzerPreset struct {
12650
12651 InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"`
12652
12653 AudioLanguage *string `json:"audioLanguage,omitempty"`
12654
12655 Mode AudioAnalysisMode `json:"mode,omitempty"`
12656
12657 ExperimentalOptions map[string]*string `json:"experimentalOptions"`
12658
12659 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
12660 }
12661
12662
12663 func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) {
12664 vap.OdataType = OdataTypeMicrosoftMediaVideoAnalyzerPreset
12665 objectMap := make(map[string]interface{})
12666 if vap.InsightsToExtract != "" {
12667 objectMap["insightsToExtract"] = vap.InsightsToExtract
12668 }
12669 if vap.AudioLanguage != nil {
12670 objectMap["audioLanguage"] = vap.AudioLanguage
12671 }
12672 if vap.Mode != "" {
12673 objectMap["mode"] = vap.Mode
12674 }
12675 if vap.ExperimentalOptions != nil {
12676 objectMap["experimentalOptions"] = vap.ExperimentalOptions
12677 }
12678 if vap.OdataType != "" {
12679 objectMap["@odata.type"] = vap.OdataType
12680 }
12681 return json.Marshal(objectMap)
12682 }
12683
12684
12685 func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
12686 return nil, false
12687 }
12688
12689
12690 func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
12691 return nil, false
12692 }
12693
12694
12695 func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
12696 return &vap, true
12697 }
12698
12699
12700 func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
12701 return nil, false
12702 }
12703
12704
12705 func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
12706 return nil, false
12707 }
12708
12709
12710 func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
12711 return &vap, true
12712 }
12713
12714
12715 func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) {
12716 return nil, false
12717 }
12718
12719
12720 func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
12721 return &vap, true
12722 }
12723
12724
12725 type BasicVideoLayer interface {
12726 AsH264Layer() (*H264Layer, bool)
12727 AsVideoLayer() (*VideoLayer, bool)
12728 }
12729
12730
12731
12732 type VideoLayer struct {
12733
12734 Bitrate *int32 `json:"bitrate,omitempty"`
12735
12736 MaxBitrate *int32 `json:"maxBitrate,omitempty"`
12737
12738 BFrames *int32 `json:"bFrames,omitempty"`
12739
12740 FrameRate *string `json:"frameRate,omitempty"`
12741
12742 Slices *int32 `json:"slices,omitempty"`
12743
12744 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
12745
12746 Width *string `json:"width,omitempty"`
12747
12748 Height *string `json:"height,omitempty"`
12749
12750 Label *string `json:"label,omitempty"`
12751
12752 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
12753 }
12754
12755 func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) {
12756 var m map[string]interface{}
12757 err := json.Unmarshal(body, &m)
12758 if err != nil {
12759 return nil, err
12760 }
12761
12762 switch m["@odata.type"] {
12763 case string(OdataTypeMicrosoftMediaH264Layer):
12764 var hl H264Layer
12765 err := json.Unmarshal(body, &hl)
12766 return hl, err
12767 default:
12768 var vl VideoLayer
12769 err := json.Unmarshal(body, &vl)
12770 return vl, err
12771 }
12772 }
12773 func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) {
12774 var rawMessages []*json.RawMessage
12775 err := json.Unmarshal(body, &rawMessages)
12776 if err != nil {
12777 return nil, err
12778 }
12779
12780 vlArray := make([]BasicVideoLayer, len(rawMessages))
12781
12782 for index, rawMessage := range rawMessages {
12783 vl, err := unmarshalBasicVideoLayer(*rawMessage)
12784 if err != nil {
12785 return nil, err
12786 }
12787 vlArray[index] = vl
12788 }
12789 return vlArray, nil
12790 }
12791
12792
12793 func (vl VideoLayer) MarshalJSON() ([]byte, error) {
12794 vl.OdataType = OdataTypeMicrosoftMediaVideoLayer
12795 objectMap := make(map[string]interface{})
12796 if vl.Bitrate != nil {
12797 objectMap["bitrate"] = vl.Bitrate
12798 }
12799 if vl.MaxBitrate != nil {
12800 objectMap["maxBitrate"] = vl.MaxBitrate
12801 }
12802 if vl.BFrames != nil {
12803 objectMap["bFrames"] = vl.BFrames
12804 }
12805 if vl.FrameRate != nil {
12806 objectMap["frameRate"] = vl.FrameRate
12807 }
12808 if vl.Slices != nil {
12809 objectMap["slices"] = vl.Slices
12810 }
12811 if vl.AdaptiveBFrame != nil {
12812 objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame
12813 }
12814 if vl.Width != nil {
12815 objectMap["width"] = vl.Width
12816 }
12817 if vl.Height != nil {
12818 objectMap["height"] = vl.Height
12819 }
12820 if vl.Label != nil {
12821 objectMap["label"] = vl.Label
12822 }
12823 if vl.OdataType != "" {
12824 objectMap["@odata.type"] = vl.OdataType
12825 }
12826 return json.Marshal(objectMap)
12827 }
12828
12829
12830 func (vl VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
12831 return nil, false
12832 }
12833
12834
12835 func (vl VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
12836 return nil, false
12837 }
12838
12839
12840 func (vl VideoLayer) AsH265Layer() (*H265Layer, bool) {
12841 return nil, false
12842 }
12843
12844
12845 func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
12846 return &vl, true
12847 }
12848
12849
12850 func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
12851 return &vl, true
12852 }
12853
12854
12855 func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) {
12856 return nil, false
12857 }
12858
12859
12860 func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
12861 return nil, false
12862 }
12863
12864
12865 func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) {
12866 return nil, false
12867 }
12868
12869
12870 func (vl VideoLayer) AsLayer() (*Layer, bool) {
12871 return nil, false
12872 }
12873
12874
12875 func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) {
12876 return &vl, true
12877 }
12878
12879
12880 type VideoOverlay struct {
12881
12882 Position *Rectangle `json:"position,omitempty"`
12883
12884 Opacity *float64 `json:"opacity,omitempty"`
12885
12886 CropRectangle *Rectangle `json:"cropRectangle,omitempty"`
12887
12888 InputLabel *string `json:"inputLabel,omitempty"`
12889
12890 Start *string `json:"start,omitempty"`
12891
12892 End *string `json:"end,omitempty"`
12893
12894 FadeInDuration *string `json:"fadeInDuration,omitempty"`
12895
12896 FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
12897
12898 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
12899
12900 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
12901 }
12902
12903
12904 func (vo VideoOverlay) MarshalJSON() ([]byte, error) {
12905 vo.OdataType = OdataTypeMicrosoftMediaVideoOverlay
12906 objectMap := make(map[string]interface{})
12907 if vo.Position != nil {
12908 objectMap["position"] = vo.Position
12909 }
12910 if vo.Opacity != nil {
12911 objectMap["opacity"] = vo.Opacity
12912 }
12913 if vo.CropRectangle != nil {
12914 objectMap["cropRectangle"] = vo.CropRectangle
12915 }
12916 if vo.InputLabel != nil {
12917 objectMap["inputLabel"] = vo.InputLabel
12918 }
12919 if vo.Start != nil {
12920 objectMap["start"] = vo.Start
12921 }
12922 if vo.End != nil {
12923 objectMap["end"] = vo.End
12924 }
12925 if vo.FadeInDuration != nil {
12926 objectMap["fadeInDuration"] = vo.FadeInDuration
12927 }
12928 if vo.FadeOutDuration != nil {
12929 objectMap["fadeOutDuration"] = vo.FadeOutDuration
12930 }
12931 if vo.AudioGainLevel != nil {
12932 objectMap["audioGainLevel"] = vo.AudioGainLevel
12933 }
12934 if vo.OdataType != "" {
12935 objectMap["@odata.type"] = vo.OdataType
12936 }
12937 return json.Marshal(objectMap)
12938 }
12939
12940
12941 func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
12942 return nil, false
12943 }
12944
12945
12946 func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
12947 return &vo, true
12948 }
12949
12950
12951 func (vo VideoOverlay) AsOverlay() (*Overlay, bool) {
12952 return nil, false
12953 }
12954
12955
12956 func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) {
12957 return &vo, true
12958 }
12959
12960
12961 type BasicVideoTrackDescriptor interface {
12962 AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
12963 AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
12964 AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
12965 }
12966
12967
12968 type VideoTrackDescriptor struct {
12969
12970 OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
12971 }
12972
12973 func unmarshalBasicVideoTrackDescriptor(body []byte) (BasicVideoTrackDescriptor, error) {
12974 var m map[string]interface{}
12975 err := json.Unmarshal(body, &m)
12976 if err != nil {
12977 return nil, err
12978 }
12979
12980 switch m["@odata.type"] {
12981 case string(OdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
12982 var svtba SelectVideoTrackByAttribute
12983 err := json.Unmarshal(body, &svtba)
12984 return svtba, err
12985 case string(OdataTypeMicrosoftMediaSelectVideoTrackByID):
12986 var svtbi SelectVideoTrackByID
12987 err := json.Unmarshal(body, &svtbi)
12988 return svtbi, err
12989 default:
12990 var vtd VideoTrackDescriptor
12991 err := json.Unmarshal(body, &vtd)
12992 return vtd, err
12993 }
12994 }
12995 func unmarshalBasicVideoTrackDescriptorArray(body []byte) ([]BasicVideoTrackDescriptor, error) {
12996 var rawMessages []*json.RawMessage
12997 err := json.Unmarshal(body, &rawMessages)
12998 if err != nil {
12999 return nil, err
13000 }
13001
13002 vtdArray := make([]BasicVideoTrackDescriptor, len(rawMessages))
13003
13004 for index, rawMessage := range rawMessages {
13005 vtd, err := unmarshalBasicVideoTrackDescriptor(*rawMessage)
13006 if err != nil {
13007 return nil, err
13008 }
13009 vtdArray[index] = vtd
13010 }
13011 return vtdArray, nil
13012 }
13013
13014
13015 func (vtd VideoTrackDescriptor) MarshalJSON() ([]byte, error) {
13016 vtd.OdataType = OdataTypeMicrosoftMediaVideoTrackDescriptor
13017 objectMap := make(map[string]interface{})
13018 if vtd.OdataType != "" {
13019 objectMap["@odata.type"] = vtd.OdataType
13020 }
13021 return json.Marshal(objectMap)
13022 }
13023
13024
13025 func (vtd VideoTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
13026 return nil, false
13027 }
13028
13029
13030 func (vtd VideoTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
13031 return nil, false
13032 }
13033
13034
13035 func (vtd VideoTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
13036 return nil, false
13037 }
13038
13039
13040 func (vtd VideoTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
13041 return nil, false
13042 }
13043
13044
13045 func (vtd VideoTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
13046 return &vtd, true
13047 }
13048
13049
13050 func (vtd VideoTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
13051 return &vtd, true
13052 }
13053
13054
13055 func (vtd VideoTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
13056 return nil, false
13057 }
13058
13059
13060 func (vtd VideoTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
13061 return nil, false
13062 }
13063
13064
13065 func (vtd VideoTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
13066 return nil, false
13067 }
13068
13069
13070 func (vtd VideoTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
13071 return &vtd, true
13072 }
13073
View as plain text