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