1package media
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
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// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2020-05-01/media"
23
24// AacAudio describes Advanced Audio Codec (AAC) audio encoding settings.
25type AacAudio struct {
26	// Profile - The encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'
27	Profile AacAudioProfile `json:"profile,omitempty"`
28	// Channels - The number of channels in the audio.
29	Channels *int32 `json:"channels,omitempty"`
30	// SamplingRate - The sampling rate to use for encoding in hertz.
31	SamplingRate *int32 `json:"samplingRate,omitempty"`
32	// Bitrate - The bitrate, in bits per second, of the output encoded audio.
33	Bitrate *int32 `json:"bitrate,omitempty"`
34	// Label - An optional label for the codec. The label can be used to control muxing behavior.
35	Label *string `json:"label,omitempty"`
36	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
37	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
38}
39
40// MarshalJSON is the custom marshaler for AacAudio.
41func (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// AsAudio is the BasicCodec implementation for AacAudio.
66func (aa AacAudio) AsAudio() (*Audio, bool) {
67	return nil, false
68}
69
70// AsBasicAudio is the BasicCodec implementation for AacAudio.
71func (aa AacAudio) AsBasicAudio() (BasicAudio, bool) {
72	return &aa, true
73}
74
75// AsAacAudio is the BasicCodec implementation for AacAudio.
76func (aa AacAudio) AsAacAudio() (*AacAudio, bool) {
77	return &aa, true
78}
79
80// AsVideo is the BasicCodec implementation for AacAudio.
81func (aa AacAudio) AsVideo() (*Video, bool) {
82	return nil, false
83}
84
85// AsBasicVideo is the BasicCodec implementation for AacAudio.
86func (aa AacAudio) AsBasicVideo() (BasicVideo, bool) {
87	return nil, false
88}
89
90// AsH265Video is the BasicCodec implementation for AacAudio.
91func (aa AacAudio) AsH265Video() (*H265Video, bool) {
92	return nil, false
93}
94
95// AsCopyVideo is the BasicCodec implementation for AacAudio.
96func (aa AacAudio) AsCopyVideo() (*CopyVideo, bool) {
97	return nil, false
98}
99
100// AsImage is the BasicCodec implementation for AacAudio.
101func (aa AacAudio) AsImage() (*Image, bool) {
102	return nil, false
103}
104
105// AsBasicImage is the BasicCodec implementation for AacAudio.
106func (aa AacAudio) AsBasicImage() (BasicImage, bool) {
107	return nil, false
108}
109
110// AsCopyAudio is the BasicCodec implementation for AacAudio.
111func (aa AacAudio) AsCopyAudio() (*CopyAudio, bool) {
112	return nil, false
113}
114
115// AsH264Video is the BasicCodec implementation for AacAudio.
116func (aa AacAudio) AsH264Video() (*H264Video, bool) {
117	return nil, false
118}
119
120// AsJpgImage is the BasicCodec implementation for AacAudio.
121func (aa AacAudio) AsJpgImage() (*JpgImage, bool) {
122	return nil, false
123}
124
125// AsPngImage is the BasicCodec implementation for AacAudio.
126func (aa AacAudio) AsPngImage() (*PngImage, bool) {
127	return nil, false
128}
129
130// AsCodec is the BasicCodec implementation for AacAudio.
131func (aa AacAudio) AsCodec() (*Codec, bool) {
132	return nil, false
133}
134
135// AsBasicCodec is the BasicCodec implementation for AacAudio.
136func (aa AacAudio) AsBasicCodec() (BasicCodec, bool) {
137	return &aa, true
138}
139
140// AbsoluteClipTime specifies the clip time as an absolute time position in the media file.  The absolute
141// time can point to a different position depending on whether the media file starts from a timestamp of
142// zero or not.
143type AbsoluteClipTime struct {
144	// Time - The time position on the timeline of the input media. It is usually specified as an ISO8601 period. e.g PT30S for 30 seconds.
145	Time *string `json:"time,omitempty"`
146	// OdataType - Possible values include: 'OdataTypeClipTime', 'OdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeMicrosoftMediaUtcClipTime'
147	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
148}
149
150// MarshalJSON is the custom marshaler for AbsoluteClipTime.
151func (act AbsoluteClipTime) MarshalJSON() ([]byte, error) {
152	act.OdataType = OdataTypeMicrosoftMediaAbsoluteClipTime
153	objectMap := make(map[string]interface{})
154	if act.Time != nil {
155		objectMap["time"] = act.Time
156	}
157	if act.OdataType != "" {
158		objectMap["@odata.type"] = act.OdataType
159	}
160	return json.Marshal(objectMap)
161}
162
163// AsAbsoluteClipTime is the BasicClipTime implementation for AbsoluteClipTime.
164func (act AbsoluteClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
165	return &act, true
166}
167
168// AsUtcClipTime is the BasicClipTime implementation for AbsoluteClipTime.
169func (act AbsoluteClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
170	return nil, false
171}
172
173// AsClipTime is the BasicClipTime implementation for AbsoluteClipTime.
174func (act AbsoluteClipTime) AsClipTime() (*ClipTime, bool) {
175	return nil, false
176}
177
178// AsBasicClipTime is the BasicClipTime implementation for AbsoluteClipTime.
179func (act AbsoluteClipTime) AsBasicClipTime() (BasicClipTime, bool) {
180	return &act, true
181}
182
183// AccountEncryption ...
184type AccountEncryption struct {
185	// Type - The type of key used to encrypt the Account Key. Possible values include: 'SystemKey', 'CustomerKey'
186	Type AccountEncryptionKeyType `json:"type,omitempty"`
187	// KeyVaultProperties - The properties of the key used to encrypt the account.
188	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
189}
190
191// AccountFilter an Account Filter.
192type AccountFilter struct {
193	autorest.Response `json:"-"`
194	*FilterProperties `json:"properties,omitempty"`
195	// SystemData - READ-ONLY; The system metadata relating to this resource.
196	SystemData *SystemData `json:"systemData,omitempty"`
197	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
198	ID *string `json:"id,omitempty"`
199	// Name - READ-ONLY; The name of the resource
200	Name *string `json:"name,omitempty"`
201	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
202	Type *string `json:"type,omitempty"`
203}
204
205// MarshalJSON is the custom marshaler for AccountFilter.
206func (af AccountFilter) MarshalJSON() ([]byte, error) {
207	objectMap := make(map[string]interface{})
208	if af.FilterProperties != nil {
209		objectMap["properties"] = af.FilterProperties
210	}
211	return json.Marshal(objectMap)
212}
213
214// UnmarshalJSON is the custom unmarshaler for AccountFilter struct.
215func (af *AccountFilter) UnmarshalJSON(body []byte) error {
216	var m map[string]*json.RawMessage
217	err := json.Unmarshal(body, &m)
218	if err != nil {
219		return err
220	}
221	for k, v := range m {
222		switch k {
223		case "properties":
224			if v != nil {
225				var filterProperties FilterProperties
226				err = json.Unmarshal(*v, &filterProperties)
227				if err != nil {
228					return err
229				}
230				af.FilterProperties = &filterProperties
231			}
232		case "systemData":
233			if v != nil {
234				var systemData SystemData
235				err = json.Unmarshal(*v, &systemData)
236				if err != nil {
237					return err
238				}
239				af.SystemData = &systemData
240			}
241		case "id":
242			if v != nil {
243				var ID string
244				err = json.Unmarshal(*v, &ID)
245				if err != nil {
246					return err
247				}
248				af.ID = &ID
249			}
250		case "name":
251			if v != nil {
252				var name string
253				err = json.Unmarshal(*v, &name)
254				if err != nil {
255					return err
256				}
257				af.Name = &name
258			}
259		case "type":
260			if v != nil {
261				var typeVar string
262				err = json.Unmarshal(*v, &typeVar)
263				if err != nil {
264					return err
265				}
266				af.Type = &typeVar
267			}
268		}
269	}
270
271	return nil
272}
273
274// AccountFilterCollection a collection of AccountFilter items.
275type AccountFilterCollection struct {
276	autorest.Response `json:"-"`
277	// Value - A collection of AccountFilter items.
278	Value *[]AccountFilter `json:"value,omitempty"`
279	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
280	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
281}
282
283// AccountFilterCollectionIterator provides access to a complete listing of AccountFilter values.
284type AccountFilterCollectionIterator struct {
285	i    int
286	page AccountFilterCollectionPage
287}
288
289// NextWithContext advances to the next value.  If there was an error making
290// the request the iterator does not advance and the error is returned.
291func (iter *AccountFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
292	if tracing.IsEnabled() {
293		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionIterator.NextWithContext")
294		defer func() {
295			sc := -1
296			if iter.Response().Response.Response != nil {
297				sc = iter.Response().Response.Response.StatusCode
298			}
299			tracing.EndSpan(ctx, sc, err)
300		}()
301	}
302	iter.i++
303	if iter.i < len(iter.page.Values()) {
304		return nil
305	}
306	err = iter.page.NextWithContext(ctx)
307	if err != nil {
308		iter.i--
309		return err
310	}
311	iter.i = 0
312	return nil
313}
314
315// Next advances to the next value.  If there was an error making
316// the request the iterator does not advance and the error is returned.
317// Deprecated: Use NextWithContext() instead.
318func (iter *AccountFilterCollectionIterator) Next() error {
319	return iter.NextWithContext(context.Background())
320}
321
322// NotDone returns true if the enumeration should be started or is not yet complete.
323func (iter AccountFilterCollectionIterator) NotDone() bool {
324	return iter.page.NotDone() && iter.i < len(iter.page.Values())
325}
326
327// Response returns the raw server response from the last page request.
328func (iter AccountFilterCollectionIterator) Response() AccountFilterCollection {
329	return iter.page.Response()
330}
331
332// Value returns the current value or a zero-initialized value if the
333// iterator has advanced beyond the end of the collection.
334func (iter AccountFilterCollectionIterator) Value() AccountFilter {
335	if !iter.page.NotDone() {
336		return AccountFilter{}
337	}
338	return iter.page.Values()[iter.i]
339}
340
341// Creates a new instance of the AccountFilterCollectionIterator type.
342func NewAccountFilterCollectionIterator(page AccountFilterCollectionPage) AccountFilterCollectionIterator {
343	return AccountFilterCollectionIterator{page: page}
344}
345
346// IsEmpty returns true if the ListResult contains no values.
347func (afc AccountFilterCollection) IsEmpty() bool {
348	return afc.Value == nil || len(*afc.Value) == 0
349}
350
351// hasNextLink returns true if the NextLink is not empty.
352func (afc AccountFilterCollection) hasNextLink() bool {
353	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
354}
355
356// accountFilterCollectionPreparer prepares a request to retrieve the next set of results.
357// It returns nil if no more results exist.
358func (afc AccountFilterCollection) accountFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
359	if !afc.hasNextLink() {
360		return nil, nil
361	}
362	return autorest.Prepare((&http.Request{}).WithContext(ctx),
363		autorest.AsJSON(),
364		autorest.AsGet(),
365		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
366}
367
368// AccountFilterCollectionPage contains a page of AccountFilter values.
369type AccountFilterCollectionPage struct {
370	fn  func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)
371	afc AccountFilterCollection
372}
373
374// NextWithContext advances to the next page of values.  If there was an error making
375// the request the page does not advance and the error is returned.
376func (page *AccountFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
377	if tracing.IsEnabled() {
378		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionPage.NextWithContext")
379		defer func() {
380			sc := -1
381			if page.Response().Response.Response != nil {
382				sc = page.Response().Response.Response.StatusCode
383			}
384			tracing.EndSpan(ctx, sc, err)
385		}()
386	}
387	for {
388		next, err := page.fn(ctx, page.afc)
389		if err != nil {
390			return err
391		}
392		page.afc = next
393		if !next.hasNextLink() || !next.IsEmpty() {
394			break
395		}
396	}
397	return nil
398}
399
400// Next advances to the next page of values.  If there was an error making
401// the request the page does not advance and the error is returned.
402// Deprecated: Use NextWithContext() instead.
403func (page *AccountFilterCollectionPage) Next() error {
404	return page.NextWithContext(context.Background())
405}
406
407// NotDone returns true if the page enumeration should be started or is not yet complete.
408func (page AccountFilterCollectionPage) NotDone() bool {
409	return !page.afc.IsEmpty()
410}
411
412// Response returns the raw server response from the last page request.
413func (page AccountFilterCollectionPage) Response() AccountFilterCollection {
414	return page.afc
415}
416
417// Values returns the slice of values for the current page or nil if there are no values.
418func (page AccountFilterCollectionPage) Values() []AccountFilter {
419	if page.afc.IsEmpty() {
420		return nil
421	}
422	return *page.afc.Value
423}
424
425// Creates a new instance of the AccountFilterCollectionPage type.
426func NewAccountFilterCollectionPage(cur AccountFilterCollection, getNextPage func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)) AccountFilterCollectionPage {
427	return AccountFilterCollectionPage{
428		fn:  getNextPage,
429		afc: cur,
430	}
431}
432
433// AkamaiAccessControl akamai access control
434type AkamaiAccessControl struct {
435	// AkamaiSignatureHeaderAuthenticationKeyList - authentication key list
436	AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"`
437}
438
439// AkamaiSignatureHeaderAuthenticationKey akamai Signature Header authentication key.
440type AkamaiSignatureHeaderAuthenticationKey struct {
441	// Identifier - identifier of the key
442	Identifier *string `json:"identifier,omitempty"`
443	// Base64Key - authentication key
444	Base64Key *string `json:"base64Key,omitempty"`
445	// Expiration - The expiration time of the authentication key.
446	Expiration *date.Time `json:"expiration,omitempty"`
447}
448
449// APIError the API error.
450type APIError struct {
451	// Error - The error properties.
452	Error *ODataError `json:"error,omitempty"`
453}
454
455// Asset an Asset.
456type Asset struct {
457	autorest.Response `json:"-"`
458	// AssetProperties - The resource properties.
459	*AssetProperties `json:"properties,omitempty"`
460	// SystemData - READ-ONLY; The system metadata relating to this resource.
461	SystemData *SystemData `json:"systemData,omitempty"`
462	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
463	ID *string `json:"id,omitempty"`
464	// Name - READ-ONLY; The name of the resource
465	Name *string `json:"name,omitempty"`
466	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
467	Type *string `json:"type,omitempty"`
468}
469
470// MarshalJSON is the custom marshaler for Asset.
471func (a Asset) MarshalJSON() ([]byte, error) {
472	objectMap := make(map[string]interface{})
473	if a.AssetProperties != nil {
474		objectMap["properties"] = a.AssetProperties
475	}
476	return json.Marshal(objectMap)
477}
478
479// UnmarshalJSON is the custom unmarshaler for Asset struct.
480func (a *Asset) UnmarshalJSON(body []byte) error {
481	var m map[string]*json.RawMessage
482	err := json.Unmarshal(body, &m)
483	if err != nil {
484		return err
485	}
486	for k, v := range m {
487		switch k {
488		case "properties":
489			if v != nil {
490				var assetProperties AssetProperties
491				err = json.Unmarshal(*v, &assetProperties)
492				if err != nil {
493					return err
494				}
495				a.AssetProperties = &assetProperties
496			}
497		case "systemData":
498			if v != nil {
499				var systemData SystemData
500				err = json.Unmarshal(*v, &systemData)
501				if err != nil {
502					return err
503				}
504				a.SystemData = &systemData
505			}
506		case "id":
507			if v != nil {
508				var ID string
509				err = json.Unmarshal(*v, &ID)
510				if err != nil {
511					return err
512				}
513				a.ID = &ID
514			}
515		case "name":
516			if v != nil {
517				var name string
518				err = json.Unmarshal(*v, &name)
519				if err != nil {
520					return err
521				}
522				a.Name = &name
523			}
524		case "type":
525			if v != nil {
526				var typeVar string
527				err = json.Unmarshal(*v, &typeVar)
528				if err != nil {
529					return err
530				}
531				a.Type = &typeVar
532			}
533		}
534	}
535
536	return nil
537}
538
539// AssetCollection a collection of Asset items.
540type AssetCollection struct {
541	autorest.Response `json:"-"`
542	// Value - A collection of Asset items.
543	Value *[]Asset `json:"value,omitempty"`
544	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
545	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
546}
547
548// AssetCollectionIterator provides access to a complete listing of Asset values.
549type AssetCollectionIterator struct {
550	i    int
551	page AssetCollectionPage
552}
553
554// NextWithContext advances to the next value.  If there was an error making
555// the request the iterator does not advance and the error is returned.
556func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
557	if tracing.IsEnabled() {
558		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext")
559		defer func() {
560			sc := -1
561			if iter.Response().Response.Response != nil {
562				sc = iter.Response().Response.Response.StatusCode
563			}
564			tracing.EndSpan(ctx, sc, err)
565		}()
566	}
567	iter.i++
568	if iter.i < len(iter.page.Values()) {
569		return nil
570	}
571	err = iter.page.NextWithContext(ctx)
572	if err != nil {
573		iter.i--
574		return err
575	}
576	iter.i = 0
577	return nil
578}
579
580// Next advances to the next value.  If there was an error making
581// the request the iterator does not advance and the error is returned.
582// Deprecated: Use NextWithContext() instead.
583func (iter *AssetCollectionIterator) Next() error {
584	return iter.NextWithContext(context.Background())
585}
586
587// NotDone returns true if the enumeration should be started or is not yet complete.
588func (iter AssetCollectionIterator) NotDone() bool {
589	return iter.page.NotDone() && iter.i < len(iter.page.Values())
590}
591
592// Response returns the raw server response from the last page request.
593func (iter AssetCollectionIterator) Response() AssetCollection {
594	return iter.page.Response()
595}
596
597// Value returns the current value or a zero-initialized value if the
598// iterator has advanced beyond the end of the collection.
599func (iter AssetCollectionIterator) Value() Asset {
600	if !iter.page.NotDone() {
601		return Asset{}
602	}
603	return iter.page.Values()[iter.i]
604}
605
606// Creates a new instance of the AssetCollectionIterator type.
607func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator {
608	return AssetCollectionIterator{page: page}
609}
610
611// IsEmpty returns true if the ListResult contains no values.
612func (ac AssetCollection) IsEmpty() bool {
613	return ac.Value == nil || len(*ac.Value) == 0
614}
615
616// hasNextLink returns true if the NextLink is not empty.
617func (ac AssetCollection) hasNextLink() bool {
618	return ac.OdataNextLink != nil && len(*ac.OdataNextLink) != 0
619}
620
621// assetCollectionPreparer prepares a request to retrieve the next set of results.
622// It returns nil if no more results exist.
623func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) {
624	if !ac.hasNextLink() {
625		return nil, nil
626	}
627	return autorest.Prepare((&http.Request{}).WithContext(ctx),
628		autorest.AsJSON(),
629		autorest.AsGet(),
630		autorest.WithBaseURL(to.String(ac.OdataNextLink)))
631}
632
633// AssetCollectionPage contains a page of Asset values.
634type AssetCollectionPage struct {
635	fn func(context.Context, AssetCollection) (AssetCollection, error)
636	ac AssetCollection
637}
638
639// NextWithContext advances to the next page of values.  If there was an error making
640// the request the page does not advance and the error is returned.
641func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) {
642	if tracing.IsEnabled() {
643		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext")
644		defer func() {
645			sc := -1
646			if page.Response().Response.Response != nil {
647				sc = page.Response().Response.Response.StatusCode
648			}
649			tracing.EndSpan(ctx, sc, err)
650		}()
651	}
652	for {
653		next, err := page.fn(ctx, page.ac)
654		if err != nil {
655			return err
656		}
657		page.ac = next
658		if !next.hasNextLink() || !next.IsEmpty() {
659			break
660		}
661	}
662	return nil
663}
664
665// Next advances to the next page of values.  If there was an error making
666// the request the page does not advance and the error is returned.
667// Deprecated: Use NextWithContext() instead.
668func (page *AssetCollectionPage) Next() error {
669	return page.NextWithContext(context.Background())
670}
671
672// NotDone returns true if the page enumeration should be started or is not yet complete.
673func (page AssetCollectionPage) NotDone() bool {
674	return !page.ac.IsEmpty()
675}
676
677// Response returns the raw server response from the last page request.
678func (page AssetCollectionPage) Response() AssetCollection {
679	return page.ac
680}
681
682// Values returns the slice of values for the current page or nil if there are no values.
683func (page AssetCollectionPage) Values() []Asset {
684	if page.ac.IsEmpty() {
685		return nil
686	}
687	return *page.ac.Value
688}
689
690// Creates a new instance of the AssetCollectionPage type.
691func NewAssetCollectionPage(cur AssetCollection, getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage {
692	return AssetCollectionPage{
693		fn: getNextPage,
694		ac: cur,
695	}
696}
697
698// AssetContainerSas the Asset Storage container SAS URLs.
699type AssetContainerSas struct {
700	autorest.Response `json:"-"`
701	// AssetContainerSasUrls - The list of Asset container SAS URLs.
702	AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"`
703}
704
705// AssetFileEncryptionMetadata the Asset File Storage encryption metadata.
706type AssetFileEncryptionMetadata struct {
707	// InitializationVector - The Asset File initialization vector.
708	InitializationVector *string `json:"initializationVector,omitempty"`
709	// AssetFileName - The Asset File name.
710	AssetFileName *string `json:"assetFileName,omitempty"`
711	// AssetFileID - The Asset File Id.
712	AssetFileID *uuid.UUID `json:"assetFileId,omitempty"`
713}
714
715// AssetFilter an Asset Filter.
716type AssetFilter struct {
717	autorest.Response `json:"-"`
718	*FilterProperties `json:"properties,omitempty"`
719	// SystemData - READ-ONLY; The system metadata relating to this resource.
720	SystemData *SystemData `json:"systemData,omitempty"`
721	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
722	ID *string `json:"id,omitempty"`
723	// Name - READ-ONLY; The name of the resource
724	Name *string `json:"name,omitempty"`
725	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
726	Type *string `json:"type,omitempty"`
727}
728
729// MarshalJSON is the custom marshaler for AssetFilter.
730func (af AssetFilter) MarshalJSON() ([]byte, error) {
731	objectMap := make(map[string]interface{})
732	if af.FilterProperties != nil {
733		objectMap["properties"] = af.FilterProperties
734	}
735	return json.Marshal(objectMap)
736}
737
738// UnmarshalJSON is the custom unmarshaler for AssetFilter struct.
739func (af *AssetFilter) UnmarshalJSON(body []byte) error {
740	var m map[string]*json.RawMessage
741	err := json.Unmarshal(body, &m)
742	if err != nil {
743		return err
744	}
745	for k, v := range m {
746		switch k {
747		case "properties":
748			if v != nil {
749				var filterProperties FilterProperties
750				err = json.Unmarshal(*v, &filterProperties)
751				if err != nil {
752					return err
753				}
754				af.FilterProperties = &filterProperties
755			}
756		case "systemData":
757			if v != nil {
758				var systemData SystemData
759				err = json.Unmarshal(*v, &systemData)
760				if err != nil {
761					return err
762				}
763				af.SystemData = &systemData
764			}
765		case "id":
766			if v != nil {
767				var ID string
768				err = json.Unmarshal(*v, &ID)
769				if err != nil {
770					return err
771				}
772				af.ID = &ID
773			}
774		case "name":
775			if v != nil {
776				var name string
777				err = json.Unmarshal(*v, &name)
778				if err != nil {
779					return err
780				}
781				af.Name = &name
782			}
783		case "type":
784			if v != nil {
785				var typeVar string
786				err = json.Unmarshal(*v, &typeVar)
787				if err != nil {
788					return err
789				}
790				af.Type = &typeVar
791			}
792		}
793	}
794
795	return nil
796}
797
798// AssetFilterCollection a collection of AssetFilter items.
799type AssetFilterCollection struct {
800	autorest.Response `json:"-"`
801	// Value - A collection of AssetFilter items.
802	Value *[]AssetFilter `json:"value,omitempty"`
803	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
804	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
805}
806
807// AssetFilterCollectionIterator provides access to a complete listing of AssetFilter values.
808type AssetFilterCollectionIterator struct {
809	i    int
810	page AssetFilterCollectionPage
811}
812
813// NextWithContext advances to the next value.  If there was an error making
814// the request the iterator does not advance and the error is returned.
815func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
816	if tracing.IsEnabled() {
817		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext")
818		defer func() {
819			sc := -1
820			if iter.Response().Response.Response != nil {
821				sc = iter.Response().Response.Response.StatusCode
822			}
823			tracing.EndSpan(ctx, sc, err)
824		}()
825	}
826	iter.i++
827	if iter.i < len(iter.page.Values()) {
828		return nil
829	}
830	err = iter.page.NextWithContext(ctx)
831	if err != nil {
832		iter.i--
833		return err
834	}
835	iter.i = 0
836	return nil
837}
838
839// Next advances to the next value.  If there was an error making
840// the request the iterator does not advance and the error is returned.
841// Deprecated: Use NextWithContext() instead.
842func (iter *AssetFilterCollectionIterator) Next() error {
843	return iter.NextWithContext(context.Background())
844}
845
846// NotDone returns true if the enumeration should be started or is not yet complete.
847func (iter AssetFilterCollectionIterator) NotDone() bool {
848	return iter.page.NotDone() && iter.i < len(iter.page.Values())
849}
850
851// Response returns the raw server response from the last page request.
852func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection {
853	return iter.page.Response()
854}
855
856// Value returns the current value or a zero-initialized value if the
857// iterator has advanced beyond the end of the collection.
858func (iter AssetFilterCollectionIterator) Value() AssetFilter {
859	if !iter.page.NotDone() {
860		return AssetFilter{}
861	}
862	return iter.page.Values()[iter.i]
863}
864
865// Creates a new instance of the AssetFilterCollectionIterator type.
866func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator {
867	return AssetFilterCollectionIterator{page: page}
868}
869
870// IsEmpty returns true if the ListResult contains no values.
871func (afc AssetFilterCollection) IsEmpty() bool {
872	return afc.Value == nil || len(*afc.Value) == 0
873}
874
875// hasNextLink returns true if the NextLink is not empty.
876func (afc AssetFilterCollection) hasNextLink() bool {
877	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
878}
879
880// assetFilterCollectionPreparer prepares a request to retrieve the next set of results.
881// It returns nil if no more results exist.
882func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
883	if !afc.hasNextLink() {
884		return nil, nil
885	}
886	return autorest.Prepare((&http.Request{}).WithContext(ctx),
887		autorest.AsJSON(),
888		autorest.AsGet(),
889		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
890}
891
892// AssetFilterCollectionPage contains a page of AssetFilter values.
893type AssetFilterCollectionPage struct {
894	fn  func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)
895	afc AssetFilterCollection
896}
897
898// NextWithContext advances to the next page of values.  If there was an error making
899// the request the page does not advance and the error is returned.
900func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
901	if tracing.IsEnabled() {
902		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext")
903		defer func() {
904			sc := -1
905			if page.Response().Response.Response != nil {
906				sc = page.Response().Response.Response.StatusCode
907			}
908			tracing.EndSpan(ctx, sc, err)
909		}()
910	}
911	for {
912		next, err := page.fn(ctx, page.afc)
913		if err != nil {
914			return err
915		}
916		page.afc = next
917		if !next.hasNextLink() || !next.IsEmpty() {
918			break
919		}
920	}
921	return nil
922}
923
924// Next advances to the next page of values.  If there was an error making
925// the request the page does not advance and the error is returned.
926// Deprecated: Use NextWithContext() instead.
927func (page *AssetFilterCollectionPage) Next() error {
928	return page.NextWithContext(context.Background())
929}
930
931// NotDone returns true if the page enumeration should be started or is not yet complete.
932func (page AssetFilterCollectionPage) NotDone() bool {
933	return !page.afc.IsEmpty()
934}
935
936// Response returns the raw server response from the last page request.
937func (page AssetFilterCollectionPage) Response() AssetFilterCollection {
938	return page.afc
939}
940
941// Values returns the slice of values for the current page or nil if there are no values.
942func (page AssetFilterCollectionPage) Values() []AssetFilter {
943	if page.afc.IsEmpty() {
944		return nil
945	}
946	return *page.afc.Value
947}
948
949// Creates a new instance of the AssetFilterCollectionPage type.
950func NewAssetFilterCollectionPage(cur AssetFilterCollection, getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage {
951	return AssetFilterCollectionPage{
952		fn:  getNextPage,
953		afc: cur,
954	}
955}
956
957// AssetProperties the Asset properties.
958type AssetProperties struct {
959	// AssetID - READ-ONLY; The Asset ID.
960	AssetID *uuid.UUID `json:"assetId,omitempty"`
961	// Created - READ-ONLY; The creation date of the Asset.
962	Created *date.Time `json:"created,omitempty"`
963	// LastModified - READ-ONLY; The last modified date of the Asset.
964	LastModified *date.Time `json:"lastModified,omitempty"`
965	// AlternateID - The alternate ID of the Asset.
966	AlternateID *string `json:"alternateId,omitempty"`
967	// Description - The Asset description.
968	Description *string `json:"description,omitempty"`
969	// Container - The name of the asset blob container.
970	Container *string `json:"container,omitempty"`
971	// StorageAccountName - The name of the storage account.
972	StorageAccountName *string `json:"storageAccountName,omitempty"`
973	// StorageEncryptionFormat - READ-ONLY; The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption'
974	StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"`
975}
976
977// MarshalJSON is the custom marshaler for AssetProperties.
978func (ap AssetProperties) MarshalJSON() ([]byte, error) {
979	objectMap := make(map[string]interface{})
980	if ap.AlternateID != nil {
981		objectMap["alternateId"] = ap.AlternateID
982	}
983	if ap.Description != nil {
984		objectMap["description"] = ap.Description
985	}
986	if ap.Container != nil {
987		objectMap["container"] = ap.Container
988	}
989	if ap.StorageAccountName != nil {
990		objectMap["storageAccountName"] = ap.StorageAccountName
991	}
992	return json.Marshal(objectMap)
993}
994
995// AssetStreamingLocator properties of the Streaming Locator.
996type AssetStreamingLocator struct {
997	// Name - READ-ONLY; Streaming Locator name.
998	Name *string `json:"name,omitempty"`
999	// AssetName - READ-ONLY; Asset Name.
1000	AssetName *string `json:"assetName,omitempty"`
1001	// Created - READ-ONLY; The creation time of the Streaming Locator.
1002	Created *date.Time `json:"created,omitempty"`
1003	// StartTime - READ-ONLY; The start time of the Streaming Locator.
1004	StartTime *date.Time `json:"startTime,omitempty"`
1005	// EndTime - READ-ONLY; The end time of the Streaming Locator.
1006	EndTime *date.Time `json:"endTime,omitempty"`
1007	// StreamingLocatorID - READ-ONLY; StreamingLocatorId of the Streaming Locator.
1008	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
1009	// StreamingPolicyName - READ-ONLY; Name of the Streaming Policy used by this Streaming Locator.
1010	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
1011	// DefaultContentKeyPolicyName - READ-ONLY; Name of the default ContentKeyPolicy used by this Streaming Locator.
1012	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
1013}
1014
1015// MarshalJSON is the custom marshaler for AssetStreamingLocator.
1016func (asl AssetStreamingLocator) MarshalJSON() ([]byte, error) {
1017	objectMap := make(map[string]interface{})
1018	return json.Marshal(objectMap)
1019}
1020
1021// BasicAudio defines the common properties for all audio codecs.
1022type BasicAudio interface {
1023	AsAacAudio() (*AacAudio, bool)
1024	AsAudio() (*Audio, bool)
1025}
1026
1027// Audio defines the common properties for all audio codecs.
1028type Audio struct {
1029	// Channels - The number of channels in the audio.
1030	Channels *int32 `json:"channels,omitempty"`
1031	// SamplingRate - The sampling rate to use for encoding in hertz.
1032	SamplingRate *int32 `json:"samplingRate,omitempty"`
1033	// Bitrate - The bitrate, in bits per second, of the output encoded audio.
1034	Bitrate *int32 `json:"bitrate,omitempty"`
1035	// Label - An optional label for the codec. The label can be used to control muxing behavior.
1036	Label *string `json:"label,omitempty"`
1037	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
1038	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
1039}
1040
1041func unmarshalBasicAudio(body []byte) (BasicAudio, error) {
1042	var m map[string]interface{}
1043	err := json.Unmarshal(body, &m)
1044	if err != nil {
1045		return nil, err
1046	}
1047
1048	switch m["@odata.type"] {
1049	case string(OdataTypeMicrosoftMediaAacAudio):
1050		var aa AacAudio
1051		err := json.Unmarshal(body, &aa)
1052		return aa, err
1053	default:
1054		var a Audio
1055		err := json.Unmarshal(body, &a)
1056		return a, err
1057	}
1058}
1059func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) {
1060	var rawMessages []*json.RawMessage
1061	err := json.Unmarshal(body, &rawMessages)
1062	if err != nil {
1063		return nil, err
1064	}
1065
1066	aArray := make([]BasicAudio, len(rawMessages))
1067
1068	for index, rawMessage := range rawMessages {
1069		a, err := unmarshalBasicAudio(*rawMessage)
1070		if err != nil {
1071			return nil, err
1072		}
1073		aArray[index] = a
1074	}
1075	return aArray, nil
1076}
1077
1078// MarshalJSON is the custom marshaler for Audio.
1079func (a Audio) MarshalJSON() ([]byte, error) {
1080	a.OdataType = OdataTypeMicrosoftMediaAudio
1081	objectMap := make(map[string]interface{})
1082	if a.Channels != nil {
1083		objectMap["channels"] = a.Channels
1084	}
1085	if a.SamplingRate != nil {
1086		objectMap["samplingRate"] = a.SamplingRate
1087	}
1088	if a.Bitrate != nil {
1089		objectMap["bitrate"] = a.Bitrate
1090	}
1091	if a.Label != nil {
1092		objectMap["label"] = a.Label
1093	}
1094	if a.OdataType != "" {
1095		objectMap["@odata.type"] = a.OdataType
1096	}
1097	return json.Marshal(objectMap)
1098}
1099
1100// AsAudio is the BasicCodec implementation for Audio.
1101func (a Audio) AsAudio() (*Audio, bool) {
1102	return &a, true
1103}
1104
1105// AsBasicAudio is the BasicCodec implementation for Audio.
1106func (a Audio) AsBasicAudio() (BasicAudio, bool) {
1107	return &a, true
1108}
1109
1110// AsAacAudio is the BasicCodec implementation for Audio.
1111func (a Audio) AsAacAudio() (*AacAudio, bool) {
1112	return nil, false
1113}
1114
1115// AsVideo is the BasicCodec implementation for Audio.
1116func (a Audio) AsVideo() (*Video, bool) {
1117	return nil, false
1118}
1119
1120// AsBasicVideo is the BasicCodec implementation for Audio.
1121func (a Audio) AsBasicVideo() (BasicVideo, bool) {
1122	return nil, false
1123}
1124
1125// AsH265Video is the BasicCodec implementation for Audio.
1126func (a Audio) AsH265Video() (*H265Video, bool) {
1127	return nil, false
1128}
1129
1130// AsCopyVideo is the BasicCodec implementation for Audio.
1131func (a Audio) AsCopyVideo() (*CopyVideo, bool) {
1132	return nil, false
1133}
1134
1135// AsImage is the BasicCodec implementation for Audio.
1136func (a Audio) AsImage() (*Image, bool) {
1137	return nil, false
1138}
1139
1140// AsBasicImage is the BasicCodec implementation for Audio.
1141func (a Audio) AsBasicImage() (BasicImage, bool) {
1142	return nil, false
1143}
1144
1145// AsCopyAudio is the BasicCodec implementation for Audio.
1146func (a Audio) AsCopyAudio() (*CopyAudio, bool) {
1147	return nil, false
1148}
1149
1150// AsH264Video is the BasicCodec implementation for Audio.
1151func (a Audio) AsH264Video() (*H264Video, bool) {
1152	return nil, false
1153}
1154
1155// AsJpgImage is the BasicCodec implementation for Audio.
1156func (a Audio) AsJpgImage() (*JpgImage, bool) {
1157	return nil, false
1158}
1159
1160// AsPngImage is the BasicCodec implementation for Audio.
1161func (a Audio) AsPngImage() (*PngImage, bool) {
1162	return nil, false
1163}
1164
1165// AsCodec is the BasicCodec implementation for Audio.
1166func (a Audio) AsCodec() (*Codec, bool) {
1167	return nil, false
1168}
1169
1170// AsBasicCodec is the BasicCodec implementation for Audio.
1171func (a Audio) AsBasicCodec() (BasicCodec, bool) {
1172	return &a, true
1173}
1174
1175// BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
1176// including speech transcription. Currently, the preset supports processing of content with a single audio track.
1177type BasicAudioAnalyzerPreset interface {
1178	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
1179	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
1180}
1181
1182// AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
1183// including speech transcription. Currently, the preset supports processing of content with a single audio
1184// track.
1185type AudioAnalyzerPreset struct {
1186	// AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US').  If you know the language of your content, it is recommended that you specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463
1187	AudioLanguage *string `json:"audioLanguage,omitempty"`
1188	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'Standard', 'Basic'
1189	Mode AudioAnalysisMode `json:"mode,omitempty"`
1190	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
1191	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
1192	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
1193	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
1194}
1195
1196func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) {
1197	var m map[string]interface{}
1198	err := json.Unmarshal(body, &m)
1199	if err != nil {
1200		return nil, err
1201	}
1202
1203	switch m["@odata.type"] {
1204	case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset):
1205		var vap VideoAnalyzerPreset
1206		err := json.Unmarshal(body, &vap)
1207		return vap, err
1208	default:
1209		var aap AudioAnalyzerPreset
1210		err := json.Unmarshal(body, &aap)
1211		return aap, err
1212	}
1213}
1214func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) {
1215	var rawMessages []*json.RawMessage
1216	err := json.Unmarshal(body, &rawMessages)
1217	if err != nil {
1218		return nil, err
1219	}
1220
1221	aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages))
1222
1223	for index, rawMessage := range rawMessages {
1224		aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage)
1225		if err != nil {
1226			return nil, err
1227		}
1228		aapArray[index] = aap
1229	}
1230	return aapArray, nil
1231}
1232
1233// MarshalJSON is the custom marshaler for AudioAnalyzerPreset.
1234func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) {
1235	aap.OdataType = OdataTypeMicrosoftMediaAudioAnalyzerPreset
1236	objectMap := make(map[string]interface{})
1237	if aap.AudioLanguage != nil {
1238		objectMap["audioLanguage"] = aap.AudioLanguage
1239	}
1240	if aap.Mode != "" {
1241		objectMap["mode"] = aap.Mode
1242	}
1243	if aap.ExperimentalOptions != nil {
1244		objectMap["experimentalOptions"] = aap.ExperimentalOptions
1245	}
1246	if aap.OdataType != "" {
1247		objectMap["@odata.type"] = aap.OdataType
1248	}
1249	return json.Marshal(objectMap)
1250}
1251
1252// AsFaceDetectorPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1253func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
1254	return nil, false
1255}
1256
1257// AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1258func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
1259	return &aap, true
1260}
1261
1262// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1263func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
1264	return &aap, true
1265}
1266
1267// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1268func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
1269	return nil, false
1270}
1271
1272// AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1273func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
1274	return nil, false
1275}
1276
1277// AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1278func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
1279	return nil, false
1280}
1281
1282// AsPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1283func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) {
1284	return nil, false
1285}
1286
1287// AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset.
1288func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
1289	return &aap, true
1290}
1291
1292// AudioOverlay describes the properties of an audio overlay.
1293type AudioOverlay struct {
1294	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
1295	InputLabel *string `json:"inputLabel,omitempty"`
1296	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
1297	Start *string `json:"start,omitempty"`
1298	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
1299	End *string `json:"end,omitempty"`
1300	// FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S).
1301	FadeInDuration *string `json:"fadeInDuration,omitempty"`
1302	// FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S).
1303	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
1304	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
1305	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
1306	// OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay'
1307	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
1308}
1309
1310// MarshalJSON is the custom marshaler for AudioOverlay.
1311func (ao AudioOverlay) MarshalJSON() ([]byte, error) {
1312	ao.OdataType = OdataTypeMicrosoftMediaAudioOverlay
1313	objectMap := make(map[string]interface{})
1314	if ao.InputLabel != nil {
1315		objectMap["inputLabel"] = ao.InputLabel
1316	}
1317	if ao.Start != nil {
1318		objectMap["start"] = ao.Start
1319	}
1320	if ao.End != nil {
1321		objectMap["end"] = ao.End
1322	}
1323	if ao.FadeInDuration != nil {
1324		objectMap["fadeInDuration"] = ao.FadeInDuration
1325	}
1326	if ao.FadeOutDuration != nil {
1327		objectMap["fadeOutDuration"] = ao.FadeOutDuration
1328	}
1329	if ao.AudioGainLevel != nil {
1330		objectMap["audioGainLevel"] = ao.AudioGainLevel
1331	}
1332	if ao.OdataType != "" {
1333		objectMap["@odata.type"] = ao.OdataType
1334	}
1335	return json.Marshal(objectMap)
1336}
1337
1338// AsAudioOverlay is the BasicOverlay implementation for AudioOverlay.
1339func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
1340	return &ao, true
1341}
1342
1343// AsVideoOverlay is the BasicOverlay implementation for AudioOverlay.
1344func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
1345	return nil, false
1346}
1347
1348// AsOverlay is the BasicOverlay implementation for AudioOverlay.
1349func (ao AudioOverlay) AsOverlay() (*Overlay, bool) {
1350	return nil, false
1351}
1352
1353// AsBasicOverlay is the BasicOverlay implementation for AudioOverlay.
1354func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) {
1355	return &ao, true
1356}
1357
1358// BasicAudioTrackDescriptor a TrackSelection to select audio tracks.
1359type BasicAudioTrackDescriptor interface {
1360	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
1361	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
1362	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
1363}
1364
1365// AudioTrackDescriptor a TrackSelection to select audio tracks.
1366type AudioTrackDescriptor struct {
1367	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'FrontLeft', 'FrontRight', 'Center', 'LowFrequencyEffects', 'BackLeft', 'BackRight', 'StereoLeft', 'StereoRight'
1368	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
1369	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
1370	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
1371}
1372
1373func unmarshalBasicAudioTrackDescriptor(body []byte) (BasicAudioTrackDescriptor, error) {
1374	var m map[string]interface{}
1375	err := json.Unmarshal(body, &m)
1376	if err != nil {
1377		return nil, err
1378	}
1379
1380	switch m["@odata.type"] {
1381	case string(OdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
1382		var satba SelectAudioTrackByAttribute
1383		err := json.Unmarshal(body, &satba)
1384		return satba, err
1385	case string(OdataTypeMicrosoftMediaSelectAudioTrackByID):
1386		var satbi SelectAudioTrackByID
1387		err := json.Unmarshal(body, &satbi)
1388		return satbi, err
1389	default:
1390		var atd AudioTrackDescriptor
1391		err := json.Unmarshal(body, &atd)
1392		return atd, err
1393	}
1394}
1395func unmarshalBasicAudioTrackDescriptorArray(body []byte) ([]BasicAudioTrackDescriptor, error) {
1396	var rawMessages []*json.RawMessage
1397	err := json.Unmarshal(body, &rawMessages)
1398	if err != nil {
1399		return nil, err
1400	}
1401
1402	atdArray := make([]BasicAudioTrackDescriptor, len(rawMessages))
1403
1404	for index, rawMessage := range rawMessages {
1405		atd, err := unmarshalBasicAudioTrackDescriptor(*rawMessage)
1406		if err != nil {
1407			return nil, err
1408		}
1409		atdArray[index] = atd
1410	}
1411	return atdArray, nil
1412}
1413
1414// MarshalJSON is the custom marshaler for AudioTrackDescriptor.
1415func (atd AudioTrackDescriptor) MarshalJSON() ([]byte, error) {
1416	atd.OdataType = OdataTypeMicrosoftMediaAudioTrackDescriptor
1417	objectMap := make(map[string]interface{})
1418	if atd.ChannelMapping != "" {
1419		objectMap["channelMapping"] = atd.ChannelMapping
1420	}
1421	if atd.OdataType != "" {
1422		objectMap["@odata.type"] = atd.OdataType
1423	}
1424	return json.Marshal(objectMap)
1425}
1426
1427// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1428func (atd AudioTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
1429	return &atd, true
1430}
1431
1432// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1433func (atd AudioTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
1434	return &atd, true
1435}
1436
1437// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1438func (atd AudioTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
1439	return nil, false
1440}
1441
1442// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1443func (atd AudioTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
1444	return nil, false
1445}
1446
1447// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1448func (atd AudioTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
1449	return nil, false
1450}
1451
1452// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1453func (atd AudioTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
1454	return nil, false
1455}
1456
1457// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1458func (atd AudioTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
1459	return nil, false
1460}
1461
1462// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1463func (atd AudioTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
1464	return nil, false
1465}
1466
1467// AsTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1468func (atd AudioTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
1469	return nil, false
1470}
1471
1472// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
1473func (atd AudioTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
1474	return &atd, true
1475}
1476
1477// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
1478type AzureEntityResource struct {
1479	// Etag - READ-ONLY; Resource Etag.
1480	Etag *string `json:"etag,omitempty"`
1481	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1482	ID *string `json:"id,omitempty"`
1483	// Name - READ-ONLY; The name of the resource
1484	Name *string `json:"name,omitempty"`
1485	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1486	Type *string `json:"type,omitempty"`
1487}
1488
1489// MarshalJSON is the custom marshaler for AzureEntityResource.
1490func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
1491	objectMap := make(map[string]interface{})
1492	return json.Marshal(objectMap)
1493}
1494
1495// BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard
1496// Encoder.
1497type BuiltInStandardEncoderPreset struct {
1498	// PresetName - The built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'ContentAwareEncodingExperimental', 'ContentAwareEncoding', 'CopyAllBitrateNonInterleaved', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD', 'H265ContentAwareEncoding', 'H265AdaptiveStreaming', 'H265SingleBitrate720p', 'H265SingleBitrate1080p', 'H265SingleBitrate4K'
1499	PresetName EncoderNamedPreset `json:"presetName,omitempty"`
1500	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
1501	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
1502}
1503
1504// MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset.
1505func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) {
1506	bisep.OdataType = OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset
1507	objectMap := make(map[string]interface{})
1508	if bisep.PresetName != "" {
1509		objectMap["presetName"] = bisep.PresetName
1510	}
1511	if bisep.OdataType != "" {
1512		objectMap["@odata.type"] = bisep.OdataType
1513	}
1514	return json.Marshal(objectMap)
1515}
1516
1517// AsFaceDetectorPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1518func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
1519	return nil, false
1520}
1521
1522// AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1523func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
1524	return nil, false
1525}
1526
1527// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1528func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
1529	return nil, false
1530}
1531
1532// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1533func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
1534	return &bisep, true
1535}
1536
1537// AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1538func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
1539	return nil, false
1540}
1541
1542// AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1543func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
1544	return nil, false
1545}
1546
1547// AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1548func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) {
1549	return nil, false
1550}
1551
1552// AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
1553func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
1554	return &bisep, true
1555}
1556
1557// CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming
1558// Policy
1559type CbcsDrmConfiguration struct {
1560	// FairPlay - FairPlay configurations
1561	FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"`
1562	// PlayReady - PlayReady configurations
1563	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
1564	// Widevine - Widevine configurations
1565	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
1566}
1567
1568// CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming
1569// Policy
1570type CencDrmConfiguration struct {
1571	// PlayReady - PlayReady configurations
1572	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
1573	// Widevine - Widevine configurations
1574	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
1575}
1576
1577// CheckNameAvailabilityInput the input to the check name availability request.
1578type CheckNameAvailabilityInput struct {
1579	// Name - The account name.
1580	Name *string `json:"name,omitempty"`
1581	// Type - The account type. For a Media Services account, this should be 'MediaServices'.
1582	Type *string `json:"type,omitempty"`
1583}
1584
1585// BasicClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position in
1586// the media.
1587type BasicClipTime interface {
1588	AsAbsoluteClipTime() (*AbsoluteClipTime, bool)
1589	AsUtcClipTime() (*UtcClipTime, bool)
1590	AsClipTime() (*ClipTime, bool)
1591}
1592
1593// ClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position
1594// in the media.
1595type ClipTime struct {
1596	// OdataType - Possible values include: 'OdataTypeClipTime', 'OdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeMicrosoftMediaUtcClipTime'
1597	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
1598}
1599
1600func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) {
1601	var m map[string]interface{}
1602	err := json.Unmarshal(body, &m)
1603	if err != nil {
1604		return nil, err
1605	}
1606
1607	switch m["@odata.type"] {
1608	case string(OdataTypeMicrosoftMediaAbsoluteClipTime):
1609		var act AbsoluteClipTime
1610		err := json.Unmarshal(body, &act)
1611		return act, err
1612	case string(OdataTypeMicrosoftMediaUtcClipTime):
1613		var uct UtcClipTime
1614		err := json.Unmarshal(body, &uct)
1615		return uct, err
1616	default:
1617		var ct ClipTime
1618		err := json.Unmarshal(body, &ct)
1619		return ct, err
1620	}
1621}
1622func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) {
1623	var rawMessages []*json.RawMessage
1624	err := json.Unmarshal(body, &rawMessages)
1625	if err != nil {
1626		return nil, err
1627	}
1628
1629	ctArray := make([]BasicClipTime, len(rawMessages))
1630
1631	for index, rawMessage := range rawMessages {
1632		ct, err := unmarshalBasicClipTime(*rawMessage)
1633		if err != nil {
1634			return nil, err
1635		}
1636		ctArray[index] = ct
1637	}
1638	return ctArray, nil
1639}
1640
1641// MarshalJSON is the custom marshaler for ClipTime.
1642func (ct ClipTime) MarshalJSON() ([]byte, error) {
1643	ct.OdataType = OdataTypeClipTime
1644	objectMap := make(map[string]interface{})
1645	if ct.OdataType != "" {
1646		objectMap["@odata.type"] = ct.OdataType
1647	}
1648	return json.Marshal(objectMap)
1649}
1650
1651// AsAbsoluteClipTime is the BasicClipTime implementation for ClipTime.
1652func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
1653	return nil, false
1654}
1655
1656// AsUtcClipTime is the BasicClipTime implementation for ClipTime.
1657func (ct ClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
1658	return nil, false
1659}
1660
1661// AsClipTime is the BasicClipTime implementation for ClipTime.
1662func (ct ClipTime) AsClipTime() (*ClipTime, bool) {
1663	return &ct, true
1664}
1665
1666// AsBasicClipTime is the BasicClipTime implementation for ClipTime.
1667func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) {
1668	return &ct, true
1669}
1670
1671// BasicCodec describes the basic properties of all codecs.
1672type BasicCodec interface {
1673	AsAudio() (*Audio, bool)
1674	AsBasicAudio() (BasicAudio, bool)
1675	AsAacAudio() (*AacAudio, bool)
1676	AsVideo() (*Video, bool)
1677	AsBasicVideo() (BasicVideo, bool)
1678	AsH265Video() (*H265Video, bool)
1679	AsCopyVideo() (*CopyVideo, bool)
1680	AsImage() (*Image, bool)
1681	AsBasicImage() (BasicImage, bool)
1682	AsCopyAudio() (*CopyAudio, bool)
1683	AsH264Video() (*H264Video, bool)
1684	AsJpgImage() (*JpgImage, bool)
1685	AsPngImage() (*PngImage, bool)
1686	AsCodec() (*Codec, bool)
1687}
1688
1689// Codec describes the basic properties of all codecs.
1690type Codec struct {
1691	// Label - An optional label for the codec. The label can be used to control muxing behavior.
1692	Label *string `json:"label,omitempty"`
1693	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
1694	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
1695}
1696
1697func unmarshalBasicCodec(body []byte) (BasicCodec, error) {
1698	var m map[string]interface{}
1699	err := json.Unmarshal(body, &m)
1700	if err != nil {
1701		return nil, err
1702	}
1703
1704	switch m["@odata.type"] {
1705	case string(OdataTypeMicrosoftMediaAudio):
1706		var a Audio
1707		err := json.Unmarshal(body, &a)
1708		return a, err
1709	case string(OdataTypeMicrosoftMediaAacAudio):
1710		var aa AacAudio
1711		err := json.Unmarshal(body, &aa)
1712		return aa, err
1713	case string(OdataTypeMicrosoftMediaVideo):
1714		var vVar Video
1715		err := json.Unmarshal(body, &vVar)
1716		return vVar, err
1717	case string(OdataTypeMicrosoftMediaH265Video):
1718		var hv H265Video
1719		err := json.Unmarshal(body, &hv)
1720		return hv, err
1721	case string(OdataTypeMicrosoftMediaCopyVideo):
1722		var cv CopyVideo
1723		err := json.Unmarshal(body, &cv)
1724		return cv, err
1725	case string(OdataTypeMicrosoftMediaImage):
1726		var i Image
1727		err := json.Unmarshal(body, &i)
1728		return i, err
1729	case string(OdataTypeMicrosoftMediaCopyAudio):
1730		var ca CopyAudio
1731		err := json.Unmarshal(body, &ca)
1732		return ca, err
1733	case string(OdataTypeMicrosoftMediaH264Video):
1734		var hv H264Video
1735		err := json.Unmarshal(body, &hv)
1736		return hv, err
1737	case string(OdataTypeMicrosoftMediaJpgImage):
1738		var ji JpgImage
1739		err := json.Unmarshal(body, &ji)
1740		return ji, err
1741	case string(OdataTypeMicrosoftMediaPngImage):
1742		var pi PngImage
1743		err := json.Unmarshal(body, &pi)
1744		return pi, err
1745	default:
1746		var c Codec
1747		err := json.Unmarshal(body, &c)
1748		return c, err
1749	}
1750}
1751func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) {
1752	var rawMessages []*json.RawMessage
1753	err := json.Unmarshal(body, &rawMessages)
1754	if err != nil {
1755		return nil, err
1756	}
1757
1758	cArray := make([]BasicCodec, len(rawMessages))
1759
1760	for index, rawMessage := range rawMessages {
1761		c, err := unmarshalBasicCodec(*rawMessage)
1762		if err != nil {
1763			return nil, err
1764		}
1765		cArray[index] = c
1766	}
1767	return cArray, nil
1768}
1769
1770// MarshalJSON is the custom marshaler for Codec.
1771func (c Codec) MarshalJSON() ([]byte, error) {
1772	c.OdataType = OdataTypeCodec
1773	objectMap := make(map[string]interface{})
1774	if c.Label != nil {
1775		objectMap["label"] = c.Label
1776	}
1777	if c.OdataType != "" {
1778		objectMap["@odata.type"] = c.OdataType
1779	}
1780	return json.Marshal(objectMap)
1781}
1782
1783// AsAudio is the BasicCodec implementation for Codec.
1784func (c Codec) AsAudio() (*Audio, bool) {
1785	return nil, false
1786}
1787
1788// AsBasicAudio is the BasicCodec implementation for Codec.
1789func (c Codec) AsBasicAudio() (BasicAudio, bool) {
1790	return nil, false
1791}
1792
1793// AsAacAudio is the BasicCodec implementation for Codec.
1794func (c Codec) AsAacAudio() (*AacAudio, bool) {
1795	return nil, false
1796}
1797
1798// AsVideo is the BasicCodec implementation for Codec.
1799func (c Codec) AsVideo() (*Video, bool) {
1800	return nil, false
1801}
1802
1803// AsBasicVideo is the BasicCodec implementation for Codec.
1804func (c Codec) AsBasicVideo() (BasicVideo, bool) {
1805	return nil, false
1806}
1807
1808// AsH265Video is the BasicCodec implementation for Codec.
1809func (c Codec) AsH265Video() (*H265Video, bool) {
1810	return nil, false
1811}
1812
1813// AsCopyVideo is the BasicCodec implementation for Codec.
1814func (c Codec) AsCopyVideo() (*CopyVideo, bool) {
1815	return nil, false
1816}
1817
1818// AsImage is the BasicCodec implementation for Codec.
1819func (c Codec) AsImage() (*Image, bool) {
1820	return nil, false
1821}
1822
1823// AsBasicImage is the BasicCodec implementation for Codec.
1824func (c Codec) AsBasicImage() (BasicImage, bool) {
1825	return nil, false
1826}
1827
1828// AsCopyAudio is the BasicCodec implementation for Codec.
1829func (c Codec) AsCopyAudio() (*CopyAudio, bool) {
1830	return nil, false
1831}
1832
1833// AsH264Video is the BasicCodec implementation for Codec.
1834func (c Codec) AsH264Video() (*H264Video, bool) {
1835	return nil, false
1836}
1837
1838// AsJpgImage is the BasicCodec implementation for Codec.
1839func (c Codec) AsJpgImage() (*JpgImage, bool) {
1840	return nil, false
1841}
1842
1843// AsPngImage is the BasicCodec implementation for Codec.
1844func (c Codec) AsPngImage() (*PngImage, bool) {
1845	return nil, false
1846}
1847
1848// AsCodec is the BasicCodec implementation for Codec.
1849func (c Codec) AsCodec() (*Codec, bool) {
1850	return &c, true
1851}
1852
1853// AsBasicCodec is the BasicCodec implementation for Codec.
1854func (c Codec) AsBasicCodec() (BasicCodec, bool) {
1855	return &c, true
1856}
1857
1858// CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme
1859type CommonEncryptionCbcs struct {
1860	// EnabledProtocols - Representing supported protocols
1861	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
1862	// ClearTracks - Representing which tracks should not be encrypted
1863	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
1864	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
1865	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
1866	// Drm - Configuration of DRMs for current encryption scheme
1867	Drm *CbcsDrmConfiguration `json:"drm,omitempty"`
1868}
1869
1870// CommonEncryptionCenc class for envelope encryption scheme
1871type CommonEncryptionCenc struct {
1872	// EnabledProtocols - Representing supported protocols
1873	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
1874	// ClearTracks - Representing which tracks should not be encrypted
1875	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
1876	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
1877	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
1878	// Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme
1879	Drm *CencDrmConfiguration `json:"drm,omitempty"`
1880}
1881
1882// ContentKeyPolicy a Content Key Policy resource.
1883type ContentKeyPolicy struct {
1884	autorest.Response           `json:"-"`
1885	*ContentKeyPolicyProperties `json:"properties,omitempty"`
1886	// SystemData - READ-ONLY; The system metadata relating to this resource.
1887	SystemData *SystemData `json:"systemData,omitempty"`
1888	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1889	ID *string `json:"id,omitempty"`
1890	// Name - READ-ONLY; The name of the resource
1891	Name *string `json:"name,omitempty"`
1892	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1893	Type *string `json:"type,omitempty"`
1894}
1895
1896// MarshalJSON is the custom marshaler for ContentKeyPolicy.
1897func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) {
1898	objectMap := make(map[string]interface{})
1899	if ckp.ContentKeyPolicyProperties != nil {
1900		objectMap["properties"] = ckp.ContentKeyPolicyProperties
1901	}
1902	return json.Marshal(objectMap)
1903}
1904
1905// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct.
1906func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error {
1907	var m map[string]*json.RawMessage
1908	err := json.Unmarshal(body, &m)
1909	if err != nil {
1910		return err
1911	}
1912	for k, v := range m {
1913		switch k {
1914		case "properties":
1915			if v != nil {
1916				var contentKeyPolicyProperties ContentKeyPolicyProperties
1917				err = json.Unmarshal(*v, &contentKeyPolicyProperties)
1918				if err != nil {
1919					return err
1920				}
1921				ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties
1922			}
1923		case "systemData":
1924			if v != nil {
1925				var systemData SystemData
1926				err = json.Unmarshal(*v, &systemData)
1927				if err != nil {
1928					return err
1929				}
1930				ckp.SystemData = &systemData
1931			}
1932		case "id":
1933			if v != nil {
1934				var ID string
1935				err = json.Unmarshal(*v, &ID)
1936				if err != nil {
1937					return err
1938				}
1939				ckp.ID = &ID
1940			}
1941		case "name":
1942			if v != nil {
1943				var name string
1944				err = json.Unmarshal(*v, &name)
1945				if err != nil {
1946					return err
1947				}
1948				ckp.Name = &name
1949			}
1950		case "type":
1951			if v != nil {
1952				var typeVar string
1953				err = json.Unmarshal(*v, &typeVar)
1954				if err != nil {
1955					return err
1956				}
1957				ckp.Type = &typeVar
1958			}
1959		}
1960	}
1961
1962	return nil
1963}
1964
1965// ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys.
1966type ContentKeyPolicyClearKeyConfiguration struct {
1967	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
1968	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
1969}
1970
1971// MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration.
1972func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) {
1973	ckpckc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration
1974	objectMap := make(map[string]interface{})
1975	if ckpckc.OdataType != "" {
1976		objectMap["@odata.type"] = ckpckc.OdataType
1977	}
1978	return json.Marshal(objectMap)
1979}
1980
1981// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
1982func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
1983	return &ckpckc, true
1984}
1985
1986// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
1987func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
1988	return nil, false
1989}
1990
1991// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
1992func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
1993	return nil, false
1994}
1995
1996// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
1997func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
1998	return nil, false
1999}
2000
2001// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
2002func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2003	return nil, false
2004}
2005
2006// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
2007func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2008	return nil, false
2009}
2010
2011// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
2012func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2013	return &ckpckc, true
2014}
2015
2016// ContentKeyPolicyCollection a collection of ContentKeyPolicy items.
2017type ContentKeyPolicyCollection struct {
2018	autorest.Response `json:"-"`
2019	// Value - A collection of ContentKeyPolicy items.
2020	Value *[]ContentKeyPolicy `json:"value,omitempty"`
2021	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
2022	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
2023}
2024
2025// ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values.
2026type ContentKeyPolicyCollectionIterator struct {
2027	i    int
2028	page ContentKeyPolicyCollectionPage
2029}
2030
2031// NextWithContext advances to the next value.  If there was an error making
2032// the request the iterator does not advance and the error is returned.
2033func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2034	if tracing.IsEnabled() {
2035		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext")
2036		defer func() {
2037			sc := -1
2038			if iter.Response().Response.Response != nil {
2039				sc = iter.Response().Response.Response.StatusCode
2040			}
2041			tracing.EndSpan(ctx, sc, err)
2042		}()
2043	}
2044	iter.i++
2045	if iter.i < len(iter.page.Values()) {
2046		return nil
2047	}
2048	err = iter.page.NextWithContext(ctx)
2049	if err != nil {
2050		iter.i--
2051		return err
2052	}
2053	iter.i = 0
2054	return nil
2055}
2056
2057// Next advances to the next value.  If there was an error making
2058// the request the iterator does not advance and the error is returned.
2059// Deprecated: Use NextWithContext() instead.
2060func (iter *ContentKeyPolicyCollectionIterator) Next() error {
2061	return iter.NextWithContext(context.Background())
2062}
2063
2064// NotDone returns true if the enumeration should be started or is not yet complete.
2065func (iter ContentKeyPolicyCollectionIterator) NotDone() bool {
2066	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2067}
2068
2069// Response returns the raw server response from the last page request.
2070func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection {
2071	return iter.page.Response()
2072}
2073
2074// Value returns the current value or a zero-initialized value if the
2075// iterator has advanced beyond the end of the collection.
2076func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy {
2077	if !iter.page.NotDone() {
2078		return ContentKeyPolicy{}
2079	}
2080	return iter.page.Values()[iter.i]
2081}
2082
2083// Creates a new instance of the ContentKeyPolicyCollectionIterator type.
2084func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator {
2085	return ContentKeyPolicyCollectionIterator{page: page}
2086}
2087
2088// IsEmpty returns true if the ListResult contains no values.
2089func (ckpc ContentKeyPolicyCollection) IsEmpty() bool {
2090	return ckpc.Value == nil || len(*ckpc.Value) == 0
2091}
2092
2093// hasNextLink returns true if the NextLink is not empty.
2094func (ckpc ContentKeyPolicyCollection) hasNextLink() bool {
2095	return ckpc.OdataNextLink != nil && len(*ckpc.OdataNextLink) != 0
2096}
2097
2098// contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results.
2099// It returns nil if no more results exist.
2100func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
2101	if !ckpc.hasNextLink() {
2102		return nil, nil
2103	}
2104	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2105		autorest.AsJSON(),
2106		autorest.AsGet(),
2107		autorest.WithBaseURL(to.String(ckpc.OdataNextLink)))
2108}
2109
2110// ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values.
2111type ContentKeyPolicyCollectionPage struct {
2112	fn   func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)
2113	ckpc ContentKeyPolicyCollection
2114}
2115
2116// NextWithContext advances to the next page of values.  If there was an error making
2117// the request the page does not advance and the error is returned.
2118func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
2119	if tracing.IsEnabled() {
2120		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext")
2121		defer func() {
2122			sc := -1
2123			if page.Response().Response.Response != nil {
2124				sc = page.Response().Response.Response.StatusCode
2125			}
2126			tracing.EndSpan(ctx, sc, err)
2127		}()
2128	}
2129	for {
2130		next, err := page.fn(ctx, page.ckpc)
2131		if err != nil {
2132			return err
2133		}
2134		page.ckpc = next
2135		if !next.hasNextLink() || !next.IsEmpty() {
2136			break
2137		}
2138	}
2139	return nil
2140}
2141
2142// Next advances to the next page of values.  If there was an error making
2143// the request the page does not advance and the error is returned.
2144// Deprecated: Use NextWithContext() instead.
2145func (page *ContentKeyPolicyCollectionPage) Next() error {
2146	return page.NextWithContext(context.Background())
2147}
2148
2149// NotDone returns true if the page enumeration should be started or is not yet complete.
2150func (page ContentKeyPolicyCollectionPage) NotDone() bool {
2151	return !page.ckpc.IsEmpty()
2152}
2153
2154// Response returns the raw server response from the last page request.
2155func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection {
2156	return page.ckpc
2157}
2158
2159// Values returns the slice of values for the current page or nil if there are no values.
2160func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy {
2161	if page.ckpc.IsEmpty() {
2162		return nil
2163	}
2164	return *page.ckpc.Value
2165}
2166
2167// Creates a new instance of the ContentKeyPolicyCollectionPage type.
2168func NewContentKeyPolicyCollectionPage(cur ContentKeyPolicyCollection, getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage {
2169	return ContentKeyPolicyCollectionPage{
2170		fn:   getNextPage,
2171		ckpc: cur,
2172	}
2173}
2174
2175// BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to
2176// create a configuration.
2177type BasicContentKeyPolicyConfiguration interface {
2178	AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool)
2179	AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool)
2180	AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool)
2181	AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool)
2182	AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool)
2183	AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool)
2184}
2185
2186// ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used
2187// to create a configuration.
2188type ContentKeyPolicyConfiguration struct {
2189	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
2190	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2191}
2192
2193func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) {
2194	var m map[string]interface{}
2195	err := json.Unmarshal(body, &m)
2196	if err != nil {
2197		return nil, err
2198	}
2199
2200	switch m["@odata.type"] {
2201	case string(OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration):
2202		var ckpckc ContentKeyPolicyClearKeyConfiguration
2203		err := json.Unmarshal(body, &ckpckc)
2204		return ckpckc, err
2205	case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration):
2206		var ckpuc ContentKeyPolicyUnknownConfiguration
2207		err := json.Unmarshal(body, &ckpuc)
2208		return ckpuc, err
2209	case string(OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration):
2210		var ckpwc ContentKeyPolicyWidevineConfiguration
2211		err := json.Unmarshal(body, &ckpwc)
2212		return ckpwc, err
2213	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration):
2214		var ckpprc ContentKeyPolicyPlayReadyConfiguration
2215		err := json.Unmarshal(body, &ckpprc)
2216		return ckpprc, err
2217	case string(OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration):
2218		var ckpfpc ContentKeyPolicyFairPlayConfiguration
2219		err := json.Unmarshal(body, &ckpfpc)
2220		return ckpfpc, err
2221	default:
2222		var ckpc ContentKeyPolicyConfiguration
2223		err := json.Unmarshal(body, &ckpc)
2224		return ckpc, err
2225	}
2226}
2227func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) {
2228	var rawMessages []*json.RawMessage
2229	err := json.Unmarshal(body, &rawMessages)
2230	if err != nil {
2231		return nil, err
2232	}
2233
2234	ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages))
2235
2236	for index, rawMessage := range rawMessages {
2237		ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage)
2238		if err != nil {
2239			return nil, err
2240		}
2241		ckpcArray[index] = ckpc
2242	}
2243	return ckpcArray, nil
2244}
2245
2246// MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration.
2247func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) {
2248	ckpc.OdataType = OdataTypeContentKeyPolicyConfiguration
2249	objectMap := make(map[string]interface{})
2250	if ckpc.OdataType != "" {
2251		objectMap["@odata.type"] = ckpc.OdataType
2252	}
2253	return json.Marshal(objectMap)
2254}
2255
2256// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2257func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2258	return nil, false
2259}
2260
2261// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2262func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2263	return nil, false
2264}
2265
2266// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2267func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2268	return nil, false
2269}
2270
2271// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2272func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2273	return nil, false
2274}
2275
2276// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2277func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2278	return nil, false
2279}
2280
2281// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2282func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2283	return &ckpc, true
2284}
2285
2286// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
2287func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2288	return &ckpc, true
2289}
2290
2291// ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses.
2292type ContentKeyPolicyFairPlayConfiguration struct {
2293	// Ask - The key that must be used as FairPlay Application Secret key.
2294	Ask *[]byte `json:"ask,omitempty"`
2295	// FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
2296	FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"`
2297	// FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
2298	FairPlayPfx *string `json:"fairPlayPfx,omitempty"`
2299	// RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'DualExpiry', 'PersistentUnlimited', 'PersistentLimited'
2300	RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"`
2301	// RentalDuration - The rental duration. Must be greater than or equal to 0.
2302	RentalDuration *int64 `json:"rentalDuration,omitempty"`
2303	// OfflineRentalConfiguration - Offline rental policy
2304	OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"`
2305	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
2306	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2307}
2308
2309// MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration.
2310func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) {
2311	ckpfpc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration
2312	objectMap := make(map[string]interface{})
2313	if ckpfpc.Ask != nil {
2314		objectMap["ask"] = ckpfpc.Ask
2315	}
2316	if ckpfpc.FairPlayPfxPassword != nil {
2317		objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword
2318	}
2319	if ckpfpc.FairPlayPfx != nil {
2320		objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx
2321	}
2322	if ckpfpc.RentalAndLeaseKeyType != "" {
2323		objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType
2324	}
2325	if ckpfpc.RentalDuration != nil {
2326		objectMap["rentalDuration"] = ckpfpc.RentalDuration
2327	}
2328	if ckpfpc.OfflineRentalConfiguration != nil {
2329		objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration
2330	}
2331	if ckpfpc.OdataType != "" {
2332		objectMap["@odata.type"] = ckpfpc.OdataType
2333	}
2334	return json.Marshal(objectMap)
2335}
2336
2337// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2338func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2339	return nil, false
2340}
2341
2342// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2343func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2344	return nil, false
2345}
2346
2347// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2348func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2349	return nil, false
2350}
2351
2352// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2353func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2354	return nil, false
2355}
2356
2357// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2358func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2359	return &ckpfpc, true
2360}
2361
2362// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2363func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2364	return nil, false
2365}
2366
2367// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
2368func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2369	return &ckpfpc, true
2370}
2371
2372// ContentKeyPolicyFairPlayOfflineRentalConfiguration ...
2373type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct {
2374	// PlaybackDurationSeconds - Playback duration
2375	PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"`
2376	// StorageDurationSeconds - Storage duration
2377	StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"`
2378}
2379
2380// ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on
2381// every request.
2382type ContentKeyPolicyOpenRestriction struct {
2383	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
2384	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
2385}
2386
2387// MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction.
2388func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) {
2389	ckpor.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction
2390	objectMap := make(map[string]interface{})
2391	if ckpor.OdataType != "" {
2392		objectMap["@odata.type"] = ckpor.OdataType
2393	}
2394	return json.Marshal(objectMap)
2395}
2396
2397// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
2398func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
2399	return &ckpor, true
2400}
2401
2402// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
2403func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
2404	return nil, false
2405}
2406
2407// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
2408func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
2409	return nil, false
2410}
2411
2412// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
2413func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
2414	return nil, false
2415}
2416
2417// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
2418func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
2419	return &ckpor, true
2420}
2421
2422// ContentKeyPolicyOption represents a policy option.
2423type ContentKeyPolicyOption struct {
2424	// PolicyOptionID - READ-ONLY; The legacy Policy Option ID.
2425	PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"`
2426	// Name - The Policy Option description.
2427	Name *string `json:"name,omitempty"`
2428	// Configuration - The key delivery configuration.
2429	Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"`
2430	// Restriction - The requirements that must be met to deliver keys with this configuration
2431	Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"`
2432}
2433
2434// MarshalJSON is the custom marshaler for ContentKeyPolicyOption.
2435func (ckpo ContentKeyPolicyOption) MarshalJSON() ([]byte, error) {
2436	objectMap := make(map[string]interface{})
2437	if ckpo.Name != nil {
2438		objectMap["name"] = ckpo.Name
2439	}
2440	objectMap["configuration"] = ckpo.Configuration
2441	objectMap["restriction"] = ckpo.Restriction
2442	return json.Marshal(objectMap)
2443}
2444
2445// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct.
2446func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error {
2447	var m map[string]*json.RawMessage
2448	err := json.Unmarshal(body, &m)
2449	if err != nil {
2450		return err
2451	}
2452	for k, v := range m {
2453		switch k {
2454		case "policyOptionId":
2455			if v != nil {
2456				var policyOptionID uuid.UUID
2457				err = json.Unmarshal(*v, &policyOptionID)
2458				if err != nil {
2459					return err
2460				}
2461				ckpo.PolicyOptionID = &policyOptionID
2462			}
2463		case "name":
2464			if v != nil {
2465				var name string
2466				err = json.Unmarshal(*v, &name)
2467				if err != nil {
2468					return err
2469				}
2470				ckpo.Name = &name
2471			}
2472		case "configuration":
2473			if v != nil {
2474				configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v)
2475				if err != nil {
2476					return err
2477				}
2478				ckpo.Configuration = configuration
2479			}
2480		case "restriction":
2481			if v != nil {
2482				restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v)
2483				if err != nil {
2484					return err
2485				}
2486				ckpo.Restriction = restriction
2487			}
2488		}
2489	}
2490
2491	return nil
2492}
2493
2494// ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses.
2495type ContentKeyPolicyPlayReadyConfiguration struct {
2496	// Licenses - The PlayReady licenses.
2497	Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"`
2498	// ResponseCustomData - The custom response data.
2499	ResponseCustomData *string `json:"responseCustomData,omitempty"`
2500	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
2501	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
2502}
2503
2504// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration.
2505func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) {
2506	ckpprc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration
2507	objectMap := make(map[string]interface{})
2508	if ckpprc.Licenses != nil {
2509		objectMap["licenses"] = ckpprc.Licenses
2510	}
2511	if ckpprc.ResponseCustomData != nil {
2512		objectMap["responseCustomData"] = ckpprc.ResponseCustomData
2513	}
2514	if ckpprc.OdataType != "" {
2515		objectMap["@odata.type"] = ckpprc.OdataType
2516	}
2517	return json.Marshal(objectMap)
2518}
2519
2520// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2521func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
2522	return nil, false
2523}
2524
2525// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2526func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
2527	return nil, false
2528}
2529
2530// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2531func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
2532	return nil, false
2533}
2534
2535// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2536func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
2537	return &ckpprc, true
2538}
2539
2540// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2541func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
2542	return nil, false
2543}
2544
2545// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2546func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
2547	return nil, false
2548}
2549
2550// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
2551func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
2552	return &ckpprc, true
2553}
2554
2555// ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the
2556// PlayReady header.
2557type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct {
2558	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
2559	OdataType OdataType `json:"@odata.type,omitempty"`
2560}
2561
2562// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
2563func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) {
2564	ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
2565	objectMap := make(map[string]interface{})
2566	if ckpprcekfh.OdataType != "" {
2567		objectMap["@odata.type"] = ckpprcekfh.OdataType
2568	}
2569	return json.Marshal(objectMap)
2570}
2571
2572// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
2573func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2574	return &ckpprcekfh, true
2575}
2576
2577// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
2578func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2579	return nil, false
2580}
2581
2582// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
2583func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2584	return nil, false
2585}
2586
2587// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
2588func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2589	return &ckpprcekfh, true
2590}
2591
2592// ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is
2593// specified in the PlayReady configuration.
2594type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct {
2595	// KeyID - The content key ID.
2596	KeyID *uuid.UUID `json:"keyId,omitempty"`
2597	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
2598	OdataType OdataType `json:"@odata.type,omitempty"`
2599}
2600
2601// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
2602func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) {
2603	ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
2604	objectMap := make(map[string]interface{})
2605	if ckpprcekfki.KeyID != nil {
2606		objectMap["keyId"] = ckpprcekfki.KeyID
2607	}
2608	if ckpprcekfki.OdataType != "" {
2609		objectMap["@odata.type"] = ckpprcekfki.OdataType
2610	}
2611	return json.Marshal(objectMap)
2612}
2613
2614// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
2615func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2616	return nil, false
2617}
2618
2619// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
2620func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2621	return &ckpprcekfki, true
2622}
2623
2624// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
2625func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2626	return nil, false
2627}
2628
2629// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
2630func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2631	return &ckpprcekfki, true
2632}
2633
2634// BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
2635// used to represent the location.
2636type BasicContentKeyPolicyPlayReadyContentKeyLocation interface {
2637	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool)
2638	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool)
2639	AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool)
2640}
2641
2642// ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
2643// used to represent the location.
2644type ContentKeyPolicyPlayReadyContentKeyLocation struct {
2645	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
2646	OdataType OdataType `json:"@odata.type,omitempty"`
2647}
2648
2649func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
2650	var m map[string]interface{}
2651	err := json.Unmarshal(body, &m)
2652	if err != nil {
2653		return nil, err
2654	}
2655
2656	switch m["@odata.type"] {
2657	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader):
2658		var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
2659		err := json.Unmarshal(body, &ckpprcekfh)
2660		return ckpprcekfh, err
2661	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier):
2662		var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
2663		err := json.Unmarshal(body, &ckpprcekfki)
2664		return ckpprcekfki, err
2665	default:
2666		var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation
2667		err := json.Unmarshal(body, &ckpprckl)
2668		return ckpprckl, err
2669	}
2670}
2671func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
2672	var rawMessages []*json.RawMessage
2673	err := json.Unmarshal(body, &rawMessages)
2674	if err != nil {
2675		return nil, err
2676	}
2677
2678	ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages))
2679
2680	for index, rawMessage := range rawMessages {
2681		ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage)
2682		if err != nil {
2683			return nil, err
2684		}
2685		ckpprcklArray[index] = ckpprckl
2686	}
2687	return ckpprcklArray, nil
2688}
2689
2690// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation.
2691func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) {
2692	ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation
2693	objectMap := make(map[string]interface{})
2694	if ckpprckl.OdataType != "" {
2695		objectMap["@odata.type"] = ckpprckl.OdataType
2696	}
2697	return json.Marshal(objectMap)
2698}
2699
2700// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
2701func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
2702	return nil, false
2703}
2704
2705// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
2706func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
2707	return nil, false
2708}
2709
2710// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
2711func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2712	return &ckpprckl, true
2713}
2714
2715// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
2716func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
2717	return &ckpprckl, true
2718}
2719
2720// ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television
2721// Output Restriction control bits. For further details see the PlayReady Compliance Rules.
2722type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct {
2723	// BestEffort - Indicates whether this restriction is enforced on a Best Effort basis.
2724	BestEffort *bool `json:"bestEffort,omitempty"`
2725	// ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive.
2726	ConfigurationData *int32 `json:"configurationData,omitempty"`
2727}
2728
2729// ContentKeyPolicyPlayReadyLicense the PlayReady license
2730type ContentKeyPolicyPlayReadyLicense struct {
2731	// AllowTestDevices - A flag indicating whether test devices can use the license.
2732	AllowTestDevices *bool `json:"allowTestDevices,omitempty"`
2733	// BeginDate - The begin date of license
2734	BeginDate *date.Time `json:"beginDate,omitempty"`
2735	// ExpirationDate - The expiration date of license.
2736	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
2737	// RelativeBeginDate - The relative begin date of license.
2738	RelativeBeginDate *string `json:"relativeBeginDate,omitempty"`
2739	// RelativeExpirationDate - The relative expiration date of license.
2740	RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"`
2741	// GracePeriod - The grace period of license.
2742	GracePeriod *string `json:"gracePeriod,omitempty"`
2743	// PlayRight - The license PlayRight
2744	PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"`
2745	// LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent'
2746	LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"`
2747	// ContentKeyLocation - The content key location.
2748	ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"`
2749	// ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming'
2750	ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"`
2751}
2752
2753// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct.
2754func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error {
2755	var m map[string]*json.RawMessage
2756	err := json.Unmarshal(body, &m)
2757	if err != nil {
2758		return err
2759	}
2760	for k, v := range m {
2761		switch k {
2762		case "allowTestDevices":
2763			if v != nil {
2764				var allowTestDevices bool
2765				err = json.Unmarshal(*v, &allowTestDevices)
2766				if err != nil {
2767					return err
2768				}
2769				ckpprl.AllowTestDevices = &allowTestDevices
2770			}
2771		case "beginDate":
2772			if v != nil {
2773				var beginDate date.Time
2774				err = json.Unmarshal(*v, &beginDate)
2775				if err != nil {
2776					return err
2777				}
2778				ckpprl.BeginDate = &beginDate
2779			}
2780		case "expirationDate":
2781			if v != nil {
2782				var expirationDate date.Time
2783				err = json.Unmarshal(*v, &expirationDate)
2784				if err != nil {
2785					return err
2786				}
2787				ckpprl.ExpirationDate = &expirationDate
2788			}
2789		case "relativeBeginDate":
2790			if v != nil {
2791				var relativeBeginDate string
2792				err = json.Unmarshal(*v, &relativeBeginDate)
2793				if err != nil {
2794					return err
2795				}
2796				ckpprl.RelativeBeginDate = &relativeBeginDate
2797			}
2798		case "relativeExpirationDate":
2799			if v != nil {
2800				var relativeExpirationDate string
2801				err = json.Unmarshal(*v, &relativeExpirationDate)
2802				if err != nil {
2803					return err
2804				}
2805				ckpprl.RelativeExpirationDate = &relativeExpirationDate
2806			}
2807		case "gracePeriod":
2808			if v != nil {
2809				var gracePeriod string
2810				err = json.Unmarshal(*v, &gracePeriod)
2811				if err != nil {
2812					return err
2813				}
2814				ckpprl.GracePeriod = &gracePeriod
2815			}
2816		case "playRight":
2817			if v != nil {
2818				var playRight ContentKeyPolicyPlayReadyPlayRight
2819				err = json.Unmarshal(*v, &playRight)
2820				if err != nil {
2821					return err
2822				}
2823				ckpprl.PlayRight = &playRight
2824			}
2825		case "licenseType":
2826			if v != nil {
2827				var licenseType ContentKeyPolicyPlayReadyLicenseType
2828				err = json.Unmarshal(*v, &licenseType)
2829				if err != nil {
2830					return err
2831				}
2832				ckpprl.LicenseType = licenseType
2833			}
2834		case "contentKeyLocation":
2835			if v != nil {
2836				contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v)
2837				if err != nil {
2838					return err
2839				}
2840				ckpprl.ContentKeyLocation = contentKeyLocation
2841			}
2842		case "contentType":
2843			if v != nil {
2844				var contentType ContentKeyPolicyPlayReadyContentType
2845				err = json.Unmarshal(*v, &contentType)
2846				if err != nil {
2847					return err
2848				}
2849				ckpprl.ContentType = contentType
2850			}
2851		}
2852	}
2853
2854	return nil
2855}
2856
2857// ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license.
2858type ContentKeyPolicyPlayReadyPlayRight struct {
2859	// FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content.
2860	FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"`
2861	// ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive.
2862	ScmsRestriction *int32 `json:"scmsRestriction,omitempty"`
2863	// AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive.
2864	AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"`
2865	// ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive.
2866	ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"`
2867	// DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
2868	DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"`
2869	// ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
2870	ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"`
2871	// ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
2872	ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"`
2873	// AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction'
2874	AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"`
2875	// UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video.
2876	UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"`
2877	// CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video.
2878	CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"`
2879	// AnalogVideoOpl - Specifies the output protection level for compressed digital audio.
2880	AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"`
2881	// CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio.
2882	CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"`
2883	// UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio.
2884	UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"`
2885}
2886
2887// ContentKeyPolicyProperties the properties of the Content Key Policy.
2888type ContentKeyPolicyProperties struct {
2889	autorest.Response `json:"-"`
2890	// PolicyID - READ-ONLY; The legacy Policy ID.
2891	PolicyID *uuid.UUID `json:"policyId,omitempty"`
2892	// Created - READ-ONLY; The creation date of the Policy
2893	Created *date.Time `json:"created,omitempty"`
2894	// LastModified - READ-ONLY; The last modified date of the Policy
2895	LastModified *date.Time `json:"lastModified,omitempty"`
2896	// Description - A description for the Policy.
2897	Description *string `json:"description,omitempty"`
2898	// Options - The Key Policy options.
2899	Options *[]ContentKeyPolicyOption `json:"options,omitempty"`
2900}
2901
2902// MarshalJSON is the custom marshaler for ContentKeyPolicyProperties.
2903func (ckpp ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) {
2904	objectMap := make(map[string]interface{})
2905	if ckpp.Description != nil {
2906		objectMap["description"] = ckpp.Description
2907	}
2908	if ckpp.Options != nil {
2909		objectMap["options"] = ckpp.Options
2910	}
2911	return json.Marshal(objectMap)
2912}
2913
2914// BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
2915// create a restriction.
2916type BasicContentKeyPolicyRestriction interface {
2917	AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool)
2918	AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool)
2919	AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool)
2920	AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool)
2921}
2922
2923// ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
2924// create a restriction.
2925type ContentKeyPolicyRestriction struct {
2926	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
2927	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
2928}
2929
2930func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) {
2931	var m map[string]interface{}
2932	err := json.Unmarshal(body, &m)
2933	if err != nil {
2934		return nil, err
2935	}
2936
2937	switch m["@odata.type"] {
2938	case string(OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction):
2939		var ckpor ContentKeyPolicyOpenRestriction
2940		err := json.Unmarshal(body, &ckpor)
2941		return ckpor, err
2942	case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction):
2943		var ckpur ContentKeyPolicyUnknownRestriction
2944		err := json.Unmarshal(body, &ckpur)
2945		return ckpur, err
2946	case string(OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction):
2947		var ckptr ContentKeyPolicyTokenRestriction
2948		err := json.Unmarshal(body, &ckptr)
2949		return ckptr, err
2950	default:
2951		var ckpr ContentKeyPolicyRestriction
2952		err := json.Unmarshal(body, &ckpr)
2953		return ckpr, err
2954	}
2955}
2956func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) {
2957	var rawMessages []*json.RawMessage
2958	err := json.Unmarshal(body, &rawMessages)
2959	if err != nil {
2960		return nil, err
2961	}
2962
2963	ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages))
2964
2965	for index, rawMessage := range rawMessages {
2966		ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage)
2967		if err != nil {
2968			return nil, err
2969		}
2970		ckprArray[index] = ckpr
2971	}
2972	return ckprArray, nil
2973}
2974
2975// MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction.
2976func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) {
2977	ckpr.OdataType = OdataTypeContentKeyPolicyRestriction
2978	objectMap := make(map[string]interface{})
2979	if ckpr.OdataType != "" {
2980		objectMap["@odata.type"] = ckpr.OdataType
2981	}
2982	return json.Marshal(objectMap)
2983}
2984
2985// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
2986func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
2987	return nil, false
2988}
2989
2990// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
2991func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
2992	return nil, false
2993}
2994
2995// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
2996func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
2997	return nil, false
2998}
2999
3000// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
3001func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3002	return &ckpr, true
3003}
3004
3005// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
3006func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3007	return &ckpr, true
3008}
3009
3010// BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class
3011// must be used to create a token key.
3012type BasicContentKeyPolicyRestrictionTokenKey interface {
3013	AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool)
3014	AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool)
3015	AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool)
3016	AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool)
3017}
3018
3019// ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived
3020// class must be used to create a token key.
3021type ContentKeyPolicyRestrictionTokenKey struct {
3022	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
3023	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3024}
3025
3026func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) {
3027	var m map[string]interface{}
3028	err := json.Unmarshal(body, &m)
3029	if err != nil {
3030		return nil, err
3031	}
3032
3033	switch m["@odata.type"] {
3034	case string(OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey):
3035		var ckpstk ContentKeyPolicySymmetricTokenKey
3036		err := json.Unmarshal(body, &ckpstk)
3037		return ckpstk, err
3038	case string(OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey):
3039		var ckprtk ContentKeyPolicyRsaTokenKey
3040		err := json.Unmarshal(body, &ckprtk)
3041		return ckprtk, err
3042	case string(OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey):
3043		var ckpxctk ContentKeyPolicyX509CertificateTokenKey
3044		err := json.Unmarshal(body, &ckpxctk)
3045		return ckpxctk, err
3046	default:
3047		var ckprtk ContentKeyPolicyRestrictionTokenKey
3048		err := json.Unmarshal(body, &ckprtk)
3049		return ckprtk, err
3050	}
3051}
3052func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) {
3053	var rawMessages []*json.RawMessage
3054	err := json.Unmarshal(body, &rawMessages)
3055	if err != nil {
3056		return nil, err
3057	}
3058
3059	ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages))
3060
3061	for index, rawMessage := range rawMessages {
3062		ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage)
3063		if err != nil {
3064			return nil, err
3065		}
3066		ckprtkArray[index] = ckprtk
3067	}
3068	return ckprtkArray, nil
3069}
3070
3071// MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey.
3072func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) {
3073	ckprtk.OdataType = OdataTypeContentKeyPolicyRestrictionTokenKey
3074	objectMap := make(map[string]interface{})
3075	if ckprtk.OdataType != "" {
3076		objectMap["@odata.type"] = ckprtk.OdataType
3077	}
3078	return json.Marshal(objectMap)
3079}
3080
3081// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
3082func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3083	return nil, false
3084}
3085
3086// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
3087func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3088	return nil, false
3089}
3090
3091// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
3092func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3093	return nil, false
3094}
3095
3096// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
3097func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3098	return &ckprtk, true
3099}
3100
3101// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
3102func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3103	return &ckprtk, true
3104}
3105
3106// ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation
3107type ContentKeyPolicyRsaTokenKey struct {
3108	// Exponent - The RSA Parameter exponent
3109	Exponent *[]byte `json:"exponent,omitempty"`
3110	// Modulus - The RSA Parameter modulus
3111	Modulus *[]byte `json:"modulus,omitempty"`
3112	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
3113	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3114}
3115
3116// MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey.
3117func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) {
3118	ckprtk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey
3119	objectMap := make(map[string]interface{})
3120	if ckprtk.Exponent != nil {
3121		objectMap["exponent"] = ckprtk.Exponent
3122	}
3123	if ckprtk.Modulus != nil {
3124		objectMap["modulus"] = ckprtk.Modulus
3125	}
3126	if ckprtk.OdataType != "" {
3127		objectMap["@odata.type"] = ckprtk.OdataType
3128	}
3129	return json.Marshal(objectMap)
3130}
3131
3132// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
3133func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3134	return nil, false
3135}
3136
3137// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
3138func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3139	return &ckprtk, true
3140}
3141
3142// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
3143func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3144	return nil, false
3145}
3146
3147// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
3148func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3149	return nil, false
3150}
3151
3152// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
3153func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3154	return &ckprtk, true
3155}
3156
3157// ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation.
3158type ContentKeyPolicySymmetricTokenKey struct {
3159	// KeyValue - The key value of the key
3160	KeyValue *[]byte `json:"keyValue,omitempty"`
3161	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
3162	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3163}
3164
3165// MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey.
3166func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) {
3167	ckpstk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey
3168	objectMap := make(map[string]interface{})
3169	if ckpstk.KeyValue != nil {
3170		objectMap["keyValue"] = ckpstk.KeyValue
3171	}
3172	if ckpstk.OdataType != "" {
3173		objectMap["@odata.type"] = ckpstk.OdataType
3174	}
3175	return json.Marshal(objectMap)
3176}
3177
3178// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
3179func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3180	return &ckpstk, true
3181}
3182
3183// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
3184func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3185	return nil, false
3186}
3187
3188// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
3189func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3190	return nil, false
3191}
3192
3193// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
3194func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3195	return nil, false
3196}
3197
3198// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
3199func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3200	return &ckpstk, true
3201}
3202
3203// ContentKeyPolicyTokenClaim represents a token claim.
3204type ContentKeyPolicyTokenClaim struct {
3205	// ClaimType - Token claim type.
3206	ClaimType *string `json:"claimType,omitempty"`
3207	// ClaimValue - Token claim value.
3208	ClaimValue *string `json:"claimValue,omitempty"`
3209}
3210
3211// ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these
3212// requirements for successful license or key delivery.
3213type ContentKeyPolicyTokenRestriction struct {
3214	// Issuer - The token issuer.
3215	Issuer *string `json:"issuer,omitempty"`
3216	// Audience - The audience for the token.
3217	Audience *string `json:"audience,omitempty"`
3218	// PrimaryVerificationKey - The primary verification key.
3219	PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"`
3220	// AlternateVerificationKeys - A list of alternative verification keys.
3221	AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"`
3222	// RequiredClaims - A list of required token claims.
3223	RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"`
3224	// RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt'
3225	RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"`
3226	// OpenIDConnectDiscoveryDocument - The OpenID connect discovery document.
3227	OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"`
3228	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
3229	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
3230}
3231
3232// MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction.
3233func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) {
3234	ckptr.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction
3235	objectMap := make(map[string]interface{})
3236	if ckptr.Issuer != nil {
3237		objectMap["issuer"] = ckptr.Issuer
3238	}
3239	if ckptr.Audience != nil {
3240		objectMap["audience"] = ckptr.Audience
3241	}
3242	objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey
3243	if ckptr.AlternateVerificationKeys != nil {
3244		objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys
3245	}
3246	if ckptr.RequiredClaims != nil {
3247		objectMap["requiredClaims"] = ckptr.RequiredClaims
3248	}
3249	if ckptr.RestrictionTokenType != "" {
3250		objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType
3251	}
3252	if ckptr.OpenIDConnectDiscoveryDocument != nil {
3253		objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument
3254	}
3255	if ckptr.OdataType != "" {
3256		objectMap["@odata.type"] = ckptr.OdataType
3257	}
3258	return json.Marshal(objectMap)
3259}
3260
3261// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
3262func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
3263	return nil, false
3264}
3265
3266// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
3267func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
3268	return nil, false
3269}
3270
3271// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
3272func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
3273	return &ckptr, true
3274}
3275
3276// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
3277func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3278	return nil, false
3279}
3280
3281// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
3282func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3283	return &ckptr, true
3284}
3285
3286// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct.
3287func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error {
3288	var m map[string]*json.RawMessage
3289	err := json.Unmarshal(body, &m)
3290	if err != nil {
3291		return err
3292	}
3293	for k, v := range m {
3294		switch k {
3295		case "issuer":
3296			if v != nil {
3297				var issuer string
3298				err = json.Unmarshal(*v, &issuer)
3299				if err != nil {
3300					return err
3301				}
3302				ckptr.Issuer = &issuer
3303			}
3304		case "audience":
3305			if v != nil {
3306				var audience string
3307				err = json.Unmarshal(*v, &audience)
3308				if err != nil {
3309					return err
3310				}
3311				ckptr.Audience = &audience
3312			}
3313		case "primaryVerificationKey":
3314			if v != nil {
3315				primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v)
3316				if err != nil {
3317					return err
3318				}
3319				ckptr.PrimaryVerificationKey = primaryVerificationKey
3320			}
3321		case "alternateVerificationKeys":
3322			if v != nil {
3323				alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v)
3324				if err != nil {
3325					return err
3326				}
3327				ckptr.AlternateVerificationKeys = &alternateVerificationKeys
3328			}
3329		case "requiredClaims":
3330			if v != nil {
3331				var requiredClaims []ContentKeyPolicyTokenClaim
3332				err = json.Unmarshal(*v, &requiredClaims)
3333				if err != nil {
3334					return err
3335				}
3336				ckptr.RequiredClaims = &requiredClaims
3337			}
3338		case "restrictionTokenType":
3339			if v != nil {
3340				var restrictionTokenType ContentKeyPolicyRestrictionTokenType
3341				err = json.Unmarshal(*v, &restrictionTokenType)
3342				if err != nil {
3343					return err
3344				}
3345				ckptr.RestrictionTokenType = restrictionTokenType
3346			}
3347		case "openIdConnectDiscoveryDocument":
3348			if v != nil {
3349				var openIDConnectDiscoveryDocument string
3350				err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument)
3351				if err != nil {
3352					return err
3353				}
3354				ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument
3355			}
3356		case "@odata.type":
3357			if v != nil {
3358				var odataType OdataTypeBasicContentKeyPolicyRestriction
3359				err = json.Unmarshal(*v, &odataType)
3360				if err != nil {
3361					return err
3362				}
3363				ckptr.OdataType = odataType
3364			}
3365		}
3366	}
3367
3368	return nil
3369}
3370
3371// ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in
3372// the current API version.
3373type ContentKeyPolicyUnknownConfiguration struct {
3374	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
3375	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
3376}
3377
3378// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration.
3379func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) {
3380	ckpuc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration
3381	objectMap := make(map[string]interface{})
3382	if ckpuc.OdataType != "" {
3383		objectMap["@odata.type"] = ckpuc.OdataType
3384	}
3385	return json.Marshal(objectMap)
3386}
3387
3388// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3389func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
3390	return nil, false
3391}
3392
3393// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3394func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
3395	return &ckpuc, true
3396}
3397
3398// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3399func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
3400	return nil, false
3401}
3402
3403// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3404func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
3405	return nil, false
3406}
3407
3408// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3409func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
3410	return nil, false
3411}
3412
3413// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3414func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
3415	return nil, false
3416}
3417
3418// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
3419func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
3420	return &ckpuc, true
3421}
3422
3423// ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the
3424// current API version.
3425type ContentKeyPolicyUnknownRestriction struct {
3426	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
3427	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
3428}
3429
3430// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction.
3431func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) {
3432	ckpur.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction
3433	objectMap := make(map[string]interface{})
3434	if ckpur.OdataType != "" {
3435		objectMap["@odata.type"] = ckpur.OdataType
3436	}
3437	return json.Marshal(objectMap)
3438}
3439
3440// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
3441func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
3442	return nil, false
3443}
3444
3445// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
3446func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
3447	return &ckpur, true
3448}
3449
3450// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
3451func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
3452	return nil, false
3453}
3454
3455// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
3456func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
3457	return nil, false
3458}
3459
3460// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
3461func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
3462	return &ckpur, true
3463}
3464
3465// ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses.
3466type ContentKeyPolicyWidevineConfiguration struct {
3467	// WidevineTemplate - The Widevine template.
3468	WidevineTemplate *string `json:"widevineTemplate,omitempty"`
3469	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
3470	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
3471}
3472
3473// MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration.
3474func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) {
3475	ckpwc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration
3476	objectMap := make(map[string]interface{})
3477	if ckpwc.WidevineTemplate != nil {
3478		objectMap["widevineTemplate"] = ckpwc.WidevineTemplate
3479	}
3480	if ckpwc.OdataType != "" {
3481		objectMap["@odata.type"] = ckpwc.OdataType
3482	}
3483	return json.Marshal(objectMap)
3484}
3485
3486// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3487func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
3488	return nil, false
3489}
3490
3491// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3492func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
3493	return nil, false
3494}
3495
3496// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3497func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
3498	return &ckpwc, true
3499}
3500
3501// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3502func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
3503	return nil, false
3504}
3505
3506// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3507func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
3508	return nil, false
3509}
3510
3511// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3512func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
3513	return nil, false
3514}
3515
3516// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
3517func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
3518	return &ckpwc, true
3519}
3520
3521// ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation.
3522type ContentKeyPolicyX509CertificateTokenKey struct {
3523	// RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET)
3524	RawBody *[]byte `json:"rawBody,omitempty"`
3525	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
3526	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
3527}
3528
3529// MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey.
3530func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) {
3531	ckpxctk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey
3532	objectMap := make(map[string]interface{})
3533	if ckpxctk.RawBody != nil {
3534		objectMap["rawBody"] = ckpxctk.RawBody
3535	}
3536	if ckpxctk.OdataType != "" {
3537		objectMap["@odata.type"] = ckpxctk.OdataType
3538	}
3539	return json.Marshal(objectMap)
3540}
3541
3542// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
3543func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
3544	return nil, false
3545}
3546
3547// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
3548func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
3549	return nil, false
3550}
3551
3552// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
3553func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
3554	return &ckpxctk, true
3555}
3556
3557// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
3558func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
3559	return nil, false
3560}
3561
3562// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
3563func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
3564	return &ckpxctk, true
3565}
3566
3567// CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream.
3568type CopyAudio struct {
3569	// Label - An optional label for the codec. The label can be used to control muxing behavior.
3570	Label *string `json:"label,omitempty"`
3571	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
3572	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
3573}
3574
3575// MarshalJSON is the custom marshaler for CopyAudio.
3576func (ca CopyAudio) MarshalJSON() ([]byte, error) {
3577	ca.OdataType = OdataTypeMicrosoftMediaCopyAudio
3578	objectMap := make(map[string]interface{})
3579	if ca.Label != nil {
3580		objectMap["label"] = ca.Label
3581	}
3582	if ca.OdataType != "" {
3583		objectMap["@odata.type"] = ca.OdataType
3584	}
3585	return json.Marshal(objectMap)
3586}
3587
3588// AsAudio is the BasicCodec implementation for CopyAudio.
3589func (ca CopyAudio) AsAudio() (*Audio, bool) {
3590	return nil, false
3591}
3592
3593// AsBasicAudio is the BasicCodec implementation for CopyAudio.
3594func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) {
3595	return nil, false
3596}
3597
3598// AsAacAudio is the BasicCodec implementation for CopyAudio.
3599func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) {
3600	return nil, false
3601}
3602
3603// AsVideo is the BasicCodec implementation for CopyAudio.
3604func (ca CopyAudio) AsVideo() (*Video, bool) {
3605	return nil, false
3606}
3607
3608// AsBasicVideo is the BasicCodec implementation for CopyAudio.
3609func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) {
3610	return nil, false
3611}
3612
3613// AsH265Video is the BasicCodec implementation for CopyAudio.
3614func (ca CopyAudio) AsH265Video() (*H265Video, bool) {
3615	return nil, false
3616}
3617
3618// AsCopyVideo is the BasicCodec implementation for CopyAudio.
3619func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) {
3620	return nil, false
3621}
3622
3623// AsImage is the BasicCodec implementation for CopyAudio.
3624func (ca CopyAudio) AsImage() (*Image, bool) {
3625	return nil, false
3626}
3627
3628// AsBasicImage is the BasicCodec implementation for CopyAudio.
3629func (ca CopyAudio) AsBasicImage() (BasicImage, bool) {
3630	return nil, false
3631}
3632
3633// AsCopyAudio is the BasicCodec implementation for CopyAudio.
3634func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) {
3635	return &ca, true
3636}
3637
3638// AsH264Video is the BasicCodec implementation for CopyAudio.
3639func (ca CopyAudio) AsH264Video() (*H264Video, bool) {
3640	return nil, false
3641}
3642
3643// AsJpgImage is the BasicCodec implementation for CopyAudio.
3644func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) {
3645	return nil, false
3646}
3647
3648// AsPngImage is the BasicCodec implementation for CopyAudio.
3649func (ca CopyAudio) AsPngImage() (*PngImage, bool) {
3650	return nil, false
3651}
3652
3653// AsCodec is the BasicCodec implementation for CopyAudio.
3654func (ca CopyAudio) AsCodec() (*Codec, bool) {
3655	return nil, false
3656}
3657
3658// AsBasicCodec is the BasicCodec implementation for CopyAudio.
3659func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) {
3660	return &ca, true
3661}
3662
3663// CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding.
3664type CopyVideo struct {
3665	// Label - An optional label for the codec. The label can be used to control muxing behavior.
3666	Label *string `json:"label,omitempty"`
3667	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
3668	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
3669}
3670
3671// MarshalJSON is the custom marshaler for CopyVideo.
3672func (cv CopyVideo) MarshalJSON() ([]byte, error) {
3673	cv.OdataType = OdataTypeMicrosoftMediaCopyVideo
3674	objectMap := make(map[string]interface{})
3675	if cv.Label != nil {
3676		objectMap["label"] = cv.Label
3677	}
3678	if cv.OdataType != "" {
3679		objectMap["@odata.type"] = cv.OdataType
3680	}
3681	return json.Marshal(objectMap)
3682}
3683
3684// AsAudio is the BasicCodec implementation for CopyVideo.
3685func (cv CopyVideo) AsAudio() (*Audio, bool) {
3686	return nil, false
3687}
3688
3689// AsBasicAudio is the BasicCodec implementation for CopyVideo.
3690func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) {
3691	return nil, false
3692}
3693
3694// AsAacAudio is the BasicCodec implementation for CopyVideo.
3695func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) {
3696	return nil, false
3697}
3698
3699// AsVideo is the BasicCodec implementation for CopyVideo.
3700func (cv CopyVideo) AsVideo() (*Video, bool) {
3701	return nil, false
3702}
3703
3704// AsBasicVideo is the BasicCodec implementation for CopyVideo.
3705func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) {
3706	return nil, false
3707}
3708
3709// AsH265Video is the BasicCodec implementation for CopyVideo.
3710func (cv CopyVideo) AsH265Video() (*H265Video, bool) {
3711	return nil, false
3712}
3713
3714// AsCopyVideo is the BasicCodec implementation for CopyVideo.
3715func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) {
3716	return &cv, true
3717}
3718
3719// AsImage is the BasicCodec implementation for CopyVideo.
3720func (cv CopyVideo) AsImage() (*Image, bool) {
3721	return nil, false
3722}
3723
3724// AsBasicImage is the BasicCodec implementation for CopyVideo.
3725func (cv CopyVideo) AsBasicImage() (BasicImage, bool) {
3726	return nil, false
3727}
3728
3729// AsCopyAudio is the BasicCodec implementation for CopyVideo.
3730func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) {
3731	return nil, false
3732}
3733
3734// AsH264Video is the BasicCodec implementation for CopyVideo.
3735func (cv CopyVideo) AsH264Video() (*H264Video, bool) {
3736	return nil, false
3737}
3738
3739// AsJpgImage is the BasicCodec implementation for CopyVideo.
3740func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) {
3741	return nil, false
3742}
3743
3744// AsPngImage is the BasicCodec implementation for CopyVideo.
3745func (cv CopyVideo) AsPngImage() (*PngImage, bool) {
3746	return nil, false
3747}
3748
3749// AsCodec is the BasicCodec implementation for CopyVideo.
3750func (cv CopyVideo) AsCodec() (*Codec, bool) {
3751	return nil, false
3752}
3753
3754// AsBasicCodec is the BasicCodec implementation for CopyVideo.
3755func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) {
3756	return &cv, true
3757}
3758
3759// CrossSiteAccessPolicies the client access policy.
3760type CrossSiteAccessPolicies struct {
3761	// ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight.
3762	ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"`
3763	// CrossDomainPolicy - The content of crossdomain.xml used by Silverlight.
3764	CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"`
3765}
3766
3767// DefaultKey class to specify properties of default content key for each encryption scheme
3768type DefaultKey struct {
3769	// Label - Label can be used to specify Content Key when creating a Streaming Locator
3770	Label *string `json:"label,omitempty"`
3771	// PolicyName - Policy used by Default Key
3772	PolicyName *string `json:"policyName,omitempty"`
3773}
3774
3775// Deinterlace describes the de-interlacing settings.
3776type Deinterlace struct {
3777	// Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'
3778	Parity DeinterlaceParity `json:"parity,omitempty"`
3779	// Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'
3780	Mode DeinterlaceMode `json:"mode,omitempty"`
3781}
3782
3783// EdgePolicies ...
3784type EdgePolicies struct {
3785	autorest.Response         `json:"-"`
3786	UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"`
3787}
3788
3789// EdgeUsageDataCollectionPolicy ...
3790type EdgeUsageDataCollectionPolicy struct {
3791	// DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H.
3792	DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"`
3793	// DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H.
3794	DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"`
3795	// MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data.
3796	MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"`
3797	// EventHubDetails - Details of Event Hub where the usage will be reported.
3798	EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"`
3799}
3800
3801// EdgeUsageDataEventHub ...
3802type EdgeUsageDataEventHub struct {
3803	// Name - Name of the Event Hub where usage will be reported.
3804	Name *string `json:"name,omitempty"`
3805	// Namespace - Namespace of the Event Hub where usage will be reported.
3806	Namespace *string `json:"namespace,omitempty"`
3807	// Token - SAS token needed to interact with Event Hub.
3808	Token *string `json:"token,omitempty"`
3809}
3810
3811// EnabledProtocols class to specify which protocols are enabled
3812type EnabledProtocols struct {
3813	// Download - Enable Download protocol or not
3814	Download *bool `json:"download,omitempty"`
3815	// Dash - Enable DASH protocol or not
3816	Dash *bool `json:"dash,omitempty"`
3817	// Hls - Enable HLS protocol or not
3818	Hls *bool `json:"hls,omitempty"`
3819	// SmoothStreaming - Enable SmoothStreaming protocol or not
3820	SmoothStreaming *bool `json:"smoothStreaming,omitempty"`
3821}
3822
3823// EntityNameAvailabilityCheckOutput the response from the check name availability request.
3824type EntityNameAvailabilityCheckOutput struct {
3825	autorest.Response `json:"-"`
3826	// NameAvailable - Specifies if the name is available.
3827	NameAvailable *bool `json:"nameAvailable,omitempty"`
3828	// Reason - Specifies the reason if the name is not available.
3829	Reason *string `json:"reason,omitempty"`
3830	// Message - Specifies the detailed reason if the name is not available.
3831	Message *string `json:"message,omitempty"`
3832}
3833
3834// EnvelopeEncryption class for EnvelopeEncryption encryption scheme
3835type EnvelopeEncryption struct {
3836	// EnabledProtocols - Representing supported protocols
3837	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
3838	// ClearTracks - Representing which tracks should not be encrypted
3839	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
3840	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
3841	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
3842	// CustomKeyAcquisitionURLTemplate - Template for the URL of the custom service delivering keys to end user players.  Not required when using Azure Media Services for issuing keys.  The template supports replaceable tokens that the service will update at runtime with the value specific to the request.  The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested.
3843	CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"`
3844}
3845
3846// FaceDetectorPreset describes all the settings to be used when analyzing a video in order to detect (and
3847// optionally redact) all the faces present.
3848type FaceDetectorPreset struct {
3849	// Resolution - Specifies the maximum resolution at which your video is analyzed. The default behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using "StandardDefinition" will resize input videos to standard definition while preserving the appropriate aspect ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high resolution video. It may also reduce the cost of using this component (see https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end up being too small in the resized video may not be detected. Possible values include: 'SourceResolution', 'StandardDefinition'
3850	Resolution AnalysisResolution `json:"resolution,omitempty"`
3851	// Mode - This mode provides the ability to choose between the following settings: 1) Analyze - For detection only.This mode generates a metadata JSON file marking appearances of faces throughout the video.Where possible, appearances of the same person are assigned the same ID. 2) Combined - Additionally redacts(blurs) detected faces. 3) Redact - This enables a 2-pass process, allowing for selective redaction of a subset of detected faces.It takes in the metadata file from a prior analyze pass, along with the source video, and a user-selected subset of IDs that require redaction. Possible values include: 'Analyze', 'Redact', 'Combined'
3852	Mode FaceRedactorMode `json:"mode,omitempty"`
3853	// BlurType - Blur type. Possible values include: 'Box', 'Low', 'Med', 'High', 'Black'
3854	BlurType BlurType `json:"blurType,omitempty"`
3855	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
3856	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
3857	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
3858	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
3859}
3860
3861// MarshalJSON is the custom marshaler for FaceDetectorPreset.
3862func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) {
3863	fdp.OdataType = OdataTypeMicrosoftMediaFaceDetectorPreset
3864	objectMap := make(map[string]interface{})
3865	if fdp.Resolution != "" {
3866		objectMap["resolution"] = fdp.Resolution
3867	}
3868	if fdp.Mode != "" {
3869		objectMap["mode"] = fdp.Mode
3870	}
3871	if fdp.BlurType != "" {
3872		objectMap["blurType"] = fdp.BlurType
3873	}
3874	if fdp.ExperimentalOptions != nil {
3875		objectMap["experimentalOptions"] = fdp.ExperimentalOptions
3876	}
3877	if fdp.OdataType != "" {
3878		objectMap["@odata.type"] = fdp.OdataType
3879	}
3880	return json.Marshal(objectMap)
3881}
3882
3883// AsFaceDetectorPreset is the BasicPreset implementation for FaceDetectorPreset.
3884func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
3885	return &fdp, true
3886}
3887
3888// AsAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
3889func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
3890	return nil, false
3891}
3892
3893// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
3894func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
3895	return nil, false
3896}
3897
3898// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
3899func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
3900	return nil, false
3901}
3902
3903// AsStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
3904func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
3905	return nil, false
3906}
3907
3908// AsVideoAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
3909func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
3910	return nil, false
3911}
3912
3913// AsPreset is the BasicPreset implementation for FaceDetectorPreset.
3914func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) {
3915	return nil, false
3916}
3917
3918// AsBasicPreset is the BasicPreset implementation for FaceDetectorPreset.
3919func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) {
3920	return &fdp, true
3921}
3922
3923// FilterProperties the Media Filter properties.
3924type FilterProperties struct {
3925	// PresentationTimeRange - The presentation time range.
3926	PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"`
3927	// FirstQuality - The first quality.
3928	FirstQuality *FirstQuality `json:"firstQuality,omitempty"`
3929	// Tracks - The tracks selection conditions.
3930	Tracks *[]FilterTrackSelection `json:"tracks,omitempty"`
3931}
3932
3933// Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be
3934// applied to the input media before encoding.
3935type Filters struct {
3936	// Deinterlace - The de-interlacing settings.
3937	Deinterlace *Deinterlace `json:"deinterlace,omitempty"`
3938	// Rotation - The rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'RotationAuto', 'RotationNone', 'RotationRotate0', 'RotationRotate90', 'RotationRotate180', 'RotationRotate270'
3939	Rotation Rotation `json:"rotation,omitempty"`
3940	// Crop - The parameters for the rectangular window with which to crop the input video.
3941	Crop *Rectangle `json:"crop,omitempty"`
3942	// Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays.
3943	Overlays *[]BasicOverlay `json:"overlays,omitempty"`
3944}
3945
3946// UnmarshalJSON is the custom unmarshaler for Filters struct.
3947func (f *Filters) UnmarshalJSON(body []byte) error {
3948	var m map[string]*json.RawMessage
3949	err := json.Unmarshal(body, &m)
3950	if err != nil {
3951		return err
3952	}
3953	for k, v := range m {
3954		switch k {
3955		case "deinterlace":
3956			if v != nil {
3957				var deinterlace Deinterlace
3958				err = json.Unmarshal(*v, &deinterlace)
3959				if err != nil {
3960					return err
3961				}
3962				f.Deinterlace = &deinterlace
3963			}
3964		case "rotation":
3965			if v != nil {
3966				var rotation Rotation
3967				err = json.Unmarshal(*v, &rotation)
3968				if err != nil {
3969					return err
3970				}
3971				f.Rotation = rotation
3972			}
3973		case "crop":
3974			if v != nil {
3975				var crop Rectangle
3976				err = json.Unmarshal(*v, &crop)
3977				if err != nil {
3978					return err
3979				}
3980				f.Crop = &crop
3981			}
3982		case "overlays":
3983			if v != nil {
3984				overlays, err := unmarshalBasicOverlayArray(*v)
3985				if err != nil {
3986					return err
3987				}
3988				f.Overlays = &overlays
3989			}
3990		}
3991	}
3992
3993	return nil
3994}
3995
3996// FilterTrackPropertyCondition the class to specify one track property condition.
3997type FilterTrackPropertyCondition struct {
3998	// Property - The track property type. Possible values include: 'FilterTrackPropertyTypeUnknown', 'FilterTrackPropertyTypeType', 'FilterTrackPropertyTypeName', 'FilterTrackPropertyTypeLanguage', 'FilterTrackPropertyTypeFourCC', 'FilterTrackPropertyTypeBitrate'
3999	Property FilterTrackPropertyType `json:"property,omitempty"`
4000	// Value - The track property value.
4001	Value *string `json:"value,omitempty"`
4002	// Operation - The track property condition operation. Possible values include: 'Equal', 'NotEqual'
4003	Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"`
4004}
4005
4006// FilterTrackSelection representing a list of FilterTrackPropertyConditions to select a track.  The
4007// filters are combined using a logical AND operation.
4008type FilterTrackSelection struct {
4009	// TrackSelections - The track selections.
4010	TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"`
4011}
4012
4013// FirstQuality filter First Quality
4014type FirstQuality struct {
4015	// Bitrate - The first quality bitrate.
4016	Bitrate *int32 `json:"bitrate,omitempty"`
4017}
4018
4019// BasicFormat base class for output.
4020type BasicFormat interface {
4021	AsImageFormat() (*ImageFormat, bool)
4022	AsBasicImageFormat() (BasicImageFormat, bool)
4023	AsJpgFormat() (*JpgFormat, bool)
4024	AsPngFormat() (*PngFormat, bool)
4025	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
4026	AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool)
4027	AsMp4Format() (*Mp4Format, bool)
4028	AsTransportStreamFormat() (*TransportStreamFormat, bool)
4029	AsFormat() (*Format, bool)
4030}
4031
4032// Format base class for output.
4033type Format struct {
4034	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
4035	FilenamePattern *string `json:"filenamePattern,omitempty"`
4036	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
4037	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
4038}
4039
4040func unmarshalBasicFormat(body []byte) (BasicFormat, error) {
4041	var m map[string]interface{}
4042	err := json.Unmarshal(body, &m)
4043	if err != nil {
4044		return nil, err
4045	}
4046
4047	switch m["@odata.type"] {
4048	case string(OdataTypeMicrosoftMediaImageFormat):
4049		var ifVar ImageFormat
4050		err := json.Unmarshal(body, &ifVar)
4051		return ifVar, err
4052	case string(OdataTypeMicrosoftMediaJpgFormat):
4053		var jf JpgFormat
4054		err := json.Unmarshal(body, &jf)
4055		return jf, err
4056	case string(OdataTypeMicrosoftMediaPngFormat):
4057		var pf PngFormat
4058		err := json.Unmarshal(body, &pf)
4059		return pf, err
4060	case string(OdataTypeMicrosoftMediaMultiBitrateFormat):
4061		var mbf MultiBitrateFormat
4062		err := json.Unmarshal(body, &mbf)
4063		return mbf, err
4064	case string(OdataTypeMicrosoftMediaMp4Format):
4065		var m4f Mp4Format
4066		err := json.Unmarshal(body, &m4f)
4067		return m4f, err
4068	case string(OdataTypeMicrosoftMediaTransportStreamFormat):
4069		var tsf TransportStreamFormat
4070		err := json.Unmarshal(body, &tsf)
4071		return tsf, err
4072	default:
4073		var f Format
4074		err := json.Unmarshal(body, &f)
4075		return f, err
4076	}
4077}
4078func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) {
4079	var rawMessages []*json.RawMessage
4080	err := json.Unmarshal(body, &rawMessages)
4081	if err != nil {
4082		return nil, err
4083	}
4084
4085	fArray := make([]BasicFormat, len(rawMessages))
4086
4087	for index, rawMessage := range rawMessages {
4088		f, err := unmarshalBasicFormat(*rawMessage)
4089		if err != nil {
4090			return nil, err
4091		}
4092		fArray[index] = f
4093	}
4094	return fArray, nil
4095}
4096
4097// MarshalJSON is the custom marshaler for Format.
4098func (f Format) MarshalJSON() ([]byte, error) {
4099	f.OdataType = OdataTypeFormat
4100	objectMap := make(map[string]interface{})
4101	if f.FilenamePattern != nil {
4102		objectMap["filenamePattern"] = f.FilenamePattern
4103	}
4104	if f.OdataType != "" {
4105		objectMap["@odata.type"] = f.OdataType
4106	}
4107	return json.Marshal(objectMap)
4108}
4109
4110// AsImageFormat is the BasicFormat implementation for Format.
4111func (f Format) AsImageFormat() (*ImageFormat, bool) {
4112	return nil, false
4113}
4114
4115// AsBasicImageFormat is the BasicFormat implementation for Format.
4116func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) {
4117	return nil, false
4118}
4119
4120// AsJpgFormat is the BasicFormat implementation for Format.
4121func (f Format) AsJpgFormat() (*JpgFormat, bool) {
4122	return nil, false
4123}
4124
4125// AsPngFormat is the BasicFormat implementation for Format.
4126func (f Format) AsPngFormat() (*PngFormat, bool) {
4127	return nil, false
4128}
4129
4130// AsMultiBitrateFormat is the BasicFormat implementation for Format.
4131func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
4132	return nil, false
4133}
4134
4135// AsBasicMultiBitrateFormat is the BasicFormat implementation for Format.
4136func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
4137	return nil, false
4138}
4139
4140// AsMp4Format is the BasicFormat implementation for Format.
4141func (f Format) AsMp4Format() (*Mp4Format, bool) {
4142	return nil, false
4143}
4144
4145// AsTransportStreamFormat is the BasicFormat implementation for Format.
4146func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
4147	return nil, false
4148}
4149
4150// AsFormat is the BasicFormat implementation for Format.
4151func (f Format) AsFormat() (*Format, bool) {
4152	return &f, true
4153}
4154
4155// AsBasicFormat is the BasicFormat implementation for Format.
4156func (f Format) AsBasicFormat() (BasicFormat, bool) {
4157	return &f, true
4158}
4159
4160// FromAllInputFile an InputDefinition that looks across all of the files provided to select tracks
4161// specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and
4162// VideoTrackByAttribute to allow selection of a single track across a set of input files.
4163type FromAllInputFile struct {
4164	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
4165	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
4166	// OdataType - Possible values include: 'OdataTypeInputDefinition', 'OdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeMicrosoftMediaInputFile'
4167	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
4168}
4169
4170// MarshalJSON is the custom marshaler for FromAllInputFile.
4171func (faif FromAllInputFile) MarshalJSON() ([]byte, error) {
4172	faif.OdataType = OdataTypeMicrosoftMediaFromAllInputFile
4173	objectMap := make(map[string]interface{})
4174	if faif.IncludedTracks != nil {
4175		objectMap["includedTracks"] = faif.IncludedTracks
4176	}
4177	if faif.OdataType != "" {
4178		objectMap["@odata.type"] = faif.OdataType
4179	}
4180	return json.Marshal(objectMap)
4181}
4182
4183// AsFromAllInputFile is the BasicInputDefinition implementation for FromAllInputFile.
4184func (faif FromAllInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
4185	return &faif, true
4186}
4187
4188// AsFromEachInputFile is the BasicInputDefinition implementation for FromAllInputFile.
4189func (faif FromAllInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
4190	return nil, false
4191}
4192
4193// AsInputFile is the BasicInputDefinition implementation for FromAllInputFile.
4194func (faif FromAllInputFile) AsInputFile() (*InputFile, bool) {
4195	return nil, false
4196}
4197
4198// AsInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
4199func (faif FromAllInputFile) AsInputDefinition() (*InputDefinition, bool) {
4200	return nil, false
4201}
4202
4203// AsBasicInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
4204func (faif FromAllInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
4205	return &faif, true
4206}
4207
4208// UnmarshalJSON is the custom unmarshaler for FromAllInputFile struct.
4209func (faif *FromAllInputFile) UnmarshalJSON(body []byte) error {
4210	var m map[string]*json.RawMessage
4211	err := json.Unmarshal(body, &m)
4212	if err != nil {
4213		return err
4214	}
4215	for k, v := range m {
4216		switch k {
4217		case "includedTracks":
4218			if v != nil {
4219				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
4220				if err != nil {
4221					return err
4222				}
4223				faif.IncludedTracks = &includedTracks
4224			}
4225		case "@odata.type":
4226			if v != nil {
4227				var odataType OdataTypeBasicInputDefinition
4228				err = json.Unmarshal(*v, &odataType)
4229				if err != nil {
4230					return err
4231				}
4232				faif.OdataType = odataType
4233			}
4234		}
4235	}
4236
4237	return nil
4238}
4239
4240// FromEachInputFile an InputDefinition that looks at each input file provided to select tracks specified
4241// by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute
4242// to select tracks from each file given.
4243type FromEachInputFile struct {
4244	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
4245	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
4246	// OdataType - Possible values include: 'OdataTypeInputDefinition', 'OdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeMicrosoftMediaInputFile'
4247	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
4248}
4249
4250// MarshalJSON is the custom marshaler for FromEachInputFile.
4251func (feif FromEachInputFile) MarshalJSON() ([]byte, error) {
4252	feif.OdataType = OdataTypeMicrosoftMediaFromEachInputFile
4253	objectMap := make(map[string]interface{})
4254	if feif.IncludedTracks != nil {
4255		objectMap["includedTracks"] = feif.IncludedTracks
4256	}
4257	if feif.OdataType != "" {
4258		objectMap["@odata.type"] = feif.OdataType
4259	}
4260	return json.Marshal(objectMap)
4261}
4262
4263// AsFromAllInputFile is the BasicInputDefinition implementation for FromEachInputFile.
4264func (feif FromEachInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
4265	return nil, false
4266}
4267
4268// AsFromEachInputFile is the BasicInputDefinition implementation for FromEachInputFile.
4269func (feif FromEachInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
4270	return &feif, true
4271}
4272
4273// AsInputFile is the BasicInputDefinition implementation for FromEachInputFile.
4274func (feif FromEachInputFile) AsInputFile() (*InputFile, bool) {
4275	return nil, false
4276}
4277
4278// AsInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
4279func (feif FromEachInputFile) AsInputDefinition() (*InputDefinition, bool) {
4280	return nil, false
4281}
4282
4283// AsBasicInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
4284func (feif FromEachInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
4285	return &feif, true
4286}
4287
4288// UnmarshalJSON is the custom unmarshaler for FromEachInputFile struct.
4289func (feif *FromEachInputFile) UnmarshalJSON(body []byte) error {
4290	var m map[string]*json.RawMessage
4291	err := json.Unmarshal(body, &m)
4292	if err != nil {
4293		return err
4294	}
4295	for k, v := range m {
4296		switch k {
4297		case "includedTracks":
4298			if v != nil {
4299				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
4300				if err != nil {
4301					return err
4302				}
4303				feif.IncludedTracks = &includedTracks
4304			}
4305		case "@odata.type":
4306			if v != nil {
4307				var odataType OdataTypeBasicInputDefinition
4308				err = json.Unmarshal(*v, &odataType)
4309				if err != nil {
4310					return err
4311				}
4312				feif.OdataType = odataType
4313			}
4314		}
4315	}
4316
4317	return nil
4318}
4319
4320// H264Layer describes the settings to be used when encoding the input video into a desired output bitrate
4321// layer with the H.264 video codec.
4322type H264Layer struct {
4323	// Profile - We currently support Baseline, Main, High, High422, High444. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444'
4324	Profile H264VideoProfile `json:"profile,omitempty"`
4325	// Level - We currently support Level up to 6.2. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer.
4326	Level *string `json:"level,omitempty"`
4327	// BufferWindow - The VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S).
4328	BufferWindow *string `json:"bufferWindow,omitempty"`
4329	// ReferenceFrames - The number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting.
4330	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
4331	// EntropyMode - The entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'
4332	EntropyMode EntropyMode `json:"entropyMode,omitempty"`
4333	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
4334	Bitrate *int32 `json:"bitrate,omitempty"`
4335	// MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate.
4336	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4337	// BFrames - The number of B-frames to be used when encoding this layer.  If not specified, the encoder chooses an appropriate number based on the video profile and level.
4338	BFrames *int32 `json:"bFrames,omitempty"`
4339	// FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video.
4340	FrameRate *string `json:"frameRate,omitempty"`
4341	// Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame.
4342	Slices *int32 `json:"slices,omitempty"`
4343	// AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
4344	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4345	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
4346	Width *string `json:"width,omitempty"`
4347	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
4348	Height *string `json:"height,omitempty"`
4349	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
4350	Label *string `json:"label,omitempty"`
4351	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
4352	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4353}
4354
4355// MarshalJSON is the custom marshaler for H264Layer.
4356func (hl H264Layer) MarshalJSON() ([]byte, error) {
4357	hl.OdataType = OdataTypeMicrosoftMediaH264Layer
4358	objectMap := make(map[string]interface{})
4359	if hl.Profile != "" {
4360		objectMap["profile"] = hl.Profile
4361	}
4362	if hl.Level != nil {
4363		objectMap["level"] = hl.Level
4364	}
4365	if hl.BufferWindow != nil {
4366		objectMap["bufferWindow"] = hl.BufferWindow
4367	}
4368	if hl.ReferenceFrames != nil {
4369		objectMap["referenceFrames"] = hl.ReferenceFrames
4370	}
4371	if hl.EntropyMode != "" {
4372		objectMap["entropyMode"] = hl.EntropyMode
4373	}
4374	if hl.Bitrate != nil {
4375		objectMap["bitrate"] = hl.Bitrate
4376	}
4377	if hl.MaxBitrate != nil {
4378		objectMap["maxBitrate"] = hl.MaxBitrate
4379	}
4380	if hl.BFrames != nil {
4381		objectMap["bFrames"] = hl.BFrames
4382	}
4383	if hl.FrameRate != nil {
4384		objectMap["frameRate"] = hl.FrameRate
4385	}
4386	if hl.Slices != nil {
4387		objectMap["slices"] = hl.Slices
4388	}
4389	if hl.AdaptiveBFrame != nil {
4390		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
4391	}
4392	if hl.Width != nil {
4393		objectMap["width"] = hl.Width
4394	}
4395	if hl.Height != nil {
4396		objectMap["height"] = hl.Height
4397	}
4398	if hl.Label != nil {
4399		objectMap["label"] = hl.Label
4400	}
4401	if hl.OdataType != "" {
4402		objectMap["@odata.type"] = hl.OdataType
4403	}
4404	return json.Marshal(objectMap)
4405}
4406
4407// AsH265VideoLayer is the BasicLayer implementation for H264Layer.
4408func (hl H264Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4409	return nil, false
4410}
4411
4412// AsBasicH265VideoLayer is the BasicLayer implementation for H264Layer.
4413func (hl H264Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4414	return nil, false
4415}
4416
4417// AsH265Layer is the BasicLayer implementation for H264Layer.
4418func (hl H264Layer) AsH265Layer() (*H265Layer, bool) {
4419	return nil, false
4420}
4421
4422// AsVideoLayer is the BasicLayer implementation for H264Layer.
4423func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) {
4424	return nil, false
4425}
4426
4427// AsBasicVideoLayer is the BasicLayer implementation for H264Layer.
4428func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4429	return &hl, true
4430}
4431
4432// AsH264Layer is the BasicLayer implementation for H264Layer.
4433func (hl H264Layer) AsH264Layer() (*H264Layer, bool) {
4434	return &hl, true
4435}
4436
4437// AsJpgLayer is the BasicLayer implementation for H264Layer.
4438func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) {
4439	return nil, false
4440}
4441
4442// AsPngLayer is the BasicLayer implementation for H264Layer.
4443func (hl H264Layer) AsPngLayer() (*PngLayer, bool) {
4444	return nil, false
4445}
4446
4447// AsLayer is the BasicLayer implementation for H264Layer.
4448func (hl H264Layer) AsLayer() (*Layer, bool) {
4449	return nil, false
4450}
4451
4452// AsBasicLayer is the BasicLayer implementation for H264Layer.
4453func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) {
4454	return &hl, true
4455}
4456
4457// H264Video describes all the properties for encoding a video with the H.264 codec.
4458type H264Video struct {
4459	// SceneChangeDetection - Whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video.
4460	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
4461	// Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'
4462	Complexity H264Complexity `json:"complexity,omitempty"`
4463	// Layers - The collection of output H.264 layers to be produced by the encoder.
4464	Layers *[]H264Layer `json:"layers,omitempty"`
4465	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
4466	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
4467	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
4468	StretchMode StretchMode `json:"stretchMode,omitempty"`
4469	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
4470	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
4471	// Label - An optional label for the codec. The label can be used to control muxing behavior.
4472	Label *string `json:"label,omitempty"`
4473	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
4474	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
4475}
4476
4477// MarshalJSON is the custom marshaler for H264Video.
4478func (hv H264Video) MarshalJSON() ([]byte, error) {
4479	hv.OdataType = OdataTypeMicrosoftMediaH264Video
4480	objectMap := make(map[string]interface{})
4481	if hv.SceneChangeDetection != nil {
4482		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
4483	}
4484	if hv.Complexity != "" {
4485		objectMap["complexity"] = hv.Complexity
4486	}
4487	if hv.Layers != nil {
4488		objectMap["layers"] = hv.Layers
4489	}
4490	if hv.KeyFrameInterval != nil {
4491		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
4492	}
4493	if hv.StretchMode != "" {
4494		objectMap["stretchMode"] = hv.StretchMode
4495	}
4496	if hv.SyncMode != "" {
4497		objectMap["syncMode"] = hv.SyncMode
4498	}
4499	if hv.Label != nil {
4500		objectMap["label"] = hv.Label
4501	}
4502	if hv.OdataType != "" {
4503		objectMap["@odata.type"] = hv.OdataType
4504	}
4505	return json.Marshal(objectMap)
4506}
4507
4508// AsAudio is the BasicCodec implementation for H264Video.
4509func (hv H264Video) AsAudio() (*Audio, bool) {
4510	return nil, false
4511}
4512
4513// AsBasicAudio is the BasicCodec implementation for H264Video.
4514func (hv H264Video) AsBasicAudio() (BasicAudio, bool) {
4515	return nil, false
4516}
4517
4518// AsAacAudio is the BasicCodec implementation for H264Video.
4519func (hv H264Video) AsAacAudio() (*AacAudio, bool) {
4520	return nil, false
4521}
4522
4523// AsVideo is the BasicCodec implementation for H264Video.
4524func (hv H264Video) AsVideo() (*Video, bool) {
4525	return nil, false
4526}
4527
4528// AsBasicVideo is the BasicCodec implementation for H264Video.
4529func (hv H264Video) AsBasicVideo() (BasicVideo, bool) {
4530	return &hv, true
4531}
4532
4533// AsH265Video is the BasicCodec implementation for H264Video.
4534func (hv H264Video) AsH265Video() (*H265Video, bool) {
4535	return nil, false
4536}
4537
4538// AsCopyVideo is the BasicCodec implementation for H264Video.
4539func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) {
4540	return nil, false
4541}
4542
4543// AsImage is the BasicCodec implementation for H264Video.
4544func (hv H264Video) AsImage() (*Image, bool) {
4545	return nil, false
4546}
4547
4548// AsBasicImage is the BasicCodec implementation for H264Video.
4549func (hv H264Video) AsBasicImage() (BasicImage, bool) {
4550	return nil, false
4551}
4552
4553// AsCopyAudio is the BasicCodec implementation for H264Video.
4554func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) {
4555	return nil, false
4556}
4557
4558// AsH264Video is the BasicCodec implementation for H264Video.
4559func (hv H264Video) AsH264Video() (*H264Video, bool) {
4560	return &hv, true
4561}
4562
4563// AsJpgImage is the BasicCodec implementation for H264Video.
4564func (hv H264Video) AsJpgImage() (*JpgImage, bool) {
4565	return nil, false
4566}
4567
4568// AsPngImage is the BasicCodec implementation for H264Video.
4569func (hv H264Video) AsPngImage() (*PngImage, bool) {
4570	return nil, false
4571}
4572
4573// AsCodec is the BasicCodec implementation for H264Video.
4574func (hv H264Video) AsCodec() (*Codec, bool) {
4575	return nil, false
4576}
4577
4578// AsBasicCodec is the BasicCodec implementation for H264Video.
4579func (hv H264Video) AsBasicCodec() (BasicCodec, bool) {
4580	return &hv, true
4581}
4582
4583// H265Layer describes the settings to be used when encoding the input video into a desired output bitrate
4584// layer with the H.265 video codec.
4585type H265Layer struct {
4586	// Profile - We currently support Main. Default is Auto. Possible values include: 'H265VideoProfileAuto', 'H265VideoProfileMain'
4587	Profile H265VideoProfile `json:"profile,omitempty"`
4588	// Level - We currently support Level up to 6.2. The value can be Auto, or a number that matches the H.265 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer.
4589	Level *string `json:"level,omitempty"`
4590	// BufferWindow - The VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S).
4591	BufferWindow *string `json:"bufferWindow,omitempty"`
4592	// ReferenceFrames - The number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting.
4593	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
4594	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this value should be 3000000 This is a required field.
4595	Bitrate *int32 `json:"bitrate,omitempty"`
4596	// MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate.
4597	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4598	// BFrames - The number of B-frames to be used when encoding this layer.  If not specified, the encoder chooses an appropriate number based on the video profile and level.
4599	BFrames *int32 `json:"bFrames,omitempty"`
4600	// FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video.
4601	FrameRate *string `json:"frameRate,omitempty"`
4602	// Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame.
4603	Slices *int32 `json:"slices,omitempty"`
4604	// AdaptiveBFrame - Specifies whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
4605	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4606	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
4607	Width *string `json:"width,omitempty"`
4608	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
4609	Height *string `json:"height,omitempty"`
4610	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
4611	Label *string `json:"label,omitempty"`
4612	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
4613	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4614}
4615
4616// MarshalJSON is the custom marshaler for H265Layer.
4617func (hl H265Layer) MarshalJSON() ([]byte, error) {
4618	hl.OdataType = OdataTypeMicrosoftMediaH265Layer
4619	objectMap := make(map[string]interface{})
4620	if hl.Profile != "" {
4621		objectMap["profile"] = hl.Profile
4622	}
4623	if hl.Level != nil {
4624		objectMap["level"] = hl.Level
4625	}
4626	if hl.BufferWindow != nil {
4627		objectMap["bufferWindow"] = hl.BufferWindow
4628	}
4629	if hl.ReferenceFrames != nil {
4630		objectMap["referenceFrames"] = hl.ReferenceFrames
4631	}
4632	if hl.Bitrate != nil {
4633		objectMap["bitrate"] = hl.Bitrate
4634	}
4635	if hl.MaxBitrate != nil {
4636		objectMap["maxBitrate"] = hl.MaxBitrate
4637	}
4638	if hl.BFrames != nil {
4639		objectMap["bFrames"] = hl.BFrames
4640	}
4641	if hl.FrameRate != nil {
4642		objectMap["frameRate"] = hl.FrameRate
4643	}
4644	if hl.Slices != nil {
4645		objectMap["slices"] = hl.Slices
4646	}
4647	if hl.AdaptiveBFrame != nil {
4648		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
4649	}
4650	if hl.Width != nil {
4651		objectMap["width"] = hl.Width
4652	}
4653	if hl.Height != nil {
4654		objectMap["height"] = hl.Height
4655	}
4656	if hl.Label != nil {
4657		objectMap["label"] = hl.Label
4658	}
4659	if hl.OdataType != "" {
4660		objectMap["@odata.type"] = hl.OdataType
4661	}
4662	return json.Marshal(objectMap)
4663}
4664
4665// AsH265VideoLayer is the BasicLayer implementation for H265Layer.
4666func (hl H265Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4667	return nil, false
4668}
4669
4670// AsBasicH265VideoLayer is the BasicLayer implementation for H265Layer.
4671func (hl H265Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4672	return &hl, true
4673}
4674
4675// AsH265Layer is the BasicLayer implementation for H265Layer.
4676func (hl H265Layer) AsH265Layer() (*H265Layer, bool) {
4677	return &hl, true
4678}
4679
4680// AsVideoLayer is the BasicLayer implementation for H265Layer.
4681func (hl H265Layer) AsVideoLayer() (*VideoLayer, bool) {
4682	return nil, false
4683}
4684
4685// AsBasicVideoLayer is the BasicLayer implementation for H265Layer.
4686func (hl H265Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4687	return nil, false
4688}
4689
4690// AsH264Layer is the BasicLayer implementation for H265Layer.
4691func (hl H265Layer) AsH264Layer() (*H264Layer, bool) {
4692	return nil, false
4693}
4694
4695// AsJpgLayer is the BasicLayer implementation for H265Layer.
4696func (hl H265Layer) AsJpgLayer() (*JpgLayer, bool) {
4697	return nil, false
4698}
4699
4700// AsPngLayer is the BasicLayer implementation for H265Layer.
4701func (hl H265Layer) AsPngLayer() (*PngLayer, bool) {
4702	return nil, false
4703}
4704
4705// AsLayer is the BasicLayer implementation for H265Layer.
4706func (hl H265Layer) AsLayer() (*Layer, bool) {
4707	return nil, false
4708}
4709
4710// AsBasicLayer is the BasicLayer implementation for H265Layer.
4711func (hl H265Layer) AsBasicLayer() (BasicLayer, bool) {
4712	return &hl, true
4713}
4714
4715// H265Video describes all the properties for encoding a video with the H.265 codec.
4716type H265Video struct {
4717	// SceneChangeDetection - Specifies whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video.
4718	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
4719	// Complexity - Tells the encoder how to choose its encoding settings.  Quality will provide for a higher compression ratio but at a higher cost and longer compute time.  Speed will produce a relatively larger file but is faster and more economical. The default value is Balanced. Possible values include: 'H265ComplexitySpeed', 'H265ComplexityBalanced', 'H265ComplexityQuality'
4720	Complexity H265Complexity `json:"complexity,omitempty"`
4721	// Layers - The collection of output H.265 layers to be produced by the encoder.
4722	Layers *[]H265Layer `json:"layers,omitempty"`
4723	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
4724	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
4725	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
4726	StretchMode StretchMode `json:"stretchMode,omitempty"`
4727	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
4728	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
4729	// Label - An optional label for the codec. The label can be used to control muxing behavior.
4730	Label *string `json:"label,omitempty"`
4731	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
4732	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
4733}
4734
4735// MarshalJSON is the custom marshaler for H265Video.
4736func (hv H265Video) MarshalJSON() ([]byte, error) {
4737	hv.OdataType = OdataTypeMicrosoftMediaH265Video
4738	objectMap := make(map[string]interface{})
4739	if hv.SceneChangeDetection != nil {
4740		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
4741	}
4742	if hv.Complexity != "" {
4743		objectMap["complexity"] = hv.Complexity
4744	}
4745	if hv.Layers != nil {
4746		objectMap["layers"] = hv.Layers
4747	}
4748	if hv.KeyFrameInterval != nil {
4749		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
4750	}
4751	if hv.StretchMode != "" {
4752		objectMap["stretchMode"] = hv.StretchMode
4753	}
4754	if hv.SyncMode != "" {
4755		objectMap["syncMode"] = hv.SyncMode
4756	}
4757	if hv.Label != nil {
4758		objectMap["label"] = hv.Label
4759	}
4760	if hv.OdataType != "" {
4761		objectMap["@odata.type"] = hv.OdataType
4762	}
4763	return json.Marshal(objectMap)
4764}
4765
4766// AsAudio is the BasicCodec implementation for H265Video.
4767func (hv H265Video) AsAudio() (*Audio, bool) {
4768	return nil, false
4769}
4770
4771// AsBasicAudio is the BasicCodec implementation for H265Video.
4772func (hv H265Video) AsBasicAudio() (BasicAudio, bool) {
4773	return nil, false
4774}
4775
4776// AsAacAudio is the BasicCodec implementation for H265Video.
4777func (hv H265Video) AsAacAudio() (*AacAudio, bool) {
4778	return nil, false
4779}
4780
4781// AsVideo is the BasicCodec implementation for H265Video.
4782func (hv H265Video) AsVideo() (*Video, bool) {
4783	return nil, false
4784}
4785
4786// AsBasicVideo is the BasicCodec implementation for H265Video.
4787func (hv H265Video) AsBasicVideo() (BasicVideo, bool) {
4788	return &hv, true
4789}
4790
4791// AsH265Video is the BasicCodec implementation for H265Video.
4792func (hv H265Video) AsH265Video() (*H265Video, bool) {
4793	return &hv, true
4794}
4795
4796// AsCopyVideo is the BasicCodec implementation for H265Video.
4797func (hv H265Video) AsCopyVideo() (*CopyVideo, bool) {
4798	return nil, false
4799}
4800
4801// AsImage is the BasicCodec implementation for H265Video.
4802func (hv H265Video) AsImage() (*Image, bool) {
4803	return nil, false
4804}
4805
4806// AsBasicImage is the BasicCodec implementation for H265Video.
4807func (hv H265Video) AsBasicImage() (BasicImage, bool) {
4808	return nil, false
4809}
4810
4811// AsCopyAudio is the BasicCodec implementation for H265Video.
4812func (hv H265Video) AsCopyAudio() (*CopyAudio, bool) {
4813	return nil, false
4814}
4815
4816// AsH264Video is the BasicCodec implementation for H265Video.
4817func (hv H265Video) AsH264Video() (*H264Video, bool) {
4818	return nil, false
4819}
4820
4821// AsJpgImage is the BasicCodec implementation for H265Video.
4822func (hv H265Video) AsJpgImage() (*JpgImage, bool) {
4823	return nil, false
4824}
4825
4826// AsPngImage is the BasicCodec implementation for H265Video.
4827func (hv H265Video) AsPngImage() (*PngImage, bool) {
4828	return nil, false
4829}
4830
4831// AsCodec is the BasicCodec implementation for H265Video.
4832func (hv H265Video) AsCodec() (*Codec, bool) {
4833	return nil, false
4834}
4835
4836// AsBasicCodec is the BasicCodec implementation for H265Video.
4837func (hv H265Video) AsBasicCodec() (BasicCodec, bool) {
4838	return &hv, true
4839}
4840
4841// BasicH265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
4842// layer.
4843type BasicH265VideoLayer interface {
4844	AsH265Layer() (*H265Layer, bool)
4845	AsH265VideoLayer() (*H265VideoLayer, bool)
4846}
4847
4848// H265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
4849// layer.
4850type H265VideoLayer struct {
4851	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this value should be 3000000 This is a required field.
4852	Bitrate *int32 `json:"bitrate,omitempty"`
4853	// MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate.
4854	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
4855	// BFrames - The number of B-frames to be used when encoding this layer.  If not specified, the encoder chooses an appropriate number based on the video profile and level.
4856	BFrames *int32 `json:"bFrames,omitempty"`
4857	// FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video.
4858	FrameRate *string `json:"frameRate,omitempty"`
4859	// Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame.
4860	Slices *int32 `json:"slices,omitempty"`
4861	// AdaptiveBFrame - Specifies whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
4862	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
4863	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
4864	Width *string `json:"width,omitempty"`
4865	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
4866	Height *string `json:"height,omitempty"`
4867	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
4868	Label *string `json:"label,omitempty"`
4869	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
4870	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
4871}
4872
4873func unmarshalBasicH265VideoLayer(body []byte) (BasicH265VideoLayer, error) {
4874	var m map[string]interface{}
4875	err := json.Unmarshal(body, &m)
4876	if err != nil {
4877		return nil, err
4878	}
4879
4880	switch m["@odata.type"] {
4881	case string(OdataTypeMicrosoftMediaH265Layer):
4882		var hl H265Layer
4883		err := json.Unmarshal(body, &hl)
4884		return hl, err
4885	default:
4886		var hvl H265VideoLayer
4887		err := json.Unmarshal(body, &hvl)
4888		return hvl, err
4889	}
4890}
4891func unmarshalBasicH265VideoLayerArray(body []byte) ([]BasicH265VideoLayer, error) {
4892	var rawMessages []*json.RawMessage
4893	err := json.Unmarshal(body, &rawMessages)
4894	if err != nil {
4895		return nil, err
4896	}
4897
4898	hvlArray := make([]BasicH265VideoLayer, len(rawMessages))
4899
4900	for index, rawMessage := range rawMessages {
4901		hvl, err := unmarshalBasicH265VideoLayer(*rawMessage)
4902		if err != nil {
4903			return nil, err
4904		}
4905		hvlArray[index] = hvl
4906	}
4907	return hvlArray, nil
4908}
4909
4910// MarshalJSON is the custom marshaler for H265VideoLayer.
4911func (hvl H265VideoLayer) MarshalJSON() ([]byte, error) {
4912	hvl.OdataType = OdataTypeMicrosoftMediaH265VideoLayer
4913	objectMap := make(map[string]interface{})
4914	if hvl.Bitrate != nil {
4915		objectMap["bitrate"] = hvl.Bitrate
4916	}
4917	if hvl.MaxBitrate != nil {
4918		objectMap["maxBitrate"] = hvl.MaxBitrate
4919	}
4920	if hvl.BFrames != nil {
4921		objectMap["bFrames"] = hvl.BFrames
4922	}
4923	if hvl.FrameRate != nil {
4924		objectMap["frameRate"] = hvl.FrameRate
4925	}
4926	if hvl.Slices != nil {
4927		objectMap["slices"] = hvl.Slices
4928	}
4929	if hvl.AdaptiveBFrame != nil {
4930		objectMap["adaptiveBFrame"] = hvl.AdaptiveBFrame
4931	}
4932	if hvl.Width != nil {
4933		objectMap["width"] = hvl.Width
4934	}
4935	if hvl.Height != nil {
4936		objectMap["height"] = hvl.Height
4937	}
4938	if hvl.Label != nil {
4939		objectMap["label"] = hvl.Label
4940	}
4941	if hvl.OdataType != "" {
4942		objectMap["@odata.type"] = hvl.OdataType
4943	}
4944	return json.Marshal(objectMap)
4945}
4946
4947// AsH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
4948func (hvl H265VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
4949	return &hvl, true
4950}
4951
4952// AsBasicH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
4953func (hvl H265VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
4954	return &hvl, true
4955}
4956
4957// AsH265Layer is the BasicLayer implementation for H265VideoLayer.
4958func (hvl H265VideoLayer) AsH265Layer() (*H265Layer, bool) {
4959	return nil, false
4960}
4961
4962// AsVideoLayer is the BasicLayer implementation for H265VideoLayer.
4963func (hvl H265VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
4964	return nil, false
4965}
4966
4967// AsBasicVideoLayer is the BasicLayer implementation for H265VideoLayer.
4968func (hvl H265VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
4969	return nil, false
4970}
4971
4972// AsH264Layer is the BasicLayer implementation for H265VideoLayer.
4973func (hvl H265VideoLayer) AsH264Layer() (*H264Layer, bool) {
4974	return nil, false
4975}
4976
4977// AsJpgLayer is the BasicLayer implementation for H265VideoLayer.
4978func (hvl H265VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
4979	return nil, false
4980}
4981
4982// AsPngLayer is the BasicLayer implementation for H265VideoLayer.
4983func (hvl H265VideoLayer) AsPngLayer() (*PngLayer, bool) {
4984	return nil, false
4985}
4986
4987// AsLayer is the BasicLayer implementation for H265VideoLayer.
4988func (hvl H265VideoLayer) AsLayer() (*Layer, bool) {
4989	return nil, false
4990}
4991
4992// AsBasicLayer is the BasicLayer implementation for H265VideoLayer.
4993func (hvl H265VideoLayer) AsBasicLayer() (BasicLayer, bool) {
4994	return &hvl, true
4995}
4996
4997// Hls HTTP Live Streaming (HLS) packing setting for the live output.
4998type Hls struct {
4999	// FragmentsPerTsSegment - The number of fragments in an HTTP Live Streaming (HLS) TS segment in the output of the live event. This value does not affect the packing ratio for HLS CMAF output.
5000	FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"`
5001}
5002
5003// BasicImage describes the basic properties for generating thumbnails from the input video
5004type BasicImage interface {
5005	AsJpgImage() (*JpgImage, bool)
5006	AsPngImage() (*PngImage, bool)
5007	AsImage() (*Image, bool)
5008}
5009
5010// Image describes the basic properties for generating thumbnails from the input video
5011type Image struct {
5012	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
5013	Start *string `json:"start,omitempty"`
5014	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
5015	Step *string `json:"step,omitempty"`
5016	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
5017	Range *string `json:"range,omitempty"`
5018	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
5019	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
5020	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
5021	StretchMode StretchMode `json:"stretchMode,omitempty"`
5022	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
5023	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
5024	// Label - An optional label for the codec. The label can be used to control muxing behavior.
5025	Label *string `json:"label,omitempty"`
5026	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
5027	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
5028}
5029
5030func unmarshalBasicImage(body []byte) (BasicImage, error) {
5031	var m map[string]interface{}
5032	err := json.Unmarshal(body, &m)
5033	if err != nil {
5034		return nil, err
5035	}
5036
5037	switch m["@odata.type"] {
5038	case string(OdataTypeMicrosoftMediaJpgImage):
5039		var ji JpgImage
5040		err := json.Unmarshal(body, &ji)
5041		return ji, err
5042	case string(OdataTypeMicrosoftMediaPngImage):
5043		var pi PngImage
5044		err := json.Unmarshal(body, &pi)
5045		return pi, err
5046	default:
5047		var i Image
5048		err := json.Unmarshal(body, &i)
5049		return i, err
5050	}
5051}
5052func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) {
5053	var rawMessages []*json.RawMessage
5054	err := json.Unmarshal(body, &rawMessages)
5055	if err != nil {
5056		return nil, err
5057	}
5058
5059	iArray := make([]BasicImage, len(rawMessages))
5060
5061	for index, rawMessage := range rawMessages {
5062		i, err := unmarshalBasicImage(*rawMessage)
5063		if err != nil {
5064			return nil, err
5065		}
5066		iArray[index] = i
5067	}
5068	return iArray, nil
5069}
5070
5071// MarshalJSON is the custom marshaler for Image.
5072func (i Image) MarshalJSON() ([]byte, error) {
5073	i.OdataType = OdataTypeMicrosoftMediaImage
5074	objectMap := make(map[string]interface{})
5075	if i.Start != nil {
5076		objectMap["start"] = i.Start
5077	}
5078	if i.Step != nil {
5079		objectMap["step"] = i.Step
5080	}
5081	if i.Range != nil {
5082		objectMap["range"] = i.Range
5083	}
5084	if i.KeyFrameInterval != nil {
5085		objectMap["keyFrameInterval"] = i.KeyFrameInterval
5086	}
5087	if i.StretchMode != "" {
5088		objectMap["stretchMode"] = i.StretchMode
5089	}
5090	if i.SyncMode != "" {
5091		objectMap["syncMode"] = i.SyncMode
5092	}
5093	if i.Label != nil {
5094		objectMap["label"] = i.Label
5095	}
5096	if i.OdataType != "" {
5097		objectMap["@odata.type"] = i.OdataType
5098	}
5099	return json.Marshal(objectMap)
5100}
5101
5102// AsAudio is the BasicCodec implementation for Image.
5103func (i Image) AsAudio() (*Audio, bool) {
5104	return nil, false
5105}
5106
5107// AsBasicAudio is the BasicCodec implementation for Image.
5108func (i Image) AsBasicAudio() (BasicAudio, bool) {
5109	return nil, false
5110}
5111
5112// AsAacAudio is the BasicCodec implementation for Image.
5113func (i Image) AsAacAudio() (*AacAudio, bool) {
5114	return nil, false
5115}
5116
5117// AsVideo is the BasicCodec implementation for Image.
5118func (i Image) AsVideo() (*Video, bool) {
5119	return nil, false
5120}
5121
5122// AsBasicVideo is the BasicCodec implementation for Image.
5123func (i Image) AsBasicVideo() (BasicVideo, bool) {
5124	return &i, true
5125}
5126
5127// AsH265Video is the BasicCodec implementation for Image.
5128func (i Image) AsH265Video() (*H265Video, bool) {
5129	return nil, false
5130}
5131
5132// AsCopyVideo is the BasicCodec implementation for Image.
5133func (i Image) AsCopyVideo() (*CopyVideo, bool) {
5134	return nil, false
5135}
5136
5137// AsImage is the BasicCodec implementation for Image.
5138func (i Image) AsImage() (*Image, bool) {
5139	return &i, true
5140}
5141
5142// AsBasicImage is the BasicCodec implementation for Image.
5143func (i Image) AsBasicImage() (BasicImage, bool) {
5144	return &i, true
5145}
5146
5147// AsCopyAudio is the BasicCodec implementation for Image.
5148func (i Image) AsCopyAudio() (*CopyAudio, bool) {
5149	return nil, false
5150}
5151
5152// AsH264Video is the BasicCodec implementation for Image.
5153func (i Image) AsH264Video() (*H264Video, bool) {
5154	return nil, false
5155}
5156
5157// AsJpgImage is the BasicCodec implementation for Image.
5158func (i Image) AsJpgImage() (*JpgImage, bool) {
5159	return nil, false
5160}
5161
5162// AsPngImage is the BasicCodec implementation for Image.
5163func (i Image) AsPngImage() (*PngImage, bool) {
5164	return nil, false
5165}
5166
5167// AsCodec is the BasicCodec implementation for Image.
5168func (i Image) AsCodec() (*Codec, bool) {
5169	return nil, false
5170}
5171
5172// AsBasicCodec is the BasicCodec implementation for Image.
5173func (i Image) AsBasicCodec() (BasicCodec, bool) {
5174	return &i, true
5175}
5176
5177// BasicImageFormat describes the properties for an output image file.
5178type BasicImageFormat interface {
5179	AsJpgFormat() (*JpgFormat, bool)
5180	AsPngFormat() (*PngFormat, bool)
5181	AsImageFormat() (*ImageFormat, bool)
5182}
5183
5184// ImageFormat describes the properties for an output image file.
5185type ImageFormat struct {
5186	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
5187	FilenamePattern *string `json:"filenamePattern,omitempty"`
5188	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
5189	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
5190}
5191
5192func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) {
5193	var m map[string]interface{}
5194	err := json.Unmarshal(body, &m)
5195	if err != nil {
5196		return nil, err
5197	}
5198
5199	switch m["@odata.type"] {
5200	case string(OdataTypeMicrosoftMediaJpgFormat):
5201		var jf JpgFormat
5202		err := json.Unmarshal(body, &jf)
5203		return jf, err
5204	case string(OdataTypeMicrosoftMediaPngFormat):
5205		var pf PngFormat
5206		err := json.Unmarshal(body, &pf)
5207		return pf, err
5208	default:
5209		var ifVar ImageFormat
5210		err := json.Unmarshal(body, &ifVar)
5211		return ifVar, err
5212	}
5213}
5214func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) {
5215	var rawMessages []*json.RawMessage
5216	err := json.Unmarshal(body, &rawMessages)
5217	if err != nil {
5218		return nil, err
5219	}
5220
5221	ifVarArray := make([]BasicImageFormat, len(rawMessages))
5222
5223	for index, rawMessage := range rawMessages {
5224		ifVar, err := unmarshalBasicImageFormat(*rawMessage)
5225		if err != nil {
5226			return nil, err
5227		}
5228		ifVarArray[index] = ifVar
5229	}
5230	return ifVarArray, nil
5231}
5232
5233// MarshalJSON is the custom marshaler for ImageFormat.
5234func (ifVar ImageFormat) MarshalJSON() ([]byte, error) {
5235	ifVar.OdataType = OdataTypeMicrosoftMediaImageFormat
5236	objectMap := make(map[string]interface{})
5237	if ifVar.FilenamePattern != nil {
5238		objectMap["filenamePattern"] = ifVar.FilenamePattern
5239	}
5240	if ifVar.OdataType != "" {
5241		objectMap["@odata.type"] = ifVar.OdataType
5242	}
5243	return json.Marshal(objectMap)
5244}
5245
5246// AsImageFormat is the BasicFormat implementation for ImageFormat.
5247func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) {
5248	return &ifVar, true
5249}
5250
5251// AsBasicImageFormat is the BasicFormat implementation for ImageFormat.
5252func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
5253	return &ifVar, true
5254}
5255
5256// AsJpgFormat is the BasicFormat implementation for ImageFormat.
5257func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) {
5258	return nil, false
5259}
5260
5261// AsPngFormat is the BasicFormat implementation for ImageFormat.
5262func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) {
5263	return nil, false
5264}
5265
5266// AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
5267func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
5268	return nil, false
5269}
5270
5271// AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
5272func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
5273	return nil, false
5274}
5275
5276// AsMp4Format is the BasicFormat implementation for ImageFormat.
5277func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) {
5278	return nil, false
5279}
5280
5281// AsTransportStreamFormat is the BasicFormat implementation for ImageFormat.
5282func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
5283	return nil, false
5284}
5285
5286// AsFormat is the BasicFormat implementation for ImageFormat.
5287func (ifVar ImageFormat) AsFormat() (*Format, bool) {
5288	return nil, false
5289}
5290
5291// AsBasicFormat is the BasicFormat implementation for ImageFormat.
5292func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) {
5293	return &ifVar, true
5294}
5295
5296// BasicInputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
5297// and related metadata.
5298type BasicInputDefinition interface {
5299	AsFromAllInputFile() (*FromAllInputFile, bool)
5300	AsFromEachInputFile() (*FromEachInputFile, bool)
5301	AsInputFile() (*InputFile, bool)
5302	AsInputDefinition() (*InputDefinition, bool)
5303}
5304
5305// InputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
5306// and related metadata.
5307type InputDefinition struct {
5308	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
5309	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
5310	// OdataType - Possible values include: 'OdataTypeInputDefinition', 'OdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeMicrosoftMediaInputFile'
5311	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
5312}
5313
5314func unmarshalBasicInputDefinition(body []byte) (BasicInputDefinition, error) {
5315	var m map[string]interface{}
5316	err := json.Unmarshal(body, &m)
5317	if err != nil {
5318		return nil, err
5319	}
5320
5321	switch m["@odata.type"] {
5322	case string(OdataTypeMicrosoftMediaFromAllInputFile):
5323		var faif FromAllInputFile
5324		err := json.Unmarshal(body, &faif)
5325		return faif, err
5326	case string(OdataTypeMicrosoftMediaFromEachInputFile):
5327		var feif FromEachInputFile
5328		err := json.Unmarshal(body, &feif)
5329		return feif, err
5330	case string(OdataTypeMicrosoftMediaInputFile):
5331		var ifVar InputFile
5332		err := json.Unmarshal(body, &ifVar)
5333		return ifVar, err
5334	default:
5335		var ID InputDefinition
5336		err := json.Unmarshal(body, &ID)
5337		return ID, err
5338	}
5339}
5340func unmarshalBasicInputDefinitionArray(body []byte) ([]BasicInputDefinition, error) {
5341	var rawMessages []*json.RawMessage
5342	err := json.Unmarshal(body, &rawMessages)
5343	if err != nil {
5344		return nil, err
5345	}
5346
5347	IDArray := make([]BasicInputDefinition, len(rawMessages))
5348
5349	for index, rawMessage := range rawMessages {
5350		ID, err := unmarshalBasicInputDefinition(*rawMessage)
5351		if err != nil {
5352			return nil, err
5353		}
5354		IDArray[index] = ID
5355	}
5356	return IDArray, nil
5357}
5358
5359// MarshalJSON is the custom marshaler for InputDefinition.
5360func (ID InputDefinition) MarshalJSON() ([]byte, error) {
5361	ID.OdataType = OdataTypeInputDefinition
5362	objectMap := make(map[string]interface{})
5363	if ID.IncludedTracks != nil {
5364		objectMap["includedTracks"] = ID.IncludedTracks
5365	}
5366	if ID.OdataType != "" {
5367		objectMap["@odata.type"] = ID.OdataType
5368	}
5369	return json.Marshal(objectMap)
5370}
5371
5372// AsFromAllInputFile is the BasicInputDefinition implementation for InputDefinition.
5373func (ID InputDefinition) AsFromAllInputFile() (*FromAllInputFile, bool) {
5374	return nil, false
5375}
5376
5377// AsFromEachInputFile is the BasicInputDefinition implementation for InputDefinition.
5378func (ID InputDefinition) AsFromEachInputFile() (*FromEachInputFile, bool) {
5379	return nil, false
5380}
5381
5382// AsInputFile is the BasicInputDefinition implementation for InputDefinition.
5383func (ID InputDefinition) AsInputFile() (*InputFile, bool) {
5384	return nil, false
5385}
5386
5387// AsInputDefinition is the BasicInputDefinition implementation for InputDefinition.
5388func (ID InputDefinition) AsInputDefinition() (*InputDefinition, bool) {
5389	return &ID, true
5390}
5391
5392// AsBasicInputDefinition is the BasicInputDefinition implementation for InputDefinition.
5393func (ID InputDefinition) AsBasicInputDefinition() (BasicInputDefinition, bool) {
5394	return &ID, true
5395}
5396
5397// UnmarshalJSON is the custom unmarshaler for InputDefinition struct.
5398func (ID *InputDefinition) UnmarshalJSON(body []byte) error {
5399	var m map[string]*json.RawMessage
5400	err := json.Unmarshal(body, &m)
5401	if err != nil {
5402		return err
5403	}
5404	for k, v := range m {
5405		switch k {
5406		case "includedTracks":
5407			if v != nil {
5408				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
5409				if err != nil {
5410					return err
5411				}
5412				ID.IncludedTracks = &includedTracks
5413			}
5414		case "@odata.type":
5415			if v != nil {
5416				var odataType OdataTypeBasicInputDefinition
5417				err = json.Unmarshal(*v, &odataType)
5418				if err != nil {
5419					return err
5420				}
5421				ID.OdataType = odataType
5422			}
5423		}
5424	}
5425
5426	return nil
5427}
5428
5429// InputFile an InputDefinition for a single file.  TrackSelections are scoped to the file specified.
5430type InputFile struct {
5431	// Filename - Name of the file that this input definition applies to.
5432	Filename *string `json:"filename,omitempty"`
5433	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
5434	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
5435	// OdataType - Possible values include: 'OdataTypeInputDefinition', 'OdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeMicrosoftMediaInputFile'
5436	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
5437}
5438
5439// MarshalJSON is the custom marshaler for InputFile.
5440func (ifVar InputFile) MarshalJSON() ([]byte, error) {
5441	ifVar.OdataType = OdataTypeMicrosoftMediaInputFile
5442	objectMap := make(map[string]interface{})
5443	if ifVar.Filename != nil {
5444		objectMap["filename"] = ifVar.Filename
5445	}
5446	if ifVar.IncludedTracks != nil {
5447		objectMap["includedTracks"] = ifVar.IncludedTracks
5448	}
5449	if ifVar.OdataType != "" {
5450		objectMap["@odata.type"] = ifVar.OdataType
5451	}
5452	return json.Marshal(objectMap)
5453}
5454
5455// AsFromAllInputFile is the BasicInputDefinition implementation for InputFile.
5456func (ifVar InputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
5457	return nil, false
5458}
5459
5460// AsFromEachInputFile is the BasicInputDefinition implementation for InputFile.
5461func (ifVar InputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
5462	return nil, false
5463}
5464
5465// AsInputFile is the BasicInputDefinition implementation for InputFile.
5466func (ifVar InputFile) AsInputFile() (*InputFile, bool) {
5467	return &ifVar, true
5468}
5469
5470// AsInputDefinition is the BasicInputDefinition implementation for InputFile.
5471func (ifVar InputFile) AsInputDefinition() (*InputDefinition, bool) {
5472	return nil, false
5473}
5474
5475// AsBasicInputDefinition is the BasicInputDefinition implementation for InputFile.
5476func (ifVar InputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
5477	return &ifVar, true
5478}
5479
5480// UnmarshalJSON is the custom unmarshaler for InputFile struct.
5481func (ifVar *InputFile) UnmarshalJSON(body []byte) error {
5482	var m map[string]*json.RawMessage
5483	err := json.Unmarshal(body, &m)
5484	if err != nil {
5485		return err
5486	}
5487	for k, v := range m {
5488		switch k {
5489		case "filename":
5490			if v != nil {
5491				var filename string
5492				err = json.Unmarshal(*v, &filename)
5493				if err != nil {
5494					return err
5495				}
5496				ifVar.Filename = &filename
5497			}
5498		case "includedTracks":
5499			if v != nil {
5500				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
5501				if err != nil {
5502					return err
5503				}
5504				ifVar.IncludedTracks = &includedTracks
5505			}
5506		case "@odata.type":
5507			if v != nil {
5508				var odataType OdataTypeBasicInputDefinition
5509				err = json.Unmarshal(*v, &odataType)
5510				if err != nil {
5511					return err
5512				}
5513				ifVar.OdataType = odataType
5514			}
5515		}
5516	}
5517
5518	return nil
5519}
5520
5521// IPAccessControl the IP access control.
5522type IPAccessControl struct {
5523	// Allow - The IP allow list.
5524	Allow *[]IPRange `json:"allow,omitempty"`
5525}
5526
5527// IPRange the IP address range in the CIDR scheme.
5528type IPRange struct {
5529	// Name - The friendly name for the IP address range.
5530	Name *string `json:"name,omitempty"`
5531	// Address - The IP address.
5532	Address *string `json:"address,omitempty"`
5533	// SubnetPrefixLength - The subnet mask prefix length (see CIDR notation).
5534	SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"`
5535}
5536
5537// Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to
5538// events using EventGrid.
5539type Job struct {
5540	autorest.Response `json:"-"`
5541	// JobProperties - The resource properties.
5542	*JobProperties `json:"properties,omitempty"`
5543	// SystemData - READ-ONLY; The system metadata relating to this resource.
5544	SystemData *SystemData `json:"systemData,omitempty"`
5545	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
5546	ID *string `json:"id,omitempty"`
5547	// Name - READ-ONLY; The name of the resource
5548	Name *string `json:"name,omitempty"`
5549	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
5550	Type *string `json:"type,omitempty"`
5551}
5552
5553// MarshalJSON is the custom marshaler for Job.
5554func (j Job) MarshalJSON() ([]byte, error) {
5555	objectMap := make(map[string]interface{})
5556	if j.JobProperties != nil {
5557		objectMap["properties"] = j.JobProperties
5558	}
5559	return json.Marshal(objectMap)
5560}
5561
5562// UnmarshalJSON is the custom unmarshaler for Job struct.
5563func (j *Job) UnmarshalJSON(body []byte) error {
5564	var m map[string]*json.RawMessage
5565	err := json.Unmarshal(body, &m)
5566	if err != nil {
5567		return err
5568	}
5569	for k, v := range m {
5570		switch k {
5571		case "properties":
5572			if v != nil {
5573				var jobProperties JobProperties
5574				err = json.Unmarshal(*v, &jobProperties)
5575				if err != nil {
5576					return err
5577				}
5578				j.JobProperties = &jobProperties
5579			}
5580		case "systemData":
5581			if v != nil {
5582				var systemData SystemData
5583				err = json.Unmarshal(*v, &systemData)
5584				if err != nil {
5585					return err
5586				}
5587				j.SystemData = &systemData
5588			}
5589		case "id":
5590			if v != nil {
5591				var ID string
5592				err = json.Unmarshal(*v, &ID)
5593				if err != nil {
5594					return err
5595				}
5596				j.ID = &ID
5597			}
5598		case "name":
5599			if v != nil {
5600				var name string
5601				err = json.Unmarshal(*v, &name)
5602				if err != nil {
5603					return err
5604				}
5605				j.Name = &name
5606			}
5607		case "type":
5608			if v != nil {
5609				var typeVar string
5610				err = json.Unmarshal(*v, &typeVar)
5611				if err != nil {
5612					return err
5613				}
5614				j.Type = &typeVar
5615			}
5616		}
5617	}
5618
5619	return nil
5620}
5621
5622// JobCollection a collection of Job items.
5623type JobCollection struct {
5624	autorest.Response `json:"-"`
5625	// Value - A collection of Job items.
5626	Value *[]Job `json:"value,omitempty"`
5627	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
5628	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
5629}
5630
5631// JobCollectionIterator provides access to a complete listing of Job values.
5632type JobCollectionIterator struct {
5633	i    int
5634	page JobCollectionPage
5635}
5636
5637// NextWithContext advances to the next value.  If there was an error making
5638// the request the iterator does not advance and the error is returned.
5639func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5640	if tracing.IsEnabled() {
5641		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext")
5642		defer func() {
5643			sc := -1
5644			if iter.Response().Response.Response != nil {
5645				sc = iter.Response().Response.Response.StatusCode
5646			}
5647			tracing.EndSpan(ctx, sc, err)
5648		}()
5649	}
5650	iter.i++
5651	if iter.i < len(iter.page.Values()) {
5652		return nil
5653	}
5654	err = iter.page.NextWithContext(ctx)
5655	if err != nil {
5656		iter.i--
5657		return err
5658	}
5659	iter.i = 0
5660	return nil
5661}
5662
5663// Next advances to the next value.  If there was an error making
5664// the request the iterator does not advance and the error is returned.
5665// Deprecated: Use NextWithContext() instead.
5666func (iter *JobCollectionIterator) Next() error {
5667	return iter.NextWithContext(context.Background())
5668}
5669
5670// NotDone returns true if the enumeration should be started or is not yet complete.
5671func (iter JobCollectionIterator) NotDone() bool {
5672	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5673}
5674
5675// Response returns the raw server response from the last page request.
5676func (iter JobCollectionIterator) Response() JobCollection {
5677	return iter.page.Response()
5678}
5679
5680// Value returns the current value or a zero-initialized value if the
5681// iterator has advanced beyond the end of the collection.
5682func (iter JobCollectionIterator) Value() Job {
5683	if !iter.page.NotDone() {
5684		return Job{}
5685	}
5686	return iter.page.Values()[iter.i]
5687}
5688
5689// Creates a new instance of the JobCollectionIterator type.
5690func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator {
5691	return JobCollectionIterator{page: page}
5692}
5693
5694// IsEmpty returns true if the ListResult contains no values.
5695func (jc JobCollection) IsEmpty() bool {
5696	return jc.Value == nil || len(*jc.Value) == 0
5697}
5698
5699// hasNextLink returns true if the NextLink is not empty.
5700func (jc JobCollection) hasNextLink() bool {
5701	return jc.OdataNextLink != nil && len(*jc.OdataNextLink) != 0
5702}
5703
5704// jobCollectionPreparer prepares a request to retrieve the next set of results.
5705// It returns nil if no more results exist.
5706func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) {
5707	if !jc.hasNextLink() {
5708		return nil, nil
5709	}
5710	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5711		autorest.AsJSON(),
5712		autorest.AsGet(),
5713		autorest.WithBaseURL(to.String(jc.OdataNextLink)))
5714}
5715
5716// JobCollectionPage contains a page of Job values.
5717type JobCollectionPage struct {
5718	fn func(context.Context, JobCollection) (JobCollection, error)
5719	jc JobCollection
5720}
5721
5722// NextWithContext advances to the next page of values.  If there was an error making
5723// the request the page does not advance and the error is returned.
5724func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) {
5725	if tracing.IsEnabled() {
5726		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext")
5727		defer func() {
5728			sc := -1
5729			if page.Response().Response.Response != nil {
5730				sc = page.Response().Response.Response.StatusCode
5731			}
5732			tracing.EndSpan(ctx, sc, err)
5733		}()
5734	}
5735	for {
5736		next, err := page.fn(ctx, page.jc)
5737		if err != nil {
5738			return err
5739		}
5740		page.jc = next
5741		if !next.hasNextLink() || !next.IsEmpty() {
5742			break
5743		}
5744	}
5745	return nil
5746}
5747
5748// Next advances to the next page of values.  If there was an error making
5749// the request the page does not advance and the error is returned.
5750// Deprecated: Use NextWithContext() instead.
5751func (page *JobCollectionPage) Next() error {
5752	return page.NextWithContext(context.Background())
5753}
5754
5755// NotDone returns true if the page enumeration should be started or is not yet complete.
5756func (page JobCollectionPage) NotDone() bool {
5757	return !page.jc.IsEmpty()
5758}
5759
5760// Response returns the raw server response from the last page request.
5761func (page JobCollectionPage) Response() JobCollection {
5762	return page.jc
5763}
5764
5765// Values returns the slice of values for the current page or nil if there are no values.
5766func (page JobCollectionPage) Values() []Job {
5767	if page.jc.IsEmpty() {
5768		return nil
5769	}
5770	return *page.jc.Value
5771}
5772
5773// Creates a new instance of the JobCollectionPage type.
5774func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage {
5775	return JobCollectionPage{
5776		fn: getNextPage,
5777		jc: cur,
5778	}
5779}
5780
5781// JobError details of JobOutput errors.
5782type JobError struct {
5783	// Code - READ-ONLY; Error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'
5784	Code JobErrorCode `json:"code,omitempty"`
5785	// Message - READ-ONLY; A human-readable language-dependent representation of the error.
5786	Message *string `json:"message,omitempty"`
5787	// Category - READ-ONLY; Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent'
5788	Category JobErrorCategory `json:"category,omitempty"`
5789	// Retry - READ-ONLY; Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry'
5790	Retry JobRetry `json:"retry,omitempty"`
5791	// Details - READ-ONLY; An array of details about specific errors that led to this reported error.
5792	Details *[]JobErrorDetail `json:"details,omitempty"`
5793}
5794
5795// MarshalJSON is the custom marshaler for JobError.
5796func (je JobError) MarshalJSON() ([]byte, error) {
5797	objectMap := make(map[string]interface{})
5798	return json.Marshal(objectMap)
5799}
5800
5801// JobErrorDetail details of JobOutput errors.
5802type JobErrorDetail struct {
5803	// Code - READ-ONLY; Code describing the error detail.
5804	Code *string `json:"code,omitempty"`
5805	// Message - READ-ONLY; A human-readable representation of the error.
5806	Message *string `json:"message,omitempty"`
5807}
5808
5809// MarshalJSON is the custom marshaler for JobErrorDetail.
5810func (jed JobErrorDetail) MarshalJSON() ([]byte, error) {
5811	objectMap := make(map[string]interface{})
5812	return json.Marshal(objectMap)
5813}
5814
5815// BasicJobInput base class for inputs to a Job.
5816type BasicJobInput interface {
5817	AsJobInputClip() (*JobInputClip, bool)
5818	AsBasicJobInputClip() (BasicJobInputClip, bool)
5819	AsJobInputs() (*JobInputs, bool)
5820	AsJobInputAsset() (*JobInputAsset, bool)
5821	AsJobInputHTTP() (*JobInputHTTP, bool)
5822	AsJobInputSequence() (*JobInputSequence, bool)
5823	AsJobInput() (*JobInput, bool)
5824}
5825
5826// JobInput base class for inputs to a Job.
5827type JobInput struct {
5828	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
5829	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
5830}
5831
5832func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) {
5833	var m map[string]interface{}
5834	err := json.Unmarshal(body, &m)
5835	if err != nil {
5836		return nil, err
5837	}
5838
5839	switch m["@odata.type"] {
5840	case string(OdataTypeMicrosoftMediaJobInputClip):
5841		var jic JobInputClip
5842		err := json.Unmarshal(body, &jic)
5843		return jic, err
5844	case string(OdataTypeMicrosoftMediaJobInputs):
5845		var ji JobInputs
5846		err := json.Unmarshal(body, &ji)
5847		return ji, err
5848	case string(OdataTypeMicrosoftMediaJobInputAsset):
5849		var jia JobInputAsset
5850		err := json.Unmarshal(body, &jia)
5851		return jia, err
5852	case string(OdataTypeMicrosoftMediaJobInputHTTP):
5853		var jih JobInputHTTP
5854		err := json.Unmarshal(body, &jih)
5855		return jih, err
5856	case string(OdataTypeMicrosoftMediaJobInputSequence):
5857		var jis JobInputSequence
5858		err := json.Unmarshal(body, &jis)
5859		return jis, err
5860	default:
5861		var ji JobInput
5862		err := json.Unmarshal(body, &ji)
5863		return ji, err
5864	}
5865}
5866func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) {
5867	var rawMessages []*json.RawMessage
5868	err := json.Unmarshal(body, &rawMessages)
5869	if err != nil {
5870		return nil, err
5871	}
5872
5873	jiArray := make([]BasicJobInput, len(rawMessages))
5874
5875	for index, rawMessage := range rawMessages {
5876		ji, err := unmarshalBasicJobInput(*rawMessage)
5877		if err != nil {
5878			return nil, err
5879		}
5880		jiArray[index] = ji
5881	}
5882	return jiArray, nil
5883}
5884
5885// MarshalJSON is the custom marshaler for JobInput.
5886func (ji JobInput) MarshalJSON() ([]byte, error) {
5887	ji.OdataType = OdataTypeJobInput
5888	objectMap := make(map[string]interface{})
5889	if ji.OdataType != "" {
5890		objectMap["@odata.type"] = ji.OdataType
5891	}
5892	return json.Marshal(objectMap)
5893}
5894
5895// AsJobInputClip is the BasicJobInput implementation for JobInput.
5896func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) {
5897	return nil, false
5898}
5899
5900// AsBasicJobInputClip is the BasicJobInput implementation for JobInput.
5901func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) {
5902	return nil, false
5903}
5904
5905// AsJobInputs is the BasicJobInput implementation for JobInput.
5906func (ji JobInput) AsJobInputs() (*JobInputs, bool) {
5907	return nil, false
5908}
5909
5910// AsJobInputAsset is the BasicJobInput implementation for JobInput.
5911func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) {
5912	return nil, false
5913}
5914
5915// AsJobInputHTTP is the BasicJobInput implementation for JobInput.
5916func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) {
5917	return nil, false
5918}
5919
5920// AsJobInputSequence is the BasicJobInput implementation for JobInput.
5921func (ji JobInput) AsJobInputSequence() (*JobInputSequence, bool) {
5922	return nil, false
5923}
5924
5925// AsJobInput is the BasicJobInput implementation for JobInput.
5926func (ji JobInput) AsJobInput() (*JobInput, bool) {
5927	return &ji, true
5928}
5929
5930// AsBasicJobInput is the BasicJobInput implementation for JobInput.
5931func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) {
5932	return &ji, true
5933}
5934
5935// JobInputAsset represents an Asset for input into a Job.
5936type JobInputAsset struct {
5937	// AssetName - The name of the input Asset.
5938	AssetName *string `json:"assetName,omitempty"`
5939	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
5940	Files *[]string `json:"files,omitempty"`
5941	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
5942	Start BasicClipTime `json:"start,omitempty"`
5943	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
5944	End BasicClipTime `json:"end,omitempty"`
5945	// Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.
5946	Label *string `json:"label,omitempty"`
5947	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
5948	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
5949	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
5950	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
5951}
5952
5953// MarshalJSON is the custom marshaler for JobInputAsset.
5954func (jia JobInputAsset) MarshalJSON() ([]byte, error) {
5955	jia.OdataType = OdataTypeMicrosoftMediaJobInputAsset
5956	objectMap := make(map[string]interface{})
5957	if jia.AssetName != nil {
5958		objectMap["assetName"] = jia.AssetName
5959	}
5960	if jia.Files != nil {
5961		objectMap["files"] = jia.Files
5962	}
5963	objectMap["start"] = jia.Start
5964	objectMap["end"] = jia.End
5965	if jia.Label != nil {
5966		objectMap["label"] = jia.Label
5967	}
5968	if jia.InputDefinitions != nil {
5969		objectMap["inputDefinitions"] = jia.InputDefinitions
5970	}
5971	if jia.OdataType != "" {
5972		objectMap["@odata.type"] = jia.OdataType
5973	}
5974	return json.Marshal(objectMap)
5975}
5976
5977// AsJobInputClip is the BasicJobInput implementation for JobInputAsset.
5978func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) {
5979	return nil, false
5980}
5981
5982// AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset.
5983func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) {
5984	return &jia, true
5985}
5986
5987// AsJobInputs is the BasicJobInput implementation for JobInputAsset.
5988func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) {
5989	return nil, false
5990}
5991
5992// AsJobInputAsset is the BasicJobInput implementation for JobInputAsset.
5993func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) {
5994	return &jia, true
5995}
5996
5997// AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset.
5998func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) {
5999	return nil, false
6000}
6001
6002// AsJobInputSequence is the BasicJobInput implementation for JobInputAsset.
6003func (jia JobInputAsset) AsJobInputSequence() (*JobInputSequence, bool) {
6004	return nil, false
6005}
6006
6007// AsJobInput is the BasicJobInput implementation for JobInputAsset.
6008func (jia JobInputAsset) AsJobInput() (*JobInput, bool) {
6009	return nil, false
6010}
6011
6012// AsBasicJobInput is the BasicJobInput implementation for JobInputAsset.
6013func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) {
6014	return &jia, true
6015}
6016
6017// UnmarshalJSON is the custom unmarshaler for JobInputAsset struct.
6018func (jia *JobInputAsset) UnmarshalJSON(body []byte) error {
6019	var m map[string]*json.RawMessage
6020	err := json.Unmarshal(body, &m)
6021	if err != nil {
6022		return err
6023	}
6024	for k, v := range m {
6025		switch k {
6026		case "assetName":
6027			if v != nil {
6028				var assetName string
6029				err = json.Unmarshal(*v, &assetName)
6030				if err != nil {
6031					return err
6032				}
6033				jia.AssetName = &assetName
6034			}
6035		case "files":
6036			if v != nil {
6037				var files []string
6038				err = json.Unmarshal(*v, &files)
6039				if err != nil {
6040					return err
6041				}
6042				jia.Files = &files
6043			}
6044		case "start":
6045			if v != nil {
6046				start, err := unmarshalBasicClipTime(*v)
6047				if err != nil {
6048					return err
6049				}
6050				jia.Start = start
6051			}
6052		case "end":
6053			if v != nil {
6054				end, err := unmarshalBasicClipTime(*v)
6055				if err != nil {
6056					return err
6057				}
6058				jia.End = end
6059			}
6060		case "label":
6061			if v != nil {
6062				var label string
6063				err = json.Unmarshal(*v, &label)
6064				if err != nil {
6065					return err
6066				}
6067				jia.Label = &label
6068			}
6069		case "inputDefinitions":
6070			if v != nil {
6071				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6072				if err != nil {
6073					return err
6074				}
6075				jia.InputDefinitions = &inputDefinitions
6076			}
6077		case "@odata.type":
6078			if v != nil {
6079				var odataType OdataTypeBasicJobInput
6080				err = json.Unmarshal(*v, &odataType)
6081				if err != nil {
6082					return err
6083				}
6084				jia.OdataType = odataType
6085			}
6086		}
6087	}
6088
6089	return nil
6090}
6091
6092// BasicJobInputClip represents input files for a Job.
6093type BasicJobInputClip interface {
6094	AsJobInputAsset() (*JobInputAsset, bool)
6095	AsJobInputHTTP() (*JobInputHTTP, bool)
6096	AsJobInputClip() (*JobInputClip, bool)
6097}
6098
6099// JobInputClip represents input files for a Job.
6100type JobInputClip struct {
6101	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
6102	Files *[]string `json:"files,omitempty"`
6103	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
6104	Start BasicClipTime `json:"start,omitempty"`
6105	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
6106	End BasicClipTime `json:"end,omitempty"`
6107	// Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.
6108	Label *string `json:"label,omitempty"`
6109	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
6110	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
6111	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
6112	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6113}
6114
6115func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) {
6116	var m map[string]interface{}
6117	err := json.Unmarshal(body, &m)
6118	if err != nil {
6119		return nil, err
6120	}
6121
6122	switch m["@odata.type"] {
6123	case string(OdataTypeMicrosoftMediaJobInputAsset):
6124		var jia JobInputAsset
6125		err := json.Unmarshal(body, &jia)
6126		return jia, err
6127	case string(OdataTypeMicrosoftMediaJobInputHTTP):
6128		var jih JobInputHTTP
6129		err := json.Unmarshal(body, &jih)
6130		return jih, err
6131	default:
6132		var jic JobInputClip
6133		err := json.Unmarshal(body, &jic)
6134		return jic, err
6135	}
6136}
6137func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) {
6138	var rawMessages []*json.RawMessage
6139	err := json.Unmarshal(body, &rawMessages)
6140	if err != nil {
6141		return nil, err
6142	}
6143
6144	jicArray := make([]BasicJobInputClip, len(rawMessages))
6145
6146	for index, rawMessage := range rawMessages {
6147		jic, err := unmarshalBasicJobInputClip(*rawMessage)
6148		if err != nil {
6149			return nil, err
6150		}
6151		jicArray[index] = jic
6152	}
6153	return jicArray, nil
6154}
6155
6156// MarshalJSON is the custom marshaler for JobInputClip.
6157func (jic JobInputClip) MarshalJSON() ([]byte, error) {
6158	jic.OdataType = OdataTypeMicrosoftMediaJobInputClip
6159	objectMap := make(map[string]interface{})
6160	if jic.Files != nil {
6161		objectMap["files"] = jic.Files
6162	}
6163	objectMap["start"] = jic.Start
6164	objectMap["end"] = jic.End
6165	if jic.Label != nil {
6166		objectMap["label"] = jic.Label
6167	}
6168	if jic.InputDefinitions != nil {
6169		objectMap["inputDefinitions"] = jic.InputDefinitions
6170	}
6171	if jic.OdataType != "" {
6172		objectMap["@odata.type"] = jic.OdataType
6173	}
6174	return json.Marshal(objectMap)
6175}
6176
6177// AsJobInputClip is the BasicJobInput implementation for JobInputClip.
6178func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) {
6179	return &jic, true
6180}
6181
6182// AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip.
6183func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6184	return &jic, true
6185}
6186
6187// AsJobInputs is the BasicJobInput implementation for JobInputClip.
6188func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) {
6189	return nil, false
6190}
6191
6192// AsJobInputAsset is the BasicJobInput implementation for JobInputClip.
6193func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) {
6194	return nil, false
6195}
6196
6197// AsJobInputHTTP is the BasicJobInput implementation for JobInputClip.
6198func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) {
6199	return nil, false
6200}
6201
6202// AsJobInputSequence is the BasicJobInput implementation for JobInputClip.
6203func (jic JobInputClip) AsJobInputSequence() (*JobInputSequence, bool) {
6204	return nil, false
6205}
6206
6207// AsJobInput is the BasicJobInput implementation for JobInputClip.
6208func (jic JobInputClip) AsJobInput() (*JobInput, bool) {
6209	return nil, false
6210}
6211
6212// AsBasicJobInput is the BasicJobInput implementation for JobInputClip.
6213func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) {
6214	return &jic, true
6215}
6216
6217// UnmarshalJSON is the custom unmarshaler for JobInputClip struct.
6218func (jic *JobInputClip) UnmarshalJSON(body []byte) error {
6219	var m map[string]*json.RawMessage
6220	err := json.Unmarshal(body, &m)
6221	if err != nil {
6222		return err
6223	}
6224	for k, v := range m {
6225		switch k {
6226		case "files":
6227			if v != nil {
6228				var files []string
6229				err = json.Unmarshal(*v, &files)
6230				if err != nil {
6231					return err
6232				}
6233				jic.Files = &files
6234			}
6235		case "start":
6236			if v != nil {
6237				start, err := unmarshalBasicClipTime(*v)
6238				if err != nil {
6239					return err
6240				}
6241				jic.Start = start
6242			}
6243		case "end":
6244			if v != nil {
6245				end, err := unmarshalBasicClipTime(*v)
6246				if err != nil {
6247					return err
6248				}
6249				jic.End = end
6250			}
6251		case "label":
6252			if v != nil {
6253				var label string
6254				err = json.Unmarshal(*v, &label)
6255				if err != nil {
6256					return err
6257				}
6258				jic.Label = &label
6259			}
6260		case "inputDefinitions":
6261			if v != nil {
6262				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6263				if err != nil {
6264					return err
6265				}
6266				jic.InputDefinitions = &inputDefinitions
6267			}
6268		case "@odata.type":
6269			if v != nil {
6270				var odataType OdataTypeBasicJobInput
6271				err = json.Unmarshal(*v, &odataType)
6272				if err != nil {
6273					return err
6274				}
6275				jic.OdataType = odataType
6276			}
6277		}
6278	}
6279
6280	return nil
6281}
6282
6283// JobInputHTTP represents HTTPS job input.
6284type JobInputHTTP struct {
6285	// BaseURI - Base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. Maximum length of 4000 characters.
6286	BaseURI *string `json:"baseUri,omitempty"`
6287	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
6288	Files *[]string `json:"files,omitempty"`
6289	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
6290	Start BasicClipTime `json:"start,omitempty"`
6291	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
6292	End BasicClipTime `json:"end,omitempty"`
6293	// Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.
6294	Label *string `json:"label,omitempty"`
6295	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
6296	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
6297	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
6298	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6299}
6300
6301// MarshalJSON is the custom marshaler for JobInputHTTP.
6302func (jih JobInputHTTP) MarshalJSON() ([]byte, error) {
6303	jih.OdataType = OdataTypeMicrosoftMediaJobInputHTTP
6304	objectMap := make(map[string]interface{})
6305	if jih.BaseURI != nil {
6306		objectMap["baseUri"] = jih.BaseURI
6307	}
6308	if jih.Files != nil {
6309		objectMap["files"] = jih.Files
6310	}
6311	objectMap["start"] = jih.Start
6312	objectMap["end"] = jih.End
6313	if jih.Label != nil {
6314		objectMap["label"] = jih.Label
6315	}
6316	if jih.InputDefinitions != nil {
6317		objectMap["inputDefinitions"] = jih.InputDefinitions
6318	}
6319	if jih.OdataType != "" {
6320		objectMap["@odata.type"] = jih.OdataType
6321	}
6322	return json.Marshal(objectMap)
6323}
6324
6325// AsJobInputClip is the BasicJobInput implementation for JobInputHTTP.
6326func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) {
6327	return nil, false
6328}
6329
6330// AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP.
6331func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6332	return &jih, true
6333}
6334
6335// AsJobInputs is the BasicJobInput implementation for JobInputHTTP.
6336func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) {
6337	return nil, false
6338}
6339
6340// AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP.
6341func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) {
6342	return nil, false
6343}
6344
6345// AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP.
6346func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) {
6347	return &jih, true
6348}
6349
6350// AsJobInputSequence is the BasicJobInput implementation for JobInputHTTP.
6351func (jih JobInputHTTP) AsJobInputSequence() (*JobInputSequence, bool) {
6352	return nil, false
6353}
6354
6355// AsJobInput is the BasicJobInput implementation for JobInputHTTP.
6356func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) {
6357	return nil, false
6358}
6359
6360// AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP.
6361func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) {
6362	return &jih, true
6363}
6364
6365// UnmarshalJSON is the custom unmarshaler for JobInputHTTP struct.
6366func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error {
6367	var m map[string]*json.RawMessage
6368	err := json.Unmarshal(body, &m)
6369	if err != nil {
6370		return err
6371	}
6372	for k, v := range m {
6373		switch k {
6374		case "baseUri":
6375			if v != nil {
6376				var baseURI string
6377				err = json.Unmarshal(*v, &baseURI)
6378				if err != nil {
6379					return err
6380				}
6381				jih.BaseURI = &baseURI
6382			}
6383		case "files":
6384			if v != nil {
6385				var files []string
6386				err = json.Unmarshal(*v, &files)
6387				if err != nil {
6388					return err
6389				}
6390				jih.Files = &files
6391			}
6392		case "start":
6393			if v != nil {
6394				start, err := unmarshalBasicClipTime(*v)
6395				if err != nil {
6396					return err
6397				}
6398				jih.Start = start
6399			}
6400		case "end":
6401			if v != nil {
6402				end, err := unmarshalBasicClipTime(*v)
6403				if err != nil {
6404					return err
6405				}
6406				jih.End = end
6407			}
6408		case "label":
6409			if v != nil {
6410				var label string
6411				err = json.Unmarshal(*v, &label)
6412				if err != nil {
6413					return err
6414				}
6415				jih.Label = &label
6416			}
6417		case "inputDefinitions":
6418			if v != nil {
6419				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
6420				if err != nil {
6421					return err
6422				}
6423				jih.InputDefinitions = &inputDefinitions
6424			}
6425		case "@odata.type":
6426			if v != nil {
6427				var odataType OdataTypeBasicJobInput
6428				err = json.Unmarshal(*v, &odataType)
6429				if err != nil {
6430					return err
6431				}
6432				jih.OdataType = odataType
6433			}
6434		}
6435	}
6436
6437	return nil
6438}
6439
6440// JobInputs describes a list of inputs to a Job.
6441type JobInputs struct {
6442	// Inputs - List of inputs to a Job.
6443	Inputs *[]BasicJobInput `json:"inputs,omitempty"`
6444	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
6445	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6446}
6447
6448// MarshalJSON is the custom marshaler for JobInputs.
6449func (ji JobInputs) MarshalJSON() ([]byte, error) {
6450	ji.OdataType = OdataTypeMicrosoftMediaJobInputs
6451	objectMap := make(map[string]interface{})
6452	if ji.Inputs != nil {
6453		objectMap["inputs"] = ji.Inputs
6454	}
6455	if ji.OdataType != "" {
6456		objectMap["@odata.type"] = ji.OdataType
6457	}
6458	return json.Marshal(objectMap)
6459}
6460
6461// AsJobInputClip is the BasicJobInput implementation for JobInputs.
6462func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) {
6463	return nil, false
6464}
6465
6466// AsBasicJobInputClip is the BasicJobInput implementation for JobInputs.
6467func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6468	return nil, false
6469}
6470
6471// AsJobInputs is the BasicJobInput implementation for JobInputs.
6472func (ji JobInputs) AsJobInputs() (*JobInputs, bool) {
6473	return &ji, true
6474}
6475
6476// AsJobInputAsset is the BasicJobInput implementation for JobInputs.
6477func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) {
6478	return nil, false
6479}
6480
6481// AsJobInputHTTP is the BasicJobInput implementation for JobInputs.
6482func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) {
6483	return nil, false
6484}
6485
6486// AsJobInputSequence is the BasicJobInput implementation for JobInputs.
6487func (ji JobInputs) AsJobInputSequence() (*JobInputSequence, bool) {
6488	return nil, false
6489}
6490
6491// AsJobInput is the BasicJobInput implementation for JobInputs.
6492func (ji JobInputs) AsJobInput() (*JobInput, bool) {
6493	return nil, false
6494}
6495
6496// AsBasicJobInput is the BasicJobInput implementation for JobInputs.
6497func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) {
6498	return &ji, true
6499}
6500
6501// UnmarshalJSON is the custom unmarshaler for JobInputs struct.
6502func (ji *JobInputs) UnmarshalJSON(body []byte) error {
6503	var m map[string]*json.RawMessage
6504	err := json.Unmarshal(body, &m)
6505	if err != nil {
6506		return err
6507	}
6508	for k, v := range m {
6509		switch k {
6510		case "inputs":
6511			if v != nil {
6512				inputs, err := unmarshalBasicJobInputArray(*v)
6513				if err != nil {
6514					return err
6515				}
6516				ji.Inputs = &inputs
6517			}
6518		case "@odata.type":
6519			if v != nil {
6520				var odataType OdataTypeBasicJobInput
6521				err = json.Unmarshal(*v, &odataType)
6522				if err != nil {
6523					return err
6524				}
6525				ji.OdataType = odataType
6526			}
6527		}
6528	}
6529
6530	return nil
6531}
6532
6533// JobInputSequence a Sequence contains an ordered list of Clips where each clip is a JobInput.  The
6534// Sequence will be treated as a single input.
6535type JobInputSequence struct {
6536	// Inputs - JobInputs that make up the timeline.
6537	Inputs *[]BasicJobInputClip `json:"inputs,omitempty"`
6538	// OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeMicrosoftMediaJobInputSequence'
6539	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
6540}
6541
6542// MarshalJSON is the custom marshaler for JobInputSequence.
6543func (jis JobInputSequence) MarshalJSON() ([]byte, error) {
6544	jis.OdataType = OdataTypeMicrosoftMediaJobInputSequence
6545	objectMap := make(map[string]interface{})
6546	if jis.Inputs != nil {
6547		objectMap["inputs"] = jis.Inputs
6548	}
6549	if jis.OdataType != "" {
6550		objectMap["@odata.type"] = jis.OdataType
6551	}
6552	return json.Marshal(objectMap)
6553}
6554
6555// AsJobInputClip is the BasicJobInput implementation for JobInputSequence.
6556func (jis JobInputSequence) AsJobInputClip() (*JobInputClip, bool) {
6557	return nil, false
6558}
6559
6560// AsBasicJobInputClip is the BasicJobInput implementation for JobInputSequence.
6561func (jis JobInputSequence) AsBasicJobInputClip() (BasicJobInputClip, bool) {
6562	return nil, false
6563}
6564
6565// AsJobInputs is the BasicJobInput implementation for JobInputSequence.
6566func (jis JobInputSequence) AsJobInputs() (*JobInputs, bool) {
6567	return nil, false
6568}
6569
6570// AsJobInputAsset is the BasicJobInput implementation for JobInputSequence.
6571func (jis JobInputSequence) AsJobInputAsset() (*JobInputAsset, bool) {
6572	return nil, false
6573}
6574
6575// AsJobInputHTTP is the BasicJobInput implementation for JobInputSequence.
6576func (jis JobInputSequence) AsJobInputHTTP() (*JobInputHTTP, bool) {
6577	return nil, false
6578}
6579
6580// AsJobInputSequence is the BasicJobInput implementation for JobInputSequence.
6581func (jis JobInputSequence) AsJobInputSequence() (*JobInputSequence, bool) {
6582	return &jis, true
6583}
6584
6585// AsJobInput is the BasicJobInput implementation for JobInputSequence.
6586func (jis JobInputSequence) AsJobInput() (*JobInput, bool) {
6587	return nil, false
6588}
6589
6590// AsBasicJobInput is the BasicJobInput implementation for JobInputSequence.
6591func (jis JobInputSequence) AsBasicJobInput() (BasicJobInput, bool) {
6592	return &jis, true
6593}
6594
6595// UnmarshalJSON is the custom unmarshaler for JobInputSequence struct.
6596func (jis *JobInputSequence) UnmarshalJSON(body []byte) error {
6597	var m map[string]*json.RawMessage
6598	err := json.Unmarshal(body, &m)
6599	if err != nil {
6600		return err
6601	}
6602	for k, v := range m {
6603		switch k {
6604		case "inputs":
6605			if v != nil {
6606				inputs, err := unmarshalBasicJobInputClipArray(*v)
6607				if err != nil {
6608					return err
6609				}
6610				jis.Inputs = &inputs
6611			}
6612		case "@odata.type":
6613			if v != nil {
6614				var odataType OdataTypeBasicJobInput
6615				err = json.Unmarshal(*v, &odataType)
6616				if err != nil {
6617					return err
6618				}
6619				jis.OdataType = odataType
6620			}
6621		}
6622	}
6623
6624	return nil
6625}
6626
6627// BasicJobOutput describes all the properties of a JobOutput.
6628type BasicJobOutput interface {
6629	AsJobOutputAsset() (*JobOutputAsset, bool)
6630	AsJobOutput() (*JobOutput, bool)
6631}
6632
6633// JobOutput describes all the properties of a JobOutput.
6634type JobOutput struct {
6635	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
6636	Error *JobError `json:"error,omitempty"`
6637	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'
6638	State JobState `json:"state,omitempty"`
6639	// Progress - READ-ONLY; If the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property.
6640	Progress *int32 `json:"progress,omitempty"`
6641	// Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform.
6642	Label *string `json:"label,omitempty"`
6643	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
6644	StartTime *date.Time `json:"startTime,omitempty"`
6645	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
6646	EndTime *date.Time `json:"endTime,omitempty"`
6647	// OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset'
6648	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
6649}
6650
6651func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) {
6652	var m map[string]interface{}
6653	err := json.Unmarshal(body, &m)
6654	if err != nil {
6655		return nil, err
6656	}
6657
6658	switch m["@odata.type"] {
6659	case string(OdataTypeMicrosoftMediaJobOutputAsset):
6660		var joa JobOutputAsset
6661		err := json.Unmarshal(body, &joa)
6662		return joa, err
6663	default:
6664		var jo JobOutput
6665		err := json.Unmarshal(body, &jo)
6666		return jo, err
6667	}
6668}
6669func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) {
6670	var rawMessages []*json.RawMessage
6671	err := json.Unmarshal(body, &rawMessages)
6672	if err != nil {
6673		return nil, err
6674	}
6675
6676	joArray := make([]BasicJobOutput, len(rawMessages))
6677
6678	for index, rawMessage := range rawMessages {
6679		jo, err := unmarshalBasicJobOutput(*rawMessage)
6680		if err != nil {
6681			return nil, err
6682		}
6683		joArray[index] = jo
6684	}
6685	return joArray, nil
6686}
6687
6688// MarshalJSON is the custom marshaler for JobOutput.
6689func (jo JobOutput) MarshalJSON() ([]byte, error) {
6690	jo.OdataType = OdataTypeJobOutput
6691	objectMap := make(map[string]interface{})
6692	if jo.Label != nil {
6693		objectMap["label"] = jo.Label
6694	}
6695	if jo.OdataType != "" {
6696		objectMap["@odata.type"] = jo.OdataType
6697	}
6698	return json.Marshal(objectMap)
6699}
6700
6701// AsJobOutputAsset is the BasicJobOutput implementation for JobOutput.
6702func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) {
6703	return nil, false
6704}
6705
6706// AsJobOutput is the BasicJobOutput implementation for JobOutput.
6707func (jo JobOutput) AsJobOutput() (*JobOutput, bool) {
6708	return &jo, true
6709}
6710
6711// AsBasicJobOutput is the BasicJobOutput implementation for JobOutput.
6712func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) {
6713	return &jo, true
6714}
6715
6716// JobOutputAsset represents an Asset used as a JobOutput.
6717type JobOutputAsset struct {
6718	// AssetName - The name of the output Asset.
6719	AssetName *string `json:"assetName,omitempty"`
6720	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
6721	Error *JobError `json:"error,omitempty"`
6722	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'
6723	State JobState `json:"state,omitempty"`
6724	// Progress - READ-ONLY; If the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property.
6725	Progress *int32 `json:"progress,omitempty"`
6726	// Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform.
6727	Label *string `json:"label,omitempty"`
6728	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
6729	StartTime *date.Time `json:"startTime,omitempty"`
6730	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
6731	EndTime *date.Time `json:"endTime,omitempty"`
6732	// OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset'
6733	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
6734}
6735
6736// MarshalJSON is the custom marshaler for JobOutputAsset.
6737func (joa JobOutputAsset) MarshalJSON() ([]byte, error) {
6738	joa.OdataType = OdataTypeMicrosoftMediaJobOutputAsset
6739	objectMap := make(map[string]interface{})
6740	if joa.AssetName != nil {
6741		objectMap["assetName"] = joa.AssetName
6742	}
6743	if joa.Label != nil {
6744		objectMap["label"] = joa.Label
6745	}
6746	if joa.OdataType != "" {
6747		objectMap["@odata.type"] = joa.OdataType
6748	}
6749	return json.Marshal(objectMap)
6750}
6751
6752// AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset.
6753func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) {
6754	return &joa, true
6755}
6756
6757// AsJobOutput is the BasicJobOutput implementation for JobOutputAsset.
6758func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) {
6759	return nil, false
6760}
6761
6762// AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset.
6763func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) {
6764	return &joa, true
6765}
6766
6767// JobProperties properties of the Job.
6768type JobProperties struct {
6769	// Created - READ-ONLY; The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
6770	Created *date.Time `json:"created,omitempty"`
6771	// State - READ-ONLY; The current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'
6772	State JobState `json:"state,omitempty"`
6773	// Description - Optional customer supplied description of the Job.
6774	Description *string `json:"description,omitempty"`
6775	// Input - The inputs for the Job.
6776	Input BasicJobInput `json:"input,omitempty"`
6777	// LastModified - READ-ONLY; The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
6778	LastModified *date.Time `json:"lastModified,omitempty"`
6779	// Outputs - The outputs for the Job.
6780	Outputs *[]BasicJobOutput `json:"outputs,omitempty"`
6781	// Priority - Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'PriorityLow', 'PriorityNormal', 'PriorityHigh'
6782	Priority Priority `json:"priority,omitempty"`
6783	// CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events.
6784	CorrelationData map[string]*string `json:"correlationData"`
6785	// StartTime - READ-ONLY; The UTC date and time at which this Job began processing.
6786	StartTime *date.Time `json:"startTime,omitempty"`
6787	// EndTime - READ-ONLY; The UTC date and time at which this Job finished processing.
6788	EndTime *date.Time `json:"endTime,omitempty"`
6789}
6790
6791// MarshalJSON is the custom marshaler for JobProperties.
6792func (jp JobProperties) MarshalJSON() ([]byte, error) {
6793	objectMap := make(map[string]interface{})
6794	if jp.Description != nil {
6795		objectMap["description"] = jp.Description
6796	}
6797	objectMap["input"] = jp.Input
6798	if jp.Outputs != nil {
6799		objectMap["outputs"] = jp.Outputs
6800	}
6801	if jp.Priority != "" {
6802		objectMap["priority"] = jp.Priority
6803	}
6804	if jp.CorrelationData != nil {
6805		objectMap["correlationData"] = jp.CorrelationData
6806	}
6807	return json.Marshal(objectMap)
6808}
6809
6810// UnmarshalJSON is the custom unmarshaler for JobProperties struct.
6811func (jp *JobProperties) UnmarshalJSON(body []byte) error {
6812	var m map[string]*json.RawMessage
6813	err := json.Unmarshal(body, &m)
6814	if err != nil {
6815		return err
6816	}
6817	for k, v := range m {
6818		switch k {
6819		case "created":
6820			if v != nil {
6821				var created date.Time
6822				err = json.Unmarshal(*v, &created)
6823				if err != nil {
6824					return err
6825				}
6826				jp.Created = &created
6827			}
6828		case "state":
6829			if v != nil {
6830				var state JobState
6831				err = json.Unmarshal(*v, &state)
6832				if err != nil {
6833					return err
6834				}
6835				jp.State = state
6836			}
6837		case "description":
6838			if v != nil {
6839				var description string
6840				err = json.Unmarshal(*v, &description)
6841				if err != nil {
6842					return err
6843				}
6844				jp.Description = &description
6845			}
6846		case "input":
6847			if v != nil {
6848				input, err := unmarshalBasicJobInput(*v)
6849				if err != nil {
6850					return err
6851				}
6852				jp.Input = input
6853			}
6854		case "lastModified":
6855			if v != nil {
6856				var lastModified date.Time
6857				err = json.Unmarshal(*v, &lastModified)
6858				if err != nil {
6859					return err
6860				}
6861				jp.LastModified = &lastModified
6862			}
6863		case "outputs":
6864			if v != nil {
6865				outputs, err := unmarshalBasicJobOutputArray(*v)
6866				if err != nil {
6867					return err
6868				}
6869				jp.Outputs = &outputs
6870			}
6871		case "priority":
6872			if v != nil {
6873				var priority Priority
6874				err = json.Unmarshal(*v, &priority)
6875				if err != nil {
6876					return err
6877				}
6878				jp.Priority = priority
6879			}
6880		case "correlationData":
6881			if v != nil {
6882				var correlationData map[string]*string
6883				err = json.Unmarshal(*v, &correlationData)
6884				if err != nil {
6885					return err
6886				}
6887				jp.CorrelationData = correlationData
6888			}
6889		case "startTime":
6890			if v != nil {
6891				var startTime date.Time
6892				err = json.Unmarshal(*v, &startTime)
6893				if err != nil {
6894					return err
6895				}
6896				jp.StartTime = &startTime
6897			}
6898		case "endTime":
6899			if v != nil {
6900				var endTime date.Time
6901				err = json.Unmarshal(*v, &endTime)
6902				if err != nil {
6903					return err
6904				}
6905				jp.EndTime = &endTime
6906			}
6907		}
6908	}
6909
6910	return nil
6911}
6912
6913// JpgFormat describes the settings for producing JPEG thumbnails.
6914type JpgFormat struct {
6915	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
6916	FilenamePattern *string `json:"filenamePattern,omitempty"`
6917	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
6918	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
6919}
6920
6921// MarshalJSON is the custom marshaler for JpgFormat.
6922func (jf JpgFormat) MarshalJSON() ([]byte, error) {
6923	jf.OdataType = OdataTypeMicrosoftMediaJpgFormat
6924	objectMap := make(map[string]interface{})
6925	if jf.FilenamePattern != nil {
6926		objectMap["filenamePattern"] = jf.FilenamePattern
6927	}
6928	if jf.OdataType != "" {
6929		objectMap["@odata.type"] = jf.OdataType
6930	}
6931	return json.Marshal(objectMap)
6932}
6933
6934// AsImageFormat is the BasicFormat implementation for JpgFormat.
6935func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) {
6936	return nil, false
6937}
6938
6939// AsBasicImageFormat is the BasicFormat implementation for JpgFormat.
6940func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
6941	return &jf, true
6942}
6943
6944// AsJpgFormat is the BasicFormat implementation for JpgFormat.
6945func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) {
6946	return &jf, true
6947}
6948
6949// AsPngFormat is the BasicFormat implementation for JpgFormat.
6950func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) {
6951	return nil, false
6952}
6953
6954// AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
6955func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
6956	return nil, false
6957}
6958
6959// AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
6960func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
6961	return nil, false
6962}
6963
6964// AsMp4Format is the BasicFormat implementation for JpgFormat.
6965func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) {
6966	return nil, false
6967}
6968
6969// AsTransportStreamFormat is the BasicFormat implementation for JpgFormat.
6970func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
6971	return nil, false
6972}
6973
6974// AsFormat is the BasicFormat implementation for JpgFormat.
6975func (jf JpgFormat) AsFormat() (*Format, bool) {
6976	return nil, false
6977}
6978
6979// AsBasicFormat is the BasicFormat implementation for JpgFormat.
6980func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) {
6981	return &jf, true
6982}
6983
6984// JpgImage describes the properties for producing a series of JPEG images from the input video.
6985type JpgImage struct {
6986	// Layers - A collection of output JPEG image layers to be produced by the encoder.
6987	Layers *[]JpgLayer `json:"layers,omitempty"`
6988	// SpriteColumn - Sets the number of columns used in thumbnail sprite image.  The number of rows are automatically calculated and a VTT file is generated with the coordinate mappings for each thumbnail in the sprite. Note: this value should be a positive integer and a proper value is recommended so that the output image resolution will not go beyond JPEG maximum pixel resolution limit 65535x65535.
6989	SpriteColumn *int32 `json:"spriteColumn,omitempty"`
6990	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
6991	Start *string `json:"start,omitempty"`
6992	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
6993	Step *string `json:"step,omitempty"`
6994	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
6995	Range *string `json:"range,omitempty"`
6996	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
6997	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
6998	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
6999	StretchMode StretchMode `json:"stretchMode,omitempty"`
7000	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
7001	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
7002	// Label - An optional label for the codec. The label can be used to control muxing behavior.
7003	Label *string `json:"label,omitempty"`
7004	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
7005	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
7006}
7007
7008// MarshalJSON is the custom marshaler for JpgImage.
7009func (ji JpgImage) MarshalJSON() ([]byte, error) {
7010	ji.OdataType = OdataTypeMicrosoftMediaJpgImage
7011	objectMap := make(map[string]interface{})
7012	if ji.Layers != nil {
7013		objectMap["layers"] = ji.Layers
7014	}
7015	if ji.SpriteColumn != nil {
7016		objectMap["spriteColumn"] = ji.SpriteColumn
7017	}
7018	if ji.Start != nil {
7019		objectMap["start"] = ji.Start
7020	}
7021	if ji.Step != nil {
7022		objectMap["step"] = ji.Step
7023	}
7024	if ji.Range != nil {
7025		objectMap["range"] = ji.Range
7026	}
7027	if ji.KeyFrameInterval != nil {
7028		objectMap["keyFrameInterval"] = ji.KeyFrameInterval
7029	}
7030	if ji.StretchMode != "" {
7031		objectMap["stretchMode"] = ji.StretchMode
7032	}
7033	if ji.SyncMode != "" {
7034		objectMap["syncMode"] = ji.SyncMode
7035	}
7036	if ji.Label != nil {
7037		objectMap["label"] = ji.Label
7038	}
7039	if ji.OdataType != "" {
7040		objectMap["@odata.type"] = ji.OdataType
7041	}
7042	return json.Marshal(objectMap)
7043}
7044
7045// AsAudio is the BasicCodec implementation for JpgImage.
7046func (ji JpgImage) AsAudio() (*Audio, bool) {
7047	return nil, false
7048}
7049
7050// AsBasicAudio is the BasicCodec implementation for JpgImage.
7051func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) {
7052	return nil, false
7053}
7054
7055// AsAacAudio is the BasicCodec implementation for JpgImage.
7056func (ji JpgImage) AsAacAudio() (*AacAudio, bool) {
7057	return nil, false
7058}
7059
7060// AsVideo is the BasicCodec implementation for JpgImage.
7061func (ji JpgImage) AsVideo() (*Video, bool) {
7062	return nil, false
7063}
7064
7065// AsBasicVideo is the BasicCodec implementation for JpgImage.
7066func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) {
7067	return &ji, true
7068}
7069
7070// AsH265Video is the BasicCodec implementation for JpgImage.
7071func (ji JpgImage) AsH265Video() (*H265Video, bool) {
7072	return nil, false
7073}
7074
7075// AsCopyVideo is the BasicCodec implementation for JpgImage.
7076func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) {
7077	return nil, false
7078}
7079
7080// AsImage is the BasicCodec implementation for JpgImage.
7081func (ji JpgImage) AsImage() (*Image, bool) {
7082	return nil, false
7083}
7084
7085// AsBasicImage is the BasicCodec implementation for JpgImage.
7086func (ji JpgImage) AsBasicImage() (BasicImage, bool) {
7087	return &ji, true
7088}
7089
7090// AsCopyAudio is the BasicCodec implementation for JpgImage.
7091func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) {
7092	return nil, false
7093}
7094
7095// AsH264Video is the BasicCodec implementation for JpgImage.
7096func (ji JpgImage) AsH264Video() (*H264Video, bool) {
7097	return nil, false
7098}
7099
7100// AsJpgImage is the BasicCodec implementation for JpgImage.
7101func (ji JpgImage) AsJpgImage() (*JpgImage, bool) {
7102	return &ji, true
7103}
7104
7105// AsPngImage is the BasicCodec implementation for JpgImage.
7106func (ji JpgImage) AsPngImage() (*PngImage, bool) {
7107	return nil, false
7108}
7109
7110// AsCodec is the BasicCodec implementation for JpgImage.
7111func (ji JpgImage) AsCodec() (*Codec, bool) {
7112	return nil, false
7113}
7114
7115// AsBasicCodec is the BasicCodec implementation for JpgImage.
7116func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) {
7117	return &ji, true
7118}
7119
7120// JpgLayer describes the settings to produce a JPEG image from the input video.
7121type JpgLayer struct {
7122	// Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70.
7123	Quality *int32 `json:"quality,omitempty"`
7124	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
7125	Width *string `json:"width,omitempty"`
7126	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
7127	Height *string `json:"height,omitempty"`
7128	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
7129	Label *string `json:"label,omitempty"`
7130	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
7131	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
7132}
7133
7134// MarshalJSON is the custom marshaler for JpgLayer.
7135func (jl JpgLayer) MarshalJSON() ([]byte, error) {
7136	jl.OdataType = OdataTypeMicrosoftMediaJpgLayer
7137	objectMap := make(map[string]interface{})
7138	if jl.Quality != nil {
7139		objectMap["quality"] = jl.Quality
7140	}
7141	if jl.Width != nil {
7142		objectMap["width"] = jl.Width
7143	}
7144	if jl.Height != nil {
7145		objectMap["height"] = jl.Height
7146	}
7147	if jl.Label != nil {
7148		objectMap["label"] = jl.Label
7149	}
7150	if jl.OdataType != "" {
7151		objectMap["@odata.type"] = jl.OdataType
7152	}
7153	return json.Marshal(objectMap)
7154}
7155
7156// AsH265VideoLayer is the BasicLayer implementation for JpgLayer.
7157func (jl JpgLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
7158	return nil, false
7159}
7160
7161// AsBasicH265VideoLayer is the BasicLayer implementation for JpgLayer.
7162func (jl JpgLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
7163	return nil, false
7164}
7165
7166// AsH265Layer is the BasicLayer implementation for JpgLayer.
7167func (jl JpgLayer) AsH265Layer() (*H265Layer, bool) {
7168	return nil, false
7169}
7170
7171// AsVideoLayer is the BasicLayer implementation for JpgLayer.
7172func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) {
7173	return nil, false
7174}
7175
7176// AsBasicVideoLayer is the BasicLayer implementation for JpgLayer.
7177func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
7178	return nil, false
7179}
7180
7181// AsH264Layer is the BasicLayer implementation for JpgLayer.
7182func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) {
7183	return nil, false
7184}
7185
7186// AsJpgLayer is the BasicLayer implementation for JpgLayer.
7187func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) {
7188	return &jl, true
7189}
7190
7191// AsPngLayer is the BasicLayer implementation for JpgLayer.
7192func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) {
7193	return nil, false
7194}
7195
7196// AsLayer is the BasicLayer implementation for JpgLayer.
7197func (jl JpgLayer) AsLayer() (*Layer, bool) {
7198	return nil, false
7199}
7200
7201// AsBasicLayer is the BasicLayer implementation for JpgLayer.
7202func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) {
7203	return &jl, true
7204}
7205
7206// KeyVaultProperties ...
7207type KeyVaultProperties struct {
7208	// KeyIdentifier - The URL of the Key Vault key used to encrypt the account. The key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key without a version (for example https://vault/keys/mykey).
7209	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
7210	// CurrentKeyIdentifier - READ-ONLY; The current key used to encrypt the Media Services account, including the key version.
7211	CurrentKeyIdentifier *string `json:"currentKeyIdentifier,omitempty"`
7212}
7213
7214// MarshalJSON is the custom marshaler for KeyVaultProperties.
7215func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
7216	objectMap := make(map[string]interface{})
7217	if kvp.KeyIdentifier != nil {
7218		objectMap["keyIdentifier"] = kvp.KeyIdentifier
7219	}
7220	return json.Marshal(objectMap)
7221}
7222
7223// BasicLayer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
7224// specifying a layer for each desired resolution. A layer represents the properties for the video or image at a
7225// resolution.
7226type BasicLayer interface {
7227	AsH265VideoLayer() (*H265VideoLayer, bool)
7228	AsBasicH265VideoLayer() (BasicH265VideoLayer, bool)
7229	AsH265Layer() (*H265Layer, bool)
7230	AsVideoLayer() (*VideoLayer, bool)
7231	AsBasicVideoLayer() (BasicVideoLayer, bool)
7232	AsH264Layer() (*H264Layer, bool)
7233	AsJpgLayer() (*JpgLayer, bool)
7234	AsPngLayer() (*PngLayer, bool)
7235	AsLayer() (*Layer, bool)
7236}
7237
7238// Layer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
7239// specifying a layer for each desired resolution. A layer represents the properties for the video or image at
7240// a resolution.
7241type Layer struct {
7242	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
7243	Width *string `json:"width,omitempty"`
7244	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
7245	Height *string `json:"height,omitempty"`
7246	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
7247	Label *string `json:"label,omitempty"`
7248	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
7249	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
7250}
7251
7252func unmarshalBasicLayer(body []byte) (BasicLayer, error) {
7253	var m map[string]interface{}
7254	err := json.Unmarshal(body, &m)
7255	if err != nil {
7256		return nil, err
7257	}
7258
7259	switch m["@odata.type"] {
7260	case string(OdataTypeMicrosoftMediaH265VideoLayer):
7261		var hvl H265VideoLayer
7262		err := json.Unmarshal(body, &hvl)
7263		return hvl, err
7264	case string(OdataTypeMicrosoftMediaH265Layer):
7265		var hl H265Layer
7266		err := json.Unmarshal(body, &hl)
7267		return hl, err
7268	case string(OdataTypeMicrosoftMediaVideoLayer):
7269		var vl VideoLayer
7270		err := json.Unmarshal(body, &vl)
7271		return vl, err
7272	case string(OdataTypeMicrosoftMediaH264Layer):
7273		var hl H264Layer
7274		err := json.Unmarshal(body, &hl)
7275		return hl, err
7276	case string(OdataTypeMicrosoftMediaJpgLayer):
7277		var jl JpgLayer
7278		err := json.Unmarshal(body, &jl)
7279		return jl, err
7280	case string(OdataTypeMicrosoftMediaPngLayer):
7281		var pl PngLayer
7282		err := json.Unmarshal(body, &pl)
7283		return pl, err
7284	default:
7285		var l Layer
7286		err := json.Unmarshal(body, &l)
7287		return l, err
7288	}
7289}
7290func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) {
7291	var rawMessages []*json.RawMessage
7292	err := json.Unmarshal(body, &rawMessages)
7293	if err != nil {
7294		return nil, err
7295	}
7296
7297	lArray := make([]BasicLayer, len(rawMessages))
7298
7299	for index, rawMessage := range rawMessages {
7300		l, err := unmarshalBasicLayer(*rawMessage)
7301		if err != nil {
7302			return nil, err
7303		}
7304		lArray[index] = l
7305	}
7306	return lArray, nil
7307}
7308
7309// MarshalJSON is the custom marshaler for Layer.
7310func (l Layer) MarshalJSON() ([]byte, error) {
7311	l.OdataType = OdataTypeLayer
7312	objectMap := make(map[string]interface{})
7313	if l.Width != nil {
7314		objectMap["width"] = l.Width
7315	}
7316	if l.Height != nil {
7317		objectMap["height"] = l.Height
7318	}
7319	if l.Label != nil {
7320		objectMap["label"] = l.Label
7321	}
7322	if l.OdataType != "" {
7323		objectMap["@odata.type"] = l.OdataType
7324	}
7325	return json.Marshal(objectMap)
7326}
7327
7328// AsH265VideoLayer is the BasicLayer implementation for Layer.
7329func (l Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
7330	return nil, false
7331}
7332
7333// AsBasicH265VideoLayer is the BasicLayer implementation for Layer.
7334func (l Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
7335	return nil, false
7336}
7337
7338// AsH265Layer is the BasicLayer implementation for Layer.
7339func (l Layer) AsH265Layer() (*H265Layer, bool) {
7340	return nil, false
7341}
7342
7343// AsVideoLayer is the BasicLayer implementation for Layer.
7344func (l Layer) AsVideoLayer() (*VideoLayer, bool) {
7345	return nil, false
7346}
7347
7348// AsBasicVideoLayer is the BasicLayer implementation for Layer.
7349func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
7350	return nil, false
7351}
7352
7353// AsH264Layer is the BasicLayer implementation for Layer.
7354func (l Layer) AsH264Layer() (*H264Layer, bool) {
7355	return nil, false
7356}
7357
7358// AsJpgLayer is the BasicLayer implementation for Layer.
7359func (l Layer) AsJpgLayer() (*JpgLayer, bool) {
7360	return nil, false
7361}
7362
7363// AsPngLayer is the BasicLayer implementation for Layer.
7364func (l Layer) AsPngLayer() (*PngLayer, bool) {
7365	return nil, false
7366}
7367
7368// AsLayer is the BasicLayer implementation for Layer.
7369func (l Layer) AsLayer() (*Layer, bool) {
7370	return &l, true
7371}
7372
7373// AsBasicLayer is the BasicLayer implementation for Layer.
7374func (l Layer) AsBasicLayer() (BasicLayer, bool) {
7375	return &l, true
7376}
7377
7378// ListContainerSasInput the parameters to the list SAS request.
7379type ListContainerSasInput struct {
7380	// Permissions - The permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'
7381	Permissions AssetContainerPermission `json:"permissions,omitempty"`
7382	// ExpiryTime - The SAS URL expiration time.  This must be less than 24 hours from the current time.
7383	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
7384}
7385
7386// ListContentKeysResponse class of response for listContentKeys action
7387type ListContentKeysResponse struct {
7388	autorest.Response `json:"-"`
7389	// ContentKeys - ContentKeys used by current Streaming Locator
7390	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
7391}
7392
7393// ListEdgePoliciesInput ...
7394type ListEdgePoliciesInput struct {
7395	// DeviceID - Unique identifier of the edge device.
7396	DeviceID *string `json:"deviceId,omitempty"`
7397}
7398
7399// ListPathsResponse class of response for listPaths action
7400type ListPathsResponse struct {
7401	autorest.Response `json:"-"`
7402	// StreamingPaths - Streaming Paths supported by current Streaming Locator
7403	StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"`
7404	// DownloadPaths - Download Paths supported by current Streaming Locator
7405	DownloadPaths *[]string `json:"downloadPaths,omitempty"`
7406}
7407
7408// ListStreamingLocatorsResponse the Streaming Locators associated with this Asset.
7409type ListStreamingLocatorsResponse struct {
7410	autorest.Response `json:"-"`
7411	// StreamingLocators - READ-ONLY; The list of Streaming Locators.
7412	StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"`
7413}
7414
7415// MarshalJSON is the custom marshaler for ListStreamingLocatorsResponse.
7416func (lslr ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) {
7417	objectMap := make(map[string]interface{})
7418	return json.Marshal(objectMap)
7419}
7420
7421// LiveEvent the live event.
7422type LiveEvent struct {
7423	autorest.Response `json:"-"`
7424	// LiveEventProperties - The live event properties.
7425	*LiveEventProperties `json:"properties,omitempty"`
7426	// SystemData - READ-ONLY; The system metadata relating to this resource.
7427	SystemData *SystemData `json:"systemData,omitempty"`
7428	// Tags - Resource tags.
7429	Tags map[string]*string `json:"tags"`
7430	// Location - The geo-location where the resource lives
7431	Location *string `json:"location,omitempty"`
7432	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
7433	ID *string `json:"id,omitempty"`
7434	// Name - READ-ONLY; The name of the resource
7435	Name *string `json:"name,omitempty"`
7436	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
7437	Type *string `json:"type,omitempty"`
7438}
7439
7440// MarshalJSON is the custom marshaler for LiveEvent.
7441func (le LiveEvent) MarshalJSON() ([]byte, error) {
7442	objectMap := make(map[string]interface{})
7443	if le.LiveEventProperties != nil {
7444		objectMap["properties"] = le.LiveEventProperties
7445	}
7446	if le.Tags != nil {
7447		objectMap["tags"] = le.Tags
7448	}
7449	if le.Location != nil {
7450		objectMap["location"] = le.Location
7451	}
7452	return json.Marshal(objectMap)
7453}
7454
7455// UnmarshalJSON is the custom unmarshaler for LiveEvent struct.
7456func (le *LiveEvent) UnmarshalJSON(body []byte) error {
7457	var m map[string]*json.RawMessage
7458	err := json.Unmarshal(body, &m)
7459	if err != nil {
7460		return err
7461	}
7462	for k, v := range m {
7463		switch k {
7464		case "properties":
7465			if v != nil {
7466				var liveEventProperties LiveEventProperties
7467				err = json.Unmarshal(*v, &liveEventProperties)
7468				if err != nil {
7469					return err
7470				}
7471				le.LiveEventProperties = &liveEventProperties
7472			}
7473		case "systemData":
7474			if v != nil {
7475				var systemData SystemData
7476				err = json.Unmarshal(*v, &systemData)
7477				if err != nil {
7478					return err
7479				}
7480				le.SystemData = &systemData
7481			}
7482		case "tags":
7483			if v != nil {
7484				var tags map[string]*string
7485				err = json.Unmarshal(*v, &tags)
7486				if err != nil {
7487					return err
7488				}
7489				le.Tags = tags
7490			}
7491		case "location":
7492			if v != nil {
7493				var location string
7494				err = json.Unmarshal(*v, &location)
7495				if err != nil {
7496					return err
7497				}
7498				le.Location = &location
7499			}
7500		case "id":
7501			if v != nil {
7502				var ID string
7503				err = json.Unmarshal(*v, &ID)
7504				if err != nil {
7505					return err
7506				}
7507				le.ID = &ID
7508			}
7509		case "name":
7510			if v != nil {
7511				var name string
7512				err = json.Unmarshal(*v, &name)
7513				if err != nil {
7514					return err
7515				}
7516				le.Name = &name
7517			}
7518		case "type":
7519			if v != nil {
7520				var typeVar string
7521				err = json.Unmarshal(*v, &typeVar)
7522				if err != nil {
7523					return err
7524				}
7525				le.Type = &typeVar
7526			}
7527		}
7528	}
7529
7530	return nil
7531}
7532
7533// LiveEventActionInput the LiveEvent action input parameter definition.
7534type LiveEventActionInput struct {
7535	// RemoveOutputsOnStop - The flag indicates whether live outputs are automatically deleted when live event is being stopped. Deleting live outputs do not delete the underlying assets.
7536	RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"`
7537}
7538
7539// LiveEventEncoding specifies the live event type and optional encoding settings for encoding live events.
7540type LiveEventEncoding struct {
7541	// EncodingType - Live event type. When encodingType is set to None, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the live event is created. Possible values include: 'LiveEventEncodingTypeNone', 'LiveEventEncodingTypeStandard', 'LiveEventEncodingTypePremium1080p'
7542	EncodingType LiveEventEncodingType `json:"encodingType,omitempty"`
7543	// PresetName - The optional encoding preset name, used when encodingType is not None. This value is specified at creation time and cannot be updated. If the encodingType is set to Standard, then the default preset name is ‘Default720p’. Else if the encodingType is set to Premium1080p, the default preset is ‘Default1080p’.
7544	PresetName *string `json:"presetName,omitempty"`
7545	// StretchMode - Specifies how the input video will be resized to fit the desired output resolution(s). Default is None. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
7546	StretchMode StretchMode `json:"stretchMode,omitempty"`
7547	// KeyFrameInterval - Use an ISO 8601 time value between 0.5 to 20 seconds to specify the output fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures).   If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value cannot be set for pass-through live events.
7548	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
7549}
7550
7551// LiveEventEndpoint the live event endpoint.
7552type LiveEventEndpoint struct {
7553	// Protocol - The endpoint protocol.
7554	Protocol *string `json:"protocol,omitempty"`
7555	// URL - The endpoint URL.
7556	URL *string `json:"url,omitempty"`
7557}
7558
7559// LiveEventInput the live event input.
7560type LiveEventInput struct {
7561	// StreamingProtocol - The input protocol for the live event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP'
7562	StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"`
7563	// AccessControl - Access control for live event input.
7564	AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"`
7565	// KeyFrameIntervalDuration - ISO 8601 time duration of the key frame interval duration of the input. This value sets the EXT-X-TARGETDURATION property in the HLS output. For example, use PT2S to indicate 2 seconds. Leave the value empty for encoding live events.
7566	KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"`
7567	// AccessToken - A UUID in string form to uniquely identify the stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value.
7568	AccessToken *string `json:"accessToken,omitempty"`
7569	// Endpoints - The input endpoints for the live event.
7570	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
7571}
7572
7573// LiveEventInputAccessControl the IP access control for live event input.
7574type LiveEventInputAccessControl struct {
7575	// IP - The IP access control properties.
7576	IP *IPAccessControl `json:"ip,omitempty"`
7577}
7578
7579// LiveEventInputTrackSelection a track selection condition. This property is reserved for future use, any
7580// value set on this property will be ignored.
7581type LiveEventInputTrackSelection struct {
7582	// Property - Property name to select. This property is reserved for future use, any value set on this property will be ignored.
7583	Property *string `json:"property,omitempty"`
7584	// Operation - Comparing operation. This property is reserved for future use, any value set on this property will be ignored.
7585	Operation *string `json:"operation,omitempty"`
7586	// Value - Property value to select. This property is reserved for future use, any value set on this property will be ignored.
7587	Value *string `json:"value,omitempty"`
7588}
7589
7590// LiveEventListResult the LiveEvent list result.
7591type LiveEventListResult struct {
7592	autorest.Response `json:"-"`
7593	// Value - The result of the List Live Event operation.
7594	Value *[]LiveEvent `json:"value,omitempty"`
7595	// OdataCount - The number of result.
7596	OdataCount *int32 `json:"@odata.count,omitempty"`
7597	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
7598	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
7599}
7600
7601// LiveEventListResultIterator provides access to a complete listing of LiveEvent values.
7602type LiveEventListResultIterator struct {
7603	i    int
7604	page LiveEventListResultPage
7605}
7606
7607// NextWithContext advances to the next value.  If there was an error making
7608// the request the iterator does not advance and the error is returned.
7609func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) {
7610	if tracing.IsEnabled() {
7611		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext")
7612		defer func() {
7613			sc := -1
7614			if iter.Response().Response.Response != nil {
7615				sc = iter.Response().Response.Response.StatusCode
7616			}
7617			tracing.EndSpan(ctx, sc, err)
7618		}()
7619	}
7620	iter.i++
7621	if iter.i < len(iter.page.Values()) {
7622		return nil
7623	}
7624	err = iter.page.NextWithContext(ctx)
7625	if err != nil {
7626		iter.i--
7627		return err
7628	}
7629	iter.i = 0
7630	return nil
7631}
7632
7633// Next advances to the next value.  If there was an error making
7634// the request the iterator does not advance and the error is returned.
7635// Deprecated: Use NextWithContext() instead.
7636func (iter *LiveEventListResultIterator) Next() error {
7637	return iter.NextWithContext(context.Background())
7638}
7639
7640// NotDone returns true if the enumeration should be started or is not yet complete.
7641func (iter LiveEventListResultIterator) NotDone() bool {
7642	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7643}
7644
7645// Response returns the raw server response from the last page request.
7646func (iter LiveEventListResultIterator) Response() LiveEventListResult {
7647	return iter.page.Response()
7648}
7649
7650// Value returns the current value or a zero-initialized value if the
7651// iterator has advanced beyond the end of the collection.
7652func (iter LiveEventListResultIterator) Value() LiveEvent {
7653	if !iter.page.NotDone() {
7654		return LiveEvent{}
7655	}
7656	return iter.page.Values()[iter.i]
7657}
7658
7659// Creates a new instance of the LiveEventListResultIterator type.
7660func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator {
7661	return LiveEventListResultIterator{page: page}
7662}
7663
7664// IsEmpty returns true if the ListResult contains no values.
7665func (lelr LiveEventListResult) IsEmpty() bool {
7666	return lelr.Value == nil || len(*lelr.Value) == 0
7667}
7668
7669// hasNextLink returns true if the NextLink is not empty.
7670func (lelr LiveEventListResult) hasNextLink() bool {
7671	return lelr.OdataNextLink != nil && len(*lelr.OdataNextLink) != 0
7672}
7673
7674// liveEventListResultPreparer prepares a request to retrieve the next set of results.
7675// It returns nil if no more results exist.
7676func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) {
7677	if !lelr.hasNextLink() {
7678		return nil, nil
7679	}
7680	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7681		autorest.AsJSON(),
7682		autorest.AsGet(),
7683		autorest.WithBaseURL(to.String(lelr.OdataNextLink)))
7684}
7685
7686// LiveEventListResultPage contains a page of LiveEvent values.
7687type LiveEventListResultPage struct {
7688	fn   func(context.Context, LiveEventListResult) (LiveEventListResult, error)
7689	lelr LiveEventListResult
7690}
7691
7692// NextWithContext advances to the next page of values.  If there was an error making
7693// the request the page does not advance and the error is returned.
7694func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) {
7695	if tracing.IsEnabled() {
7696		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext")
7697		defer func() {
7698			sc := -1
7699			if page.Response().Response.Response != nil {
7700				sc = page.Response().Response.Response.StatusCode
7701			}
7702			tracing.EndSpan(ctx, sc, err)
7703		}()
7704	}
7705	for {
7706		next, err := page.fn(ctx, page.lelr)
7707		if err != nil {
7708			return err
7709		}
7710		page.lelr = next
7711		if !next.hasNextLink() || !next.IsEmpty() {
7712			break
7713		}
7714	}
7715	return nil
7716}
7717
7718// Next advances to the next page of values.  If there was an error making
7719// the request the page does not advance and the error is returned.
7720// Deprecated: Use NextWithContext() instead.
7721func (page *LiveEventListResultPage) Next() error {
7722	return page.NextWithContext(context.Background())
7723}
7724
7725// NotDone returns true if the page enumeration should be started or is not yet complete.
7726func (page LiveEventListResultPage) NotDone() bool {
7727	return !page.lelr.IsEmpty()
7728}
7729
7730// Response returns the raw server response from the last page request.
7731func (page LiveEventListResultPage) Response() LiveEventListResult {
7732	return page.lelr
7733}
7734
7735// Values returns the slice of values for the current page or nil if there are no values.
7736func (page LiveEventListResultPage) Values() []LiveEvent {
7737	if page.lelr.IsEmpty() {
7738		return nil
7739	}
7740	return *page.lelr.Value
7741}
7742
7743// Creates a new instance of the LiveEventListResultPage type.
7744func NewLiveEventListResultPage(cur LiveEventListResult, getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage {
7745	return LiveEventListResultPage{
7746		fn:   getNextPage,
7747		lelr: cur,
7748	}
7749}
7750
7751// LiveEventOutputTranscriptionTrack describes a transcription track in the output of a live event,
7752// generated using speech-to-text transcription. This property is reserved for future use, any value set on
7753// this property will be ignored.
7754type LiveEventOutputTranscriptionTrack struct {
7755	// TrackName - The output track name. This property is reserved for future use, any value set on this property will be ignored.
7756	TrackName *string `json:"trackName,omitempty"`
7757}
7758
7759// LiveEventPreview live event preview settings.
7760type LiveEventPreview struct {
7761	// Endpoints - The endpoints for preview. Do not share the preview URL with the live event audience.
7762	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
7763	// AccessControl - The access control for live event preview.
7764	AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"`
7765	// PreviewLocator - The identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created.
7766	PreviewLocator *string `json:"previewLocator,omitempty"`
7767	// StreamingPolicyName - The name of streaming policy used for the live event preview. This value is specified at creation time and cannot be updated.
7768	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
7769	// AlternativeMediaID - An alternative media identifier associated with the streaming locator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field.
7770	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
7771}
7772
7773// LiveEventPreviewAccessControl the IP access control for the live event preview endpoint.
7774type LiveEventPreviewAccessControl struct {
7775	// IP - The IP access control properties.
7776	IP *IPAccessControl `json:"ip,omitempty"`
7777}
7778
7779// LiveEventProperties the live event properties.
7780type LiveEventProperties struct {
7781	// Description - A description for the live event.
7782	Description *string `json:"description,omitempty"`
7783	// Input - Live event input settings. It defines how the live event receives input from a contribution encoder.
7784	Input *LiveEventInput `json:"input,omitempty"`
7785	// Preview - Live event preview settings. Preview allows live event producers to preview the live streaming content without creating any live output.
7786	Preview *LiveEventPreview `json:"preview,omitempty"`
7787	// Encoding - Encoding settings for the live event. It configures whether a live encoder is used for the live event and settings for the live encoder if it is used.
7788	Encoding *LiveEventEncoding `json:"encoding,omitempty"`
7789	// Transcriptions - Live transcription settings for the live event. See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature.
7790	Transcriptions *[]LiveEventTranscription `json:"transcriptions,omitempty"`
7791	// ProvisioningState - READ-ONLY; The provisioning state of the live event.
7792	ProvisioningState *string `json:"provisioningState,omitempty"`
7793	// ResourceState - READ-ONLY; The resource state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for more information. Possible values include: 'Stopped', 'Allocating', 'StandBy', 'Starting', 'Running', 'Stopping', 'Deleting'
7794	ResourceState LiveEventResourceState `json:"resourceState,omitempty"`
7795	// CrossSiteAccessPolicies - Live event cross site access policies.
7796	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
7797	// UseStaticHostname - Specifies whether a static hostname would be assigned to the live event preview and ingest endpoints. This value can only be updated if the live event is in Standby state
7798	UseStaticHostname *bool `json:"useStaticHostname,omitempty"`
7799	// HostnamePrefix - When useStaticHostname is set to true, the hostnamePrefix specifies the first part of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be a combination of this prefix, the media service account name and a short code for the Azure Media Services data center.
7800	HostnamePrefix *string `json:"hostnamePrefix,omitempty"`
7801	// StreamOptions - The options to use for the LiveEvent. This value is specified at creation time and cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'.
7802	StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"`
7803	// Created - READ-ONLY; The creation time for the live event
7804	Created *date.Time `json:"created,omitempty"`
7805	// LastModified - READ-ONLY; The last modified time of the live event.
7806	LastModified *date.Time `json:"lastModified,omitempty"`
7807}
7808
7809// MarshalJSON is the custom marshaler for LiveEventProperties.
7810func (lep LiveEventProperties) MarshalJSON() ([]byte, error) {
7811	objectMap := make(map[string]interface{})
7812	if lep.Description != nil {
7813		objectMap["description"] = lep.Description
7814	}
7815	if lep.Input != nil {
7816		objectMap["input"] = lep.Input
7817	}
7818	if lep.Preview != nil {
7819		objectMap["preview"] = lep.Preview
7820	}
7821	if lep.Encoding != nil {
7822		objectMap["encoding"] = lep.Encoding
7823	}
7824	if lep.Transcriptions != nil {
7825		objectMap["transcriptions"] = lep.Transcriptions
7826	}
7827	if lep.CrossSiteAccessPolicies != nil {
7828		objectMap["crossSiteAccessPolicies"] = lep.CrossSiteAccessPolicies
7829	}
7830	if lep.UseStaticHostname != nil {
7831		objectMap["useStaticHostname"] = lep.UseStaticHostname
7832	}
7833	if lep.HostnamePrefix != nil {
7834		objectMap["hostnamePrefix"] = lep.HostnamePrefix
7835	}
7836	if lep.StreamOptions != nil {
7837		objectMap["streamOptions"] = lep.StreamOptions
7838	}
7839	return json.Marshal(objectMap)
7840}
7841
7842// LiveEventsAllocateFuture an abstraction for monitoring and retrieving the results of a long-running
7843// operation.
7844type LiveEventsAllocateFuture struct {
7845	azure.FutureAPI
7846	// Result returns the result of the asynchronous operation.
7847	// If the operation has not completed it will return an error.
7848	Result func(LiveEventsClient) (autorest.Response, error)
7849}
7850
7851// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7852func (future *LiveEventsAllocateFuture) UnmarshalJSON(body []byte) error {
7853	var azFuture azure.Future
7854	if err := json.Unmarshal(body, &azFuture); err != nil {
7855		return err
7856	}
7857	future.FutureAPI = &azFuture
7858	future.Result = future.result
7859	return nil
7860}
7861
7862// result is the default implementation for LiveEventsAllocateFuture.Result.
7863func (future *LiveEventsAllocateFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7864	var done bool
7865	done, err = future.DoneWithContext(context.Background(), client)
7866	if err != nil {
7867		err = autorest.NewErrorWithError(err, "media.LiveEventsAllocateFuture", "Result", future.Response(), "Polling failure")
7868		return
7869	}
7870	if !done {
7871		ar.Response = future.Response()
7872		err = azure.NewAsyncOpIncompleteError("media.LiveEventsAllocateFuture")
7873		return
7874	}
7875	ar.Response = future.Response()
7876	return
7877}
7878
7879// LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
7880// operation.
7881type LiveEventsCreateFuture struct {
7882	azure.FutureAPI
7883	// Result returns the result of the asynchronous operation.
7884	// If the operation has not completed it will return an error.
7885	Result func(LiveEventsClient) (LiveEvent, error)
7886}
7887
7888// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7889func (future *LiveEventsCreateFuture) UnmarshalJSON(body []byte) error {
7890	var azFuture azure.Future
7891	if err := json.Unmarshal(body, &azFuture); err != nil {
7892		return err
7893	}
7894	future.FutureAPI = &azFuture
7895	future.Result = future.result
7896	return nil
7897}
7898
7899// result is the default implementation for LiveEventsCreateFuture.Result.
7900func (future *LiveEventsCreateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
7901	var done bool
7902	done, err = future.DoneWithContext(context.Background(), client)
7903	if err != nil {
7904		err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure")
7905		return
7906	}
7907	if !done {
7908		le.Response.Response = future.Response()
7909		err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture")
7910		return
7911	}
7912	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7913	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
7914		le, err = client.CreateResponder(le.Response.Response)
7915		if err != nil {
7916			err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request")
7917		}
7918	}
7919	return
7920}
7921
7922// LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7923// operation.
7924type LiveEventsDeleteFuture struct {
7925	azure.FutureAPI
7926	// Result returns the result of the asynchronous operation.
7927	// If the operation has not completed it will return an error.
7928	Result func(LiveEventsClient) (autorest.Response, error)
7929}
7930
7931// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7932func (future *LiveEventsDeleteFuture) UnmarshalJSON(body []byte) error {
7933	var azFuture azure.Future
7934	if err := json.Unmarshal(body, &azFuture); err != nil {
7935		return err
7936	}
7937	future.FutureAPI = &azFuture
7938	future.Result = future.result
7939	return nil
7940}
7941
7942// result is the default implementation for LiveEventsDeleteFuture.Result.
7943func (future *LiveEventsDeleteFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7944	var done bool
7945	done, err = future.DoneWithContext(context.Background(), client)
7946	if err != nil {
7947		err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure")
7948		return
7949	}
7950	if !done {
7951		ar.Response = future.Response()
7952		err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture")
7953		return
7954	}
7955	ar.Response = future.Response()
7956	return
7957}
7958
7959// LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running
7960// operation.
7961type LiveEventsResetFuture struct {
7962	azure.FutureAPI
7963	// Result returns the result of the asynchronous operation.
7964	// If the operation has not completed it will return an error.
7965	Result func(LiveEventsClient) (autorest.Response, error)
7966}
7967
7968// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7969func (future *LiveEventsResetFuture) UnmarshalJSON(body []byte) error {
7970	var azFuture azure.Future
7971	if err := json.Unmarshal(body, &azFuture); err != nil {
7972		return err
7973	}
7974	future.FutureAPI = &azFuture
7975	future.Result = future.result
7976	return nil
7977}
7978
7979// result is the default implementation for LiveEventsResetFuture.Result.
7980func (future *LiveEventsResetFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
7981	var done bool
7982	done, err = future.DoneWithContext(context.Background(), client)
7983	if err != nil {
7984		err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure")
7985		return
7986	}
7987	if !done {
7988		ar.Response = future.Response()
7989		err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture")
7990		return
7991	}
7992	ar.Response = future.Response()
7993	return
7994}
7995
7996// LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running
7997// operation.
7998type LiveEventsStartFuture struct {
7999	azure.FutureAPI
8000	// Result returns the result of the asynchronous operation.
8001	// If the operation has not completed it will return an error.
8002	Result func(LiveEventsClient) (autorest.Response, error)
8003}
8004
8005// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8006func (future *LiveEventsStartFuture) UnmarshalJSON(body []byte) error {
8007	var azFuture azure.Future
8008	if err := json.Unmarshal(body, &azFuture); err != nil {
8009		return err
8010	}
8011	future.FutureAPI = &azFuture
8012	future.Result = future.result
8013	return nil
8014}
8015
8016// result is the default implementation for LiveEventsStartFuture.Result.
8017func (future *LiveEventsStartFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
8018	var done bool
8019	done, err = future.DoneWithContext(context.Background(), client)
8020	if err != nil {
8021		err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure")
8022		return
8023	}
8024	if !done {
8025		ar.Response = future.Response()
8026		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture")
8027		return
8028	}
8029	ar.Response = future.Response()
8030	return
8031}
8032
8033// LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running
8034// operation.
8035type LiveEventsStopFuture struct {
8036	azure.FutureAPI
8037	// Result returns the result of the asynchronous operation.
8038	// If the operation has not completed it will return an error.
8039	Result func(LiveEventsClient) (autorest.Response, error)
8040}
8041
8042// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8043func (future *LiveEventsStopFuture) UnmarshalJSON(body []byte) error {
8044	var azFuture azure.Future
8045	if err := json.Unmarshal(body, &azFuture); err != nil {
8046		return err
8047	}
8048	future.FutureAPI = &azFuture
8049	future.Result = future.result
8050	return nil
8051}
8052
8053// result is the default implementation for LiveEventsStopFuture.Result.
8054func (future *LiveEventsStopFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
8055	var done bool
8056	done, err = future.DoneWithContext(context.Background(), client)
8057	if err != nil {
8058		err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure")
8059		return
8060	}
8061	if !done {
8062		ar.Response = future.Response()
8063		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture")
8064		return
8065	}
8066	ar.Response = future.Response()
8067	return
8068}
8069
8070// LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8071// operation.
8072type LiveEventsUpdateFuture struct {
8073	azure.FutureAPI
8074	// Result returns the result of the asynchronous operation.
8075	// If the operation has not completed it will return an error.
8076	Result func(LiveEventsClient) (LiveEvent, error)
8077}
8078
8079// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8080func (future *LiveEventsUpdateFuture) UnmarshalJSON(body []byte) error {
8081	var azFuture azure.Future
8082	if err := json.Unmarshal(body, &azFuture); err != nil {
8083		return err
8084	}
8085	future.FutureAPI = &azFuture
8086	future.Result = future.result
8087	return nil
8088}
8089
8090// result is the default implementation for LiveEventsUpdateFuture.Result.
8091func (future *LiveEventsUpdateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
8092	var done bool
8093	done, err = future.DoneWithContext(context.Background(), client)
8094	if err != nil {
8095		err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure")
8096		return
8097	}
8098	if !done {
8099		le.Response.Response = future.Response()
8100		err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture")
8101		return
8102	}
8103	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8104	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
8105		le, err = client.UpdateResponder(le.Response.Response)
8106		if err != nil {
8107			err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request")
8108		}
8109	}
8110	return
8111}
8112
8113// LiveEventTranscription describes the transcription tracks in the output of a live event, generated using
8114// speech-to-text transcription. This property is reserved for future use, any value set on this property
8115// will be ignored.
8116type LiveEventTranscription struct {
8117	// Language - Specifies the language (locale) to be used for speech-to-text transcription – it should match the spoken language in the audio track. The value should be in BCP-47 format (e.g: 'en-US'). See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature and the list of supported languages.
8118	Language *string `json:"language,omitempty"`
8119	// InputTrackSelection - Provides a mechanism to select the audio track in the input live feed, to which speech-to-text transcription is applied. This property is reserved for future use, any value set on this property will be ignored.
8120	InputTrackSelection *[]LiveEventInputTrackSelection `json:"inputTrackSelection,omitempty"`
8121	// OutputTranscriptionTrack - Describes a transcription track in the output of a live event, generated using speech-to-text transcription. This property is reserved for future use, any value set on this property will be ignored.
8122	OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"`
8123}
8124
8125// LiveOutput the Live Output.
8126type LiveOutput struct {
8127	autorest.Response `json:"-"`
8128	// LiveOutputProperties - Live output properties.
8129	*LiveOutputProperties `json:"properties,omitempty"`
8130	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
8131	ID *string `json:"id,omitempty"`
8132	// Name - READ-ONLY; The name of the resource
8133	Name *string `json:"name,omitempty"`
8134	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
8135	Type *string `json:"type,omitempty"`
8136}
8137
8138// MarshalJSON is the custom marshaler for LiveOutput.
8139func (lo LiveOutput) MarshalJSON() ([]byte, error) {
8140	objectMap := make(map[string]interface{})
8141	if lo.LiveOutputProperties != nil {
8142		objectMap["properties"] = lo.LiveOutputProperties
8143	}
8144	return json.Marshal(objectMap)
8145}
8146
8147// UnmarshalJSON is the custom unmarshaler for LiveOutput struct.
8148func (lo *LiveOutput) UnmarshalJSON(body []byte) error {
8149	var m map[string]*json.RawMessage
8150	err := json.Unmarshal(body, &m)
8151	if err != nil {
8152		return err
8153	}
8154	for k, v := range m {
8155		switch k {
8156		case "properties":
8157			if v != nil {
8158				var liveOutputProperties LiveOutputProperties
8159				err = json.Unmarshal(*v, &liveOutputProperties)
8160				if err != nil {
8161					return err
8162				}
8163				lo.LiveOutputProperties = &liveOutputProperties
8164			}
8165		case "id":
8166			if v != nil {
8167				var ID string
8168				err = json.Unmarshal(*v, &ID)
8169				if err != nil {
8170					return err
8171				}
8172				lo.ID = &ID
8173			}
8174		case "name":
8175			if v != nil {
8176				var name string
8177				err = json.Unmarshal(*v, &name)
8178				if err != nil {
8179					return err
8180				}
8181				lo.Name = &name
8182			}
8183		case "type":
8184			if v != nil {
8185				var typeVar string
8186				err = json.Unmarshal(*v, &typeVar)
8187				if err != nil {
8188					return err
8189				}
8190				lo.Type = &typeVar
8191			}
8192		}
8193	}
8194
8195	return nil
8196}
8197
8198// LiveOutputListResult the LiveOutput list result.
8199type LiveOutputListResult struct {
8200	autorest.Response `json:"-"`
8201	// Value - The result of the List LiveOutput operation.
8202	Value *[]LiveOutput `json:"value,omitempty"`
8203	// OdataCount - The number of result.
8204	OdataCount *int32 `json:"@odata.count,omitempty"`
8205	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
8206	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
8207}
8208
8209// LiveOutputListResultIterator provides access to a complete listing of LiveOutput values.
8210type LiveOutputListResultIterator struct {
8211	i    int
8212	page LiveOutputListResultPage
8213}
8214
8215// NextWithContext advances to the next value.  If there was an error making
8216// the request the iterator does not advance and the error is returned.
8217func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
8218	if tracing.IsEnabled() {
8219		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext")
8220		defer func() {
8221			sc := -1
8222			if iter.Response().Response.Response != nil {
8223				sc = iter.Response().Response.Response.StatusCode
8224			}
8225			tracing.EndSpan(ctx, sc, err)
8226		}()
8227	}
8228	iter.i++
8229	if iter.i < len(iter.page.Values()) {
8230		return nil
8231	}
8232	err = iter.page.NextWithContext(ctx)
8233	if err != nil {
8234		iter.i--
8235		return err
8236	}
8237	iter.i = 0
8238	return nil
8239}
8240
8241// Next advances to the next value.  If there was an error making
8242// the request the iterator does not advance and the error is returned.
8243// Deprecated: Use NextWithContext() instead.
8244func (iter *LiveOutputListResultIterator) Next() error {
8245	return iter.NextWithContext(context.Background())
8246}
8247
8248// NotDone returns true if the enumeration should be started or is not yet complete.
8249func (iter LiveOutputListResultIterator) NotDone() bool {
8250	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8251}
8252
8253// Response returns the raw server response from the last page request.
8254func (iter LiveOutputListResultIterator) Response() LiveOutputListResult {
8255	return iter.page.Response()
8256}
8257
8258// Value returns the current value or a zero-initialized value if the
8259// iterator has advanced beyond the end of the collection.
8260func (iter LiveOutputListResultIterator) Value() LiveOutput {
8261	if !iter.page.NotDone() {
8262		return LiveOutput{}
8263	}
8264	return iter.page.Values()[iter.i]
8265}
8266
8267// Creates a new instance of the LiveOutputListResultIterator type.
8268func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator {
8269	return LiveOutputListResultIterator{page: page}
8270}
8271
8272// IsEmpty returns true if the ListResult contains no values.
8273func (lolr LiveOutputListResult) IsEmpty() bool {
8274	return lolr.Value == nil || len(*lolr.Value) == 0
8275}
8276
8277// hasNextLink returns true if the NextLink is not empty.
8278func (lolr LiveOutputListResult) hasNextLink() bool {
8279	return lolr.OdataNextLink != nil && len(*lolr.OdataNextLink) != 0
8280}
8281
8282// liveOutputListResultPreparer prepares a request to retrieve the next set of results.
8283// It returns nil if no more results exist.
8284func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) {
8285	if !lolr.hasNextLink() {
8286		return nil, nil
8287	}
8288	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8289		autorest.AsJSON(),
8290		autorest.AsGet(),
8291		autorest.WithBaseURL(to.String(lolr.OdataNextLink)))
8292}
8293
8294// LiveOutputListResultPage contains a page of LiveOutput values.
8295type LiveOutputListResultPage struct {
8296	fn   func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)
8297	lolr LiveOutputListResult
8298}
8299
8300// NextWithContext advances to the next page of values.  If there was an error making
8301// the request the page does not advance and the error is returned.
8302func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) {
8303	if tracing.IsEnabled() {
8304		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext")
8305		defer func() {
8306			sc := -1
8307			if page.Response().Response.Response != nil {
8308				sc = page.Response().Response.Response.StatusCode
8309			}
8310			tracing.EndSpan(ctx, sc, err)
8311		}()
8312	}
8313	for {
8314		next, err := page.fn(ctx, page.lolr)
8315		if err != nil {
8316			return err
8317		}
8318		page.lolr = next
8319		if !next.hasNextLink() || !next.IsEmpty() {
8320			break
8321		}
8322	}
8323	return nil
8324}
8325
8326// Next advances to the next page of values.  If there was an error making
8327// the request the page does not advance and the error is returned.
8328// Deprecated: Use NextWithContext() instead.
8329func (page *LiveOutputListResultPage) Next() error {
8330	return page.NextWithContext(context.Background())
8331}
8332
8333// NotDone returns true if the page enumeration should be started or is not yet complete.
8334func (page LiveOutputListResultPage) NotDone() bool {
8335	return !page.lolr.IsEmpty()
8336}
8337
8338// Response returns the raw server response from the last page request.
8339func (page LiveOutputListResultPage) Response() LiveOutputListResult {
8340	return page.lolr
8341}
8342
8343// Values returns the slice of values for the current page or nil if there are no values.
8344func (page LiveOutputListResultPage) Values() []LiveOutput {
8345	if page.lolr.IsEmpty() {
8346		return nil
8347	}
8348	return *page.lolr.Value
8349}
8350
8351// Creates a new instance of the LiveOutputListResultPage type.
8352func NewLiveOutputListResultPage(cur LiveOutputListResult, getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage {
8353	return LiveOutputListResultPage{
8354		fn:   getNextPage,
8355		lolr: cur,
8356	}
8357}
8358
8359// LiveOutputProperties the JSON object that contains the properties required to create a live output.
8360type LiveOutputProperties struct {
8361	// Description - The description of the live output.
8362	Description *string `json:"description,omitempty"`
8363	// AssetName - The asset that the live output will write to.
8364	AssetName *string `json:"assetName,omitempty"`
8365	// ArchiveWindowLength - ISO 8601 time between 1 minute to 25 hours to indicate the maximum content length that can be archived in the asset for this live output. This also sets the maximum content length for the rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive window.
8366	ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"`
8367	// ManifestName - The manifest file name. If not provided, the service will generate one automatically.
8368	ManifestName *string `json:"manifestName,omitempty"`
8369	// Hls - HTTP Live Streaming (HLS) packing setting for the live output.
8370	Hls *Hls `json:"hls,omitempty"`
8371	// OutputSnapTime - The initial timestamp that the live output will start at, any content before this value will not be archived.
8372	OutputSnapTime *int64 `json:"outputSnapTime,omitempty"`
8373	// Created - READ-ONLY; The creation time the live output.
8374	Created *date.Time `json:"created,omitempty"`
8375	// LastModified - READ-ONLY; The time the live output was last modified.
8376	LastModified *date.Time `json:"lastModified,omitempty"`
8377	// ProvisioningState - READ-ONLY; The provisioning state of the live output.
8378	ProvisioningState *string `json:"provisioningState,omitempty"`
8379	// ResourceState - READ-ONLY; The resource state of the live output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting'
8380	ResourceState LiveOutputResourceState `json:"resourceState,omitempty"`
8381}
8382
8383// MarshalJSON is the custom marshaler for LiveOutputProperties.
8384func (lop LiveOutputProperties) MarshalJSON() ([]byte, error) {
8385	objectMap := make(map[string]interface{})
8386	if lop.Description != nil {
8387		objectMap["description"] = lop.Description
8388	}
8389	if lop.AssetName != nil {
8390		objectMap["assetName"] = lop.AssetName
8391	}
8392	if lop.ArchiveWindowLength != nil {
8393		objectMap["archiveWindowLength"] = lop.ArchiveWindowLength
8394	}
8395	if lop.ManifestName != nil {
8396		objectMap["manifestName"] = lop.ManifestName
8397	}
8398	if lop.Hls != nil {
8399		objectMap["hls"] = lop.Hls
8400	}
8401	if lop.OutputSnapTime != nil {
8402		objectMap["outputSnapTime"] = lop.OutputSnapTime
8403	}
8404	return json.Marshal(objectMap)
8405}
8406
8407// LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
8408// operation.
8409type LiveOutputsCreateFuture struct {
8410	azure.FutureAPI
8411	// Result returns the result of the asynchronous operation.
8412	// If the operation has not completed it will return an error.
8413	Result func(LiveOutputsClient) (LiveOutput, error)
8414}
8415
8416// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8417func (future *LiveOutputsCreateFuture) UnmarshalJSON(body []byte) error {
8418	var azFuture azure.Future
8419	if err := json.Unmarshal(body, &azFuture); err != nil {
8420		return err
8421	}
8422	future.FutureAPI = &azFuture
8423	future.Result = future.result
8424	return nil
8425}
8426
8427// result is the default implementation for LiveOutputsCreateFuture.Result.
8428func (future *LiveOutputsCreateFuture) result(client LiveOutputsClient) (lo LiveOutput, err error) {
8429	var done bool
8430	done, err = future.DoneWithContext(context.Background(), client)
8431	if err != nil {
8432		err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure")
8433		return
8434	}
8435	if !done {
8436		lo.Response.Response = future.Response()
8437		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture")
8438		return
8439	}
8440	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8441	if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent {
8442		lo, err = client.CreateResponder(lo.Response.Response)
8443		if err != nil {
8444			err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request")
8445		}
8446	}
8447	return
8448}
8449
8450// LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8451// operation.
8452type LiveOutputsDeleteFuture struct {
8453	azure.FutureAPI
8454	// Result returns the result of the asynchronous operation.
8455	// If the operation has not completed it will return an error.
8456	Result func(LiveOutputsClient) (autorest.Response, error)
8457}
8458
8459// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8460func (future *LiveOutputsDeleteFuture) UnmarshalJSON(body []byte) error {
8461	var azFuture azure.Future
8462	if err := json.Unmarshal(body, &azFuture); err != nil {
8463		return err
8464	}
8465	future.FutureAPI = &azFuture
8466	future.Result = future.result
8467	return nil
8468}
8469
8470// result is the default implementation for LiveOutputsDeleteFuture.Result.
8471func (future *LiveOutputsDeleteFuture) result(client LiveOutputsClient) (ar autorest.Response, err error) {
8472	var done bool
8473	done, err = future.DoneWithContext(context.Background(), client)
8474	if err != nil {
8475		err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure")
8476		return
8477	}
8478	if !done {
8479		ar.Response = future.Response()
8480		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture")
8481		return
8482	}
8483	ar.Response = future.Response()
8484	return
8485}
8486
8487// Location ...
8488type Location struct {
8489	Name *string `json:"name,omitempty"`
8490}
8491
8492// LogSpecification a diagnostic log emitted by service.
8493type LogSpecification struct {
8494	// Name - READ-ONLY; The diagnostic log category name.
8495	Name *string `json:"name,omitempty"`
8496	// DisplayName - READ-ONLY; The diagnostic log category display name.
8497	DisplayName *string `json:"displayName,omitempty"`
8498	// BlobDuration - READ-ONLY; The time range for requests in each blob.
8499	BlobDuration *string `json:"blobDuration,omitempty"`
8500}
8501
8502// MarshalJSON is the custom marshaler for LogSpecification.
8503func (ls LogSpecification) MarshalJSON() ([]byte, error) {
8504	objectMap := make(map[string]interface{})
8505	return json.Marshal(objectMap)
8506}
8507
8508// MetricDimension a metric dimension.
8509type MetricDimension struct {
8510	// Name - READ-ONLY; The metric dimension name.
8511	Name *string `json:"name,omitempty"`
8512	// DisplayName - READ-ONLY; The display name for the dimension.
8513	DisplayName *string `json:"displayName,omitempty"`
8514	// ToBeExportedForShoebox - READ-ONLY; Whether to export metric to shoebox.
8515	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
8516}
8517
8518// MarshalJSON is the custom marshaler for MetricDimension.
8519func (md MetricDimension) MarshalJSON() ([]byte, error) {
8520	objectMap := make(map[string]interface{})
8521	return json.Marshal(objectMap)
8522}
8523
8524// MetricSpecification a metric emitted by service.
8525type MetricSpecification struct {
8526	// Name - READ-ONLY; The metric name.
8527	Name *string `json:"name,omitempty"`
8528	// DisplayName - READ-ONLY; The metric display name.
8529	DisplayName *string `json:"displayName,omitempty"`
8530	// DisplayDescription - READ-ONLY; The metric display description.
8531	DisplayDescription *string `json:"displayDescription,omitempty"`
8532	// Unit - READ-ONLY; The metric unit. Possible values include: 'MetricUnitBytes', 'MetricUnitCount', 'MetricUnitMilliseconds'
8533	Unit MetricUnit `json:"unit,omitempty"`
8534	// AggregationType - READ-ONLY; The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'
8535	AggregationType MetricAggregationType `json:"aggregationType,omitempty"`
8536	// LockAggregationType - READ-ONLY; The metric lock aggregation type. Possible values include: 'Average', 'Count', 'Total'
8537	LockAggregationType MetricAggregationType `json:"lockAggregationType,omitempty"`
8538	// SupportedAggregationTypes - Supported aggregation types.
8539	SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
8540	// Dimensions - READ-ONLY; The metric dimensions.
8541	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
8542}
8543
8544// MarshalJSON is the custom marshaler for MetricSpecification.
8545func (ms MetricSpecification) MarshalJSON() ([]byte, error) {
8546	objectMap := make(map[string]interface{})
8547	if ms.SupportedAggregationTypes != nil {
8548		objectMap["supportedAggregationTypes"] = ms.SupportedAggregationTypes
8549	}
8550	return json.Marshal(objectMap)
8551}
8552
8553// Mp4Format describes the properties for an output ISO MP4 file.
8554type Mp4Format struct {
8555	// OutputFiles - The list of output files to produce.  Each entry in the list is a set of audio and video layer labels to be muxed together .
8556	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
8557	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
8558	FilenamePattern *string `json:"filenamePattern,omitempty"`
8559	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
8560	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
8561}
8562
8563// MarshalJSON is the custom marshaler for Mp4Format.
8564func (m4f Mp4Format) MarshalJSON() ([]byte, error) {
8565	m4f.OdataType = OdataTypeMicrosoftMediaMp4Format
8566	objectMap := make(map[string]interface{})
8567	if m4f.OutputFiles != nil {
8568		objectMap["outputFiles"] = m4f.OutputFiles
8569	}
8570	if m4f.FilenamePattern != nil {
8571		objectMap["filenamePattern"] = m4f.FilenamePattern
8572	}
8573	if m4f.OdataType != "" {
8574		objectMap["@odata.type"] = m4f.OdataType
8575	}
8576	return json.Marshal(objectMap)
8577}
8578
8579// AsImageFormat is the BasicFormat implementation for Mp4Format.
8580func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) {
8581	return nil, false
8582}
8583
8584// AsBasicImageFormat is the BasicFormat implementation for Mp4Format.
8585func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) {
8586	return nil, false
8587}
8588
8589// AsJpgFormat is the BasicFormat implementation for Mp4Format.
8590func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) {
8591	return nil, false
8592}
8593
8594// AsPngFormat is the BasicFormat implementation for Mp4Format.
8595func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) {
8596	return nil, false
8597}
8598
8599// AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
8600func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
8601	return nil, false
8602}
8603
8604// AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
8605func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
8606	return &m4f, true
8607}
8608
8609// AsMp4Format is the BasicFormat implementation for Mp4Format.
8610func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) {
8611	return &m4f, true
8612}
8613
8614// AsTransportStreamFormat is the BasicFormat implementation for Mp4Format.
8615func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
8616	return nil, false
8617}
8618
8619// AsFormat is the BasicFormat implementation for Mp4Format.
8620func (m4f Mp4Format) AsFormat() (*Format, bool) {
8621	return nil, false
8622}
8623
8624// AsBasicFormat is the BasicFormat implementation for Mp4Format.
8625func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) {
8626	return &m4f, true
8627}
8628
8629// BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The
8630// default behavior is to produce one output file for each video layer which is muxed together with all the audios. The
8631// exact output files produced can be controlled by specifying the outputFiles collection.
8632type BasicMultiBitrateFormat interface {
8633	AsMp4Format() (*Mp4Format, bool)
8634	AsTransportStreamFormat() (*TransportStreamFormat, bool)
8635	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
8636}
8637
8638// MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files.
8639// The default behavior is to produce one output file for each video layer which is muxed together with all the
8640// audios. The exact output files produced can be controlled by specifying the outputFiles collection.
8641type MultiBitrateFormat struct {
8642	// OutputFiles - The list of output files to produce.  Each entry in the list is a set of audio and video layer labels to be muxed together .
8643	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
8644	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
8645	FilenamePattern *string `json:"filenamePattern,omitempty"`
8646	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
8647	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
8648}
8649
8650func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) {
8651	var m map[string]interface{}
8652	err := json.Unmarshal(body, &m)
8653	if err != nil {
8654		return nil, err
8655	}
8656
8657	switch m["@odata.type"] {
8658	case string(OdataTypeMicrosoftMediaMp4Format):
8659		var m4f Mp4Format
8660		err := json.Unmarshal(body, &m4f)
8661		return m4f, err
8662	case string(OdataTypeMicrosoftMediaTransportStreamFormat):
8663		var tsf TransportStreamFormat
8664		err := json.Unmarshal(body, &tsf)
8665		return tsf, err
8666	default:
8667		var mbf MultiBitrateFormat
8668		err := json.Unmarshal(body, &mbf)
8669		return mbf, err
8670	}
8671}
8672func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) {
8673	var rawMessages []*json.RawMessage
8674	err := json.Unmarshal(body, &rawMessages)
8675	if err != nil {
8676		return nil, err
8677	}
8678
8679	mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages))
8680
8681	for index, rawMessage := range rawMessages {
8682		mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage)
8683		if err != nil {
8684			return nil, err
8685		}
8686		mbfArray[index] = mbf
8687	}
8688	return mbfArray, nil
8689}
8690
8691// MarshalJSON is the custom marshaler for MultiBitrateFormat.
8692func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) {
8693	mbf.OdataType = OdataTypeMicrosoftMediaMultiBitrateFormat
8694	objectMap := make(map[string]interface{})
8695	if mbf.OutputFiles != nil {
8696		objectMap["outputFiles"] = mbf.OutputFiles
8697	}
8698	if mbf.FilenamePattern != nil {
8699		objectMap["filenamePattern"] = mbf.FilenamePattern
8700	}
8701	if mbf.OdataType != "" {
8702		objectMap["@odata.type"] = mbf.OdataType
8703	}
8704	return json.Marshal(objectMap)
8705}
8706
8707// AsImageFormat is the BasicFormat implementation for MultiBitrateFormat.
8708func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) {
8709	return nil, false
8710}
8711
8712// AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat.
8713func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
8714	return nil, false
8715}
8716
8717// AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat.
8718func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) {
8719	return nil, false
8720}
8721
8722// AsPngFormat is the BasicFormat implementation for MultiBitrateFormat.
8723func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) {
8724	return nil, false
8725}
8726
8727// AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
8728func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
8729	return &mbf, true
8730}
8731
8732// AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
8733func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
8734	return &mbf, true
8735}
8736
8737// AsMp4Format is the BasicFormat implementation for MultiBitrateFormat.
8738func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) {
8739	return nil, false
8740}
8741
8742// AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat.
8743func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
8744	return nil, false
8745}
8746
8747// AsFormat is the BasicFormat implementation for MultiBitrateFormat.
8748func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) {
8749	return nil, false
8750}
8751
8752// AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat.
8753func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) {
8754	return &mbf, true
8755}
8756
8757// NoEncryption class for NoEncryption scheme
8758type NoEncryption struct {
8759	// EnabledProtocols - Representing supported protocols
8760	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
8761}
8762
8763// ODataError information about an error.
8764type ODataError struct {
8765	// Code - A language-independent error name.
8766	Code *string `json:"code,omitempty"`
8767	// Message - The error message.
8768	Message *string `json:"message,omitempty"`
8769	// Target - The target of the error (for example, the name of the property in error).
8770	Target *string `json:"target,omitempty"`
8771	// Details - The error details.
8772	Details *[]ODataError `json:"details,omitempty"`
8773}
8774
8775// Operation an operation.
8776type Operation struct {
8777	// Name - The operation name.
8778	Name *string `json:"name,omitempty"`
8779	// Display - The operation display name.
8780	Display *OperationDisplay `json:"display,omitempty"`
8781	// Origin - Origin of the operation.
8782	Origin *string `json:"origin,omitempty"`
8783	// Properties - Operation properties format.
8784	Properties *Properties `json:"properties,omitempty"`
8785}
8786
8787// OperationCollection a collection of Operation items.
8788type OperationCollection struct {
8789	autorest.Response `json:"-"`
8790	// Value - A collection of Operation items.
8791	Value *[]Operation `json:"value,omitempty"`
8792	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
8793	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
8794}
8795
8796// OperationCollectionIterator provides access to a complete listing of Operation values.
8797type OperationCollectionIterator struct {
8798	i    int
8799	page OperationCollectionPage
8800}
8801
8802// NextWithContext advances to the next value.  If there was an error making
8803// the request the iterator does not advance and the error is returned.
8804func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8805	if tracing.IsEnabled() {
8806		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
8807		defer func() {
8808			sc := -1
8809			if iter.Response().Response.Response != nil {
8810				sc = iter.Response().Response.Response.StatusCode
8811			}
8812			tracing.EndSpan(ctx, sc, err)
8813		}()
8814	}
8815	iter.i++
8816	if iter.i < len(iter.page.Values()) {
8817		return nil
8818	}
8819	err = iter.page.NextWithContext(ctx)
8820	if err != nil {
8821		iter.i--
8822		return err
8823	}
8824	iter.i = 0
8825	return nil
8826}
8827
8828// Next advances to the next value.  If there was an error making
8829// the request the iterator does not advance and the error is returned.
8830// Deprecated: Use NextWithContext() instead.
8831func (iter *OperationCollectionIterator) Next() error {
8832	return iter.NextWithContext(context.Background())
8833}
8834
8835// NotDone returns true if the enumeration should be started or is not yet complete.
8836func (iter OperationCollectionIterator) NotDone() bool {
8837	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8838}
8839
8840// Response returns the raw server response from the last page request.
8841func (iter OperationCollectionIterator) Response() OperationCollection {
8842	return iter.page.Response()
8843}
8844
8845// Value returns the current value or a zero-initialized value if the
8846// iterator has advanced beyond the end of the collection.
8847func (iter OperationCollectionIterator) Value() Operation {
8848	if !iter.page.NotDone() {
8849		return Operation{}
8850	}
8851	return iter.page.Values()[iter.i]
8852}
8853
8854// Creates a new instance of the OperationCollectionIterator type.
8855func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
8856	return OperationCollectionIterator{page: page}
8857}
8858
8859// IsEmpty returns true if the ListResult contains no values.
8860func (oc OperationCollection) IsEmpty() bool {
8861	return oc.Value == nil || len(*oc.Value) == 0
8862}
8863
8864// hasNextLink returns true if the NextLink is not empty.
8865func (oc OperationCollection) hasNextLink() bool {
8866	return oc.OdataNextLink != nil && len(*oc.OdataNextLink) != 0
8867}
8868
8869// operationCollectionPreparer prepares a request to retrieve the next set of results.
8870// It returns nil if no more results exist.
8871func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
8872	if !oc.hasNextLink() {
8873		return nil, nil
8874	}
8875	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8876		autorest.AsJSON(),
8877		autorest.AsGet(),
8878		autorest.WithBaseURL(to.String(oc.OdataNextLink)))
8879}
8880
8881// OperationCollectionPage contains a page of Operation values.
8882type OperationCollectionPage struct {
8883	fn func(context.Context, OperationCollection) (OperationCollection, error)
8884	oc OperationCollection
8885}
8886
8887// NextWithContext advances to the next page of values.  If there was an error making
8888// the request the page does not advance and the error is returned.
8889func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
8890	if tracing.IsEnabled() {
8891		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
8892		defer func() {
8893			sc := -1
8894			if page.Response().Response.Response != nil {
8895				sc = page.Response().Response.Response.StatusCode
8896			}
8897			tracing.EndSpan(ctx, sc, err)
8898		}()
8899	}
8900	for {
8901		next, err := page.fn(ctx, page.oc)
8902		if err != nil {
8903			return err
8904		}
8905		page.oc = next
8906		if !next.hasNextLink() || !next.IsEmpty() {
8907			break
8908		}
8909	}
8910	return nil
8911}
8912
8913// Next advances to the next page of values.  If there was an error making
8914// the request the page does not advance and the error is returned.
8915// Deprecated: Use NextWithContext() instead.
8916func (page *OperationCollectionPage) Next() error {
8917	return page.NextWithContext(context.Background())
8918}
8919
8920// NotDone returns true if the page enumeration should be started or is not yet complete.
8921func (page OperationCollectionPage) NotDone() bool {
8922	return !page.oc.IsEmpty()
8923}
8924
8925// Response returns the raw server response from the last page request.
8926func (page OperationCollectionPage) Response() OperationCollection {
8927	return page.oc
8928}
8929
8930// Values returns the slice of values for the current page or nil if there are no values.
8931func (page OperationCollectionPage) Values() []Operation {
8932	if page.oc.IsEmpty() {
8933		return nil
8934	}
8935	return *page.oc.Value
8936}
8937
8938// Creates a new instance of the OperationCollectionPage type.
8939func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
8940	return OperationCollectionPage{
8941		fn: getNextPage,
8942		oc: cur,
8943	}
8944}
8945
8946// OperationDisplay operation details.
8947type OperationDisplay struct {
8948	// Provider - The service provider.
8949	Provider *string `json:"provider,omitempty"`
8950	// Resource - Resource on which the operation is performed.
8951	Resource *string `json:"resource,omitempty"`
8952	// Operation - The operation type.
8953	Operation *string `json:"operation,omitempty"`
8954	// Description - The operation description.
8955	Description *string `json:"description,omitempty"`
8956}
8957
8958// OutputFile represents an output file produced.
8959type OutputFile struct {
8960	// Labels - The list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1.
8961	Labels *[]string `json:"labels,omitempty"`
8962}
8963
8964// BasicOverlay base type for all overlays - image, audio or video.
8965type BasicOverlay interface {
8966	AsAudioOverlay() (*AudioOverlay, bool)
8967	AsVideoOverlay() (*VideoOverlay, bool)
8968	AsOverlay() (*Overlay, bool)
8969}
8970
8971// Overlay base type for all overlays - image, audio or video.
8972type Overlay struct {
8973	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
8974	InputLabel *string `json:"inputLabel,omitempty"`
8975	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
8976	Start *string `json:"start,omitempty"`
8977	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
8978	End *string `json:"end,omitempty"`
8979	// FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S).
8980	FadeInDuration *string `json:"fadeInDuration,omitempty"`
8981	// FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S).
8982	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
8983	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
8984	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
8985	// OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay'
8986	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
8987}
8988
8989func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) {
8990	var m map[string]interface{}
8991	err := json.Unmarshal(body, &m)
8992	if err != nil {
8993		return nil, err
8994	}
8995
8996	switch m["@odata.type"] {
8997	case string(OdataTypeMicrosoftMediaAudioOverlay):
8998		var ao AudioOverlay
8999		err := json.Unmarshal(body, &ao)
9000		return ao, err
9001	case string(OdataTypeMicrosoftMediaVideoOverlay):
9002		var vo VideoOverlay
9003		err := json.Unmarshal(body, &vo)
9004		return vo, err
9005	default:
9006		var o Overlay
9007		err := json.Unmarshal(body, &o)
9008		return o, err
9009	}
9010}
9011func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) {
9012	var rawMessages []*json.RawMessage
9013	err := json.Unmarshal(body, &rawMessages)
9014	if err != nil {
9015		return nil, err
9016	}
9017
9018	oArray := make([]BasicOverlay, len(rawMessages))
9019
9020	for index, rawMessage := range rawMessages {
9021		o, err := unmarshalBasicOverlay(*rawMessage)
9022		if err != nil {
9023			return nil, err
9024		}
9025		oArray[index] = o
9026	}
9027	return oArray, nil
9028}
9029
9030// MarshalJSON is the custom marshaler for Overlay.
9031func (o Overlay) MarshalJSON() ([]byte, error) {
9032	o.OdataType = OdataTypeOverlay
9033	objectMap := make(map[string]interface{})
9034	if o.InputLabel != nil {
9035		objectMap["inputLabel"] = o.InputLabel
9036	}
9037	if o.Start != nil {
9038		objectMap["start"] = o.Start
9039	}
9040	if o.End != nil {
9041		objectMap["end"] = o.End
9042	}
9043	if o.FadeInDuration != nil {
9044		objectMap["fadeInDuration"] = o.FadeInDuration
9045	}
9046	if o.FadeOutDuration != nil {
9047		objectMap["fadeOutDuration"] = o.FadeOutDuration
9048	}
9049	if o.AudioGainLevel != nil {
9050		objectMap["audioGainLevel"] = o.AudioGainLevel
9051	}
9052	if o.OdataType != "" {
9053		objectMap["@odata.type"] = o.OdataType
9054	}
9055	return json.Marshal(objectMap)
9056}
9057
9058// AsAudioOverlay is the BasicOverlay implementation for Overlay.
9059func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) {
9060	return nil, false
9061}
9062
9063// AsVideoOverlay is the BasicOverlay implementation for Overlay.
9064func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) {
9065	return nil, false
9066}
9067
9068// AsOverlay is the BasicOverlay implementation for Overlay.
9069func (o Overlay) AsOverlay() (*Overlay, bool) {
9070	return &o, true
9071}
9072
9073// AsBasicOverlay is the BasicOverlay implementation for Overlay.
9074func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) {
9075	return &o, true
9076}
9077
9078// PngFormat describes the settings for producing PNG thumbnails.
9079type PngFormat struct {
9080	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
9081	FilenamePattern *string `json:"filenamePattern,omitempty"`
9082	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
9083	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
9084}
9085
9086// MarshalJSON is the custom marshaler for PngFormat.
9087func (pf PngFormat) MarshalJSON() ([]byte, error) {
9088	pf.OdataType = OdataTypeMicrosoftMediaPngFormat
9089	objectMap := make(map[string]interface{})
9090	if pf.FilenamePattern != nil {
9091		objectMap["filenamePattern"] = pf.FilenamePattern
9092	}
9093	if pf.OdataType != "" {
9094		objectMap["@odata.type"] = pf.OdataType
9095	}
9096	return json.Marshal(objectMap)
9097}
9098
9099// AsImageFormat is the BasicFormat implementation for PngFormat.
9100func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) {
9101	return nil, false
9102}
9103
9104// AsBasicImageFormat is the BasicFormat implementation for PngFormat.
9105func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
9106	return &pf, true
9107}
9108
9109// AsJpgFormat is the BasicFormat implementation for PngFormat.
9110func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) {
9111	return nil, false
9112}
9113
9114// AsPngFormat is the BasicFormat implementation for PngFormat.
9115func (pf PngFormat) AsPngFormat() (*PngFormat, bool) {
9116	return &pf, true
9117}
9118
9119// AsMultiBitrateFormat is the BasicFormat implementation for PngFormat.
9120func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
9121	return nil, false
9122}
9123
9124// AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat.
9125func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
9126	return nil, false
9127}
9128
9129// AsMp4Format is the BasicFormat implementation for PngFormat.
9130func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) {
9131	return nil, false
9132}
9133
9134// AsTransportStreamFormat is the BasicFormat implementation for PngFormat.
9135func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
9136	return nil, false
9137}
9138
9139// AsFormat is the BasicFormat implementation for PngFormat.
9140func (pf PngFormat) AsFormat() (*Format, bool) {
9141	return nil, false
9142}
9143
9144// AsBasicFormat is the BasicFormat implementation for PngFormat.
9145func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) {
9146	return &pf, true
9147}
9148
9149// PngImage describes the properties for producing a series of PNG images from the input video.
9150type PngImage struct {
9151	// Layers - A collection of output PNG image layers to be produced by the encoder.
9152	Layers *[]PngLayer `json:"layers,omitempty"`
9153	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
9154	Start *string `json:"start,omitempty"`
9155	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
9156	Step *string `json:"step,omitempty"`
9157	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
9158	Range *string `json:"range,omitempty"`
9159	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
9160	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
9161	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
9162	StretchMode StretchMode `json:"stretchMode,omitempty"`
9163	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
9164	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
9165	// Label - An optional label for the codec. The label can be used to control muxing behavior.
9166	Label *string `json:"label,omitempty"`
9167	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
9168	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
9169}
9170
9171// MarshalJSON is the custom marshaler for PngImage.
9172func (pi PngImage) MarshalJSON() ([]byte, error) {
9173	pi.OdataType = OdataTypeMicrosoftMediaPngImage
9174	objectMap := make(map[string]interface{})
9175	if pi.Layers != nil {
9176		objectMap["layers"] = pi.Layers
9177	}
9178	if pi.Start != nil {
9179		objectMap["start"] = pi.Start
9180	}
9181	if pi.Step != nil {
9182		objectMap["step"] = pi.Step
9183	}
9184	if pi.Range != nil {
9185		objectMap["range"] = pi.Range
9186	}
9187	if pi.KeyFrameInterval != nil {
9188		objectMap["keyFrameInterval"] = pi.KeyFrameInterval
9189	}
9190	if pi.StretchMode != "" {
9191		objectMap["stretchMode"] = pi.StretchMode
9192	}
9193	if pi.SyncMode != "" {
9194		objectMap["syncMode"] = pi.SyncMode
9195	}
9196	if pi.Label != nil {
9197		objectMap["label"] = pi.Label
9198	}
9199	if pi.OdataType != "" {
9200		objectMap["@odata.type"] = pi.OdataType
9201	}
9202	return json.Marshal(objectMap)
9203}
9204
9205// AsAudio is the BasicCodec implementation for PngImage.
9206func (pi PngImage) AsAudio() (*Audio, bool) {
9207	return nil, false
9208}
9209
9210// AsBasicAudio is the BasicCodec implementation for PngImage.
9211func (pi PngImage) AsBasicAudio() (BasicAudio, bool) {
9212	return nil, false
9213}
9214
9215// AsAacAudio is the BasicCodec implementation for PngImage.
9216func (pi PngImage) AsAacAudio() (*AacAudio, bool) {
9217	return nil, false
9218}
9219
9220// AsVideo is the BasicCodec implementation for PngImage.
9221func (pi PngImage) AsVideo() (*Video, bool) {
9222	return nil, false
9223}
9224
9225// AsBasicVideo is the BasicCodec implementation for PngImage.
9226func (pi PngImage) AsBasicVideo() (BasicVideo, bool) {
9227	return &pi, true
9228}
9229
9230// AsH265Video is the BasicCodec implementation for PngImage.
9231func (pi PngImage) AsH265Video() (*H265Video, bool) {
9232	return nil, false
9233}
9234
9235// AsCopyVideo is the BasicCodec implementation for PngImage.
9236func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) {
9237	return nil, false
9238}
9239
9240// AsImage is the BasicCodec implementation for PngImage.
9241func (pi PngImage) AsImage() (*Image, bool) {
9242	return nil, false
9243}
9244
9245// AsBasicImage is the BasicCodec implementation for PngImage.
9246func (pi PngImage) AsBasicImage() (BasicImage, bool) {
9247	return &pi, true
9248}
9249
9250// AsCopyAudio is the BasicCodec implementation for PngImage.
9251func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) {
9252	return nil, false
9253}
9254
9255// AsH264Video is the BasicCodec implementation for PngImage.
9256func (pi PngImage) AsH264Video() (*H264Video, bool) {
9257	return nil, false
9258}
9259
9260// AsJpgImage is the BasicCodec implementation for PngImage.
9261func (pi PngImage) AsJpgImage() (*JpgImage, bool) {
9262	return nil, false
9263}
9264
9265// AsPngImage is the BasicCodec implementation for PngImage.
9266func (pi PngImage) AsPngImage() (*PngImage, bool) {
9267	return &pi, true
9268}
9269
9270// AsCodec is the BasicCodec implementation for PngImage.
9271func (pi PngImage) AsCodec() (*Codec, bool) {
9272	return nil, false
9273}
9274
9275// AsBasicCodec is the BasicCodec implementation for PngImage.
9276func (pi PngImage) AsBasicCodec() (BasicCodec, bool) {
9277	return &pi, true
9278}
9279
9280// PngLayer describes the settings to produce a PNG image from the input video.
9281type PngLayer struct {
9282	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
9283	Width *string `json:"width,omitempty"`
9284	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
9285	Height *string `json:"height,omitempty"`
9286	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
9287	Label *string `json:"label,omitempty"`
9288	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
9289	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
9290}
9291
9292// MarshalJSON is the custom marshaler for PngLayer.
9293func (pl PngLayer) MarshalJSON() ([]byte, error) {
9294	pl.OdataType = OdataTypeMicrosoftMediaPngLayer
9295	objectMap := make(map[string]interface{})
9296	if pl.Width != nil {
9297		objectMap["width"] = pl.Width
9298	}
9299	if pl.Height != nil {
9300		objectMap["height"] = pl.Height
9301	}
9302	if pl.Label != nil {
9303		objectMap["label"] = pl.Label
9304	}
9305	if pl.OdataType != "" {
9306		objectMap["@odata.type"] = pl.OdataType
9307	}
9308	return json.Marshal(objectMap)
9309}
9310
9311// AsH265VideoLayer is the BasicLayer implementation for PngLayer.
9312func (pl PngLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
9313	return nil, false
9314}
9315
9316// AsBasicH265VideoLayer is the BasicLayer implementation for PngLayer.
9317func (pl PngLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
9318	return nil, false
9319}
9320
9321// AsH265Layer is the BasicLayer implementation for PngLayer.
9322func (pl PngLayer) AsH265Layer() (*H265Layer, bool) {
9323	return nil, false
9324}
9325
9326// AsVideoLayer is the BasicLayer implementation for PngLayer.
9327func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) {
9328	return nil, false
9329}
9330
9331// AsBasicVideoLayer is the BasicLayer implementation for PngLayer.
9332func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
9333	return nil, false
9334}
9335
9336// AsH264Layer is the BasicLayer implementation for PngLayer.
9337func (pl PngLayer) AsH264Layer() (*H264Layer, bool) {
9338	return nil, false
9339}
9340
9341// AsJpgLayer is the BasicLayer implementation for PngLayer.
9342func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) {
9343	return nil, false
9344}
9345
9346// AsPngLayer is the BasicLayer implementation for PngLayer.
9347func (pl PngLayer) AsPngLayer() (*PngLayer, bool) {
9348	return &pl, true
9349}
9350
9351// AsLayer is the BasicLayer implementation for PngLayer.
9352func (pl PngLayer) AsLayer() (*Layer, bool) {
9353	return nil, false
9354}
9355
9356// AsBasicLayer is the BasicLayer implementation for PngLayer.
9357func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) {
9358	return &pl, true
9359}
9360
9361// PresentationTimeRange the presentation time range, this is asset related and not recommended for Account
9362// Filter.
9363type PresentationTimeRange struct {
9364	// StartTimestamp - The absolute start time boundary.
9365	StartTimestamp *int64 `json:"startTimestamp,omitempty"`
9366	// EndTimestamp - The absolute end time boundary.
9367	EndTimestamp *int64 `json:"endTimestamp,omitempty"`
9368	// PresentationWindowDuration - The relative to end sliding window.
9369	PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"`
9370	// LiveBackoffDuration - The relative to end right edge.
9371	LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"`
9372	// Timescale - The time scale of time stamps.
9373	Timescale *int64 `json:"timescale,omitempty"`
9374	// ForceEndTimestamp - The indicator of forcing existing of end time stamp.
9375	ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"`
9376}
9377
9378// BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should
9379// be processed.
9380type BasicPreset interface {
9381	AsFaceDetectorPreset() (*FaceDetectorPreset, bool)
9382	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
9383	AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool)
9384	AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool)
9385	AsStandardEncoderPreset() (*StandardEncoderPreset, bool)
9386	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
9387	AsPreset() (*Preset, bool)
9388}
9389
9390// Preset base type for all Presets, which define the recipe or instructions on how the input media files
9391// should be processed.
9392type Preset struct {
9393	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
9394	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
9395}
9396
9397func unmarshalBasicPreset(body []byte) (BasicPreset, error) {
9398	var m map[string]interface{}
9399	err := json.Unmarshal(body, &m)
9400	if err != nil {
9401		return nil, err
9402	}
9403
9404	switch m["@odata.type"] {
9405	case string(OdataTypeMicrosoftMediaFaceDetectorPreset):
9406		var fdp FaceDetectorPreset
9407		err := json.Unmarshal(body, &fdp)
9408		return fdp, err
9409	case string(OdataTypeMicrosoftMediaAudioAnalyzerPreset):
9410		var aap AudioAnalyzerPreset
9411		err := json.Unmarshal(body, &aap)
9412		return aap, err
9413	case string(OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset):
9414		var bisep BuiltInStandardEncoderPreset
9415		err := json.Unmarshal(body, &bisep)
9416		return bisep, err
9417	case string(OdataTypeMicrosoftMediaStandardEncoderPreset):
9418		var sep StandardEncoderPreset
9419		err := json.Unmarshal(body, &sep)
9420		return sep, err
9421	case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset):
9422		var vap VideoAnalyzerPreset
9423		err := json.Unmarshal(body, &vap)
9424		return vap, err
9425	default:
9426		var p Preset
9427		err := json.Unmarshal(body, &p)
9428		return p, err
9429	}
9430}
9431func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) {
9432	var rawMessages []*json.RawMessage
9433	err := json.Unmarshal(body, &rawMessages)
9434	if err != nil {
9435		return nil, err
9436	}
9437
9438	pArray := make([]BasicPreset, len(rawMessages))
9439
9440	for index, rawMessage := range rawMessages {
9441		p, err := unmarshalBasicPreset(*rawMessage)
9442		if err != nil {
9443			return nil, err
9444		}
9445		pArray[index] = p
9446	}
9447	return pArray, nil
9448}
9449
9450// MarshalJSON is the custom marshaler for Preset.
9451func (p Preset) MarshalJSON() ([]byte, error) {
9452	p.OdataType = OdataTypePreset
9453	objectMap := make(map[string]interface{})
9454	if p.OdataType != "" {
9455		objectMap["@odata.type"] = p.OdataType
9456	}
9457	return json.Marshal(objectMap)
9458}
9459
9460// AsFaceDetectorPreset is the BasicPreset implementation for Preset.
9461func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
9462	return nil, false
9463}
9464
9465// AsAudioAnalyzerPreset is the BasicPreset implementation for Preset.
9466func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
9467	return nil, false
9468}
9469
9470// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset.
9471func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
9472	return nil, false
9473}
9474
9475// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset.
9476func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
9477	return nil, false
9478}
9479
9480// AsStandardEncoderPreset is the BasicPreset implementation for Preset.
9481func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
9482	return nil, false
9483}
9484
9485// AsVideoAnalyzerPreset is the BasicPreset implementation for Preset.
9486func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
9487	return nil, false
9488}
9489
9490// AsPreset is the BasicPreset implementation for Preset.
9491func (p Preset) AsPreset() (*Preset, bool) {
9492	return &p, true
9493}
9494
9495// AsBasicPreset is the BasicPreset implementation for Preset.
9496func (p Preset) AsBasicPreset() (BasicPreset, bool) {
9497	return &p, true
9498}
9499
9500// PrivateEndpoint the Private Endpoint resource.
9501type PrivateEndpoint struct {
9502	// ID - READ-ONLY; The ARM identifier for Private Endpoint
9503	ID *string `json:"id,omitempty"`
9504}
9505
9506// MarshalJSON is the custom marshaler for PrivateEndpoint.
9507func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
9508	objectMap := make(map[string]interface{})
9509	return json.Marshal(objectMap)
9510}
9511
9512// PrivateEndpointConnection the Private Endpoint Connection resource.
9513type PrivateEndpointConnection struct {
9514	autorest.Response `json:"-"`
9515	// PrivateEndpointConnectionProperties - Resource properties.
9516	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
9517	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
9518	ID *string `json:"id,omitempty"`
9519	// Name - READ-ONLY; The name of the resource
9520	Name *string `json:"name,omitempty"`
9521	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
9522	Type *string `json:"type,omitempty"`
9523}
9524
9525// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
9526func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
9527	objectMap := make(map[string]interface{})
9528	if pec.PrivateEndpointConnectionProperties != nil {
9529		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
9530	}
9531	return json.Marshal(objectMap)
9532}
9533
9534// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
9535func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
9536	var m map[string]*json.RawMessage
9537	err := json.Unmarshal(body, &m)
9538	if err != nil {
9539		return err
9540	}
9541	for k, v := range m {
9542		switch k {
9543		case "properties":
9544			if v != nil {
9545				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
9546				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
9547				if err != nil {
9548					return err
9549				}
9550				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
9551			}
9552		case "id":
9553			if v != nil {
9554				var ID string
9555				err = json.Unmarshal(*v, &ID)
9556				if err != nil {
9557					return err
9558				}
9559				pec.ID = &ID
9560			}
9561		case "name":
9562			if v != nil {
9563				var name string
9564				err = json.Unmarshal(*v, &name)
9565				if err != nil {
9566					return err
9567				}
9568				pec.Name = &name
9569			}
9570		case "type":
9571			if v != nil {
9572				var typeVar string
9573				err = json.Unmarshal(*v, &typeVar)
9574				if err != nil {
9575					return err
9576				}
9577				pec.Type = &typeVar
9578			}
9579		}
9580	}
9581
9582	return nil
9583}
9584
9585// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified
9586// storage account
9587type PrivateEndpointConnectionListResult struct {
9588	autorest.Response `json:"-"`
9589	// Value - Array of private endpoint connections
9590	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
9591}
9592
9593// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
9594type PrivateEndpointConnectionProperties struct {
9595	// PrivateEndpoint - The resource of private end point.
9596	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
9597	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
9598	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
9599	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
9600	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
9601}
9602
9603// PrivateLinkResource a private link resource
9604type PrivateLinkResource struct {
9605	autorest.Response `json:"-"`
9606	// PrivateLinkResourceProperties - Resource properties.
9607	*PrivateLinkResourceProperties `json:"properties,omitempty"`
9608	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
9609	ID *string `json:"id,omitempty"`
9610	// Name - READ-ONLY; The name of the resource
9611	Name *string `json:"name,omitempty"`
9612	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
9613	Type *string `json:"type,omitempty"`
9614}
9615
9616// MarshalJSON is the custom marshaler for PrivateLinkResource.
9617func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
9618	objectMap := make(map[string]interface{})
9619	if plr.PrivateLinkResourceProperties != nil {
9620		objectMap["properties"] = plr.PrivateLinkResourceProperties
9621	}
9622	return json.Marshal(objectMap)
9623}
9624
9625// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
9626func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
9627	var m map[string]*json.RawMessage
9628	err := json.Unmarshal(body, &m)
9629	if err != nil {
9630		return err
9631	}
9632	for k, v := range m {
9633		switch k {
9634		case "properties":
9635			if v != nil {
9636				var privateLinkResourceProperties PrivateLinkResourceProperties
9637				err = json.Unmarshal(*v, &privateLinkResourceProperties)
9638				if err != nil {
9639					return err
9640				}
9641				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
9642			}
9643		case "id":
9644			if v != nil {
9645				var ID string
9646				err = json.Unmarshal(*v, &ID)
9647				if err != nil {
9648					return err
9649				}
9650				plr.ID = &ID
9651			}
9652		case "name":
9653			if v != nil {
9654				var name string
9655				err = json.Unmarshal(*v, &name)
9656				if err != nil {
9657					return err
9658				}
9659				plr.Name = &name
9660			}
9661		case "type":
9662			if v != nil {
9663				var typeVar string
9664				err = json.Unmarshal(*v, &typeVar)
9665				if err != nil {
9666					return err
9667				}
9668				plr.Type = &typeVar
9669			}
9670		}
9671	}
9672
9673	return nil
9674}
9675
9676// PrivateLinkResourceListResult a list of private link resources
9677type PrivateLinkResourceListResult struct {
9678	autorest.Response `json:"-"`
9679	// Value - Array of private link resources
9680	Value *[]PrivateLinkResource `json:"value,omitempty"`
9681}
9682
9683// PrivateLinkResourceProperties properties of a private link resource.
9684type PrivateLinkResourceProperties struct {
9685	// GroupID - READ-ONLY; The private link resource group id.
9686	GroupID *string `json:"groupId,omitempty"`
9687	// RequiredMembers - READ-ONLY; The private link resource required member names.
9688	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
9689	// RequiredZoneNames - The private link resource Private link DNS zone name.
9690	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
9691}
9692
9693// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
9694func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
9695	objectMap := make(map[string]interface{})
9696	if plrp.RequiredZoneNames != nil {
9697		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
9698	}
9699	return json.Marshal(objectMap)
9700}
9701
9702// PrivateLinkServiceConnectionState a collection of information about the state of the connection between
9703// service consumer and provider.
9704type PrivateLinkServiceConnectionState struct {
9705	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'
9706	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
9707	// Description - The reason for approval/rejection of the connection.
9708	Description *string `json:"description,omitempty"`
9709	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
9710	ActionsRequired *string `json:"actionsRequired,omitempty"`
9711}
9712
9713// Properties the service specification property.
9714type Properties struct {
9715	// ServiceSpecification - READ-ONLY; The service specifications.
9716	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
9717}
9718
9719// MarshalJSON is the custom marshaler for Properties.
9720func (p Properties) MarshalJSON() ([]byte, error) {
9721	objectMap := make(map[string]interface{})
9722	return json.Marshal(objectMap)
9723}
9724
9725// Provider a resource provider.
9726type Provider struct {
9727	// ProviderName - The provider name.
9728	ProviderName *string `json:"providerName,omitempty"`
9729}
9730
9731// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
9732// have tags and a location
9733type ProxyResource struct {
9734	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
9735	ID *string `json:"id,omitempty"`
9736	// Name - READ-ONLY; The name of the resource
9737	Name *string `json:"name,omitempty"`
9738	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
9739	Type *string `json:"type,omitempty"`
9740}
9741
9742// MarshalJSON is the custom marshaler for ProxyResource.
9743func (pr ProxyResource) MarshalJSON() ([]byte, error) {
9744	objectMap := make(map[string]interface{})
9745	return json.Marshal(objectMap)
9746}
9747
9748// Rectangle describes the properties of a rectangular window applied to the input media before processing
9749// it.
9750type Rectangle struct {
9751	// Left - The number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%).
9752	Left *string `json:"left,omitempty"`
9753	// Top - The number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%).
9754	Top *string `json:"top,omitempty"`
9755	// Width - The width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%).
9756	Width *string `json:"width,omitempty"`
9757	// Height - The height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%).
9758	Height *string `json:"height,omitempty"`
9759}
9760
9761// Resource common fields that are returned in the response for all Azure Resource Manager resources
9762type Resource struct {
9763	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
9764	ID *string `json:"id,omitempty"`
9765	// Name - READ-ONLY; The name of the resource
9766	Name *string `json:"name,omitempty"`
9767	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
9768	Type *string `json:"type,omitempty"`
9769}
9770
9771// MarshalJSON is the custom marshaler for Resource.
9772func (r Resource) MarshalJSON() ([]byte, error) {
9773	objectMap := make(map[string]interface{})
9774	return json.Marshal(objectMap)
9775}
9776
9777// SelectAudioTrackByAttribute select audio tracks from the input by specifying an attribute and an
9778// attribute filter.
9779type SelectAudioTrackByAttribute struct {
9780	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'Bitrate', 'Language'
9781	Attribute TrackAttribute `json:"attribute,omitempty"`
9782	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'All', 'Top', 'Bottom', 'ValueEquals'
9783	Filter AttributeFilter `json:"filter,omitempty"`
9784	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property.
9785	FilterValue *string `json:"filterValue,omitempty"`
9786	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'FrontLeft', 'FrontRight', 'Center', 'LowFrequencyEffects', 'BackLeft', 'BackRight', 'StereoLeft', 'StereoRight'
9787	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
9788	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
9789	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9790}
9791
9792// MarshalJSON is the custom marshaler for SelectAudioTrackByAttribute.
9793func (satba SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) {
9794	satba.OdataType = OdataTypeMicrosoftMediaSelectAudioTrackByAttribute
9795	objectMap := make(map[string]interface{})
9796	if satba.Attribute != "" {
9797		objectMap["attribute"] = satba.Attribute
9798	}
9799	if satba.Filter != "" {
9800		objectMap["filter"] = satba.Filter
9801	}
9802	if satba.FilterValue != nil {
9803		objectMap["filterValue"] = satba.FilterValue
9804	}
9805	if satba.ChannelMapping != "" {
9806		objectMap["channelMapping"] = satba.ChannelMapping
9807	}
9808	if satba.OdataType != "" {
9809		objectMap["@odata.type"] = satba.OdataType
9810	}
9811	return json.Marshal(objectMap)
9812}
9813
9814// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9815func (satba SelectAudioTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9816	return nil, false
9817}
9818
9819// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9820func (satba SelectAudioTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9821	return &satba, true
9822}
9823
9824// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9825func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9826	return &satba, true
9827}
9828
9829// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9830func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9831	return nil, false
9832}
9833
9834// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9835func (satba SelectAudioTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9836	return nil, false
9837}
9838
9839// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9840func (satba SelectAudioTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9841	return nil, false
9842}
9843
9844// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9845func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
9846	return nil, false
9847}
9848
9849// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9850func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
9851	return nil, false
9852}
9853
9854// AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9855func (satba SelectAudioTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
9856	return nil, false
9857}
9858
9859// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
9860func (satba SelectAudioTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
9861	return &satba, true
9862}
9863
9864// SelectAudioTrackByID select audio tracks from the input by specifying a track identifier.
9865type SelectAudioTrackByID struct {
9866	// TrackID - Track identifier to select
9867	TrackID *int64 `json:"trackId,omitempty"`
9868	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'FrontLeft', 'FrontRight', 'Center', 'LowFrequencyEffects', 'BackLeft', 'BackRight', 'StereoLeft', 'StereoRight'
9869	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
9870	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
9871	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9872}
9873
9874// MarshalJSON is the custom marshaler for SelectAudioTrackByID.
9875func (satbi SelectAudioTrackByID) MarshalJSON() ([]byte, error) {
9876	satbi.OdataType = OdataTypeMicrosoftMediaSelectAudioTrackByID
9877	objectMap := make(map[string]interface{})
9878	if satbi.TrackID != nil {
9879		objectMap["trackId"] = satbi.TrackID
9880	}
9881	if satbi.ChannelMapping != "" {
9882		objectMap["channelMapping"] = satbi.ChannelMapping
9883	}
9884	if satbi.OdataType != "" {
9885		objectMap["@odata.type"] = satbi.OdataType
9886	}
9887	return json.Marshal(objectMap)
9888}
9889
9890// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9891func (satbi SelectAudioTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9892	return nil, false
9893}
9894
9895// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9896func (satbi SelectAudioTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9897	return &satbi, true
9898}
9899
9900// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9901func (satbi SelectAudioTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9902	return nil, false
9903}
9904
9905// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9906func (satbi SelectAudioTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9907	return &satbi, true
9908}
9909
9910// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9911func (satbi SelectAudioTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9912	return nil, false
9913}
9914
9915// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9916func (satbi SelectAudioTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9917	return nil, false
9918}
9919
9920// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9921func (satbi SelectAudioTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
9922	return nil, false
9923}
9924
9925// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9926func (satbi SelectAudioTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
9927	return nil, false
9928}
9929
9930// AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9931func (satbi SelectAudioTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
9932	return nil, false
9933}
9934
9935// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
9936func (satbi SelectAudioTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
9937	return &satbi, true
9938}
9939
9940// SelectVideoTrackByAttribute select video tracks from the input by specifying an attribute and an
9941// attribute filter.
9942type SelectVideoTrackByAttribute struct {
9943	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'Bitrate', 'Language'
9944	Attribute TrackAttribute `json:"attribute,omitempty"`
9945	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'All', 'Top', 'Bottom', 'ValueEquals'
9946	Filter AttributeFilter `json:"filter,omitempty"`
9947	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property. For TrackAttribute.Bitrate, this should be an integer value in bits per second (e.g: '1500000').  The TrackAttribute.Language is not supported for video tracks.
9948	FilterValue *string `json:"filterValue,omitempty"`
9949	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
9950	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
9951}
9952
9953// MarshalJSON is the custom marshaler for SelectVideoTrackByAttribute.
9954func (svtba SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) {
9955	svtba.OdataType = OdataTypeMicrosoftMediaSelectVideoTrackByAttribute
9956	objectMap := make(map[string]interface{})
9957	if svtba.Attribute != "" {
9958		objectMap["attribute"] = svtba.Attribute
9959	}
9960	if svtba.Filter != "" {
9961		objectMap["filter"] = svtba.Filter
9962	}
9963	if svtba.FilterValue != nil {
9964		objectMap["filterValue"] = svtba.FilterValue
9965	}
9966	if svtba.OdataType != "" {
9967		objectMap["@odata.type"] = svtba.OdataType
9968	}
9969	return json.Marshal(objectMap)
9970}
9971
9972// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9973func (svtba SelectVideoTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
9974	return nil, false
9975}
9976
9977// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9978func (svtba SelectVideoTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
9979	return nil, false
9980}
9981
9982// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9983func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
9984	return nil, false
9985}
9986
9987// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9988func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
9989	return nil, false
9990}
9991
9992// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9993func (svtba SelectVideoTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
9994	return nil, false
9995}
9996
9997// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
9998func (svtba SelectVideoTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
9999	return &svtba, true
10000}
10001
10002// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
10003func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
10004	return &svtba, true
10005}
10006
10007// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
10008func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
10009	return nil, false
10010}
10011
10012// AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
10013func (svtba SelectVideoTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
10014	return nil, false
10015}
10016
10017// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
10018func (svtba SelectVideoTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
10019	return &svtba, true
10020}
10021
10022// SelectVideoTrackByID select video tracks from the input by specifying a track identifier.
10023type SelectVideoTrackByID struct {
10024	// TrackID - Track identifier to select
10025	TrackID *int64 `json:"trackId,omitempty"`
10026	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
10027	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
10028}
10029
10030// MarshalJSON is the custom marshaler for SelectVideoTrackByID.
10031func (svtbi SelectVideoTrackByID) MarshalJSON() ([]byte, error) {
10032	svtbi.OdataType = OdataTypeMicrosoftMediaSelectVideoTrackByID
10033	objectMap := make(map[string]interface{})
10034	if svtbi.TrackID != nil {
10035		objectMap["trackId"] = svtbi.TrackID
10036	}
10037	if svtbi.OdataType != "" {
10038		objectMap["@odata.type"] = svtbi.OdataType
10039	}
10040	return json.Marshal(objectMap)
10041}
10042
10043// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10044func (svtbi SelectVideoTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
10045	return nil, false
10046}
10047
10048// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10049func (svtbi SelectVideoTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
10050	return nil, false
10051}
10052
10053// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10054func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
10055	return nil, false
10056}
10057
10058// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10059func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
10060	return nil, false
10061}
10062
10063// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10064func (svtbi SelectVideoTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
10065	return nil, false
10066}
10067
10068// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10069func (svtbi SelectVideoTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
10070	return &svtbi, true
10071}
10072
10073// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10074func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
10075	return nil, false
10076}
10077
10078// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10079func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
10080	return &svtbi, true
10081}
10082
10083// AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10084func (svtbi SelectVideoTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
10085	return nil, false
10086}
10087
10088// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
10089func (svtbi SelectVideoTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
10090	return &svtbi, true
10091}
10092
10093// Service a Media Services account.
10094type Service struct {
10095	autorest.Response `json:"-"`
10096	// ServiceProperties - The resource properties.
10097	*ServiceProperties `json:"properties,omitempty"`
10098	// Identity - The Managed Identity for the Media Services account.
10099	Identity *ServiceIdentity `json:"identity,omitempty"`
10100	// SystemData - READ-ONLY; The system metadata relating to this resource.
10101	SystemData *SystemData `json:"systemData,omitempty"`
10102	// Tags - Resource tags.
10103	Tags map[string]*string `json:"tags"`
10104	// Location - The geo-location where the resource lives
10105	Location *string `json:"location,omitempty"`
10106	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
10107	ID *string `json:"id,omitempty"`
10108	// Name - READ-ONLY; The name of the resource
10109	Name *string `json:"name,omitempty"`
10110	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
10111	Type *string `json:"type,omitempty"`
10112}
10113
10114// MarshalJSON is the custom marshaler for Service.
10115func (s Service) MarshalJSON() ([]byte, error) {
10116	objectMap := make(map[string]interface{})
10117	if s.ServiceProperties != nil {
10118		objectMap["properties"] = s.ServiceProperties
10119	}
10120	if s.Identity != nil {
10121		objectMap["identity"] = s.Identity
10122	}
10123	if s.Tags != nil {
10124		objectMap["tags"] = s.Tags
10125	}
10126	if s.Location != nil {
10127		objectMap["location"] = s.Location
10128	}
10129	return json.Marshal(objectMap)
10130}
10131
10132// UnmarshalJSON is the custom unmarshaler for Service struct.
10133func (s *Service) UnmarshalJSON(body []byte) error {
10134	var m map[string]*json.RawMessage
10135	err := json.Unmarshal(body, &m)
10136	if err != nil {
10137		return err
10138	}
10139	for k, v := range m {
10140		switch k {
10141		case "properties":
10142			if v != nil {
10143				var serviceProperties ServiceProperties
10144				err = json.Unmarshal(*v, &serviceProperties)
10145				if err != nil {
10146					return err
10147				}
10148				s.ServiceProperties = &serviceProperties
10149			}
10150		case "identity":
10151			if v != nil {
10152				var identity ServiceIdentity
10153				err = json.Unmarshal(*v, &identity)
10154				if err != nil {
10155					return err
10156				}
10157				s.Identity = &identity
10158			}
10159		case "systemData":
10160			if v != nil {
10161				var systemData SystemData
10162				err = json.Unmarshal(*v, &systemData)
10163				if err != nil {
10164					return err
10165				}
10166				s.SystemData = &systemData
10167			}
10168		case "tags":
10169			if v != nil {
10170				var tags map[string]*string
10171				err = json.Unmarshal(*v, &tags)
10172				if err != nil {
10173					return err
10174				}
10175				s.Tags = tags
10176			}
10177		case "location":
10178			if v != nil {
10179				var location string
10180				err = json.Unmarshal(*v, &location)
10181				if err != nil {
10182					return err
10183				}
10184				s.Location = &location
10185			}
10186		case "id":
10187			if v != nil {
10188				var ID string
10189				err = json.Unmarshal(*v, &ID)
10190				if err != nil {
10191					return err
10192				}
10193				s.ID = &ID
10194			}
10195		case "name":
10196			if v != nil {
10197				var name string
10198				err = json.Unmarshal(*v, &name)
10199				if err != nil {
10200					return err
10201				}
10202				s.Name = &name
10203			}
10204		case "type":
10205			if v != nil {
10206				var typeVar string
10207				err = json.Unmarshal(*v, &typeVar)
10208				if err != nil {
10209					return err
10210				}
10211				s.Type = &typeVar
10212			}
10213		}
10214	}
10215
10216	return nil
10217}
10218
10219// ServiceCollection a collection of MediaService items.
10220type ServiceCollection struct {
10221	autorest.Response `json:"-"`
10222	// Value - A collection of MediaService items.
10223	Value *[]Service `json:"value,omitempty"`
10224	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
10225	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
10226}
10227
10228// ServiceCollectionIterator provides access to a complete listing of Service values.
10229type ServiceCollectionIterator struct {
10230	i    int
10231	page ServiceCollectionPage
10232}
10233
10234// NextWithContext advances to the next value.  If there was an error making
10235// the request the iterator does not advance and the error is returned.
10236func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10237	if tracing.IsEnabled() {
10238		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext")
10239		defer func() {
10240			sc := -1
10241			if iter.Response().Response.Response != nil {
10242				sc = iter.Response().Response.Response.StatusCode
10243			}
10244			tracing.EndSpan(ctx, sc, err)
10245		}()
10246	}
10247	iter.i++
10248	if iter.i < len(iter.page.Values()) {
10249		return nil
10250	}
10251	err = iter.page.NextWithContext(ctx)
10252	if err != nil {
10253		iter.i--
10254		return err
10255	}
10256	iter.i = 0
10257	return nil
10258}
10259
10260// Next advances to the next value.  If there was an error making
10261// the request the iterator does not advance and the error is returned.
10262// Deprecated: Use NextWithContext() instead.
10263func (iter *ServiceCollectionIterator) Next() error {
10264	return iter.NextWithContext(context.Background())
10265}
10266
10267// NotDone returns true if the enumeration should be started or is not yet complete.
10268func (iter ServiceCollectionIterator) NotDone() bool {
10269	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10270}
10271
10272// Response returns the raw server response from the last page request.
10273func (iter ServiceCollectionIterator) Response() ServiceCollection {
10274	return iter.page.Response()
10275}
10276
10277// Value returns the current value or a zero-initialized value if the
10278// iterator has advanced beyond the end of the collection.
10279func (iter ServiceCollectionIterator) Value() Service {
10280	if !iter.page.NotDone() {
10281		return Service{}
10282	}
10283	return iter.page.Values()[iter.i]
10284}
10285
10286// Creates a new instance of the ServiceCollectionIterator type.
10287func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator {
10288	return ServiceCollectionIterator{page: page}
10289}
10290
10291// IsEmpty returns true if the ListResult contains no values.
10292func (sc ServiceCollection) IsEmpty() bool {
10293	return sc.Value == nil || len(*sc.Value) == 0
10294}
10295
10296// hasNextLink returns true if the NextLink is not empty.
10297func (sc ServiceCollection) hasNextLink() bool {
10298	return sc.OdataNextLink != nil && len(*sc.OdataNextLink) != 0
10299}
10300
10301// serviceCollectionPreparer prepares a request to retrieve the next set of results.
10302// It returns nil if no more results exist.
10303func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) {
10304	if !sc.hasNextLink() {
10305		return nil, nil
10306	}
10307	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10308		autorest.AsJSON(),
10309		autorest.AsGet(),
10310		autorest.WithBaseURL(to.String(sc.OdataNextLink)))
10311}
10312
10313// ServiceCollectionPage contains a page of Service values.
10314type ServiceCollectionPage struct {
10315	fn func(context.Context, ServiceCollection) (ServiceCollection, error)
10316	sc ServiceCollection
10317}
10318
10319// NextWithContext advances to the next page of values.  If there was an error making
10320// the request the page does not advance and the error is returned.
10321func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
10322	if tracing.IsEnabled() {
10323		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext")
10324		defer func() {
10325			sc := -1
10326			if page.Response().Response.Response != nil {
10327				sc = page.Response().Response.Response.StatusCode
10328			}
10329			tracing.EndSpan(ctx, sc, err)
10330		}()
10331	}
10332	for {
10333		next, err := page.fn(ctx, page.sc)
10334		if err != nil {
10335			return err
10336		}
10337		page.sc = next
10338		if !next.hasNextLink() || !next.IsEmpty() {
10339			break
10340		}
10341	}
10342	return nil
10343}
10344
10345// Next advances to the next page of values.  If there was an error making
10346// the request the page does not advance and the error is returned.
10347// Deprecated: Use NextWithContext() instead.
10348func (page *ServiceCollectionPage) Next() error {
10349	return page.NextWithContext(context.Background())
10350}
10351
10352// NotDone returns true if the page enumeration should be started or is not yet complete.
10353func (page ServiceCollectionPage) NotDone() bool {
10354	return !page.sc.IsEmpty()
10355}
10356
10357// Response returns the raw server response from the last page request.
10358func (page ServiceCollectionPage) Response() ServiceCollection {
10359	return page.sc
10360}
10361
10362// Values returns the slice of values for the current page or nil if there are no values.
10363func (page ServiceCollectionPage) Values() []Service {
10364	if page.sc.IsEmpty() {
10365		return nil
10366	}
10367	return *page.sc.Value
10368}
10369
10370// Creates a new instance of the ServiceCollectionPage type.
10371func NewServiceCollectionPage(cur ServiceCollection, getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage {
10372	return ServiceCollectionPage{
10373		fn: getNextPage,
10374		sc: cur,
10375	}
10376}
10377
10378// ServiceIdentity ...
10379type ServiceIdentity struct {
10380	// Type - The identity type. Possible values include: 'ManagedIdentityTypeSystemAssigned', 'ManagedIdentityTypeNone'
10381	Type ManagedIdentityType `json:"type,omitempty"`
10382	// PrincipalID - READ-ONLY; The Principal ID of the identity.
10383	PrincipalID *string `json:"principalId,omitempty"`
10384	// TenantID - READ-ONLY; The Tenant ID of the identity.
10385	TenantID *string `json:"tenantId,omitempty"`
10386}
10387
10388// MarshalJSON is the custom marshaler for ServiceIdentity.
10389func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
10390	objectMap := make(map[string]interface{})
10391	if si.Type != "" {
10392		objectMap["type"] = si.Type
10393	}
10394	return json.Marshal(objectMap)
10395}
10396
10397// ServiceProperties properties of the Media Services account.
10398type ServiceProperties struct {
10399	// MediaServiceID - READ-ONLY; The Media Services account ID.
10400	MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"`
10401	// StorageAccounts - The storage accounts for this resource.
10402	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
10403	// StorageAuthentication - Possible values include: 'StorageAuthenticationSystem', 'StorageAuthenticationManagedIdentity'
10404	StorageAuthentication StorageAuthentication `json:"storageAuthentication,omitempty"`
10405	// Encryption - The account encryption properties.
10406	Encryption *AccountEncryption `json:"encryption,omitempty"`
10407}
10408
10409// MarshalJSON is the custom marshaler for ServiceProperties.
10410func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
10411	objectMap := make(map[string]interface{})
10412	if sp.StorageAccounts != nil {
10413		objectMap["storageAccounts"] = sp.StorageAccounts
10414	}
10415	if sp.StorageAuthentication != "" {
10416		objectMap["storageAuthentication"] = sp.StorageAuthentication
10417	}
10418	if sp.Encryption != nil {
10419		objectMap["encryption"] = sp.Encryption
10420	}
10421	return json.Marshal(objectMap)
10422}
10423
10424// ServiceSpecification the service metric specifications.
10425type ServiceSpecification struct {
10426	// LogSpecifications - READ-ONLY; List of log specifications.
10427	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
10428	// MetricSpecifications - READ-ONLY; List of metric specifications.
10429	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
10430}
10431
10432// MarshalJSON is the custom marshaler for ServiceSpecification.
10433func (ss ServiceSpecification) MarshalJSON() ([]byte, error) {
10434	objectMap := make(map[string]interface{})
10435	return json.Marshal(objectMap)
10436}
10437
10438// StandardEncoderPreset describes all the settings to be used when encoding the input video with the
10439// Standard Encoder.
10440type StandardEncoderPreset struct {
10441	// Filters - One or more filtering operations that are applied to the input media before encoding.
10442	Filters *Filters `json:"filters,omitempty"`
10443	// Codecs - The list of codecs to be used when encoding the input video.
10444	Codecs *[]BasicCodec `json:"codecs,omitempty"`
10445	// Formats - The list of outputs to be produced by the encoder.
10446	Formats *[]BasicFormat `json:"formats,omitempty"`
10447	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
10448	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
10449}
10450
10451// MarshalJSON is the custom marshaler for StandardEncoderPreset.
10452func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) {
10453	sep.OdataType = OdataTypeMicrosoftMediaStandardEncoderPreset
10454	objectMap := make(map[string]interface{})
10455	if sep.Filters != nil {
10456		objectMap["filters"] = sep.Filters
10457	}
10458	if sep.Codecs != nil {
10459		objectMap["codecs"] = sep.Codecs
10460	}
10461	if sep.Formats != nil {
10462		objectMap["formats"] = sep.Formats
10463	}
10464	if sep.OdataType != "" {
10465		objectMap["@odata.type"] = sep.OdataType
10466	}
10467	return json.Marshal(objectMap)
10468}
10469
10470// AsFaceDetectorPreset is the BasicPreset implementation for StandardEncoderPreset.
10471func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
10472	return nil, false
10473}
10474
10475// AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
10476func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
10477	return nil, false
10478}
10479
10480// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
10481func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
10482	return nil, false
10483}
10484
10485// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
10486func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
10487	return nil, false
10488}
10489
10490// AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
10491func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
10492	return &sep, true
10493}
10494
10495// AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
10496func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
10497	return nil, false
10498}
10499
10500// AsPreset is the BasicPreset implementation for StandardEncoderPreset.
10501func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) {
10502	return nil, false
10503}
10504
10505// AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset.
10506func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
10507	return &sep, true
10508}
10509
10510// UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct.
10511func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error {
10512	var m map[string]*json.RawMessage
10513	err := json.Unmarshal(body, &m)
10514	if err != nil {
10515		return err
10516	}
10517	for k, v := range m {
10518		switch k {
10519		case "filters":
10520			if v != nil {
10521				var filters Filters
10522				err = json.Unmarshal(*v, &filters)
10523				if err != nil {
10524					return err
10525				}
10526				sep.Filters = &filters
10527			}
10528		case "codecs":
10529			if v != nil {
10530				codecs, err := unmarshalBasicCodecArray(*v)
10531				if err != nil {
10532					return err
10533				}
10534				sep.Codecs = &codecs
10535			}
10536		case "formats":
10537			if v != nil {
10538				formats, err := unmarshalBasicFormatArray(*v)
10539				if err != nil {
10540					return err
10541				}
10542				sep.Formats = &formats
10543			}
10544		case "@odata.type":
10545			if v != nil {
10546				var odataType OdataTypeBasicPreset
10547				err = json.Unmarshal(*v, &odataType)
10548				if err != nil {
10549					return err
10550				}
10551				sep.OdataType = odataType
10552			}
10553		}
10554	}
10555
10556	return nil
10557}
10558
10559// StorageAccount the storage account details.
10560type StorageAccount struct {
10561	// ID - The ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts.
10562	ID *string `json:"id,omitempty"`
10563	// Type - The type of the storage account. Possible values include: 'Primary', 'Secondary'
10564	Type StorageAccountType `json:"type,omitempty"`
10565}
10566
10567// StorageEncryptedAssetDecryptionData data needed to decrypt asset files encrypted with legacy storage
10568// encryption.
10569type StorageEncryptedAssetDecryptionData struct {
10570	autorest.Response `json:"-"`
10571	// Key - The Asset File storage encryption key.
10572	Key *[]byte `json:"key,omitempty"`
10573	// AssetFileEncryptionMetadata - Asset File encryption metadata.
10574	AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"`
10575}
10576
10577// StreamingEndpoint the streaming endpoint.
10578type StreamingEndpoint struct {
10579	autorest.Response `json:"-"`
10580	// StreamingEndpointProperties - The streaming endpoint properties.
10581	*StreamingEndpointProperties `json:"properties,omitempty"`
10582	// SystemData - READ-ONLY; The system metadata relating to this resource.
10583	SystemData *SystemData `json:"systemData,omitempty"`
10584	// Tags - Resource tags.
10585	Tags map[string]*string `json:"tags"`
10586	// Location - The geo-location where the resource lives
10587	Location *string `json:"location,omitempty"`
10588	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
10589	ID *string `json:"id,omitempty"`
10590	// Name - READ-ONLY; The name of the resource
10591	Name *string `json:"name,omitempty"`
10592	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
10593	Type *string `json:"type,omitempty"`
10594}
10595
10596// MarshalJSON is the custom marshaler for StreamingEndpoint.
10597func (se StreamingEndpoint) MarshalJSON() ([]byte, error) {
10598	objectMap := make(map[string]interface{})
10599	if se.StreamingEndpointProperties != nil {
10600		objectMap["properties"] = se.StreamingEndpointProperties
10601	}
10602	if se.Tags != nil {
10603		objectMap["tags"] = se.Tags
10604	}
10605	if se.Location != nil {
10606		objectMap["location"] = se.Location
10607	}
10608	return json.Marshal(objectMap)
10609}
10610
10611// UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct.
10612func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error {
10613	var m map[string]*json.RawMessage
10614	err := json.Unmarshal(body, &m)
10615	if err != nil {
10616		return err
10617	}
10618	for k, v := range m {
10619		switch k {
10620		case "properties":
10621			if v != nil {
10622				var streamingEndpointProperties StreamingEndpointProperties
10623				err = json.Unmarshal(*v, &streamingEndpointProperties)
10624				if err != nil {
10625					return err
10626				}
10627				se.StreamingEndpointProperties = &streamingEndpointProperties
10628			}
10629		case "systemData":
10630			if v != nil {
10631				var systemData SystemData
10632				err = json.Unmarshal(*v, &systemData)
10633				if err != nil {
10634					return err
10635				}
10636				se.SystemData = &systemData
10637			}
10638		case "tags":
10639			if v != nil {
10640				var tags map[string]*string
10641				err = json.Unmarshal(*v, &tags)
10642				if err != nil {
10643					return err
10644				}
10645				se.Tags = tags
10646			}
10647		case "location":
10648			if v != nil {
10649				var location string
10650				err = json.Unmarshal(*v, &location)
10651				if err != nil {
10652					return err
10653				}
10654				se.Location = &location
10655			}
10656		case "id":
10657			if v != nil {
10658				var ID string
10659				err = json.Unmarshal(*v, &ID)
10660				if err != nil {
10661					return err
10662				}
10663				se.ID = &ID
10664			}
10665		case "name":
10666			if v != nil {
10667				var name string
10668				err = json.Unmarshal(*v, &name)
10669				if err != nil {
10670					return err
10671				}
10672				se.Name = &name
10673			}
10674		case "type":
10675			if v != nil {
10676				var typeVar string
10677				err = json.Unmarshal(*v, &typeVar)
10678				if err != nil {
10679					return err
10680				}
10681				se.Type = &typeVar
10682			}
10683		}
10684	}
10685
10686	return nil
10687}
10688
10689// StreamingEndpointAccessControl streaming endpoint access control definition.
10690type StreamingEndpointAccessControl struct {
10691	// Akamai - The access control of Akamai
10692	Akamai *AkamaiAccessControl `json:"akamai,omitempty"`
10693	// IP - The IP access control of the streaming endpoint.
10694	IP *IPAccessControl `json:"ip,omitempty"`
10695}
10696
10697// StreamingEndpointListResult the streaming endpoint list result.
10698type StreamingEndpointListResult struct {
10699	autorest.Response `json:"-"`
10700	// Value - The result of the List StreamingEndpoint operation.
10701	Value *[]StreamingEndpoint `json:"value,omitempty"`
10702	// OdataCount - The number of result.
10703	OdataCount *int32 `json:"@odata.count,omitempty"`
10704	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of streaming endpoints.
10705	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
10706}
10707
10708// StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values.
10709type StreamingEndpointListResultIterator struct {
10710	i    int
10711	page StreamingEndpointListResultPage
10712}
10713
10714// NextWithContext advances to the next value.  If there was an error making
10715// the request the iterator does not advance and the error is returned.
10716func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
10717	if tracing.IsEnabled() {
10718		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext")
10719		defer func() {
10720			sc := -1
10721			if iter.Response().Response.Response != nil {
10722				sc = iter.Response().Response.Response.StatusCode
10723			}
10724			tracing.EndSpan(ctx, sc, err)
10725		}()
10726	}
10727	iter.i++
10728	if iter.i < len(iter.page.Values()) {
10729		return nil
10730	}
10731	err = iter.page.NextWithContext(ctx)
10732	if err != nil {
10733		iter.i--
10734		return err
10735	}
10736	iter.i = 0
10737	return nil
10738}
10739
10740// Next advances to the next value.  If there was an error making
10741// the request the iterator does not advance and the error is returned.
10742// Deprecated: Use NextWithContext() instead.
10743func (iter *StreamingEndpointListResultIterator) Next() error {
10744	return iter.NextWithContext(context.Background())
10745}
10746
10747// NotDone returns true if the enumeration should be started or is not yet complete.
10748func (iter StreamingEndpointListResultIterator) NotDone() bool {
10749	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10750}
10751
10752// Response returns the raw server response from the last page request.
10753func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult {
10754	return iter.page.Response()
10755}
10756
10757// Value returns the current value or a zero-initialized value if the
10758// iterator has advanced beyond the end of the collection.
10759func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint {
10760	if !iter.page.NotDone() {
10761		return StreamingEndpoint{}
10762	}
10763	return iter.page.Values()[iter.i]
10764}
10765
10766// Creates a new instance of the StreamingEndpointListResultIterator type.
10767func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator {
10768	return StreamingEndpointListResultIterator{page: page}
10769}
10770
10771// IsEmpty returns true if the ListResult contains no values.
10772func (selr StreamingEndpointListResult) IsEmpty() bool {
10773	return selr.Value == nil || len(*selr.Value) == 0
10774}
10775
10776// hasNextLink returns true if the NextLink is not empty.
10777func (selr StreamingEndpointListResult) hasNextLink() bool {
10778	return selr.OdataNextLink != nil && len(*selr.OdataNextLink) != 0
10779}
10780
10781// streamingEndpointListResultPreparer prepares a request to retrieve the next set of results.
10782// It returns nil if no more results exist.
10783func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
10784	if !selr.hasNextLink() {
10785		return nil, nil
10786	}
10787	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10788		autorest.AsJSON(),
10789		autorest.AsGet(),
10790		autorest.WithBaseURL(to.String(selr.OdataNextLink)))
10791}
10792
10793// StreamingEndpointListResultPage contains a page of StreamingEndpoint values.
10794type StreamingEndpointListResultPage struct {
10795	fn   func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)
10796	selr StreamingEndpointListResult
10797}
10798
10799// NextWithContext advances to the next page of values.  If there was an error making
10800// the request the page does not advance and the error is returned.
10801func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
10802	if tracing.IsEnabled() {
10803		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext")
10804		defer func() {
10805			sc := -1
10806			if page.Response().Response.Response != nil {
10807				sc = page.Response().Response.Response.StatusCode
10808			}
10809			tracing.EndSpan(ctx, sc, err)
10810		}()
10811	}
10812	for {
10813		next, err := page.fn(ctx, page.selr)
10814		if err != nil {
10815			return err
10816		}
10817		page.selr = next
10818		if !next.hasNextLink() || !next.IsEmpty() {
10819			break
10820		}
10821	}
10822	return nil
10823}
10824
10825// Next advances to the next page of values.  If there was an error making
10826// the request the page does not advance and the error is returned.
10827// Deprecated: Use NextWithContext() instead.
10828func (page *StreamingEndpointListResultPage) Next() error {
10829	return page.NextWithContext(context.Background())
10830}
10831
10832// NotDone returns true if the page enumeration should be started or is not yet complete.
10833func (page StreamingEndpointListResultPage) NotDone() bool {
10834	return !page.selr.IsEmpty()
10835}
10836
10837// Response returns the raw server response from the last page request.
10838func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult {
10839	return page.selr
10840}
10841
10842// Values returns the slice of values for the current page or nil if there are no values.
10843func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint {
10844	if page.selr.IsEmpty() {
10845		return nil
10846	}
10847	return *page.selr.Value
10848}
10849
10850// Creates a new instance of the StreamingEndpointListResultPage type.
10851func NewStreamingEndpointListResultPage(cur StreamingEndpointListResult, getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage {
10852	return StreamingEndpointListResultPage{
10853		fn:   getNextPage,
10854		selr: cur,
10855	}
10856}
10857
10858// StreamingEndpointProperties the streaming endpoint properties.
10859type StreamingEndpointProperties struct {
10860	// Description - The streaming endpoint description.
10861	Description *string `json:"description,omitempty"`
10862	// ScaleUnits - The number of scale units. Use the Scale operation to adjust this value.
10863	ScaleUnits *int32 `json:"scaleUnits,omitempty"`
10864	// AvailabilitySetName - This feature is deprecated, do not set a value for this property.
10865	AvailabilitySetName *string `json:"availabilitySetName,omitempty"`
10866	// AccessControl - The access control definition of the streaming endpoint.
10867	AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"`
10868	// MaxCacheAge - Max cache age
10869	MaxCacheAge *int64 `json:"maxCacheAge,omitempty"`
10870	// CustomHostNames - The custom host names of the streaming endpoint
10871	CustomHostNames *[]string `json:"customHostNames,omitempty"`
10872	// HostName - READ-ONLY; The streaming endpoint host name.
10873	HostName *string `json:"hostName,omitempty"`
10874	// CdnEnabled - The CDN enabled flag.
10875	CdnEnabled *bool `json:"cdnEnabled,omitempty"`
10876	// CdnProvider - The CDN provider name.
10877	CdnProvider *string `json:"cdnProvider,omitempty"`
10878	// CdnProfile - The CDN profile name.
10879	CdnProfile *string `json:"cdnProfile,omitempty"`
10880	// ProvisioningState - READ-ONLY; The provisioning state of the streaming endpoint.
10881	ProvisioningState *string `json:"provisioningState,omitempty"`
10882	// ResourceState - READ-ONLY; The resource state of the streaming endpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling'
10883	ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"`
10884	// CrossSiteAccessPolicies - The streaming endpoint access policies.
10885	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
10886	// FreeTrialEndTime - READ-ONLY; The free trial expiration time.
10887	FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"`
10888	// Created - READ-ONLY; The exact time the streaming endpoint was created.
10889	Created *date.Time `json:"created,omitempty"`
10890	// LastModified - READ-ONLY; The exact time the streaming endpoint was last modified.
10891	LastModified *date.Time `json:"lastModified,omitempty"`
10892}
10893
10894// MarshalJSON is the custom marshaler for StreamingEndpointProperties.
10895func (sep StreamingEndpointProperties) MarshalJSON() ([]byte, error) {
10896	objectMap := make(map[string]interface{})
10897	if sep.Description != nil {
10898		objectMap["description"] = sep.Description
10899	}
10900	if sep.ScaleUnits != nil {
10901		objectMap["scaleUnits"] = sep.ScaleUnits
10902	}
10903	if sep.AvailabilitySetName != nil {
10904		objectMap["availabilitySetName"] = sep.AvailabilitySetName
10905	}
10906	if sep.AccessControl != nil {
10907		objectMap["accessControl"] = sep.AccessControl
10908	}
10909	if sep.MaxCacheAge != nil {
10910		objectMap["maxCacheAge"] = sep.MaxCacheAge
10911	}
10912	if sep.CustomHostNames != nil {
10913		objectMap["customHostNames"] = sep.CustomHostNames
10914	}
10915	if sep.CdnEnabled != nil {
10916		objectMap["cdnEnabled"] = sep.CdnEnabled
10917	}
10918	if sep.CdnProvider != nil {
10919		objectMap["cdnProvider"] = sep.CdnProvider
10920	}
10921	if sep.CdnProfile != nil {
10922		objectMap["cdnProfile"] = sep.CdnProfile
10923	}
10924	if sep.CrossSiteAccessPolicies != nil {
10925		objectMap["crossSiteAccessPolicies"] = sep.CrossSiteAccessPolicies
10926	}
10927	return json.Marshal(objectMap)
10928}
10929
10930// StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a
10931// long-running operation.
10932type StreamingEndpointsCreateFuture struct {
10933	azure.FutureAPI
10934	// Result returns the result of the asynchronous operation.
10935	// If the operation has not completed it will return an error.
10936	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
10937}
10938
10939// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10940func (future *StreamingEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
10941	var azFuture azure.Future
10942	if err := json.Unmarshal(body, &azFuture); err != nil {
10943		return err
10944	}
10945	future.FutureAPI = &azFuture
10946	future.Result = future.result
10947	return nil
10948}
10949
10950// result is the default implementation for StreamingEndpointsCreateFuture.Result.
10951func (future *StreamingEndpointsCreateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
10952	var done bool
10953	done, err = future.DoneWithContext(context.Background(), client)
10954	if err != nil {
10955		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
10956		return
10957	}
10958	if !done {
10959		se.Response.Response = future.Response()
10960		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture")
10961		return
10962	}
10963	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10964	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
10965		se, err = client.CreateResponder(se.Response.Response)
10966		if err != nil {
10967			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
10968		}
10969	}
10970	return
10971}
10972
10973// StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a
10974// long-running operation.
10975type StreamingEndpointsDeleteFuture struct {
10976	azure.FutureAPI
10977	// Result returns the result of the asynchronous operation.
10978	// If the operation has not completed it will return an error.
10979	Result func(StreamingEndpointsClient) (autorest.Response, error)
10980}
10981
10982// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10983func (future *StreamingEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
10984	var azFuture azure.Future
10985	if err := json.Unmarshal(body, &azFuture); err != nil {
10986		return err
10987	}
10988	future.FutureAPI = &azFuture
10989	future.Result = future.result
10990	return nil
10991}
10992
10993// result is the default implementation for StreamingEndpointsDeleteFuture.Result.
10994func (future *StreamingEndpointsDeleteFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
10995	var done bool
10996	done, err = future.DoneWithContext(context.Background(), client)
10997	if err != nil {
10998		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
10999		return
11000	}
11001	if !done {
11002		ar.Response = future.Response()
11003		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture")
11004		return
11005	}
11006	ar.Response = future.Response()
11007	return
11008}
11009
11010// StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running
11011// operation.
11012type StreamingEndpointsScaleFuture struct {
11013	azure.FutureAPI
11014	// Result returns the result of the asynchronous operation.
11015	// If the operation has not completed it will return an error.
11016	Result func(StreamingEndpointsClient) (autorest.Response, error)
11017}
11018
11019// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11020func (future *StreamingEndpointsScaleFuture) UnmarshalJSON(body []byte) error {
11021	var azFuture azure.Future
11022	if err := json.Unmarshal(body, &azFuture); err != nil {
11023		return err
11024	}
11025	future.FutureAPI = &azFuture
11026	future.Result = future.result
11027	return nil
11028}
11029
11030// result is the default implementation for StreamingEndpointsScaleFuture.Result.
11031func (future *StreamingEndpointsScaleFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11032	var done bool
11033	done, err = future.DoneWithContext(context.Background(), client)
11034	if err != nil {
11035		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure")
11036		return
11037	}
11038	if !done {
11039		ar.Response = future.Response()
11040		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture")
11041		return
11042	}
11043	ar.Response = future.Response()
11044	return
11045}
11046
11047// StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running
11048// operation.
11049type StreamingEndpointsStartFuture struct {
11050	azure.FutureAPI
11051	// Result returns the result of the asynchronous operation.
11052	// If the operation has not completed it will return an error.
11053	Result func(StreamingEndpointsClient) (autorest.Response, error)
11054}
11055
11056// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11057func (future *StreamingEndpointsStartFuture) UnmarshalJSON(body []byte) error {
11058	var azFuture azure.Future
11059	if err := json.Unmarshal(body, &azFuture); err != nil {
11060		return err
11061	}
11062	future.FutureAPI = &azFuture
11063	future.Result = future.result
11064	return nil
11065}
11066
11067// result is the default implementation for StreamingEndpointsStartFuture.Result.
11068func (future *StreamingEndpointsStartFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11069	var done bool
11070	done, err = future.DoneWithContext(context.Background(), client)
11071	if err != nil {
11072		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure")
11073		return
11074	}
11075	if !done {
11076		ar.Response = future.Response()
11077		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture")
11078		return
11079	}
11080	ar.Response = future.Response()
11081	return
11082}
11083
11084// StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running
11085// operation.
11086type StreamingEndpointsStopFuture struct {
11087	azure.FutureAPI
11088	// Result returns the result of the asynchronous operation.
11089	// If the operation has not completed it will return an error.
11090	Result func(StreamingEndpointsClient) (autorest.Response, error)
11091}
11092
11093// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11094func (future *StreamingEndpointsStopFuture) UnmarshalJSON(body []byte) error {
11095	var azFuture azure.Future
11096	if err := json.Unmarshal(body, &azFuture); err != nil {
11097		return err
11098	}
11099	future.FutureAPI = &azFuture
11100	future.Result = future.result
11101	return nil
11102}
11103
11104// result is the default implementation for StreamingEndpointsStopFuture.Result.
11105func (future *StreamingEndpointsStopFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
11106	var done bool
11107	done, err = future.DoneWithContext(context.Background(), client)
11108	if err != nil {
11109		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure")
11110		return
11111	}
11112	if !done {
11113		ar.Response = future.Response()
11114		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture")
11115		return
11116	}
11117	ar.Response = future.Response()
11118	return
11119}
11120
11121// StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a
11122// long-running operation.
11123type StreamingEndpointsUpdateFuture struct {
11124	azure.FutureAPI
11125	// Result returns the result of the asynchronous operation.
11126	// If the operation has not completed it will return an error.
11127	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
11128}
11129
11130// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11131func (future *StreamingEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
11132	var azFuture azure.Future
11133	if err := json.Unmarshal(body, &azFuture); err != nil {
11134		return err
11135	}
11136	future.FutureAPI = &azFuture
11137	future.Result = future.result
11138	return nil
11139}
11140
11141// result is the default implementation for StreamingEndpointsUpdateFuture.Result.
11142func (future *StreamingEndpointsUpdateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
11143	var done bool
11144	done, err = future.DoneWithContext(context.Background(), client)
11145	if err != nil {
11146		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
11147		return
11148	}
11149	if !done {
11150		se.Response.Response = future.Response()
11151		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture")
11152		return
11153	}
11154	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11155	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
11156		se, err = client.UpdateResponder(se.Response.Response)
11157		if err != nil {
11158			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
11159		}
11160	}
11161	return
11162}
11163
11164// StreamingEntityScaleUnit scale units definition
11165type StreamingEntityScaleUnit struct {
11166	// ScaleUnit - The scale unit number of the streaming endpoint.
11167	ScaleUnit *int32 `json:"scaleUnit,omitempty"`
11168}
11169
11170// StreamingLocator a Streaming Locator resource
11171type StreamingLocator struct {
11172	autorest.Response           `json:"-"`
11173	*StreamingLocatorProperties `json:"properties,omitempty"`
11174	// SystemData - READ-ONLY; The system metadata relating to this resource.
11175	SystemData *SystemData `json:"systemData,omitempty"`
11176	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
11177	ID *string `json:"id,omitempty"`
11178	// Name - READ-ONLY; The name of the resource
11179	Name *string `json:"name,omitempty"`
11180	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
11181	Type *string `json:"type,omitempty"`
11182}
11183
11184// MarshalJSON is the custom marshaler for StreamingLocator.
11185func (sl StreamingLocator) MarshalJSON() ([]byte, error) {
11186	objectMap := make(map[string]interface{})
11187	if sl.StreamingLocatorProperties != nil {
11188		objectMap["properties"] = sl.StreamingLocatorProperties
11189	}
11190	return json.Marshal(objectMap)
11191}
11192
11193// UnmarshalJSON is the custom unmarshaler for StreamingLocator struct.
11194func (sl *StreamingLocator) UnmarshalJSON(body []byte) error {
11195	var m map[string]*json.RawMessage
11196	err := json.Unmarshal(body, &m)
11197	if err != nil {
11198		return err
11199	}
11200	for k, v := range m {
11201		switch k {
11202		case "properties":
11203			if v != nil {
11204				var streamingLocatorProperties StreamingLocatorProperties
11205				err = json.Unmarshal(*v, &streamingLocatorProperties)
11206				if err != nil {
11207					return err
11208				}
11209				sl.StreamingLocatorProperties = &streamingLocatorProperties
11210			}
11211		case "systemData":
11212			if v != nil {
11213				var systemData SystemData
11214				err = json.Unmarshal(*v, &systemData)
11215				if err != nil {
11216					return err
11217				}
11218				sl.SystemData = &systemData
11219			}
11220		case "id":
11221			if v != nil {
11222				var ID string
11223				err = json.Unmarshal(*v, &ID)
11224				if err != nil {
11225					return err
11226				}
11227				sl.ID = &ID
11228			}
11229		case "name":
11230			if v != nil {
11231				var name string
11232				err = json.Unmarshal(*v, &name)
11233				if err != nil {
11234					return err
11235				}
11236				sl.Name = &name
11237			}
11238		case "type":
11239			if v != nil {
11240				var typeVar string
11241				err = json.Unmarshal(*v, &typeVar)
11242				if err != nil {
11243					return err
11244				}
11245				sl.Type = &typeVar
11246			}
11247		}
11248	}
11249
11250	return nil
11251}
11252
11253// StreamingLocatorCollection a collection of StreamingLocator items.
11254type StreamingLocatorCollection struct {
11255	autorest.Response `json:"-"`
11256	// Value - A collection of StreamingLocator items.
11257	Value *[]StreamingLocator `json:"value,omitempty"`
11258	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
11259	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
11260}
11261
11262// StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values.
11263type StreamingLocatorCollectionIterator struct {
11264	i    int
11265	page StreamingLocatorCollectionPage
11266}
11267
11268// NextWithContext advances to the next value.  If there was an error making
11269// the request the iterator does not advance and the error is returned.
11270func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11271	if tracing.IsEnabled() {
11272		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext")
11273		defer func() {
11274			sc := -1
11275			if iter.Response().Response.Response != nil {
11276				sc = iter.Response().Response.Response.StatusCode
11277			}
11278			tracing.EndSpan(ctx, sc, err)
11279		}()
11280	}
11281	iter.i++
11282	if iter.i < len(iter.page.Values()) {
11283		return nil
11284	}
11285	err = iter.page.NextWithContext(ctx)
11286	if err != nil {
11287		iter.i--
11288		return err
11289	}
11290	iter.i = 0
11291	return nil
11292}
11293
11294// Next advances to the next value.  If there was an error making
11295// the request the iterator does not advance and the error is returned.
11296// Deprecated: Use NextWithContext() instead.
11297func (iter *StreamingLocatorCollectionIterator) Next() error {
11298	return iter.NextWithContext(context.Background())
11299}
11300
11301// NotDone returns true if the enumeration should be started or is not yet complete.
11302func (iter StreamingLocatorCollectionIterator) NotDone() bool {
11303	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11304}
11305
11306// Response returns the raw server response from the last page request.
11307func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection {
11308	return iter.page.Response()
11309}
11310
11311// Value returns the current value or a zero-initialized value if the
11312// iterator has advanced beyond the end of the collection.
11313func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator {
11314	if !iter.page.NotDone() {
11315		return StreamingLocator{}
11316	}
11317	return iter.page.Values()[iter.i]
11318}
11319
11320// Creates a new instance of the StreamingLocatorCollectionIterator type.
11321func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator {
11322	return StreamingLocatorCollectionIterator{page: page}
11323}
11324
11325// IsEmpty returns true if the ListResult contains no values.
11326func (slc StreamingLocatorCollection) IsEmpty() bool {
11327	return slc.Value == nil || len(*slc.Value) == 0
11328}
11329
11330// hasNextLink returns true if the NextLink is not empty.
11331func (slc StreamingLocatorCollection) hasNextLink() bool {
11332	return slc.OdataNextLink != nil && len(*slc.OdataNextLink) != 0
11333}
11334
11335// streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results.
11336// It returns nil if no more results exist.
11337func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) {
11338	if !slc.hasNextLink() {
11339		return nil, nil
11340	}
11341	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11342		autorest.AsJSON(),
11343		autorest.AsGet(),
11344		autorest.WithBaseURL(to.String(slc.OdataNextLink)))
11345}
11346
11347// StreamingLocatorCollectionPage contains a page of StreamingLocator values.
11348type StreamingLocatorCollectionPage struct {
11349	fn  func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)
11350	slc StreamingLocatorCollection
11351}
11352
11353// NextWithContext advances to the next page of values.  If there was an error making
11354// the request the page does not advance and the error is returned.
11355func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) {
11356	if tracing.IsEnabled() {
11357		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext")
11358		defer func() {
11359			sc := -1
11360			if page.Response().Response.Response != nil {
11361				sc = page.Response().Response.Response.StatusCode
11362			}
11363			tracing.EndSpan(ctx, sc, err)
11364		}()
11365	}
11366	for {
11367		next, err := page.fn(ctx, page.slc)
11368		if err != nil {
11369			return err
11370		}
11371		page.slc = next
11372		if !next.hasNextLink() || !next.IsEmpty() {
11373			break
11374		}
11375	}
11376	return nil
11377}
11378
11379// Next advances to the next page of values.  If there was an error making
11380// the request the page does not advance and the error is returned.
11381// Deprecated: Use NextWithContext() instead.
11382func (page *StreamingLocatorCollectionPage) Next() error {
11383	return page.NextWithContext(context.Background())
11384}
11385
11386// NotDone returns true if the page enumeration should be started or is not yet complete.
11387func (page StreamingLocatorCollectionPage) NotDone() bool {
11388	return !page.slc.IsEmpty()
11389}
11390
11391// Response returns the raw server response from the last page request.
11392func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection {
11393	return page.slc
11394}
11395
11396// Values returns the slice of values for the current page or nil if there are no values.
11397func (page StreamingLocatorCollectionPage) Values() []StreamingLocator {
11398	if page.slc.IsEmpty() {
11399		return nil
11400	}
11401	return *page.slc.Value
11402}
11403
11404// Creates a new instance of the StreamingLocatorCollectionPage type.
11405func NewStreamingLocatorCollectionPage(cur StreamingLocatorCollection, getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage {
11406	return StreamingLocatorCollectionPage{
11407		fn:  getNextPage,
11408		slc: cur,
11409	}
11410}
11411
11412// StreamingLocatorContentKey class for content key in Streaming Locator
11413type StreamingLocatorContentKey struct {
11414	// ID - ID of Content Key
11415	ID *uuid.UUID `json:"id,omitempty"`
11416	// Type - READ-ONLY; Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption'
11417	Type StreamingLocatorContentKeyType `json:"type,omitempty"`
11418	// LabelReferenceInStreamingPolicy - Label of Content Key as specified in the Streaming Policy
11419	LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"`
11420	// Value - Value of Content Key
11421	Value *string `json:"value,omitempty"`
11422	// PolicyName - READ-ONLY; ContentKeyPolicy used by Content Key
11423	PolicyName *string `json:"policyName,omitempty"`
11424	// Tracks - READ-ONLY; Tracks which use this Content Key
11425	Tracks *[]TrackSelection `json:"tracks,omitempty"`
11426}
11427
11428// MarshalJSON is the custom marshaler for StreamingLocatorContentKey.
11429func (slck StreamingLocatorContentKey) MarshalJSON() ([]byte, error) {
11430	objectMap := make(map[string]interface{})
11431	if slck.ID != nil {
11432		objectMap["id"] = slck.ID
11433	}
11434	if slck.LabelReferenceInStreamingPolicy != nil {
11435		objectMap["labelReferenceInStreamingPolicy"] = slck.LabelReferenceInStreamingPolicy
11436	}
11437	if slck.Value != nil {
11438		objectMap["value"] = slck.Value
11439	}
11440	return json.Marshal(objectMap)
11441}
11442
11443// StreamingLocatorProperties properties of the Streaming Locator.
11444type StreamingLocatorProperties struct {
11445	// AssetName - Asset Name
11446	AssetName *string `json:"assetName,omitempty"`
11447	// Created - READ-ONLY; The creation time of the Streaming Locator.
11448	Created *date.Time `json:"created,omitempty"`
11449	// StartTime - The start time of the Streaming Locator.
11450	StartTime *date.Time `json:"startTime,omitempty"`
11451	// EndTime - The end time of the Streaming Locator.
11452	EndTime *date.Time `json:"endTime,omitempty"`
11453	// StreamingLocatorID - The StreamingLocatorId of the Streaming Locator.
11454	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
11455	// StreamingPolicyName - Name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming'
11456	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
11457	// DefaultContentKeyPolicyName - Name of the default ContentKeyPolicy used by this Streaming Locator.
11458	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
11459	// ContentKeys - The ContentKeys used by this Streaming Locator.
11460	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
11461	// AlternativeMediaID - Alternative Media ID of this Streaming Locator
11462	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
11463	// Filters - A list of asset or account filters which apply to this streaming locator
11464	Filters *[]string `json:"filters,omitempty"`
11465}
11466
11467// MarshalJSON is the custom marshaler for StreamingLocatorProperties.
11468func (slp StreamingLocatorProperties) MarshalJSON() ([]byte, error) {
11469	objectMap := make(map[string]interface{})
11470	if slp.AssetName != nil {
11471		objectMap["assetName"] = slp.AssetName
11472	}
11473	if slp.StartTime != nil {
11474		objectMap["startTime"] = slp.StartTime
11475	}
11476	if slp.EndTime != nil {
11477		objectMap["endTime"] = slp.EndTime
11478	}
11479	if slp.StreamingLocatorID != nil {
11480		objectMap["streamingLocatorId"] = slp.StreamingLocatorID
11481	}
11482	if slp.StreamingPolicyName != nil {
11483		objectMap["streamingPolicyName"] = slp.StreamingPolicyName
11484	}
11485	if slp.DefaultContentKeyPolicyName != nil {
11486		objectMap["defaultContentKeyPolicyName"] = slp.DefaultContentKeyPolicyName
11487	}
11488	if slp.ContentKeys != nil {
11489		objectMap["contentKeys"] = slp.ContentKeys
11490	}
11491	if slp.AlternativeMediaID != nil {
11492		objectMap["alternativeMediaId"] = slp.AlternativeMediaID
11493	}
11494	if slp.Filters != nil {
11495		objectMap["filters"] = slp.Filters
11496	}
11497	return json.Marshal(objectMap)
11498}
11499
11500// StreamingPath class of paths for streaming
11501type StreamingPath struct {
11502	// StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload'
11503	StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"`
11504	// EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs'
11505	EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"`
11506	// Paths - Streaming paths for each protocol and encryptionScheme pair
11507	Paths *[]string `json:"paths,omitempty"`
11508}
11509
11510// StreamingPolicy a Streaming Policy resource
11511type StreamingPolicy struct {
11512	autorest.Response          `json:"-"`
11513	*StreamingPolicyProperties `json:"properties,omitempty"`
11514	// SystemData - READ-ONLY; The system metadata relating to this resource.
11515	SystemData *SystemData `json:"systemData,omitempty"`
11516	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
11517	ID *string `json:"id,omitempty"`
11518	// Name - READ-ONLY; The name of the resource
11519	Name *string `json:"name,omitempty"`
11520	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
11521	Type *string `json:"type,omitempty"`
11522}
11523
11524// MarshalJSON is the custom marshaler for StreamingPolicy.
11525func (sp StreamingPolicy) MarshalJSON() ([]byte, error) {
11526	objectMap := make(map[string]interface{})
11527	if sp.StreamingPolicyProperties != nil {
11528		objectMap["properties"] = sp.StreamingPolicyProperties
11529	}
11530	return json.Marshal(objectMap)
11531}
11532
11533// UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct.
11534func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error {
11535	var m map[string]*json.RawMessage
11536	err := json.Unmarshal(body, &m)
11537	if err != nil {
11538		return err
11539	}
11540	for k, v := range m {
11541		switch k {
11542		case "properties":
11543			if v != nil {
11544				var streamingPolicyProperties StreamingPolicyProperties
11545				err = json.Unmarshal(*v, &streamingPolicyProperties)
11546				if err != nil {
11547					return err
11548				}
11549				sp.StreamingPolicyProperties = &streamingPolicyProperties
11550			}
11551		case "systemData":
11552			if v != nil {
11553				var systemData SystemData
11554				err = json.Unmarshal(*v, &systemData)
11555				if err != nil {
11556					return err
11557				}
11558				sp.SystemData = &systemData
11559			}
11560		case "id":
11561			if v != nil {
11562				var ID string
11563				err = json.Unmarshal(*v, &ID)
11564				if err != nil {
11565					return err
11566				}
11567				sp.ID = &ID
11568			}
11569		case "name":
11570			if v != nil {
11571				var name string
11572				err = json.Unmarshal(*v, &name)
11573				if err != nil {
11574					return err
11575				}
11576				sp.Name = &name
11577			}
11578		case "type":
11579			if v != nil {
11580				var typeVar string
11581				err = json.Unmarshal(*v, &typeVar)
11582				if err != nil {
11583					return err
11584				}
11585				sp.Type = &typeVar
11586			}
11587		}
11588	}
11589
11590	return nil
11591}
11592
11593// StreamingPolicyCollection a collection of StreamingPolicy items.
11594type StreamingPolicyCollection struct {
11595	autorest.Response `json:"-"`
11596	// Value - A collection of StreamingPolicy items.
11597	Value *[]StreamingPolicy `json:"value,omitempty"`
11598	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
11599	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
11600}
11601
11602// StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values.
11603type StreamingPolicyCollectionIterator struct {
11604	i    int
11605	page StreamingPolicyCollectionPage
11606}
11607
11608// NextWithContext advances to the next value.  If there was an error making
11609// the request the iterator does not advance and the error is returned.
11610func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11611	if tracing.IsEnabled() {
11612		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext")
11613		defer func() {
11614			sc := -1
11615			if iter.Response().Response.Response != nil {
11616				sc = iter.Response().Response.Response.StatusCode
11617			}
11618			tracing.EndSpan(ctx, sc, err)
11619		}()
11620	}
11621	iter.i++
11622	if iter.i < len(iter.page.Values()) {
11623		return nil
11624	}
11625	err = iter.page.NextWithContext(ctx)
11626	if err != nil {
11627		iter.i--
11628		return err
11629	}
11630	iter.i = 0
11631	return nil
11632}
11633
11634// Next advances to the next value.  If there was an error making
11635// the request the iterator does not advance and the error is returned.
11636// Deprecated: Use NextWithContext() instead.
11637func (iter *StreamingPolicyCollectionIterator) Next() error {
11638	return iter.NextWithContext(context.Background())
11639}
11640
11641// NotDone returns true if the enumeration should be started or is not yet complete.
11642func (iter StreamingPolicyCollectionIterator) NotDone() bool {
11643	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11644}
11645
11646// Response returns the raw server response from the last page request.
11647func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection {
11648	return iter.page.Response()
11649}
11650
11651// Value returns the current value or a zero-initialized value if the
11652// iterator has advanced beyond the end of the collection.
11653func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy {
11654	if !iter.page.NotDone() {
11655		return StreamingPolicy{}
11656	}
11657	return iter.page.Values()[iter.i]
11658}
11659
11660// Creates a new instance of the StreamingPolicyCollectionIterator type.
11661func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator {
11662	return StreamingPolicyCollectionIterator{page: page}
11663}
11664
11665// IsEmpty returns true if the ListResult contains no values.
11666func (spc StreamingPolicyCollection) IsEmpty() bool {
11667	return spc.Value == nil || len(*spc.Value) == 0
11668}
11669
11670// hasNextLink returns true if the NextLink is not empty.
11671func (spc StreamingPolicyCollection) hasNextLink() bool {
11672	return spc.OdataNextLink != nil && len(*spc.OdataNextLink) != 0
11673}
11674
11675// streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results.
11676// It returns nil if no more results exist.
11677func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
11678	if !spc.hasNextLink() {
11679		return nil, nil
11680	}
11681	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11682		autorest.AsJSON(),
11683		autorest.AsGet(),
11684		autorest.WithBaseURL(to.String(spc.OdataNextLink)))
11685}
11686
11687// StreamingPolicyCollectionPage contains a page of StreamingPolicy values.
11688type StreamingPolicyCollectionPage struct {
11689	fn  func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)
11690	spc StreamingPolicyCollection
11691}
11692
11693// NextWithContext advances to the next page of values.  If there was an error making
11694// the request the page does not advance and the error is returned.
11695func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
11696	if tracing.IsEnabled() {
11697		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext")
11698		defer func() {
11699			sc := -1
11700			if page.Response().Response.Response != nil {
11701				sc = page.Response().Response.Response.StatusCode
11702			}
11703			tracing.EndSpan(ctx, sc, err)
11704		}()
11705	}
11706	for {
11707		next, err := page.fn(ctx, page.spc)
11708		if err != nil {
11709			return err
11710		}
11711		page.spc = next
11712		if !next.hasNextLink() || !next.IsEmpty() {
11713			break
11714		}
11715	}
11716	return nil
11717}
11718
11719// Next advances to the next page of values.  If there was an error making
11720// the request the page does not advance and the error is returned.
11721// Deprecated: Use NextWithContext() instead.
11722func (page *StreamingPolicyCollectionPage) Next() error {
11723	return page.NextWithContext(context.Background())
11724}
11725
11726// NotDone returns true if the page enumeration should be started or is not yet complete.
11727func (page StreamingPolicyCollectionPage) NotDone() bool {
11728	return !page.spc.IsEmpty()
11729}
11730
11731// Response returns the raw server response from the last page request.
11732func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection {
11733	return page.spc
11734}
11735
11736// Values returns the slice of values for the current page or nil if there are no values.
11737func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy {
11738	if page.spc.IsEmpty() {
11739		return nil
11740	}
11741	return *page.spc.Value
11742}
11743
11744// Creates a new instance of the StreamingPolicyCollectionPage type.
11745func NewStreamingPolicyCollectionPage(cur StreamingPolicyCollection, getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage {
11746	return StreamingPolicyCollectionPage{
11747		fn:  getNextPage,
11748		spc: cur,
11749	}
11750}
11751
11752// StreamingPolicyContentKey class to specify properties of content key
11753type StreamingPolicyContentKey struct {
11754	// Label - Label can be used to specify Content Key when creating a Streaming Locator
11755	Label *string `json:"label,omitempty"`
11756	// PolicyName - Policy used by Content Key
11757	PolicyName *string `json:"policyName,omitempty"`
11758	// Tracks - Tracks which use this content key
11759	Tracks *[]TrackSelection `json:"tracks,omitempty"`
11760}
11761
11762// StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy
11763type StreamingPolicyContentKeys struct {
11764	// DefaultKey - Default content key for an encryption scheme
11765	DefaultKey *DefaultKey `json:"defaultKey,omitempty"`
11766	// KeyToTrackMappings - Representing tracks needs separate content key
11767	KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"`
11768}
11769
11770// StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy
11771type StreamingPolicyFairPlayConfiguration struct {
11772	// CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players.  Not required when using Azure Media Services for issuing licenses.  The template supports replaceable tokens that the service will update at runtime with the value specific to the request.  The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested.
11773	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11774	// AllowPersistentLicense - All license to be persistent or not
11775	AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"`
11776}
11777
11778// StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy
11779type StreamingPolicyPlayReadyConfiguration struct {
11780	// CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players.  Not required when using Azure Media Services for issuing licenses.  The template supports replaceable tokens that the service will update at runtime with the value specific to the request.  The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested.
11781	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11782	// PlayReadyCustomAttributes - Custom attributes for PlayReady
11783	PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"`
11784}
11785
11786// StreamingPolicyProperties class to specify properties of Streaming Policy
11787type StreamingPolicyProperties struct {
11788	// Created - READ-ONLY; Creation time of Streaming Policy
11789	Created *date.Time `json:"created,omitempty"`
11790	// DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy
11791	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
11792	// EnvelopeEncryption - Configuration of EnvelopeEncryption
11793	EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"`
11794	// CommonEncryptionCenc - Configuration of CommonEncryptionCenc
11795	CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"`
11796	// CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs
11797	CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"`
11798	// NoEncryption - Configurations of NoEncryption
11799	NoEncryption *NoEncryption `json:"noEncryption,omitempty"`
11800}
11801
11802// MarshalJSON is the custom marshaler for StreamingPolicyProperties.
11803func (spp StreamingPolicyProperties) MarshalJSON() ([]byte, error) {
11804	objectMap := make(map[string]interface{})
11805	if spp.DefaultContentKeyPolicyName != nil {
11806		objectMap["defaultContentKeyPolicyName"] = spp.DefaultContentKeyPolicyName
11807	}
11808	if spp.EnvelopeEncryption != nil {
11809		objectMap["envelopeEncryption"] = spp.EnvelopeEncryption
11810	}
11811	if spp.CommonEncryptionCenc != nil {
11812		objectMap["commonEncryptionCenc"] = spp.CommonEncryptionCenc
11813	}
11814	if spp.CommonEncryptionCbcs != nil {
11815		objectMap["commonEncryptionCbcs"] = spp.CommonEncryptionCbcs
11816	}
11817	if spp.NoEncryption != nil {
11818		objectMap["noEncryption"] = spp.NoEncryption
11819	}
11820	return json.Marshal(objectMap)
11821}
11822
11823// StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy
11824type StreamingPolicyWidevineConfiguration struct {
11825	// CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players.  Not required when using Azure Media Services for issuing licenses.  The template supports replaceable tokens that the service will update at runtime with the value specific to the request.  The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested.
11826	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
11827}
11828
11829// SyncStorageKeysInput the input to the sync storage keys request.
11830type SyncStorageKeysInput struct {
11831	// ID - The ID of the storage account resource.
11832	ID *string `json:"id,omitempty"`
11833}
11834
11835// SystemData metadata pertaining to creation and last modification of the resource.
11836type SystemData struct {
11837	// CreatedBy - The identity that created the resource.
11838	CreatedBy *string `json:"createdBy,omitempty"`
11839	// CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
11840	CreatedByType CreatedByType `json:"createdByType,omitempty"`
11841	// CreatedAt - The timestamp of resource creation (UTC).
11842	CreatedAt *date.Time `json:"createdAt,omitempty"`
11843	// LastModifiedBy - The identity that last modified the resource.
11844	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
11845	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
11846	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
11847	// LastModifiedAt - The timestamp of resource last modification (UTC)
11848	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
11849}
11850
11851// BasicTrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
11852// that should be processed by a Job
11853type BasicTrackDescriptor interface {
11854	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
11855	AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool)
11856	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
11857	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
11858	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
11859	AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool)
11860	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
11861	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
11862	AsTrackDescriptor() (*TrackDescriptor, bool)
11863}
11864
11865// TrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
11866// that should be processed by a Job
11867type TrackDescriptor struct {
11868	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
11869	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
11870}
11871
11872func unmarshalBasicTrackDescriptor(body []byte) (BasicTrackDescriptor, error) {
11873	var m map[string]interface{}
11874	err := json.Unmarshal(body, &m)
11875	if err != nil {
11876		return nil, err
11877	}
11878
11879	switch m["@odata.type"] {
11880	case string(OdataTypeMicrosoftMediaAudioTrackDescriptor):
11881		var atd AudioTrackDescriptor
11882		err := json.Unmarshal(body, &atd)
11883		return atd, err
11884	case string(OdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
11885		var satba SelectAudioTrackByAttribute
11886		err := json.Unmarshal(body, &satba)
11887		return satba, err
11888	case string(OdataTypeMicrosoftMediaSelectAudioTrackByID):
11889		var satbi SelectAudioTrackByID
11890		err := json.Unmarshal(body, &satbi)
11891		return satbi, err
11892	case string(OdataTypeMicrosoftMediaVideoTrackDescriptor):
11893		var vtd VideoTrackDescriptor
11894		err := json.Unmarshal(body, &vtd)
11895		return vtd, err
11896	case string(OdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
11897		var svtba SelectVideoTrackByAttribute
11898		err := json.Unmarshal(body, &svtba)
11899		return svtba, err
11900	case string(OdataTypeMicrosoftMediaSelectVideoTrackByID):
11901		var svtbi SelectVideoTrackByID
11902		err := json.Unmarshal(body, &svtbi)
11903		return svtbi, err
11904	default:
11905		var td TrackDescriptor
11906		err := json.Unmarshal(body, &td)
11907		return td, err
11908	}
11909}
11910func unmarshalBasicTrackDescriptorArray(body []byte) ([]BasicTrackDescriptor, error) {
11911	var rawMessages []*json.RawMessage
11912	err := json.Unmarshal(body, &rawMessages)
11913	if err != nil {
11914		return nil, err
11915	}
11916
11917	tdArray := make([]BasicTrackDescriptor, len(rawMessages))
11918
11919	for index, rawMessage := range rawMessages {
11920		td, err := unmarshalBasicTrackDescriptor(*rawMessage)
11921		if err != nil {
11922			return nil, err
11923		}
11924		tdArray[index] = td
11925	}
11926	return tdArray, nil
11927}
11928
11929// MarshalJSON is the custom marshaler for TrackDescriptor.
11930func (td TrackDescriptor) MarshalJSON() ([]byte, error) {
11931	td.OdataType = OdataTypeTrackDescriptor
11932	objectMap := make(map[string]interface{})
11933	if td.OdataType != "" {
11934		objectMap["@odata.type"] = td.OdataType
11935	}
11936	return json.Marshal(objectMap)
11937}
11938
11939// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11940func (td TrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
11941	return nil, false
11942}
11943
11944// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11945func (td TrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
11946	return nil, false
11947}
11948
11949// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
11950func (td TrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
11951	return nil, false
11952}
11953
11954// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
11955func (td TrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
11956	return nil, false
11957}
11958
11959// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11960func (td TrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
11961	return nil, false
11962}
11963
11964// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11965func (td TrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
11966	return nil, false
11967}
11968
11969// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
11970func (td TrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
11971	return nil, false
11972}
11973
11974// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
11975func (td TrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
11976	return nil, false
11977}
11978
11979// AsTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11980func (td TrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
11981	return &td, true
11982}
11983
11984// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
11985func (td TrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
11986	return &td, true
11987}
11988
11989// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
11990// which has 'tags' and a 'location'
11991type TrackedResource struct {
11992	// Tags - Resource tags.
11993	Tags map[string]*string `json:"tags"`
11994	// Location - The geo-location where the resource lives
11995	Location *string `json:"location,omitempty"`
11996	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
11997	ID *string `json:"id,omitempty"`
11998	// Name - READ-ONLY; The name of the resource
11999	Name *string `json:"name,omitempty"`
12000	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
12001	Type *string `json:"type,omitempty"`
12002}
12003
12004// MarshalJSON is the custom marshaler for TrackedResource.
12005func (tr TrackedResource) MarshalJSON() ([]byte, error) {
12006	objectMap := make(map[string]interface{})
12007	if tr.Tags != nil {
12008		objectMap["tags"] = tr.Tags
12009	}
12010	if tr.Location != nil {
12011		objectMap["location"] = tr.Location
12012	}
12013	return json.Marshal(objectMap)
12014}
12015
12016// TrackPropertyCondition class to specify one track property condition
12017type TrackPropertyCondition struct {
12018	// Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC'
12019	Property TrackPropertyType `json:"property,omitempty"`
12020	// Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual'
12021	Operation TrackPropertyCompareOperation `json:"operation,omitempty"`
12022	// Value - Track property value
12023	Value *string `json:"value,omitempty"`
12024}
12025
12026// TrackSelection class to select a track
12027type TrackSelection struct {
12028	// TrackSelections - TrackSelections is a track property condition list which can specify track(s)
12029	TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"`
12030}
12031
12032// Transform a Transform encapsulates the rules or instructions for generating desired outputs from input
12033// media, such as by transcoding or by extracting insights. After the Transform is created, it can be
12034// applied to input media by creating Jobs.
12035type Transform struct {
12036	autorest.Response `json:"-"`
12037	// TransformProperties - The resource properties.
12038	*TransformProperties `json:"properties,omitempty"`
12039	// SystemData - READ-ONLY; The system metadata relating to this resource.
12040	SystemData *SystemData `json:"systemData,omitempty"`
12041	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
12042	ID *string `json:"id,omitempty"`
12043	// Name - READ-ONLY; The name of the resource
12044	Name *string `json:"name,omitempty"`
12045	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
12046	Type *string `json:"type,omitempty"`
12047}
12048
12049// MarshalJSON is the custom marshaler for Transform.
12050func (t Transform) MarshalJSON() ([]byte, error) {
12051	objectMap := make(map[string]interface{})
12052	if t.TransformProperties != nil {
12053		objectMap["properties"] = t.TransformProperties
12054	}
12055	return json.Marshal(objectMap)
12056}
12057
12058// UnmarshalJSON is the custom unmarshaler for Transform struct.
12059func (t *Transform) UnmarshalJSON(body []byte) error {
12060	var m map[string]*json.RawMessage
12061	err := json.Unmarshal(body, &m)
12062	if err != nil {
12063		return err
12064	}
12065	for k, v := range m {
12066		switch k {
12067		case "properties":
12068			if v != nil {
12069				var transformProperties TransformProperties
12070				err = json.Unmarshal(*v, &transformProperties)
12071				if err != nil {
12072					return err
12073				}
12074				t.TransformProperties = &transformProperties
12075			}
12076		case "systemData":
12077			if v != nil {
12078				var systemData SystemData
12079				err = json.Unmarshal(*v, &systemData)
12080				if err != nil {
12081					return err
12082				}
12083				t.SystemData = &systemData
12084			}
12085		case "id":
12086			if v != nil {
12087				var ID string
12088				err = json.Unmarshal(*v, &ID)
12089				if err != nil {
12090					return err
12091				}
12092				t.ID = &ID
12093			}
12094		case "name":
12095			if v != nil {
12096				var name string
12097				err = json.Unmarshal(*v, &name)
12098				if err != nil {
12099					return err
12100				}
12101				t.Name = &name
12102			}
12103		case "type":
12104			if v != nil {
12105				var typeVar string
12106				err = json.Unmarshal(*v, &typeVar)
12107				if err != nil {
12108					return err
12109				}
12110				t.Type = &typeVar
12111			}
12112		}
12113	}
12114
12115	return nil
12116}
12117
12118// TransformCollection a collection of Transform items.
12119type TransformCollection struct {
12120	autorest.Response `json:"-"`
12121	// Value - A collection of Transform items.
12122	Value *[]Transform `json:"value,omitempty"`
12123	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
12124	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
12125}
12126
12127// TransformCollectionIterator provides access to a complete listing of Transform values.
12128type TransformCollectionIterator struct {
12129	i    int
12130	page TransformCollectionPage
12131}
12132
12133// NextWithContext advances to the next value.  If there was an error making
12134// the request the iterator does not advance and the error is returned.
12135func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12136	if tracing.IsEnabled() {
12137		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext")
12138		defer func() {
12139			sc := -1
12140			if iter.Response().Response.Response != nil {
12141				sc = iter.Response().Response.Response.StatusCode
12142			}
12143			tracing.EndSpan(ctx, sc, err)
12144		}()
12145	}
12146	iter.i++
12147	if iter.i < len(iter.page.Values()) {
12148		return nil
12149	}
12150	err = iter.page.NextWithContext(ctx)
12151	if err != nil {
12152		iter.i--
12153		return err
12154	}
12155	iter.i = 0
12156	return nil
12157}
12158
12159// Next advances to the next value.  If there was an error making
12160// the request the iterator does not advance and the error is returned.
12161// Deprecated: Use NextWithContext() instead.
12162func (iter *TransformCollectionIterator) Next() error {
12163	return iter.NextWithContext(context.Background())
12164}
12165
12166// NotDone returns true if the enumeration should be started or is not yet complete.
12167func (iter TransformCollectionIterator) NotDone() bool {
12168	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12169}
12170
12171// Response returns the raw server response from the last page request.
12172func (iter TransformCollectionIterator) Response() TransformCollection {
12173	return iter.page.Response()
12174}
12175
12176// Value returns the current value or a zero-initialized value if the
12177// iterator has advanced beyond the end of the collection.
12178func (iter TransformCollectionIterator) Value() Transform {
12179	if !iter.page.NotDone() {
12180		return Transform{}
12181	}
12182	return iter.page.Values()[iter.i]
12183}
12184
12185// Creates a new instance of the TransformCollectionIterator type.
12186func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator {
12187	return TransformCollectionIterator{page: page}
12188}
12189
12190// IsEmpty returns true if the ListResult contains no values.
12191func (tc TransformCollection) IsEmpty() bool {
12192	return tc.Value == nil || len(*tc.Value) == 0
12193}
12194
12195// hasNextLink returns true if the NextLink is not empty.
12196func (tc TransformCollection) hasNextLink() bool {
12197	return tc.OdataNextLink != nil && len(*tc.OdataNextLink) != 0
12198}
12199
12200// transformCollectionPreparer prepares a request to retrieve the next set of results.
12201// It returns nil if no more results exist.
12202func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) {
12203	if !tc.hasNextLink() {
12204		return nil, nil
12205	}
12206	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12207		autorest.AsJSON(),
12208		autorest.AsGet(),
12209		autorest.WithBaseURL(to.String(tc.OdataNextLink)))
12210}
12211
12212// TransformCollectionPage contains a page of Transform values.
12213type TransformCollectionPage struct {
12214	fn func(context.Context, TransformCollection) (TransformCollection, error)
12215	tc TransformCollection
12216}
12217
12218// NextWithContext advances to the next page of values.  If there was an error making
12219// the request the page does not advance and the error is returned.
12220func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) {
12221	if tracing.IsEnabled() {
12222		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext")
12223		defer func() {
12224			sc := -1
12225			if page.Response().Response.Response != nil {
12226				sc = page.Response().Response.Response.StatusCode
12227			}
12228			tracing.EndSpan(ctx, sc, err)
12229		}()
12230	}
12231	for {
12232		next, err := page.fn(ctx, page.tc)
12233		if err != nil {
12234			return err
12235		}
12236		page.tc = next
12237		if !next.hasNextLink() || !next.IsEmpty() {
12238			break
12239		}
12240	}
12241	return nil
12242}
12243
12244// Next advances to the next page of values.  If there was an error making
12245// the request the page does not advance and the error is returned.
12246// Deprecated: Use NextWithContext() instead.
12247func (page *TransformCollectionPage) Next() error {
12248	return page.NextWithContext(context.Background())
12249}
12250
12251// NotDone returns true if the page enumeration should be started or is not yet complete.
12252func (page TransformCollectionPage) NotDone() bool {
12253	return !page.tc.IsEmpty()
12254}
12255
12256// Response returns the raw server response from the last page request.
12257func (page TransformCollectionPage) Response() TransformCollection {
12258	return page.tc
12259}
12260
12261// Values returns the slice of values for the current page or nil if there are no values.
12262func (page TransformCollectionPage) Values() []Transform {
12263	if page.tc.IsEmpty() {
12264		return nil
12265	}
12266	return *page.tc.Value
12267}
12268
12269// Creates a new instance of the TransformCollectionPage type.
12270func NewTransformCollectionPage(cur TransformCollection, getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage {
12271	return TransformCollectionPage{
12272		fn: getNextPage,
12273		tc: cur,
12274	}
12275}
12276
12277// TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while
12278// generating the desired output.
12279type TransformOutput struct {
12280	// OnError - A Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob'
12281	OnError OnErrorType `json:"onError,omitempty"`
12282	// RelativePriority - Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'PriorityLow', 'PriorityNormal', 'PriorityHigh'
12283	RelativePriority Priority `json:"relativePriority,omitempty"`
12284	// Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output.
12285	Preset BasicPreset `json:"preset,omitempty"`
12286}
12287
12288// UnmarshalJSON is the custom unmarshaler for TransformOutput struct.
12289func (toVar *TransformOutput) UnmarshalJSON(body []byte) error {
12290	var m map[string]*json.RawMessage
12291	err := json.Unmarshal(body, &m)
12292	if err != nil {
12293		return err
12294	}
12295	for k, v := range m {
12296		switch k {
12297		case "onError":
12298			if v != nil {
12299				var onError OnErrorType
12300				err = json.Unmarshal(*v, &onError)
12301				if err != nil {
12302					return err
12303				}
12304				toVar.OnError = onError
12305			}
12306		case "relativePriority":
12307			if v != nil {
12308				var relativePriority Priority
12309				err = json.Unmarshal(*v, &relativePriority)
12310				if err != nil {
12311					return err
12312				}
12313				toVar.RelativePriority = relativePriority
12314			}
12315		case "preset":
12316			if v != nil {
12317				preset, err := unmarshalBasicPreset(*v)
12318				if err != nil {
12319					return err
12320				}
12321				toVar.Preset = preset
12322			}
12323		}
12324	}
12325
12326	return nil
12327}
12328
12329// TransformProperties a Transform.
12330type TransformProperties struct {
12331	// Created - READ-ONLY; The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format.
12332	Created *date.Time `json:"created,omitempty"`
12333	// Description - An optional verbose description of the Transform.
12334	Description *string `json:"description,omitempty"`
12335	// LastModified - READ-ONLY; The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format.
12336	LastModified *date.Time `json:"lastModified,omitempty"`
12337	// Outputs - An array of one or more TransformOutputs that the Transform should generate.
12338	Outputs *[]TransformOutput `json:"outputs,omitempty"`
12339}
12340
12341// MarshalJSON is the custom marshaler for TransformProperties.
12342func (tp TransformProperties) MarshalJSON() ([]byte, error) {
12343	objectMap := make(map[string]interface{})
12344	if tp.Description != nil {
12345		objectMap["description"] = tp.Description
12346	}
12347	if tp.Outputs != nil {
12348		objectMap["outputs"] = tp.Outputs
12349	}
12350	return json.Marshal(objectMap)
12351}
12352
12353// TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC
12354// 13818-1) output video file(s).
12355type TransportStreamFormat struct {
12356	// OutputFiles - The list of output files to produce.  Each entry in the list is a set of audio and video layer labels to be muxed together .
12357	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
12358	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
12359	FilenamePattern *string `json:"filenamePattern,omitempty"`
12360	// OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat'
12361	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
12362}
12363
12364// MarshalJSON is the custom marshaler for TransportStreamFormat.
12365func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) {
12366	tsf.OdataType = OdataTypeMicrosoftMediaTransportStreamFormat
12367	objectMap := make(map[string]interface{})
12368	if tsf.OutputFiles != nil {
12369		objectMap["outputFiles"] = tsf.OutputFiles
12370	}
12371	if tsf.FilenamePattern != nil {
12372		objectMap["filenamePattern"] = tsf.FilenamePattern
12373	}
12374	if tsf.OdataType != "" {
12375		objectMap["@odata.type"] = tsf.OdataType
12376	}
12377	return json.Marshal(objectMap)
12378}
12379
12380// AsImageFormat is the BasicFormat implementation for TransportStreamFormat.
12381func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) {
12382	return nil, false
12383}
12384
12385// AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat.
12386func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
12387	return nil, false
12388}
12389
12390// AsJpgFormat is the BasicFormat implementation for TransportStreamFormat.
12391func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) {
12392	return nil, false
12393}
12394
12395// AsPngFormat is the BasicFormat implementation for TransportStreamFormat.
12396func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) {
12397	return nil, false
12398}
12399
12400// AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
12401func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
12402	return nil, false
12403}
12404
12405// AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
12406func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
12407	return &tsf, true
12408}
12409
12410// AsMp4Format is the BasicFormat implementation for TransportStreamFormat.
12411func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) {
12412	return nil, false
12413}
12414
12415// AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat.
12416func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
12417	return &tsf, true
12418}
12419
12420// AsFormat is the BasicFormat implementation for TransportStreamFormat.
12421func (tsf TransportStreamFormat) AsFormat() (*Format, bool) {
12422	return nil, false
12423}
12424
12425// AsBasicFormat is the BasicFormat implementation for TransportStreamFormat.
12426func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) {
12427	return &tsf, true
12428}
12429
12430// UtcClipTime specifies the clip time as a Utc time position in the media file.  The Utc time can point to
12431// a different position depending on whether the media file starts from a timestamp of zero or not.
12432type UtcClipTime struct {
12433	// Time - The time position on the timeline of the input media based on Utc time.
12434	Time *date.Time `json:"time,omitempty"`
12435	// OdataType - Possible values include: 'OdataTypeClipTime', 'OdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeMicrosoftMediaUtcClipTime'
12436	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
12437}
12438
12439// MarshalJSON is the custom marshaler for UtcClipTime.
12440func (uct UtcClipTime) MarshalJSON() ([]byte, error) {
12441	uct.OdataType = OdataTypeMicrosoftMediaUtcClipTime
12442	objectMap := make(map[string]interface{})
12443	if uct.Time != nil {
12444		objectMap["time"] = uct.Time
12445	}
12446	if uct.OdataType != "" {
12447		objectMap["@odata.type"] = uct.OdataType
12448	}
12449	return json.Marshal(objectMap)
12450}
12451
12452// AsAbsoluteClipTime is the BasicClipTime implementation for UtcClipTime.
12453func (uct UtcClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
12454	return nil, false
12455}
12456
12457// AsUtcClipTime is the BasicClipTime implementation for UtcClipTime.
12458func (uct UtcClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
12459	return &uct, true
12460}
12461
12462// AsClipTime is the BasicClipTime implementation for UtcClipTime.
12463func (uct UtcClipTime) AsClipTime() (*ClipTime, bool) {
12464	return nil, false
12465}
12466
12467// AsBasicClipTime is the BasicClipTime implementation for UtcClipTime.
12468func (uct UtcClipTime) AsBasicClipTime() (BasicClipTime, bool) {
12469	return &uct, true
12470}
12471
12472// BasicVideo describes the basic properties for encoding the input video.
12473type BasicVideo interface {
12474	AsH265Video() (*H265Video, bool)
12475	AsImage() (*Image, bool)
12476	AsBasicImage() (BasicImage, bool)
12477	AsH264Video() (*H264Video, bool)
12478	AsJpgImage() (*JpgImage, bool)
12479	AsPngImage() (*PngImage, bool)
12480	AsVideo() (*Video, bool)
12481}
12482
12483// Video describes the basic properties for encoding the input video.
12484type Video struct {
12485	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
12486	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
12487	// StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
12488	StretchMode StretchMode `json:"stretchMode,omitempty"`
12489	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
12490	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
12491	// Label - An optional label for the codec. The label can be used to control muxing behavior.
12492	Label *string `json:"label,omitempty"`
12493	// OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaH265Video', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage'
12494	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
12495}
12496
12497func unmarshalBasicVideo(body []byte) (BasicVideo, error) {
12498	var m map[string]interface{}
12499	err := json.Unmarshal(body, &m)
12500	if err != nil {
12501		return nil, err
12502	}
12503
12504	switch m["@odata.type"] {
12505	case string(OdataTypeMicrosoftMediaH265Video):
12506		var hv H265Video
12507		err := json.Unmarshal(body, &hv)
12508		return hv, err
12509	case string(OdataTypeMicrosoftMediaImage):
12510		var i Image
12511		err := json.Unmarshal(body, &i)
12512		return i, err
12513	case string(OdataTypeMicrosoftMediaH264Video):
12514		var hv H264Video
12515		err := json.Unmarshal(body, &hv)
12516		return hv, err
12517	case string(OdataTypeMicrosoftMediaJpgImage):
12518		var ji JpgImage
12519		err := json.Unmarshal(body, &ji)
12520		return ji, err
12521	case string(OdataTypeMicrosoftMediaPngImage):
12522		var pi PngImage
12523		err := json.Unmarshal(body, &pi)
12524		return pi, err
12525	default:
12526		var vVar Video
12527		err := json.Unmarshal(body, &vVar)
12528		return vVar, err
12529	}
12530}
12531func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) {
12532	var rawMessages []*json.RawMessage
12533	err := json.Unmarshal(body, &rawMessages)
12534	if err != nil {
12535		return nil, err
12536	}
12537
12538	vVarArray := make([]BasicVideo, len(rawMessages))
12539
12540	for index, rawMessage := range rawMessages {
12541		vVar, err := unmarshalBasicVideo(*rawMessage)
12542		if err != nil {
12543			return nil, err
12544		}
12545		vVarArray[index] = vVar
12546	}
12547	return vVarArray, nil
12548}
12549
12550// MarshalJSON is the custom marshaler for Video.
12551func (vVar Video) MarshalJSON() ([]byte, error) {
12552	vVar.OdataType = OdataTypeMicrosoftMediaVideo
12553	objectMap := make(map[string]interface{})
12554	if vVar.KeyFrameInterval != nil {
12555		objectMap["keyFrameInterval"] = vVar.KeyFrameInterval
12556	}
12557	if vVar.StretchMode != "" {
12558		objectMap["stretchMode"] = vVar.StretchMode
12559	}
12560	if vVar.SyncMode != "" {
12561		objectMap["syncMode"] = vVar.SyncMode
12562	}
12563	if vVar.Label != nil {
12564		objectMap["label"] = vVar.Label
12565	}
12566	if vVar.OdataType != "" {
12567		objectMap["@odata.type"] = vVar.OdataType
12568	}
12569	return json.Marshal(objectMap)
12570}
12571
12572// AsAudio is the BasicCodec implementation for Video.
12573func (vVar Video) AsAudio() (*Audio, bool) {
12574	return nil, false
12575}
12576
12577// AsBasicAudio is the BasicCodec implementation for Video.
12578func (vVar Video) AsBasicAudio() (BasicAudio, bool) {
12579	return nil, false
12580}
12581
12582// AsAacAudio is the BasicCodec implementation for Video.
12583func (vVar Video) AsAacAudio() (*AacAudio, bool) {
12584	return nil, false
12585}
12586
12587// AsVideo is the BasicCodec implementation for Video.
12588func (vVar Video) AsVideo() (*Video, bool) {
12589	return &vVar, true
12590}
12591
12592// AsBasicVideo is the BasicCodec implementation for Video.
12593func (vVar Video) AsBasicVideo() (BasicVideo, bool) {
12594	return &vVar, true
12595}
12596
12597// AsH265Video is the BasicCodec implementation for Video.
12598func (vVar Video) AsH265Video() (*H265Video, bool) {
12599	return nil, false
12600}
12601
12602// AsCopyVideo is the BasicCodec implementation for Video.
12603func (vVar Video) AsCopyVideo() (*CopyVideo, bool) {
12604	return nil, false
12605}
12606
12607// AsImage is the BasicCodec implementation for Video.
12608func (vVar Video) AsImage() (*Image, bool) {
12609	return nil, false
12610}
12611
12612// AsBasicImage is the BasicCodec implementation for Video.
12613func (vVar Video) AsBasicImage() (BasicImage, bool) {
12614	return nil, false
12615}
12616
12617// AsCopyAudio is the BasicCodec implementation for Video.
12618func (vVar Video) AsCopyAudio() (*CopyAudio, bool) {
12619	return nil, false
12620}
12621
12622// AsH264Video is the BasicCodec implementation for Video.
12623func (vVar Video) AsH264Video() (*H264Video, bool) {
12624	return nil, false
12625}
12626
12627// AsJpgImage is the BasicCodec implementation for Video.
12628func (vVar Video) AsJpgImage() (*JpgImage, bool) {
12629	return nil, false
12630}
12631
12632// AsPngImage is the BasicCodec implementation for Video.
12633func (vVar Video) AsPngImage() (*PngImage, bool) {
12634	return nil, false
12635}
12636
12637// AsCodec is the BasicCodec implementation for Video.
12638func (vVar Video) AsCodec() (*Codec, bool) {
12639	return nil, false
12640}
12641
12642// AsBasicCodec is the BasicCodec implementation for Video.
12643func (vVar Video) AsBasicCodec() (BasicCodec, bool) {
12644	return &vVar, true
12645}
12646
12647// VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and
12648// video, and outputs a JSON format file.
12649type VideoAnalyzerPreset struct {
12650	// InsightsToExtract - Defines the type of insights that you want the service to generate. The allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If you set this to AllInsights and the input is audio only, then only audio insights are generated. Similarly if the input is video only, then only video insights are generated. It is recommended that you not use AudioInsightsOnly if you expect some of your inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to be audio only. Your Jobs in such conditions would error out. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'
12651	InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"`
12652	// AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US').  If you know the language of your content, it is recommended that you specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463
12653	AudioLanguage *string `json:"audioLanguage,omitempty"`
12654	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'Standard', 'Basic'
12655	Mode AudioAnalysisMode `json:"mode,omitempty"`
12656	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
12657	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
12658	// OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset'
12659	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
12660}
12661
12662// MarshalJSON is the custom marshaler for VideoAnalyzerPreset.
12663func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) {
12664	vap.OdataType = OdataTypeMicrosoftMediaVideoAnalyzerPreset
12665	objectMap := make(map[string]interface{})
12666	if vap.InsightsToExtract != "" {
12667		objectMap["insightsToExtract"] = vap.InsightsToExtract
12668	}
12669	if vap.AudioLanguage != nil {
12670		objectMap["audioLanguage"] = vap.AudioLanguage
12671	}
12672	if vap.Mode != "" {
12673		objectMap["mode"] = vap.Mode
12674	}
12675	if vap.ExperimentalOptions != nil {
12676		objectMap["experimentalOptions"] = vap.ExperimentalOptions
12677	}
12678	if vap.OdataType != "" {
12679		objectMap["@odata.type"] = vap.OdataType
12680	}
12681	return json.Marshal(objectMap)
12682}
12683
12684// AsFaceDetectorPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12685func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
12686	return nil, false
12687}
12688
12689// AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12690func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
12691	return nil, false
12692}
12693
12694// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12695func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
12696	return &vap, true
12697}
12698
12699// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12700func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
12701	return nil, false
12702}
12703
12704// AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12705func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
12706	return nil, false
12707}
12708
12709// AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12710func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
12711	return &vap, true
12712}
12713
12714// AsPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12715func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) {
12716	return nil, false
12717}
12718
12719// AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset.
12720func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
12721	return &vap, true
12722}
12723
12724// BasicVideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer.
12725type BasicVideoLayer interface {
12726	AsH264Layer() (*H264Layer, bool)
12727	AsVideoLayer() (*VideoLayer, bool)
12728}
12729
12730// VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
12731// layer.
12732type VideoLayer struct {
12733	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
12734	Bitrate *int32 `json:"bitrate,omitempty"`
12735	// MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate.
12736	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
12737	// BFrames - The number of B-frames to be used when encoding this layer.  If not specified, the encoder chooses an appropriate number based on the video profile and level.
12738	BFrames *int32 `json:"bFrames,omitempty"`
12739	// FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video.
12740	FrameRate *string `json:"frameRate,omitempty"`
12741	// Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame.
12742	Slices *int32 `json:"slices,omitempty"`
12743	// AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
12744	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
12745	// Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
12746	Width *string `json:"width,omitempty"`
12747	// Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
12748	Height *string `json:"height,omitempty"`
12749	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
12750	Label *string `json:"label,omitempty"`
12751	// OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeMicrosoftMediaH265Layer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer'
12752	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
12753}
12754
12755func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) {
12756	var m map[string]interface{}
12757	err := json.Unmarshal(body, &m)
12758	if err != nil {
12759		return nil, err
12760	}
12761
12762	switch m["@odata.type"] {
12763	case string(OdataTypeMicrosoftMediaH264Layer):
12764		var hl H264Layer
12765		err := json.Unmarshal(body, &hl)
12766		return hl, err
12767	default:
12768		var vl VideoLayer
12769		err := json.Unmarshal(body, &vl)
12770		return vl, err
12771	}
12772}
12773func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) {
12774	var rawMessages []*json.RawMessage
12775	err := json.Unmarshal(body, &rawMessages)
12776	if err != nil {
12777		return nil, err
12778	}
12779
12780	vlArray := make([]BasicVideoLayer, len(rawMessages))
12781
12782	for index, rawMessage := range rawMessages {
12783		vl, err := unmarshalBasicVideoLayer(*rawMessage)
12784		if err != nil {
12785			return nil, err
12786		}
12787		vlArray[index] = vl
12788	}
12789	return vlArray, nil
12790}
12791
12792// MarshalJSON is the custom marshaler for VideoLayer.
12793func (vl VideoLayer) MarshalJSON() ([]byte, error) {
12794	vl.OdataType = OdataTypeMicrosoftMediaVideoLayer
12795	objectMap := make(map[string]interface{})
12796	if vl.Bitrate != nil {
12797		objectMap["bitrate"] = vl.Bitrate
12798	}
12799	if vl.MaxBitrate != nil {
12800		objectMap["maxBitrate"] = vl.MaxBitrate
12801	}
12802	if vl.BFrames != nil {
12803		objectMap["bFrames"] = vl.BFrames
12804	}
12805	if vl.FrameRate != nil {
12806		objectMap["frameRate"] = vl.FrameRate
12807	}
12808	if vl.Slices != nil {
12809		objectMap["slices"] = vl.Slices
12810	}
12811	if vl.AdaptiveBFrame != nil {
12812		objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame
12813	}
12814	if vl.Width != nil {
12815		objectMap["width"] = vl.Width
12816	}
12817	if vl.Height != nil {
12818		objectMap["height"] = vl.Height
12819	}
12820	if vl.Label != nil {
12821		objectMap["label"] = vl.Label
12822	}
12823	if vl.OdataType != "" {
12824		objectMap["@odata.type"] = vl.OdataType
12825	}
12826	return json.Marshal(objectMap)
12827}
12828
12829// AsH265VideoLayer is the BasicLayer implementation for VideoLayer.
12830func (vl VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
12831	return nil, false
12832}
12833
12834// AsBasicH265VideoLayer is the BasicLayer implementation for VideoLayer.
12835func (vl VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
12836	return nil, false
12837}
12838
12839// AsH265Layer is the BasicLayer implementation for VideoLayer.
12840func (vl VideoLayer) AsH265Layer() (*H265Layer, bool) {
12841	return nil, false
12842}
12843
12844// AsVideoLayer is the BasicLayer implementation for VideoLayer.
12845func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
12846	return &vl, true
12847}
12848
12849// AsBasicVideoLayer is the BasicLayer implementation for VideoLayer.
12850func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
12851	return &vl, true
12852}
12853
12854// AsH264Layer is the BasicLayer implementation for VideoLayer.
12855func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) {
12856	return nil, false
12857}
12858
12859// AsJpgLayer is the BasicLayer implementation for VideoLayer.
12860func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
12861	return nil, false
12862}
12863
12864// AsPngLayer is the BasicLayer implementation for VideoLayer.
12865func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) {
12866	return nil, false
12867}
12868
12869// AsLayer is the BasicLayer implementation for VideoLayer.
12870func (vl VideoLayer) AsLayer() (*Layer, bool) {
12871	return nil, false
12872}
12873
12874// AsBasicLayer is the BasicLayer implementation for VideoLayer.
12875func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) {
12876	return &vl, true
12877}
12878
12879// VideoOverlay describes the properties of a video overlay.
12880type VideoOverlay struct {
12881	// Position - The location in the input video where the overlay is applied.
12882	Position *Rectangle `json:"position,omitempty"`
12883	// Opacity - The opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque.
12884	Opacity *float64 `json:"opacity,omitempty"`
12885	// CropRectangle - An optional rectangular window used to crop the overlay image or video.
12886	CropRectangle *Rectangle `json:"cropRectangle,omitempty"`
12887	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
12888	InputLabel *string `json:"inputLabel,omitempty"`
12889	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
12890	Start *string `json:"start,omitempty"`
12891	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
12892	End *string `json:"end,omitempty"`
12893	// FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S).
12894	FadeInDuration *string `json:"fadeInDuration,omitempty"`
12895	// FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S).
12896	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
12897	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
12898	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
12899	// OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay'
12900	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
12901}
12902
12903// MarshalJSON is the custom marshaler for VideoOverlay.
12904func (vo VideoOverlay) MarshalJSON() ([]byte, error) {
12905	vo.OdataType = OdataTypeMicrosoftMediaVideoOverlay
12906	objectMap := make(map[string]interface{})
12907	if vo.Position != nil {
12908		objectMap["position"] = vo.Position
12909	}
12910	if vo.Opacity != nil {
12911		objectMap["opacity"] = vo.Opacity
12912	}
12913	if vo.CropRectangle != nil {
12914		objectMap["cropRectangle"] = vo.CropRectangle
12915	}
12916	if vo.InputLabel != nil {
12917		objectMap["inputLabel"] = vo.InputLabel
12918	}
12919	if vo.Start != nil {
12920		objectMap["start"] = vo.Start
12921	}
12922	if vo.End != nil {
12923		objectMap["end"] = vo.End
12924	}
12925	if vo.FadeInDuration != nil {
12926		objectMap["fadeInDuration"] = vo.FadeInDuration
12927	}
12928	if vo.FadeOutDuration != nil {
12929		objectMap["fadeOutDuration"] = vo.FadeOutDuration
12930	}
12931	if vo.AudioGainLevel != nil {
12932		objectMap["audioGainLevel"] = vo.AudioGainLevel
12933	}
12934	if vo.OdataType != "" {
12935		objectMap["@odata.type"] = vo.OdataType
12936	}
12937	return json.Marshal(objectMap)
12938}
12939
12940// AsAudioOverlay is the BasicOverlay implementation for VideoOverlay.
12941func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
12942	return nil, false
12943}
12944
12945// AsVideoOverlay is the BasicOverlay implementation for VideoOverlay.
12946func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
12947	return &vo, true
12948}
12949
12950// AsOverlay is the BasicOverlay implementation for VideoOverlay.
12951func (vo VideoOverlay) AsOverlay() (*Overlay, bool) {
12952	return nil, false
12953}
12954
12955// AsBasicOverlay is the BasicOverlay implementation for VideoOverlay.
12956func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) {
12957	return &vo, true
12958}
12959
12960// BasicVideoTrackDescriptor a TrackSelection to select video tracks.
12961type BasicVideoTrackDescriptor interface {
12962	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
12963	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
12964	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
12965}
12966
12967// VideoTrackDescriptor a TrackSelection to select video tracks.
12968type VideoTrackDescriptor struct {
12969	// OdataType - Possible values include: 'OdataTypeTrackDescriptor', 'OdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeMicrosoftMediaSelectVideoTrackByID'
12970	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
12971}
12972
12973func unmarshalBasicVideoTrackDescriptor(body []byte) (BasicVideoTrackDescriptor, error) {
12974	var m map[string]interface{}
12975	err := json.Unmarshal(body, &m)
12976	if err != nil {
12977		return nil, err
12978	}
12979
12980	switch m["@odata.type"] {
12981	case string(OdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
12982		var svtba SelectVideoTrackByAttribute
12983		err := json.Unmarshal(body, &svtba)
12984		return svtba, err
12985	case string(OdataTypeMicrosoftMediaSelectVideoTrackByID):
12986		var svtbi SelectVideoTrackByID
12987		err := json.Unmarshal(body, &svtbi)
12988		return svtbi, err
12989	default:
12990		var vtd VideoTrackDescriptor
12991		err := json.Unmarshal(body, &vtd)
12992		return vtd, err
12993	}
12994}
12995func unmarshalBasicVideoTrackDescriptorArray(body []byte) ([]BasicVideoTrackDescriptor, error) {
12996	var rawMessages []*json.RawMessage
12997	err := json.Unmarshal(body, &rawMessages)
12998	if err != nil {
12999		return nil, err
13000	}
13001
13002	vtdArray := make([]BasicVideoTrackDescriptor, len(rawMessages))
13003
13004	for index, rawMessage := range rawMessages {
13005		vtd, err := unmarshalBasicVideoTrackDescriptor(*rawMessage)
13006		if err != nil {
13007			return nil, err
13008		}
13009		vtdArray[index] = vtd
13010	}
13011	return vtdArray, nil
13012}
13013
13014// MarshalJSON is the custom marshaler for VideoTrackDescriptor.
13015func (vtd VideoTrackDescriptor) MarshalJSON() ([]byte, error) {
13016	vtd.OdataType = OdataTypeMicrosoftMediaVideoTrackDescriptor
13017	objectMap := make(map[string]interface{})
13018	if vtd.OdataType != "" {
13019		objectMap["@odata.type"] = vtd.OdataType
13020	}
13021	return json.Marshal(objectMap)
13022}
13023
13024// AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13025func (vtd VideoTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
13026	return nil, false
13027}
13028
13029// AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13030func (vtd VideoTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
13031	return nil, false
13032}
13033
13034// AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13035func (vtd VideoTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
13036	return nil, false
13037}
13038
13039// AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13040func (vtd VideoTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
13041	return nil, false
13042}
13043
13044// AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13045func (vtd VideoTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
13046	return &vtd, true
13047}
13048
13049// AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13050func (vtd VideoTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
13051	return &vtd, true
13052}
13053
13054// AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13055func (vtd VideoTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
13056	return nil, false
13057}
13058
13059// AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13060func (vtd VideoTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
13061	return nil, false
13062}
13063
13064// AsTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13065func (vtd VideoTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
13066	return nil, false
13067}
13068
13069// AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
13070func (vtd VideoTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
13071	return &vtd, true
13072}
13073