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