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