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