...

Source file src/github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2018-07-01/media/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2018-07-01/media

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

View as plain text