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